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 838DC45A7C; Fri, 4 Oct 2024 19:46:05 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 28CD242FA1; Fri, 4 Oct 2024 19:45:04 +0200 (CEST) Received: from mail-pg1-f175.google.com (mail-pg1-f175.google.com [209.85.215.175]) by mails.dpdk.org (Postfix) with ESMTP id 1435542F8D for ; Fri, 4 Oct 2024 19:45:01 +0200 (CEST) Received: by mail-pg1-f175.google.com with SMTP id 41be03b00d2f7-7db238d07b3so1928623a12.2 for ; Fri, 04 Oct 2024 10:45:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1728063900; x=1728668700; 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=GW/Kr4qANVFHcMtGcWaB/Q5AIJ3kAnIeUrCszxAe51EEfgomfxYrhr/QhyttrKlAHW gwblkxXWsfD0hB92xblu4jHGkOFZg4Hpm7vgSAyOZZbJmqXzhicgk8oCARuxojXK9B5D WANl1pB8w6QBC7eA/g9o3BJR+pLz1NMcBDol8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728063900; x=1728668700; 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=N4wXYue1q07EL1xU/8bih9xQbrF46dWcy8OyNyLujKXqKW/mEzawzfGpV6I8CqLDl0 ourm9uZXXsJzy6KONUXmmMV47vL+cSB/kOQtWjHdKm0K2s5bcdrkUBT3AnggjMS6DIGO zUACnYUip4YIYhQoBCVf6jaG7DhYDqsiIA7yv2WbXXdQuDhVTSkyMD5n8yG0dft9zEZi 8ipPeCczTSLGU2SdHNh8gvLTa7LPHpbIELxQqUUKAYPDq0HZZ4lHAn9DJ+L5vjC3uzPd o+qGO3ivg5TydTgKbKPKncRqnU/vRnMo13oloapYbTopKlZKF7UtDbA9kEED+ky0LwXu UfMw== X-Gm-Message-State: AOJu0YxVK/GodLhFy91bfoWLJsbNGVUpNR/VSJ+kK9hA23VFUtHw94Np eOFOf0f8fiHtd5izZOyR1Tmo3gDh6FGZ/UftSomKxoUGtX4D0KHD4ljlwO+h3p5XKooZMbtRhzF /IAFSxxLgBweI71bY/TNPDvTPSgcFonrBAsGi/ltwa4hbKMsWpAey/zSrzWV30CS0xwmvUdyp0D VNnyFIC1Y7snOaJJKEHAGXsNbmXD0uzI3POwv/4rGeDg== X-Google-Smtp-Source: AGHT+IEu2o2hSvKCoCAEg7T0+HKZV8i0td47U/Kijs200YghqrbUwk/fKmDhr2aaEheNMS7XQ9Fk4A== X-Received: by 2002:a05:6a20:cd0e:b0:1d2:e888:fcd1 with SMTP id adf61e73a8af0-1d6dfabb812mr5952881637.33.1728063899783; Fri, 04 Oct 2024 10:44:59 -0700 (PDT) Received: from dhcp-10-123-154-23.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71df0cd0b5bsm128103b3a.53.2024.10.04.10.44.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Oct 2024 10:44:59 -0700 (PDT) From: Sriharsha Basavapatna To: dev@dpdk.org Cc: Sangtani Parag Satishbhai , Sriharsha Basavapatna , Ajit Khaparde Subject: [PATCH v4 07/47] net/bnxt: tf_core: fix slice count in case of HA entry move Date: Fri, 4 Oct 2024 23:22:58 +0530 Message-Id: <20241004175338.3156160-8-sriharsha.basavapatna@broadcom.com> X-Mailer: git-send-email 2.39.0.189.g4dbebc36b0 In-Reply-To: <20241004175338.3156160-1-sriharsha.basavapatna@broadcom.com> References: <20241004175338.3156160-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