From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 88CFB459FB; Fri, 27 Sep 2024 19:59:57 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9F7724065E; Fri, 27 Sep 2024 19:59:03 +0200 (CEST) Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) by mails.dpdk.org (Postfix) with ESMTP id EE2A440648 for ; Fri, 27 Sep 2024 19:58:59 +0200 (CEST) Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-205722ba00cso23480745ad.0 for ; Fri, 27 Sep 2024 10:58:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1727459939; x=1728064739; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=PjItn4UKNh32h4VjxiwoHdLhBhYvtTxKRydk1cNjExQ=; b=TCVywyhhpofpeqbNnVUGMnliLweocBsgwAjNk39gk9Vl+whSqlMMEwOmGrlSzzkn/F SI+JVb0YM+3FWCMdqd8glgYPtCq6w1eAmYFOIBTCOF0JvubJxO1tbtXMVywk8kpt4T34 57yztjUnkQIb2Ii9fQ+RaInm1vg9xNCqAmUrI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727459939; x=1728064739; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PjItn4UKNh32h4VjxiwoHdLhBhYvtTxKRydk1cNjExQ=; b=oq1vQkDrfUaaY+b73p3WUvFnihDbiU9ArNFGddDstsUzCX24D0E9o+/dkWsgLcOXU3 0QmDIQ8Lv28Ku9G3x6U35OejNDMJLRDCROkLS23MqE0vEDNa9uVYbOK0zbfVbCxoJ9Oe uAvhhhnfjgw2ZHozXuLImgZd8M0nh4Vobqvld3UO/shZJDzoURx9jnZJESfY+AUnBy1G q7ipMQIm+9WlOTQB1YfCg1sTKSW2NuHvkQs5PmzYJIE6kXQ7PnJW7x46HZXC4+sHl833 cY2g4cPg75Nu5yqP/zqRKcFZyVamMLAvxnKsemWtnBig9c7i1A8fEuYBfmL8kra/FVj3 gjsA== X-Gm-Message-State: AOJu0YyLr36uox/+JdjEYSPc+LjqkkDtG8pb2rFIAT27ZEXtGVXljrZe Vts8ewvRxWbeTK4DuZwcAnD410yH0wZwHeo5k1Kucm6t20ngCt0LaOk3Y2h8V6mthCErMdiTQHD 67LyMzv3QxY5LVwpQi4+oD1NhnEb7HL+U0+Uto3El7+gCPWfhvvWRwomSMscG2eeAELmJcF55gk fJqWo593IFsVIPRCaTC6xtP2rAsN7qydf2ocEeBPc8nw== X-Google-Smtp-Source: AGHT+IGg46FeJOKYnAGp0oNi/wD2VtWSiiU9UQy9bPWSI9LVEjAc/MyCIkk44MdbJZCLompyDN/qhw== X-Received: by 2002:a17:902:c94c:b0:20b:49c3:7856 with SMTP id d9443c01a7336-20b49c37c7fmr24993695ad.17.1727459938530; Fri, 27 Sep 2024 10:58:58 -0700 (PDT) Received: from dhcp-10-123-154-23.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20b37e4e4desm16198945ad.251.2024.09.27.10.58.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Sep 2024 10:58:58 -0700 (PDT) From: Sriharsha Basavapatna To: dev@dpdk.org Cc: Sangtani Parag Satishbhai , Sriharsha Basavapatna , Ajit Khaparde Subject: [PATCH v2 07/47] net/bnxt: tf_core: fix slice count in case of HA entry move Date: Fri, 27 Sep 2024 23:37:49 +0530 Message-Id: <20240927180829.525350-8-sriharsha.basavapatna@broadcom.com> X-Mailer: git-send-email 2.39.0.189.g4dbebc36b0 In-Reply-To: <20240927180829.525350-1-sriharsha.basavapatna@broadcom.com> References: <20240927180829.525350-1-sriharsha.basavapatna@broadcom.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Sangtani Parag Satishbhai When entries are moved during HA, a shared move function transfers TCAM entries by using get/set message APIs, and the slice number of the entry is required to accomplish the movement. The slice number is calculated as the product of row_slice and entry size. Before calling get/set message APIs, the source entry size should be updated with the destination entry size; otherwise, it might corrupt the slice number field, which may result in writing an incorrect entry. A fix is made which now copies the entry size from the source to the destination before calling get/set message APIs, ensuring the correct slice number is modified. Signed-off-by: Sangtani Parag Satishbhai Reviewed-by: Sriharsha Basavapatna Reviewed-by: Ajit Khaparde --- drivers/net/bnxt/tf_core/cfa_tcam_mgr.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/bnxt/tf_core/cfa_tcam_mgr.c b/drivers/net/bnxt/tf_core/cfa_tcam_mgr.c index 349f52caba..33b1e4121e 100644 --- a/drivers/net/bnxt/tf_core/cfa_tcam_mgr.c +++ b/drivers/net/bnxt/tf_core/cfa_tcam_mgr.c @@ -1717,6 +1717,11 @@ cfa_tcam_mgr_shared_entry_move(int sess_idx, struct cfa_tcam_mgr_context *contex uint8_t key[CFA_TCAM_MGR_MAX_KEY_SIZE]; uint8_t mask[CFA_TCAM_MGR_MAX_KEY_SIZE]; uint8_t result[CFA_TCAM_MGR_MAX_KEY_SIZE]; + /* + * Copy entry size before moving else if + * slice number is non zero and entry size is zero it will cause issues + */ + dst_row->entry_size = src_row->entry_size; int rc; @@ -1791,7 +1796,6 @@ cfa_tcam_mgr_shared_entry_move(int sess_idx, struct cfa_tcam_mgr_context *contex ROW_ENTRY_SET(dst_row, dst_row_slice); dst_row->entries[dst_row_slice] = entry_id; - dst_row->entry_size = src_row->entry_size; dst_row->priority = src_row->priority; ROW_ENTRY_CLEAR(src_row, entry->slice); entry->row = dst_row_index; -- 2.39.3