]> git.droids-corp.org - dpdk.git/commitdiff
net/nfp: fix live MAC changes not supported
authorAlejandro Lucero <alejandro.lucero@netronome.com>
Fri, 24 Aug 2018 14:25:36 +0000 (15:25 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 28 Aug 2018 13:27:39 +0000 (15:27 +0200)
Some NFP firmwares support live changes to the MAC address, but
this is not always true and the firmware advertises it accordingly.

This patch checks if firmware does not support live changes and
sets RTE_ETH_DEV_NOLIVE_MAC_ADDR in that case.

Cc: stable@dpdk.org
Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
drivers/net/nfp/nfp_net.c

index 6e5e305f1d7fb3ce962b9914c2fe1f25f044cd2f..ee743e9753ffdb93c1cc0d7252e3bf18b73817a2 100644 (file)
@@ -2886,6 +2886,9 @@ nfp_net_init(struct rte_eth_dev *eth_dev)
        ether_addr_copy((struct ether_addr *)hw->mac_addr,
                        &eth_dev->data->mac_addrs[0]);
 
+       if (!(hw->cap & NFP_NET_CFG_CTRL_LIVE_ADDR))
+               eth_dev->data->dev_flags |= RTE_ETH_DEV_NOLIVE_MAC_ADDR;
+
        PMD_INIT_LOG(INFO, "port %d VendorID=0x%x DeviceID=0x%x "
                     "mac=%02x:%02x:%02x:%02x:%02x:%02x",
                     eth_dev->data->port_id, pci_dev->id.vendor_id,