Commit 11ac75ed authored by Sathya Perla's avatar Sathya Perla Committed by David S. Miller

be2net: refactor/cleanup vf configuration code

- use adapter->num_vfs (and not the module param) to store the actual
number of vfs created. Use the same variable to reflect SRIOV
enable/disable state. So, drop the adapter->sriov_enabled field.

- use for_all_vfs() macro in VF configuration code

- drop the "vf_" prefix for the fields of be_vf_cfg; the prefix is
redundant and removing it helps reduce line wrap
Signed-off-by: default avatarSathya Perla <sathya.perla@emulex.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 110b82bc
......@@ -288,11 +288,11 @@ struct be_drv_stats {
};
struct be_vf_cfg {
unsigned char vf_mac_addr[ETH_ALEN];
int vf_if_handle;
int vf_pmac_id;
u16 vf_vlan_tag;
u32 vf_tx_rate;
unsigned char mac_addr[ETH_ALEN];
int if_handle;
int pmac_id;
u16 vlan_tag;
u32 tx_rate;
};
struct be_adapter {
......@@ -368,16 +368,20 @@ struct be_adapter {
u32 flash_status;
struct completion flash_compl;
bool be3_native;
bool sriov_enabled;
struct be_vf_cfg *vf_cfg;
u32 num_vfs;
u8 is_virtfn;
struct be_vf_cfg *vf_cfg;
bool be3_native;
u32 sli_family;
u8 hba_port_num;
u16 pvid;
};
#define be_physfn(adapter) (!adapter->is_virtfn)
#define sriov_enabled(adapter) (adapter->num_vfs > 0)
#define for_all_vfs(adapter, vf_cfg, i) \
for (i = 0, vf_cfg = &adapter->vf_cfg[i]; i < adapter->num_vfs; \
i++, vf_cfg++)
/* BladeEngine Generation numbers */
#define BE_GEN2 2
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment