From patchwork Fri Aug 30 14:00:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sriharsha Basavapatna X-Patchwork-Id: 143471 X-Patchwork-Delegate: ajit.khaparde@broadcom.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 03FA2458A8; Fri, 30 Aug 2024 15:52:06 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2F31342EC2; Fri, 30 Aug 2024 15:51:19 +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 3737942EBA for ; Fri, 30 Aug 2024 15:51:17 +0200 (CEST) Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-20223b5c1c0so17299975ad.2 for ; Fri, 30 Aug 2024 06:51:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1725025876; x=1725630676; 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=5/zr++Xm/i4f1sFWZh10kCZlh5B8aahCig3NDoiGzz4=; b=AqQHEvq+zYE5yXT37/+pP4vCefcGfEqtf85lLitQcW8HYFKe+GDNCTFfM3VXHRF9+m DlLHYWc/zgckBUbW59TfLltoWFXci1Gsv2Lds+izrrBnAzNRVl09FhAoxo7W9bLRM2aQ J+EErwRlG5W/mZn2MZ/Ous92ogRA7+4mI/wrE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725025876; x=1725630676; 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=5/zr++Xm/i4f1sFWZh10kCZlh5B8aahCig3NDoiGzz4=; b=FAqb9hd9j//HG/f1rMC0zogziAFvwTufxyIzantHkauCmdeULcIEvkjM8hfe5NkL8h K+15kqoYNeWooQI9Ma3SvgmZ9U0xb3/m48Lek1CyhcDdp54cW6091EMG9yN8n7ASlT8J 2YQ1gh0L7uS0dzXlrxvOd641TVFyQfmgNmP+ETLyGIaMlX/P3EFepEKyDYmdA6/XfUsy hcGJTh4bUfoO+9xhDmOSMAM8uZ2i4tjawy57RtZvaRy2qZEE6u0wblHpaaFTmNw13U0o BtkGxZjqppGVDQrGpShRDY3KwxaLU9ZaU3r7EXaBbQGI+rDaP8rkwPG5OHy+IcxQjuGm KyeA== X-Gm-Message-State: AOJu0YwoQW9DgQBtm0KBO+jiO1viHADQ9jpTPH8KkdB35bRMSbO+hHJa T21OMInafms2jgehN3cpo5xB8U87H3Aw+kQ1Q2sqyWs4bJuI/sDYV99jTdTYiaekdw7g1ZERTXd GimCgOrTNEV/iCUsekmm1lLbgKOndEsgHmtyX6IViS2qfkFY/nyaT2YKHStfh/uAYiMOZLUcx2t jkxnGQ58L7J96XqWJU9JEiT6wi2MIl3xUEjZs4KieO7QpS X-Google-Smtp-Source: AGHT+IGFDCMZl0RlpijRYJcMqWhR05jpKEbLbu7iRPQ+v21gjTc8Kxd6cLuYBAgqVquj0h7tMF7Szw== X-Received: by 2002:a17:902:db0d:b0:1fd:67c2:f975 with SMTP id d9443c01a7336-2050c390ce2mr65706555ad.29.1725025875798; Fri, 30 Aug 2024 06:51:15 -0700 (PDT) Received: from dhcp-10-123-154-23.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-205155658dfsm27067145ad.297.2024.08.30.06.51.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Aug 2024 06:51:15 -0700 (PDT) From: Sriharsha Basavapatna To: dev@dpdk.org Cc: Sangtani Parag Satishbhai , Sriharsha Basavapatna Subject: [PATCH 07/47] net/bnxt: tf_core: fix slice count in case of HA entry move Date: Fri, 30 Aug 2024 19:30:09 +0530 Message-Id: <20240830140049.1715230-8-sriharsha.basavapatna@broadcom.com> X-Mailer: git-send-email 2.39.0.189.g4dbebc36b0 In-Reply-To: <20240830140049.1715230-1-sriharsha.basavapatna@broadcom.com> References: <20240830140049.1715230-1-sriharsha.basavapatna@broadcom.com> MIME-Version: 1.0 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 Signed-off-by: Sriharsha Basavapatna --- 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;