From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id E0567A04AC; Tue, 1 Sep 2020 19:33:05 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9D21D1C0B1; Tue, 1 Sep 2020 19:33:05 +0200 (CEST) Received: from stargate.chelsio.com (stargate.chelsio.com [12.32.117.8]) by dpdk.org (Postfix) with ESMTP id 8BCFA1C0B0; Tue, 1 Sep 2020 19:33:04 +0200 (CEST) Received: from localhost (scalar.blr.asicdesigners.com [10.193.185.94]) by stargate.chelsio.com (8.13.8/8.13.8) with ESMTP id 081HX1Mb013794; Tue, 1 Sep 2020 10:33:01 -0700 From: Rahul Lakkireddy To: dev@dpdk.org Cc: kaara.satwik@chelsio.com, stable@dpdk.org Date: Tue, 1 Sep 2020 22:48:49 +0530 Message-Id: <1598980729-19850-1-git-send-email-rahul.lakkireddy@chelsio.com> X-Mailer: git-send-email 2.5.3 Subject: [dpdk-dev] [PATCH] net/cxgbe: fix duplicate MAC addresses in MPS TCAM X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Karra Satwik During MAC address insertion to MPS TCAM, add a default mask when the mask is not explicitly specified. Othewise, 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 5302d1343..6e5fae992 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.24.0