bnx2x: set random MAC address if one isn't assigned
PATCH 1/1 bnx2x: set random MAC address if one isn't assigned
If the PF hasn't assigned an address, assign one randomly. While here, convert to use DPDK's ether address utility routines.
--- drivers/net/bnx2x/bnx2x.h | 8 -------- drivers/net/bnx2x/bnx2x_vfpf.c | 9 +++++---- drivers/net/bnx2x/bnx2x_vfpf.h | 2 +- 3 files changed, 6 insertions(+), 13 deletions(-)
drivers/net/bnx2x/bnx2x.h +0 -8
@@ -1904,14 +1904,6 @@ pci_find_cap(struct bnx2x_softc *sc, uint8_t id, uint8_t type)return NULL ; } -static inline int is_valid_ether_addr (uint8_t *addr) -{ -if (!(addr[0 ] | addr[1 ] | addr[2 ] | addr[3 ] | addr[4 ] | addr[5 ])) -return 0 ; -else -return 1 ; -} -static inline void bnx2x_set_rx_mode (struct bnx2x_softc *sc) {
drivers/net/bnx2x/bnx2x_vfpf.c +5 -4
@@ -293,10 +293,11 @@ int bnx2x_vf_get_resources(struct bnx2x_softc *sc, uint8_t tx_count, uint8_t rx_ sc->igu_sb_cnt, sc->igu_base_sb);strncpy (sc->fw_ver, sc_resp.fw_ver,sizeof (sc->fw_ver)); -if (is_valid_ether_addr (sc_resp.resc.current_mac_addr)) - (void )rte_memcpy (sc->link_params.mac_addr, - sc_resp.resc.current_mac_addr, -ETH_ALEN ); +if (is_valid_assigned_ether_addr (&sc_resp.resc.current_mac_addr)) +ether_addr_copy (&sc_resp.resc.current_mac_addr, + (struct ether_addr *) sc->link_params.mac_addr); +else +eth_random_addr (sc->link_params.mac_addr);return 0 ; }
drivers/net/bnx2x/bnx2x_vfpf.h +1 -1
@@ -114,7 +114,7 @@ struct vf_resc {uint8_t num_vlan_filters;uint8_t num_mc_filters;uint8_t permanent_mac_addr[ETH_ALEN ]; -uint8_t current_mac_addr[ETH_ALEN ]; +struct ether_addr current_mac_addr;uint16_t pf_link_speed;uint32_t pf_link_supported; };
Signature · 1 line
2.5.5
Quoted 6 lines · Chas Williams
If the PF hasn't assigned an address, assign one randomly. While here, convert to use DPDK's ether address utility routines.
Fixes 540a211084a7 ("bnx2x: driver core")Signed-off-by Chas Williams <[email protected]>
Maintainers, any comment or ack on this patch?
/Bruce
Rasesh Mody
Acked-byQuoted 7 lines
From: Bruce Richardson [mailto:[email protected]]
Sent: Wednesday, June 29, 2016 3:56 AMQuoted 3 lines · Chas Williams
If the PF hasn't assigned an address, assign one randomly. While here, convert to use DPDK's ether address utility routines.
Quoted 7 lines
Quoted 3 lines
Fixes 540a211084a7 ("bnx2x: driver core")Signed-off-by Chas Williams <[email protected]>Maintainers, any comment or ack on this patch?
/Bruce
Thanks!
Rasesh
Bruce Richardson
AppliedQuoted 11 lines · Rasesh Mody
Quoted 11 lines
From: Bruce Richardson [mailto:[email protected]]
Sent: Wednesday, June 29, 2016 3:56 AMQuoted 6 lines · Chas Williams
If the PF hasn't assigned an address, assign one randomly. While here, convert to use DPDK's ether address utility routines.
Fixes 540a211084a7 ("bnx2x: driver core")Signed-off-by Chas Williams <[email protected]>
Quoted 8 lines
Quoted 3 lines
Maintainers, any comment or ack on this patch?
/Bruce
Acked-by Rasesh Mody <[email protected]>Thanks!
Rasesh
Applied to dpdk-next-net/rel_16_07
/Bruce