Skip to content

Commit 813a5fa

Browse files
Kishore Padmanabhaajitkhaparde
authored andcommitted
net/bnxt: support TruFlow promiscuous mode
The truflow application support promiscuous mode to enable or disable receiving the packets with unknown destination mac addresses. Signed-off-by: Kishore Padmanabha <[email protected]> Reviewed-by: Shuanglin Wang <[email protected]> Acked-by: Ajit Khaparde <[email protected]>
1 parent ef86bb9 commit 813a5fa

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

drivers/net/bnxt/bnxt_ethdev.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2161,9 +2161,15 @@ static int bnxt_promiscuous_enable_op(struct rte_eth_dev *eth_dev)
21612161
old_flags = vnic->flags;
21622162
vnic->flags |= BNXT_VNIC_INFO_PROMISC;
21632163
rc = bnxt_hwrm_cfa_l2_set_rx_mask(bp, vnic, 0, NULL);
2164-
if (rc != 0)
2164+
if (rc != 0) {
21652165
vnic->flags = old_flags;
2166-
2166+
return rc;
2167+
}
2168+
rc = bnxt_ulp_promisc_mode_set(bp, 1);
2169+
if (rc != 0) {
2170+
vnic->flags = old_flags;
2171+
rc = bnxt_hwrm_cfa_l2_set_rx_mask(bp, vnic, 0, NULL);
2172+
}
21672173
return rc;
21682174
}
21692175

@@ -2185,6 +2191,11 @@ static int bnxt_promiscuous_disable_op(struct rte_eth_dev *eth_dev)
21852191
if (bp->vnic_info == NULL)
21862192
return 0;
21872193

2194+
if (bnxt_ulp_promisc_mode_set(bp, 0)) {
2195+
PMD_DRV_LOG_LINE(ERR, "Unable to disable promiscuous mode");
2196+
return -EINVAL;
2197+
}
2198+
21882199
vnic = bnxt_get_default_vnic(bp);
21892200

21902201
old_flags = vnic->flags;

0 commit comments

Comments
 (0)