From 987984204bdc982e0f58393678dd50ba91c639c4 Mon Sep 17 00:00:00 2001 From: Harman Kalra Date: Wed, 3 Jun 2020 20:22:13 +0530 Subject: [PATCH] net/octeontx2: fix DMAC filtering Issue has been observed where packets are getting dropped at DMAC filtering if a new dmac address is added before starting of port. Fixes: c43adf61682f ("net/octeontx2: add unicast MAC filter") Cc: stable@dpdk.org Signed-off-by: Harman Kalra Acked-by: Sunil Kumar Kori Acked-by: Jerin Jacob --- drivers/net/octeontx2/otx2_ethdev.h | 1 + drivers/net/octeontx2/otx2_ethdev_ops.c | 4 +++- drivers/net/octeontx2/otx2_mac.c | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h index 0fbf68b8e0..16b0d81633 100644 --- a/drivers/net/octeontx2/otx2_ethdev.h +++ b/drivers/net/octeontx2/otx2_ethdev.h @@ -271,6 +271,7 @@ struct otx2_eth_dev { uint8_t mac_addr[RTE_ETHER_ADDR_LEN]; uint8_t mkex_pfl_name[MKEX_NAME_LEN]; uint8_t max_mac_entries; + bool dmac_filter_enable; uint8_t lf_tx_stats; uint8_t lf_rx_stats; uint16_t flags; diff --git a/drivers/net/octeontx2/otx2_ethdev_ops.c b/drivers/net/octeontx2/otx2_ethdev_ops.c index 80ac2b96e1..faecf216c1 100644 --- a/drivers/net/octeontx2/otx2_ethdev_ops.c +++ b/drivers/net/octeontx2/otx2_ethdev_ops.c @@ -148,8 +148,10 @@ otx2_nix_promisc_enable(struct rte_eth_dev *eth_dev) int otx2_nix_promisc_disable(struct rte_eth_dev *eth_dev) { - otx2_nix_promisc_config(eth_dev, 0); + struct otx2_eth_dev *dev = otx2_eth_pmd_priv(eth_dev); + otx2_nix_promisc_config(eth_dev, dev->dmac_filter_enable); nix_cgx_promisc_config(eth_dev, 0); + dev->dmac_filter_enable = false; return 0; } diff --git a/drivers/net/octeontx2/otx2_mac.c b/drivers/net/octeontx2/otx2_mac.c index 262d185e54..49a700ca1d 100644 --- a/drivers/net/octeontx2/otx2_mac.c +++ b/drivers/net/octeontx2/otx2_mac.c @@ -76,6 +76,8 @@ otx2_nix_mac_addr_add(struct rte_eth_dev *eth_dev, struct rte_ether_addr *addr, /* Enable promiscuous mode at NIX level */ otx2_nix_promisc_config(eth_dev, 1); + dev->dmac_filter_enable = true; + eth_dev->data->promiscuous = 0; done: return rc; -- 2.20.1