be2net: Adding PCI SRIOV support
Subsystems (2)
PATCH 1/1 be2net: Adding PCI SRIOV support
- Patch adds support to enable PCI SRIOV in the driver and changes to handle initialization of PCI virtual functions.
- Function handler to change mac addresses for VF from its corresponding PF.
Signed-off-by Sarveshwar Bandi <[email protected]>
--- drivers/net/benet/be.h | 9 ++ drivers/net/benet/be_cmds.c | 4 + drivers/net/benet/be_cmds.h | 2 drivers/net/benet/be_hw.h | 3 + drivers/net/benet/be_main.c | 222 ++++++++++++++++++++++++++++++++++--------- 5 files changed, 191 insertions(+), 49 deletions(-)
drivers/net/benet/be.h +9 -0
@@ -83,6 +83,8 @@ #define RX_FRAGS_REFILL_WM (RX_Q_LEN - M#define FW_VER_LEN 32 +#define BE_MAX_VF 32 +struct be_dma_mem {void *va;dma_addr_t dma;
@@ -280,8 +282,15 @@ struct be_adapter {u8 port_type;u8 transceiver;u8 generation;/* BladeEngine ASIC generation */ + +bool sriov_enabled; +u32 vf_if_handle[BE_MAX_VF ]; +u32 vf_pmac_id[BE_MAX_VF ]; +u8 base_eq_id; }; +#define be_physfn (adapter) (!adapter->pdev->is_virtfn) +/* BladeEngine Generation numbers */ #define BE_GEN2 2#define BE_GEN3 3
drivers/net/benet/be_cmds.c +3 -1
@@ -843,7 +843,8 @@ int be_cmd_q_destroy(struct be_adapter ** Uses mbox */ int be_cmd_if_create (struct be_adapter *adapter,u32 cap_flags,u32 en_flags, -u8 *mac,bool pmac_invalid,u32 *if_handle,u32 *pmac_id) +u8 *mac,bool pmac_invalid,u32 *if_handle,u32 *pmac_id, +u32 domain) {struct be_mcc_wrb *wrb;struct be_cmd_req_if_create *req;
@@ -860,6 +861,7 @@ int be_cmd_if_create(struct be_adapter *be_cmd_hdr_prepare (&req->hdr,CMD_SUBSYSTEM_COMMON ,OPCODE_COMMON_NTWK_INTERFACE_CREATE ,sizeof (*req)); + req->hdr.domain = domain; req->capability_flags =cpu_to_le32 (cap_flags); req->enable_flags =cpu_to_le32 (en_flags); req->pmac_invalid = pmac_invalid;
drivers/net/benet/be_cmds.h +1 -1
@@ -878,7 +878,7 @@ extern int be_cmd_pmac_add(struct be_adaextern int be_cmd_pmac_del (struct be_adapter *adapter,u32 if_id,u32 pmac_id);extern int be_cmd_if_create (struct be_adapter *adapter,u32 cap_flags,u32 en_flags,u8 *mac,bool pmac_invalid, -u32 *if_handle,u32 *pmac_id); +u32 *if_handle,u32 *pmac_id,u32 domain);extern int be_cmd_if_destroy (struct be_adapter *adapter,u32 if_handle);extern int be_cmd_eq_create (struct be_adapter *adapter,struct be_queue_info *eq,int eq_delay);
drivers/net/benet/be_hw.h +3 -0
@@ -99,6 +99,9 @@ #define DB_MCCQ_RING_ID_MASK 0x7FF /* b/* Number of entries posted */ #define DB_MCCQ_NUM_POSTED_SHIFT (16)/* bits 16 - 29 */ +/********** SRIOV VF PCICFG OFFSET ********/ +#define SRIOV_VF_PCICFG_OFFSET (4096) +/* Flashrom related descriptors */ #define IMAGE_TYPE_FIRMWARE 160#define IMAGE_TYPE_BOOTCODE 224
drivers/net/benet/be_main.c +175 -47
387 lines not on this page · raw message
Signature · 1 line
1.4.0
From: Sarveshwar Bandi <[email protected]>
Date: Wed, 31 Mar 2010 18:26:12 +0530
Quoted 4 lines
- Patch adds support to enable PCI SRIOV in the driver and changes to handle initialization of PCI virtual functions.
- Function handler to change mac addresses for VF from its corresponding PF.Signed-off-by Sarveshwar Bandi <[email protected]>
Applied, thanks.