Skip to contentSkip to conversation

fixes to bnxt PMD

PATCH Applied Ajit Khaparde 2 participants 8 messages Jul 25, 2017 – Jul 31, 2017 Network drivers

lore
Share & tools
lore
#0 lore raw

cover fixes to bnxt PMD

Couple of fixes to the bnxt PMD against the dpdk-next-net tree. Please apply.

net/bnxt: check current vlan anti spoof value before setting new value net/bnxt: fix arguments to _rte_eth_dev_callback_process

 drivers/net/bnxt/rte_pmd_bnxt.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
Signature · 1 line
2.10.1 (Apple Git-78)
#1 lore raw

PATCH 1/2 net/bnxt: check current vlan anti spoof value before setting new value

If the current VLAN anti spoof setting is same as the new value, the firmware can return an error. Call the HWRM command to update the new setting if it is different from the current value.

Fixes 36735a932ca7 ("net/bnxt: support set VF QOS and MAC anti spoof")
---
 drivers/net/bnxt/rte_pmd_bnxt.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/bnxt/rte_pmd_bnxt.c +3 -0
index c1876f8..dd7e5b8 100644
@@ -321,6 +321,9 @@ int rte_pmd_bnxt_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf, uint8_t on)
 	if (vf >= dev_info.max_vfs)
 		return -EINVAL;
 
+	if (on == bp->pf.vf_info[vf].vlan_spoof_en)
+		return 0;
+
 	rc = bnxt_hwrm_func_cfg_vf_set_vlan_anti_spoof(bp, vf, on);
 	if (!rc) {
 		bp->pf.vf_info[vf].vlan_spoof_en = on;
Signature · 1 line
2.10.1 (Apple Git-78)
#3 lore raw

PATCH 2/2 net/bnxt: fix arguments to _rte_eth_dev_callback_process

In reply to Ajit Khaparde

The callback arguments to _rte_eth_dev_callback_process() are swapped. Fix them.

Fixes d6af1a13d7a1 ("ethdev: add return values to callback process API")
---
 drivers/net/bnxt/rte_pmd_bnxt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/bnxt/rte_pmd_bnxt.c +1 -1
index dd7e5b8..0463373 100644
@@ -57,7 +57,7 @@ int bnxt_rcv_msg_from_vf(struct bnxt *bp, uint16_t vf_id, void *msg)
 	cb_param.msg = msg;
 
 	_rte_eth_dev_callback_process(bp->eth_dev, RTE_ETH_EVENT_VF_MBOX,
-			&cb_param, NULL);
+				      NULL, &cb_param);
 
 	/* Default to approve */
 	if (cb_param.retval == RTE_PMD_BNXT_MB_EVENT_PROCEED)
Signature · 1 line
2.10.1 (Apple Git-78)
#4 lore raw

Re: [PATCH 2/2] net/bnxt: fix arguments to _rte_eth_dev_callback_process

Quoted 15 lines · Ajit Khaparde

The callback arguments to _rte_eth_dev_callback_process() are swapped. Fix them.

Fixes d6af1a13d7a1 ("ethdev: add return values to callback process API")
---
 drivers/net/bnxt/rte_pmd_bnxt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/bnxt/rte_pmd_bnxt.c +0 -0
index dd7e5b8..0463373 100644

drivers/net/bnxt/rte_pmd_bnxt.c int bnxt_rcv_msg_from_vf(struct bnxt *bp, uint16_t vf_id, void *msg) · line 60

Quoted 5 lines
drivers/net/bnxt/rte_pmd_bnxt.c +1 -1
@@ -57,7 +57,7 @@ int bnxt_rcv_msg_from_vf(struct bnxt *bp, uint16_t vf_id, void *msg)
 	cb_param.msg = msg;
 
 	_rte_eth_dev_callback_process(bp->eth_dev, RTE_ETH_EVENT_VF_MBOX,
-			&cb_param, NULL);
+				      NULL, &cb_param);

Hi Ajit,

Since you are using "cb_param.retval", change looks good.

But it is easy to confuse between cb_param and ret_param. To clarify your intention, I suggest renaming "cb_param" to "ret_param", does it make sense?

Thanks,
ferruh

Quoted 4 lines
drivers/net/bnxt/rte_pmd_bnxt.c +0 -0
 	/* Default to approve */
 	if (cb_param.retval == RTE_PMD_BNXT_MB_EVENT_PROCEED)
 
Applied
#2 lore raw

Re: [PATCH 1/2] net/bnxt: check current vlan anti spoof value before setting new value

In reply to Ajit Khaparde
Quoted 7 lines · Ajit Khaparde

If the current VLAN anti spoof setting is same as the new value, the firmware can return an error. Call the HWRM command to update the new setting if it is different from the current value.

