]> git.droids-corp.org - dpdk.git/commitdiff
net/mlx5: fix VF MAC address set over BlueField
authorRaslan Darawsheh <rasland@mellanox.com>
Wed, 22 Jul 2020 09:07:55 +0000 (12:07 +0300)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 29 Jul 2020 22:41:23 +0000 (00:41 +0200)
When trying to set MAC address of an ethernet device and if it was
a representor, PMD sets the MAC over the corresponding VF instead.

For the case of HPF (Host PF representor on BlueField), PMD shouldn't
attempt to set it, since it doesn't have any corresponding VF and fails.

This will fix the issue by setting the MAC on the dev directly.

Fixes: 0d1d73170820 ("net/mlx5: set VF MAC address from host")
Cc: stable@dpdk.org
Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
drivers/net/mlx5/mlx5_mac.c

index 2d808d629b7e30ccde4d70cbeb78192d987a0db1..88c52b29f44557af6770e8ce3b378210a1fd2082 100644 (file)
@@ -157,8 +157,11 @@ mlx5_mac_addr_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr)
        uint16_t port_id;
        struct mlx5_priv *priv = dev->data->dev_private;
 
-       /* Configuring the VF instead of its representor. */
-       if (priv->representor) {
+       /*
+        * Configuring the VF instead of its representor,
+        * need to skip the special case of HPF on Bluefield.
+        */
+       if (priv->representor && priv->representor_id >= 0) {
                DRV_LOG(DEBUG, "VF represented by port %u setting primary MAC address",
                        dev->data->port_id);
                RTE_ETH_FOREACH_DEV_SIBLING(port_id, dev->data->port_id) {