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 1A06945C9A; Thu, 7 Nov 2024 14:42:42 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 74AFD42F25; Thu, 7 Nov 2024 14:42:34 +0100 (CET) Received: from mail-pg1-f193.google.com (mail-pg1-f193.google.com [209.85.215.193]) by mails.dpdk.org (Postfix) with ESMTP id E56DF42F05 for ; Thu, 7 Nov 2024 14:42:32 +0100 (CET) Received: by mail-pg1-f193.google.com with SMTP id 41be03b00d2f7-7ea76a12c32so751404a12.1 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=1730986952; x=1731591752; 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=Sh8s8ArPAam9hIEvVFnqD3y+gMAm4pdaIyTVHfmRT7uDgzk6p82x6jkpB8d42kY7Bi Ys2aiXL7YYqzYdv7f36NXw0ysasSvsSxe0Hi/LKwdzEqoQzdwcsSXxeG8UfwfN4S1EuN 61b7lb5oj0SBnm1aZZboUhV1xng+HlSx6gFus= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730986952; x=1731591752; 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=ioCl2YIpOO5j0uNQk/iW9agiDehVfWCnMz2TdTwnPsNpDk9EjtZ2T3ORpb1mr/w6Os fjPk4EcJnTej5VKtLRzTjfgYTdKKPnKqsXNSWRgpxF+SDe4jSBycGWyDR3mVhtHZ8HPX 9rYiaIAs9kqaKAO+Exgc9+THZ8cCHZGf4HsOejs6D8RNbkHAJ5FEinn9s9ZUSV3c1g4h C4pV/NdAMgIIEvkN/CqjFs14cQaORFhH2hLMC6RHGvv0ddGYdvk2dNRuWoFsxwojuMdY U8vdzbkV8wm2HoH5bMOOTQDiapor8CQX809N/LZvCVXNArvetKI2BqgWngWX0vvxxu5J NQng== X-Gm-Message-State: AOJu0YyU95On7y6RdSOpOiVtt1u8WQb+kFhrZfiV6V7CnWuw7WIHGg+0 5rn3BGDiCRqlxdTVbHYvx/VSH+ln3lxJqQGojlmITAUvOCtGxSGzO5qE7Hex5v6XQMAwcsVPz/1 CbPktTCE8RMRDgBpjXMGcaQ06gRhn/9ZTKzd4ssRR4COktfF4YPVQKZacDBNqhCvDXv7y6HmBih fENTfNF6IlNg+2JP1X08IhefONeqs3FgUoW9P6XZGrjd4v 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: 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") 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