Fixes 36735a932ca7 ("net/bnxt: support set VF QOS and MAC anti spoof")

Applied to dpdk-next-net/master, thanks.

#5 lore raw

Re: [PATCH 2/2] net/bnxt: fix arguments to _rte_eth_dev_callback_process

In reply to Ferruh Yigit
Quoted 25 lines · Ferruh Yigit
Quoted 15 lines · Ajit Khaparde

The callback arguments to _rte_eth_dev_callback_process() are swapped. Fix them.

Fixes d6af1a13d7a1 ("ethdev: add return values to callback process API")
---
 drivers/net/bnxt/rte_pmd_bnxt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/bnxt/rte_pmd_bnxt.c +0 -0
index dd7e5b8..0463373 100644

drivers/net/bnxt/rte_pmd_bnxt.c int bnxt_rcv_msg_from_vf(struct bnxt *bp, uint16_t vf_id, void *msg) · line 60

Quoted 5 lines
drivers/net/bnxt/rte_pmd_bnxt.c +1 -1
@@ -57,7 +57,7 @@ int bnxt_rcv_msg_from_vf(struct bnxt *bp, uint16_t vf_id, void *msg)
 	cb_param.msg = msg;
 
 	_rte_eth_dev_callback_process(bp->eth_dev, RTE_ETH_EVENT_VF_MBOX,
-			&cb_param, NULL);
+				      NULL, &cb_param);

Hi Ajit,

Quoted 5 lines

Since you are using "cb_param.retval", change looks good.

But it is easy to confuse between cb_param and ret_param. To clarify your intention, I suggest renaming "cb_param" to "ret_param", does it make sense?

I got other patch in the set, they are not related and to save some work for you, can you please send a new version of just this patch?

Quoted 9 lines

Thanks,
ferruh

Quoted 4 lines
drivers/net/bnxt/rte_pmd_bnxt.c +0 -0
 	/* Default to approve */
 	if (cb_param.retval == RTE_PMD_BNXT_MB_EVENT_PROCEED)
 
#6 lore raw

PATCH v2 1/1 net/bnxt: fix arguments to _rte_eth_dev_callback_process

The callback arguments to _rte_eth_dev_callback_process() are swapped. Fix them.

Fixes d6af1a13d7a1 ("ethdev: add return values to callback process API")

--
v1->v2: rename a cb_param to ret_param as per review comment.

---
 drivers/net/bnxt/rte_pmd_bnxt.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)
drivers/net/bnxt/rte_pmd_bnxt.c +9 -8
index dd7e5b8..c343d90 100644
@@ -50,20 +50,21 @@
 
 int bnxt_rcv_msg_from_vf(struct bnxt *bp, uint16_t vf_id, void *msg)
 {
-	struct rte_pmd_bnxt_mb_event_param cb_param;
+	struct rte_pmd_bnxt_mb_event_param ret_param;
 
-	cb_param.retval = RTE_PMD_BNXT_MB_EVENT_PROCEED;
-	cb_param.vf_id = vf_id;
-	cb_param.msg = msg;
+	ret_param.retval = RTE_PMD_BNXT_MB_EVENT_PROCEED;
+	ret_param.vf_id = vf_id;
+	ret_param.msg = msg;
 
 	_rte_eth_dev_callback_process(bp->eth_dev, RTE_ETH_EVENT_VF_MBOX,
-			&cb_param, NULL);
+				      NULL, &ret_param);
 
 	/* Default to approve */
-	if (cb_param.retval == RTE_PMD_BNXT_MB_EVENT_PROCEED)
-		cb_param.retval = RTE_PMD_BNXT_MB_EVENT_NOOP_ACK;
+	if (ret_param.retval == RTE_PMD_BNXT_MB_EVENT_PROCEED)
+		ret_param.retval = RTE_PMD_BNXT_MB_EVENT_NOOP_ACK;
 
-	return cb_param.retval == RTE_PMD_BNXT_MB_EVENT_NOOP_ACK ? true : false;
+	return ret_param.retval == RTE_PMD_BNXT_MB_EVENT_NOOP_ACK ?
+		true : false;
 }
 
 int rte_pmd_bnxt_set_tx_loopback(uint8_t port, uint8_t on)
Signature · 1 line
2.10.1 (Apple Git-78)
Applied
#7 lore raw

Re: [PATCH v2] net/bnxt: fix arguments to _rte_eth_dev_callback_process

Quoted 6 lines · Ajit Khaparde

The callback arguments to _rte_eth_dev_callback_process() are swapped. Fix them.

Fixes d6af1a13d7a1 ("ethdev: add return values to callback process API")

Applied to dpdk-next-net/master, thanks.