-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
qlcnic: Support SR-IOV enable and disable
o Add QLCNIC_SRIOV to Kconfig. o Provide PCI sysfs hooks to enable and disable SR-IOV. o Allow enabling only when CONFIG_QLCNIC_SRIOV is defined. o qlcnic_sriov_pf.c has all the PF related SR-IOV functionality. o qlcnic_sriov_common.c has VF functionality and SR-IOV functionality which is common between VF and PF. o qlcnic_sriov.h is a common header file for SR-IOV defines. Signed-off-by: Manish Chopra <manish.chopra@qlogic.com> Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com> Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
- Loading branch information
Rajesh Borundia
authored and
David S. Miller
committed
Mar 29, 2013
1 parent
c23343c
commit 02feda1
Showing
12 changed files
with
613 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* QLogic qlcnic NIC Driver | ||
* Copyright (c) 2009-2013 QLogic Corporation | ||
* | ||
* See LICENSE.qlcnic for copyright and licensing details. | ||
*/ | ||
|
||
#ifndef _QLCNIC_83XX_SRIOV_H_ | ||
#define _QLCNIC_83XX_SRIOV_H_ | ||
|
||
#include "qlcnic.h" | ||
#include <linux/types.h> | ||
#include <linux/pci.h> | ||
|
||
struct qlcnic_resources { | ||
u16 num_tx_mac_filters; | ||
u16 num_rx_ucast_mac_filters; | ||
u16 num_rx_mcast_mac_filters; | ||
|
||
u16 num_txvlan_keys; | ||
|
||
u16 num_rx_queues; | ||
u16 num_tx_queues; | ||
|
||
u16 num_rx_buf_rings; | ||
u16 num_rx_status_rings; | ||
|
||
u16 num_destip; | ||
u32 num_lro_flows_supported; | ||
u16 max_local_ipv6_addrs; | ||
u16 max_remote_ipv6_addrs; | ||
}; | ||
|
||
struct qlcnic_sriov { | ||
u16 vp_handle; | ||
u8 num_vfs; | ||
struct qlcnic_resources ff_max; | ||
}; | ||
|
||
int qlcnic_sriov_init(struct qlcnic_adapter *, int); | ||
void qlcnic_sriov_cleanup(struct qlcnic_adapter *); | ||
void __qlcnic_sriov_cleanup(struct qlcnic_adapter *); | ||
|
||
static inline bool qlcnic_sriov_enable_check(struct qlcnic_adapter *adapter) | ||
{ | ||
return test_bit(__QLCNIC_SRIOV_ENABLE, &adapter->state) ? true : false; | ||
} | ||
|
||
#ifdef CONFIG_QLCNIC_SRIOV | ||
void qlcnic_sriov_pf_disable(struct qlcnic_adapter *); | ||
void qlcnic_sriov_pf_cleanup(struct qlcnic_adapter *); | ||
int qlcnic_pci_sriov_configure(struct pci_dev *, int); | ||
#else | ||
static inline void qlcnic_sriov_pf_disable(struct qlcnic_adapter *adapter) {} | ||
static inline void qlcnic_sriov_pf_cleanup(struct qlcnic_adapter *adapter) {} | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* QLogic qlcnic NIC Driver | ||
* Copyright (c) 2009-2013 QLogic Corporation | ||
* | ||
* See LICENSE.qlcnic for copyright and licensing details. | ||
*/ | ||
|
||
#include "qlcnic_sriov.h" | ||
#include "qlcnic.h" | ||
#include <linux/types.h> | ||
|
||
int qlcnic_sriov_init(struct qlcnic_adapter *adapter, int num_vfs) | ||
{ | ||
struct qlcnic_sriov *sriov; | ||
|
||
if (!qlcnic_sriov_enable_check(adapter)) | ||
return -EIO; | ||
|
||
sriov = kzalloc(sizeof(struct qlcnic_sriov), GFP_KERNEL); | ||
if (!sriov) | ||
return -ENOMEM; | ||
|
||
adapter->ahw->sriov = sriov; | ||
sriov->num_vfs = num_vfs; | ||
return 0; | ||
} | ||
|
||
void __qlcnic_sriov_cleanup(struct qlcnic_adapter *adapter) | ||
{ | ||
if (!qlcnic_sriov_enable_check(adapter)) | ||
return; | ||
|
||
kfree(adapter->ahw->sriov); | ||
} | ||
|
||
void qlcnic_sriov_cleanup(struct qlcnic_adapter *adapter) | ||
{ | ||
if (qlcnic_sriov_pf_check(adapter)) | ||
qlcnic_sriov_pf_cleanup(adapter); | ||
} |
Oops, something went wrong.