Hello 

After survey about solution for Broadcom bnxt driver issue with promiscous 
mode. I am not found any normal solution with that situation.
Only workaround to using promiscous mode to have normal operations with these 
cards. This isn't normal by me!

I look and do some debug on bnxt driver. Issue came from hardware filter in 
ASIC. On init driver and its ring buffers default states of filter are all 
block. Also I saw that we have not ability to append configured VLANs on the 
host into broadcom vlan tag list to be allowed for further processing from 
network stack.
Then my solution is simple and effective in such situation. I append to filter 
mask bit for passing further for processing all tagged vlans and native/primary 
vlan too.

This is enough to have normal packet processing for bnxt driver.
We have such BCM57414 NetXtreme-E 10Gb/25Gb RDMA Ethernet Controller. I tested 
patch on them.

Patch is make on FreeBSD 14.0-CURRENT #3 main-n244973-c02a28754bc-dirty: Tue 
Nov  2 20:53:08 EET 2021

If you are thinking it is ok. You can feel free to merge it to FreeBSD existing 
driver.

P.S. I found other small issues, but they are not show stoppers now for us.

Br

Michael Pounov
CloudSigma AG
ELWIX.ORG  






-- 
Michael Pounov <mi...@elwix.org>
diff --git a/sys/dev/bnxt/if_bnxt.c b/sys/dev/bnxt/if_bnxt.c
index 7811f4fdebf..f4a53cd4d93 100644
--- a/sys/dev/bnxt/if_bnxt.c
+++ b/sys/dev/bnxt/if_bnxt.c
@@ -588,7 +588,8 @@ bnxt_rx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs,
 	softc->vnic_info.def_ring_grp = (uint16_t)HWRM_NA_SIGNATURE;
 	softc->vnic_info.cos_rule = (uint16_t)HWRM_NA_SIGNATURE;
 	softc->vnic_info.lb_rule = (uint16_t)HWRM_NA_SIGNATURE;
-	softc->vnic_info.rx_mask = HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_BCAST;
+	softc->vnic_info.rx_mask = HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_BCAST | 
+		HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_ANYVLAN_NONVLAN;
 	softc->vnic_info.mc_list_count = 0;
 	softc->vnic_info.flags = BNXT_VNIC_FLAG_DEFAULT;
 	rc = iflib_dma_alloc(ctx, BNXT_MAX_MC_ADDRS * ETHER_ADDR_LEN,
@@ -1392,8 +1393,7 @@ bnxt_promisc_set(if_ctx_t ctx, int flags)
 		    HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_ANYVLAN_NONVLAN;
 	else
 		softc->vnic_info.rx_mask &=
-		    ~(HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_PROMISCUOUS |
-		    HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_ANYVLAN_NONVLAN);
+		    ~(HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_PROMISCUOUS);
 
 	rc = bnxt_hwrm_cfa_l2_set_rx_mask(softc, &softc->vnic_info);
 

Reply via email to