Skip to contentSkip to conversation

net/bnxt: return -EBUSY if port is active during MTU change

PATCH In review Benjamin Le Berre 2 participants 2 messages Sep 15, 2022 – Oct 4, 2022 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/bnxt: return -EBUSY if port is active during MTU change

When the BNXT PMD was made to disallow MTU changes on active ports, the error code chosen for the case in bnxt_set_mtu_op() was -EPERM.

The doc comment for rte_eth_dev_set_mtu() in lib/ethdev/rte_ethdev.h lists -EBUSY as the value to be used if the port must be stopped before applying an MTU change and does not list -EPERM as a possible return value.

This patch makes bnxt_set_mtu_op() return -EBUSY instead of -EPERM so that rte_eth_dev_set_mtu() behaves as expected.

Fixes a42ab1eb33ff ("net/bnxt: disallow MTU change when device is started")

---
Hi,

Should I Cc [email protected]?

Thanks,
Benjamin.

 drivers/net/bnxt/bnxt_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/bnxt/bnxt_ethdev.c +1 -1
index e275d3a53fda..c07a41c693da 100644
@@ -3030,7 +3030,7 @@ int bnxt_mtu_set_op(struct rte_eth_dev *eth_dev, uint16_t new_mtu)
 	/* Return if port is active */
 	if (eth_dev->data->dev_started) {
 		PMD_DRV_LOG(ERR, "Stop port before changing MTU\n");
-		return -EPERM;
+		return -EBUSY;
 	}
 
 	/* Exit if receive queues are not configured yet */
Signature · 1 line
2.30.2
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Benjamin Le Berre

When the BNXT PMD was made to disallow MTU changes on active ports, the error code chosen for the case in bnxt_set_mtu_op() was -EPERM.

The doc comment for rte_eth_dev_set_mtu() in lib/ethdev/rte_ethdev.h lists -EBUSY as the value to be used if the port must be stopped before applying an MTU change and does not list -EPERM as a possible return value.

Quoted 6 lines

This patch makes bnxt_set_mtu_op() return -EBUSY instead of -EPERM so that rte_eth_dev_set_mtu() behaves as expected.

Fixes a42ab1eb33ff ("net/bnxt: disallow MTU change when device is started")
Quoted 4 lines

---
Hi,

Should I Cc [email protected]?

I just added it to Cc. Hopefully it works.
Updated the commit headline to
net/bnxt: fix return status during MTU change

Patch merged to dpdk-next-net-brcm. Thanks

Quoted 23 lines

Thanks,
Benjamin.

 drivers/net/bnxt/bnxt_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/bnxt/bnxt_ethdev.c +1 -2
index e275d3a53fda..c07a41c693da 100644
@@ -3030,7 +3030,7 @@ int bnxt_mtu_set_op(struct rte_eth_dev *eth_dev, uint16_t new_mtu)
        /* Return if port is active */
        if (eth_dev->data->dev_started) {
                PMD_DRV_LOG(ERR, "Stop port before changing MTU\n");
-               return -EPERM;
+               return -EBUSY;
        }
 
        /* Exit if receive queues are not configured yet */
--

2.30.2