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 CEB0445C9A; Thu, 7 Nov 2024 14:43:30 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6455F42F75; Thu, 7 Nov 2024 14:42:52 +0100 (CET) Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) by mails.dpdk.org (Postfix) with ESMTP id 6E8E142F21 for ; Thu, 7 Nov 2024 14:42:50 +0100 (CET) Received: by mail-pf1-f179.google.com with SMTP id d2e1a72fcca58-720be27db27so694112b3a.2 for ; Thu, 07 Nov 2024 05:42:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1730986969; x=1731591769; 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=ag79qAYfCb9fB5NPZLrsItxBWOjBfE58PWUNhYfs8Uo=; b=LEC/zwnu6g5G4qXFGu7zQ/Tneec19pRa3l3w+D5vwwqikHhfKwKQnwjR09rkgy+If8 QNBCvutumWTurqWJRQDM2FvXBJEDOUQdY+eq4DOq8M8z+yZm1+qp9n16XnKofMPWWczH vytP8cduCL5cpoW3T04XIcP3oJyHvqVU4xqFM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730986969; x=1731591769; 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=ag79qAYfCb9fB5NPZLrsItxBWOjBfE58PWUNhYfs8Uo=; b=b8gjOpGccVI+gNx7/X+mJBgLRGJr+Rm3FZ/22T1/sukeGwBhOvGYwP5Okgq5m49okJ e7wlbmY+OsW1mzSrsHyn5NQ5wOLeK6VDIO6uqV4GYCXOZlu1UjUarsY9NopByWSgSv3y knFO5BL133qj/zigabDmvFZDaaQIU9+2PRBZMOpFbak/cti3YnnKgHQeE6wVR2Bb8OoL IaUeq0kR7Y47/+W626HFgl/+jz1HIwRSggTzsvYgj1442AD1K0R/UkCRoV5fgfVCTrZY LSGy3QD3xt+r7d/5j0kK8iuNUUCIyjeD+xegkxkbBiINXjrIC33kQBakW2SPtKUHdFZJ 1d6Q== X-Gm-Message-State: AOJu0YwpHKOaSz+NCdiOk6NFu+ka8rRhD+elhsrwhaTvqd/LxiuXWIc+ nv+KJX1f+vwc91FiotGxLUqPygiUEZEeJaxG3+6bmFUyPoW8wHlZ8bvj6I+59ypGRw7e1Q682mt UGPZF95SKmcBoNfWwfj/YB52fHWSqTVBN/8Ux+zfbYSa+RWRsXFKjqD5sUJvnb4xnLpO56RD4iS 0lZ4gyODdvx0R8ECdbp7k4bgEPvmH/cVQQVCNtqooRlg== X-Google-Smtp-Source: AGHT+IHRwXW96Ay7f79cU2d56BlKqy2VCOZsyPU/JWgIPu+uIYfV+/PTrLY0vSnAGsJtrglDYnAuzA== X-Received: by 2002:a05:6a20:e608:b0:1db:d920:ccc5 with SMTP id adf61e73a8af0-1dc1e35b2c6mr19005637.13.1730986968976; Thu, 07 Nov 2024 05:42:48 -0800 (PST) Received: from dhcp-10-123-154-23.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e9a5f52969sm1409878a91.2.2024.11.07.05.42.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Nov 2024 05:42:48 -0800 (PST) From: Sriharsha Basavapatna To: dev@dpdk.org Cc: Sangtani Parag Satishbhai , stable@dpdk.org, Sriharsha Basavapatna , Ajit Khaparde Subject: [PATCH v8 07/47] net/bnxt: tf_core: fix slice count in case of HA entry move Date: Thu, 7 Nov 2024 19:22:14 +0530 Message-Id: <20241107135254.1611676-8-sriharsha.basavapatna@broadcom.com> X-Mailer: git-send-email 2.39.0.189.g4dbebc36b0 In-Reply-To: <20241107135254.1611676-1-sriharsha.basavapatna@broadcom.com> References: <20241107135254.1611676-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. Fixes: 97435d7906d7 ("net/bnxt: update Truflow core") Cc: stable@dpdk.org Signed-off-by: Sangtani Parag Satishbhai Reviewed-by: Sriharsha Basavapatna Reviewed-by: Ajit Khaparde --- .mailmap | 1 + drivers/net/bnxt/tf_core/cfa_tcam_mgr.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.mailmap b/.mailmap index 504c390f0f..210df76f0f 100644 --- a/.mailmap +++ b/.mailmap @@ -1321,6 +1321,7 @@ Samina Arshad Sampath Peechu Samuel Gauthier Sandilya Bhagi +Sangtani Parag Satishbhai Sangjin Han Sankar Chokkalingam Santoshkumar Karanappa Rastapur 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