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 A10E645C9A for ; Thu, 7 Nov 2024 14:42:34 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4B35342F1D; Thu, 7 Nov 2024 14:42:34 +0100 (CET) Received: from mail-pg1-f194.google.com (mail-pg1-f194.google.com [209.85.215.194]) by mails.dpdk.org (Postfix) with ESMTP id 6599D40280 for ; Thu, 7 Nov 2024 14:42:32 +0100 (CET) Received: by mail-pg1-f194.google.com with SMTP id 41be03b00d2f7-7d4f85766f0so733909a12.2 for ; Thu, 07 Nov 2024 05:42:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1730986951; x=1731591751; 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=5gi+4bjYYmlwIxopE+PX/Jap/VwZVSJpuBB9Zcqaf6I=; b=N3JjvIRg8uutOT+V/D/4wivxSqX9Tadhky7p0aYm/Siwz1Jc8hUFaEq2a9dEVlikYl 3Q4q062qmtpluDCdb7phznSiPAwg26f9KY5rQVaRanQC78qz7dbzihWpltXWhjRcuDPO Dx+HASEmp7uvWGD1mRHNq+u8Eelze3VOmh00Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730986951; x=1731591751; 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=5gi+4bjYYmlwIxopE+PX/Jap/VwZVSJpuBB9Zcqaf6I=; b=l7J6kwuBa/qeSoLzkPI2hyEK+x9hLQFX3cTaUXXmhF1DnF/jCfCRx3bGXRh6QMp7vy DF40lGzSIFIbSfltF+45xS7ETXZRh7FJZfduGtZGn+IysIuW+qV1ZSvbL1p50J3SYFhX O245BfqbIGTJhEEcy6y8pjPSYcd4VemmO/8WTPDPhFXpvey8kpGolS+iWvwn4qy0bVZW tOkqZNgMPgdV+1LWAvQWoM17guC4HyIICCFN8KsiwKdciEhg7/XFnu6GhwcqL+SpKBaS N6sfWH4b+rmJYUgaFNuJVJCHtLD6g98nVmDkqA65HZwqoh9rt/OAio9Geq+kqr3kooq6 Qz+g== X-Forwarded-Encrypted: i=1; AJvYcCWo9atLIUYa1h151POGcW0ybsd3wCgpekNtXBOit5k5lk5TrQwWW3ShGH1I0iLVvyUPtMEntNY=@dpdk.org X-Gm-Message-State: AOJu0YzwJVwoiyCNW5DNrFNLH9dPQN/1AyAGnMsVNOJk2ytDAbf5pOhE 6EU0UkllAE2HIsXLZdUoG9IFo7yNE1ETeLWqm6hmzFwjfeSkZu55VZNYlPy6SQ== X-Google-Smtp-Source: AGHT+IHAjyy5JmElag4bvOFzCIIMW/gzlpsGf6Er/kykV67cd6/h4bs1UHKO5tVE0mYVkMH1gjUyIA== X-Received: by 2002:a05:6a20:258a:b0:1db:df7b:471d with SMTP id adf61e73a8af0-1dc1e1a846bmr24400637.5.1730986951409; Thu, 07 Nov 2024 05:42:31 -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.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Nov 2024 05:42:30 -0800 (PST) From: Sriharsha Basavapatna To: dev@dpdk.org Cc: Shahaji Bhosle , stable@dpdk.org, Randy Schacher , Kishore Padmanabha , Sriharsha Basavapatna , Ajit Khaparde Subject: [PATCH v8 01/47] net/bnxt: tf_core: fix wc tcam multi slice delete issue Date: Thu, 7 Nov 2024 19:22:08 +0530 Message-Id: <20241107135254.1611676-2-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: 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") Cc: stable@dpdk.org Reviewed-by: Randy Schacher Reviewed-by: Kishore Padmanabha Signed-off-by: Shahaji Bhosle Signed-off-by: Sriharsha Basavapatna Reviewed-by: Ajit Khaparde --- drivers/net/bnxt/tf_core/tf_msg.c | 28 +++++++++++----------- drivers/net/bnxt/tf_ulp/bnxt_tf_pmd_shim.c | 21 ++++++++++++++-- 2 files changed, 33 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 75a0b77ac2..fc8d0098f9 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,18 @@ 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_LINE(ERR, "Tunnel type:%d alloc failed for port:%d error:%s", + type, port, + (rc == + HWRM_TUNNEL_DST_PORT_ALLOC_OUTPUT_ERROR_INFO_ERR_ALLOCATED) ? + "already allocated" : "no resource"); + } + return rc; } int @@ -589,7 +598,15 @@ 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) { + if (rc == HWRM_TUNNEL_DST_PORT_ALLOC_OUTPUT_ERROR_INFO_ERR_ALLOCATED) + PMD_DRV_LOG_LINE(ERR, + "Tunnel already allocated, type:%d port:%d", + hwtype, udp_port); + else + PMD_DRV_LOG_LINE(ERR, "Tunnel allocation failed, type:%d port:%d", + hwtype, udp_port); + } 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, -- 2.39.3