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 0716745C9A for ; Thu, 7 Nov 2024 14:42:53 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E267042F63; Thu, 7 Nov 2024 14:42:51 +0100 (CET) Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) by mails.dpdk.org (Postfix) with ESMTP id EFEA442F21 for ; Thu, 7 Nov 2024 14:42:49 +0100 (CET) Received: by mail-pg1-f177.google.com with SMTP id 41be03b00d2f7-7f3f1849849so741270a12.1 for ; Thu, 07 Nov 2024 05:42:49 -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=CUhmxgF9WjVqoYWP7YuOR4rlA2KF+n3Z6sCnWmZsL7ZrNV12prLeud2l80eDbDcVcQ BjJ8OgHQqnqbx6I7hkrRED1pbI/vzLHzBQCjASIqVwBuwRYVMJ1X+krEd9S6epkWXYBj 36P0FuWwjz5CGRQdedoEUKfg5Qk8k7cRFJJTlVmTtN0YGJ+MJ43htesci83VugZl+F5w F7TT3jnlCB++SskU2h6xzxmxPdLAsyceaizbQeOABRRazDWxhqJDuEtZdsSTJ5kLJuNp iNS7nIUSutb2HxWJj5B7XZxtKl2v2sn+575JEQrUXFedOqaSjExPEi9GhJJxgZaGHJ0i ZH3A== X-Forwarded-Encrypted: i=1; AJvYcCWxG2tG2JhCuf28L9OajClxrK064FvIqrjLDCalW5AocQ/n5QCpfWiZYCir42o3Or3vkLGP4k4=@dpdk.org X-Gm-Message-State: AOJu0YzT39iOFgEqR/6I/wUdJhgoozvixT2ZWhhoWhwLTCS3xZrSdd2h GiwvvfEX34LCuw2OnvdHYPUlwgQxq1BXZYvr7q808A2D0CtqhCfez1A166AK9g== 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: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-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