DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/bnxt: fix bug which could set multiple conflicting bits
@ 2017-07-29 20:54 Ajit Khaparde
  2017-07-31 14:53 ` Ferruh Yigit
  0 siblings, 1 reply; 2+ messages in thread
From: Ajit Khaparde @ 2017-07-29 20:54 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hurd

Only set the vlanonly bit if vlan_nonvlan is clear. Also, allow the
VLAN table to be cleared when vlanonly is set.

Clearing the VLAN table when vlanonly is set will stop all traffic
since it requires all frames to have a VLAN tag, and that tag to be
in the zero-length table. This is still a valid use case though,
and has been seen in the wild.

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

Signed-off-by: Stephen Hurd <stephen.hurd@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_hwrm.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 4b1810c..e710e63 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -266,8 +266,9 @@ int bnxt_hwrm_cfa_l2_set_rx_mask(struct bnxt *bp,
 		req.num_mc_entries = rte_cpu_to_le_32(vnic->mc_addr_cnt);
 		req.mc_tbl_addr = rte_cpu_to_le_64(vnic->mc_list_dma_addr);
 	}
-	if (vlan_count && vlan_table) {
-		mask |= HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_VLANONLY;
+	if (vlan_table) {
+		if (!(mask & HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_VLAN_NONVLAN))
+			mask |= HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_VLANONLY;
 		req.vlan_tag_tbl_addr = rte_cpu_to_le_16(
 			 rte_mem_virt2phy(vlan_table));
 		req.num_vlan_tags = rte_cpu_to_le_32((uint32_t)vlan_count);
-- 
2.10.1 (Apple Git-78)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH] net/bnxt: fix bug which could set multiple conflicting bits
  2017-07-29 20:54 [dpdk-dev] [PATCH] net/bnxt: fix bug which could set multiple conflicting bits Ajit Khaparde
@ 2017-07-31 14:53 ` Ferruh Yigit
  0 siblings, 0 replies; 2+ messages in thread
From: Ferruh Yigit @ 2017-07-31 14:53 UTC (permalink / raw)
  To: Ajit Khaparde, dev; +Cc: Stephen Hurd

On 7/29/2017 9:54 PM, Ajit Khaparde wrote:
> Only set the vlanonly bit if vlan_nonvlan is clear. Also, allow the
> VLAN table to be cleared when vlanonly is set.
> 
> Clearing the VLAN table when vlanonly is set will stop all traffic
> since it requires all frames to have a VLAN tag, and that tag to be
> in the zero-length table. This is still a valid use case though,
> and has been seen in the wild.
> 
> Fixes: 36735a932ca7 ("net/bnxt: support set VF QOS and MAC anti spoof")
> 
> Signed-off-by: Stephen Hurd <stephen.hurd@broadcom.com>
> Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-07-31 14:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-29 20:54 [dpdk-dev] [PATCH] net/bnxt: fix bug which could set multiple conflicting bits Ajit Khaparde
2017-07-31 14:53 ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).