diff options
author | Ajit Khaparde <ajitk@serverengines.com> | 2010-08-25 00:32:33 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-08-25 16:41:25 -0700 |
commit | 6d87f5c3ac5856bf1309700e2f15e2e7fcd3c578 (patch) | |
tree | 2ba12a7c04aeb3ecef77881f03147b334dc9fe9b /drivers/net/benet/be.h | |
parent | aa7c6e5fa08bb5014b6432a690d28748f11e93fc (diff) |
be2net: fix to dynamically generate MAC Address for VFs
The BE ASIC/firmware doesnot reserve and assign MAC address for VFs.
This results in the VF interfaces being created with MAC Address 0.
The code change proposed takes the MAC address of PF to generate a seed.
MAC Address for VFs are assigned incrementally starting from the seed.
These addresses are programmed in the ASIC by the PF and the VF driver
queries for the MAC address during its probe.
Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/benet/be.h')
-rw-r--r-- | drivers/net/benet/be.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/net/benet/be.h b/drivers/net/benet/be.h index 99197bd54da5..d1fb7928ffc5 100644 --- a/drivers/net/benet/be.h +++ b/drivers/net/benet/be.h @@ -413,6 +413,20 @@ static inline void be_check_sriov_fn_type(struct be_adapter *adapter) adapter->is_virtfn = (data != 0xAA); } +static inline void be_vf_eth_addr_generate(struct be_adapter *adapter, u8 *mac) +{ + u32 addr; + + addr = jhash(adapter->netdev->dev_addr, ETH_ALEN, 0); + + mac[5] = (u8)(addr & 0xFF); + mac[4] = (u8)((addr >> 8) & 0xFF); + mac[3] = (u8)((addr >> 16) & 0xFF); + mac[2] = 0xC9; + mac[1] = 0x00; + mac[0] = 0x00; +} + extern void be_cq_notify(struct be_adapter *adapter, u16 qid, bool arm, u16 num_popped); extern void be_link_status_update(struct be_adapter *adapter, bool link_up); |