From 0dd95bc917e9a29065a8f73e13807492dca1e509 Mon Sep 17 00:00:00 2001 From: Karra Satwik Date: Sat, 12 Sep 2020 05:17:51 +0530 Subject: [PATCH] net/cxgbe: fix duplicate MAC addresses in MPS TCAM During MAC address insertion to MPS TCAM, add a default mask when the mask is not explicitly specified. Otherwise, driver misses the mask comparison and ends up inserting duplicate entries in the MPS TCAM. Fixes: 6fda3f0ddda9 ("net/cxgbe: add API to program hardware MPS table") Cc: stable@dpdk.org Signed-off-by: Karra Satwik Signed-off-by: Rahul Lakkireddy --- drivers/net/cxgbe/mps_tcam.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/cxgbe/mps_tcam.c b/drivers/net/cxgbe/mps_tcam.c index 5302d1343d..6e5fae9928 100644 --- a/drivers/net/cxgbe/mps_tcam.c +++ b/drivers/net/cxgbe/mps_tcam.c @@ -140,6 +140,7 @@ int cxgbe_mpstcam_modify(struct port_info *pi, int idx, const u8 *addr) /* idx can now be different from what user provided */ entry = &mpstcam->entry[idx]; memcpy(entry->eth_addr, addr, RTE_ETHER_ADDR_LEN); + memset(entry->mask, ~0, RTE_ETHER_ADDR_LEN); /* NOTE: we have considered the case that idx returned by t4_change_mac * will be different from the user provided value only if user * provided value is -1 -- 2.20.1