From patchwork Fri Aug 30 14:00:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sriharsha Basavapatna X-Patchwork-Id: 143465 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 7D947458A8; Fri, 30 Aug 2024 15:51:09 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1969542E95; Fri, 30 Aug 2024 15:51:05 +0200 (CEST) Received: from mail-pl1-f195.google.com (mail-pl1-f195.google.com [209.85.214.195]) by mails.dpdk.org (Postfix) with ESMTP id 02994402D8 for ; Fri, 30 Aug 2024 15:51:03 +0200 (CEST) Received: by mail-pl1-f195.google.com with SMTP id d9443c01a7336-20223b5c1c0so17297235ad.2 for ; Fri, 30 Aug 2024 06:51:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1725025862; x=1725630662; 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=qnrlqimcdF/FxHoq41uAJefGaCja7NU+W3mUgmYJQr0=; b=ejwn1R9MVRvGmTyMVfHFrCvhipJe4xiSnQueRZw36GLbCAs0swwTEzKPgcdzEJcf2m 29S/c+d5K7emd9USeszPXAVpZLYeMiyZWnRl8M4B7gNGEDQo1+87n4+xLFvqOlNMfQjJ lTdndySwR1gJSYmZOmG52deLxy/q+xdsQ5P+g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725025862; x=1725630662; 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=qnrlqimcdF/FxHoq41uAJefGaCja7NU+W3mUgmYJQr0=; b=sT1J66PNp/pssA1fnLEcLQy04NH3SrpRFPAMPNZfLBFYs1qH5/NmOxyYdX/dDJlmmV w9Rj14akMbYRj7yAl9iuQtH/yiHd4jBXo8l3c4gnH86XhhFLf8rpMSqKPoJtfTcmJUWq vywT/FzLsVe7L2MZcS26uSmiKnRrf6G2jToJL7koXdiN6MA222z2Aww+52jlcdplSHBE yTxj6fRqtyIiTyfDIhvFbkofUZZQnTnXYIAYmJCNWB4XSFFUJIitp8mZw52qVfqc9X25 unB/rPt9btv6gV9/5zwsGX3gI7GBD9PoLuWgtqxHkA0vSBVi+bKG4CiT3XCLECCuzPs2 K9aQ== X-Gm-Message-State: AOJu0YyZLJ7iZ21+tVxqAGRdhc1mvALvdoesIutMy+6dov2aeIFduGH6 HC4/YhFl1YkcU87lTfqNWapeYlCsEyYuLQ8N9aZ9L/YHyiYAI2XBjJTPkVxwnba8UIdDIFxsVou O0NydQMzXhNAYGwt9Zg7gjVJ9aVm/WszU3V9IU5AUkR3AKRzcrLipTjRJSdYM+IThb0mGvDqI9k rfSMVzn10xMYDJgty9ox8fafN3jMZ0Wnr+o09WmXQ0RvBJd1U= X-Google-Smtp-Source: AGHT+IGPDoj/bhDFgdYbpPTU0PtLdKrGcfaKoOPVNsL93pxZPYK62j2Wrm52xK958ZuazHSf0Nwajw== X-Received: by 2002:a17:902:cec8:b0:202:5af:47fc with SMTP id d9443c01a7336-2050c21967dmr75827515ad.13.1725025861566; Fri, 30 Aug 2024 06:51:01 -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.50.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Aug 2024 06:51:01 -0700 (PDT) From: Sriharsha Basavapatna To: dev@dpdk.org Cc: Shahaji Bhosle , Randy Schacher , Kishore Padmanabha , Sriharsha Basavapatna Subject: [PATCH 01/47] net/bnxt: tf_core: fix wc tcam multi slice delete issue Date: Fri, 30 Aug 2024 19:30:03 +0530 Message-Id: <20240830140049.1715230-2-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: Shahaji Bhosle FW tries to update the HWRM request data in the delete case to update the mode bit and also update invalid profile id. This update only happens when the data is send over DMA. HWRM requests are read only buffers and cannot be updated. So driver now will always send WC tcam set message over DMA channel. Update tunnel alloc apis to provide error message. Fixes: ca5e61bd562d ("net/bnxt: support EM and TCAM lookup with table scope") Signed-off-by: Shahaji Bhosle Reviewed-by: Randy Schacher Reviewed-by: Kishore Padmanabha Signed-off-by: Sriharsha Basavapatna --- drivers/net/bnxt/tf_core/tf_msg.c | 28 +++++++++++----------- drivers/net/bnxt/tf_ulp/bnxt_tf_pmd_shim.c | 18 ++++++++++++-- 2 files changed, 30 insertions(+), 16 deletions(-) diff --git a/drivers/net/bnxt/tf_core/tf_msg.c b/drivers/net/bnxt/tf_core/tf_msg.c index 1c66c7e01a..4aa90f6b07 100644 --- a/drivers/net/bnxt/tf_core/tf_msg.c +++ b/drivers/net/bnxt/tf_core/tf_msg.c @@ -1612,20 +1612,20 @@ tf_msg_tcam_entry_set(struct tf *tfp, req.result_size = parms->result_size; data_size = 2 * req.key_size + req.result_size; - if (data_size <= TF_PCI_BUF_SIZE_MAX) { - /* use pci buffer */ - data = &req.dev_data[0]; - } else { - /* use dma buffer */ - req.flags |= HWRM_TF_TCAM_SET_INPUT_FLAGS_DMA; - rc = tf_msg_alloc_dma_buf(&buf, data_size); - if (rc) - goto cleanup; - data = buf.va_addr; - tfp_memcpy(&req.dev_data[0], - &buf.pa_addr, - sizeof(buf.pa_addr)); - } + /* + * Always use dma buffer, as the delete multi slice + * tcam entries not support with HWRM request buffer + * only DMA'ed buffer can update the mode bits for + * the delete to work + */ + req.flags |= HWRM_TF_TCAM_SET_INPUT_FLAGS_DMA; + rc = tf_msg_alloc_dma_buf(&buf, data_size); + if (rc) + goto cleanup; + data = buf.va_addr; + tfp_memcpy(&req.dev_data[0], + &buf.pa_addr, + sizeof(buf.pa_addr)); tfp_memcpy(&data[0], parms->key, parms->key_size); tfp_memcpy(&data[parms->key_size], parms->mask, parms->key_size); diff --git a/drivers/net/bnxt/tf_ulp/bnxt_tf_pmd_shim.c b/drivers/net/bnxt/tf_ulp/bnxt_tf_pmd_shim.c index 96d61c3ed2..7e4952c062 100644 --- a/drivers/net/bnxt/tf_ulp/bnxt_tf_pmd_shim.c +++ b/drivers/net/bnxt/tf_ulp/bnxt_tf_pmd_shim.c @@ -32,9 +32,17 @@ bnxt_tunnel_dst_port_alloc(struct bnxt *bp, uint16_t port, uint8_t type) { - return bnxt_hwrm_tunnel_dst_port_alloc(bp, + int rc = 0; + rc = bnxt_hwrm_tunnel_dst_port_alloc(bp, port, type); + if (rc) { + PMD_DRV_LOG(ERR, "Tunnel type:%d alloc failed for port:%d error:%s\n", + type, port, + (rc == HWRM_TUNNEL_DST_PORT_ALLOC_OUTPUT_ERROR_INFO_ERR_ALLOCATED) ? + "already allocated" : "no resource"); + } + return rc; } int @@ -589,7 +597,13 @@ bnxt_pmd_global_tunnel_set(uint16_t port_id, uint8_t type, } rc = bnxt_hwrm_tunnel_dst_port_alloc(bp, udp_port, hwtype); - if (!rc) { + if (rc) { + PMD_DRV_LOG(ERR, "Tunnel type:%d alloc failed for port:%d error:%s\n", + hwtype, udp_port, + (rc == + HWRM_TUNNEL_DST_PORT_ALLOC_OUTPUT_ERROR_INFO_ERR_ALLOCATED) ? + "already allocated" : "no resource"); + } else { ulp_global_tunnel_db[type].ref_cnt++; ulp_global_tunnel_db[type].dport = udp_port; bnxt_pmd_global_reg_data_to_hndl(port_id, bp->ecpri_upar_in_use,