From patchwork Wed Feb 21 21:20:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajit Khaparde X-Patchwork-Id: 136978 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 0A9AE43B67; Wed, 21 Feb 2024 22:21:10 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D54A640689; Wed, 21 Feb 2024 22:21:05 +0100 (CET) Received: from mail-yw1-f177.google.com (mail-yw1-f177.google.com [209.85.128.177]) by mails.dpdk.org (Postfix) with ESMTP id 795594064E for ; Wed, 21 Feb 2024 22:21:04 +0100 (CET) Received: by mail-yw1-f177.google.com with SMTP id 00721157ae682-6083befe2a7so38462097b3.0 for ; Wed, 21 Feb 2024 13:21:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1708550463; x=1709155263; darn=dpdk.org; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=ZkKXSg3jZRC7V4SJiM59h/iLOdCRLiy3ECR/CoAfc1k=; b=GErkbydsevHNJfZtYwFOhsUnEjDe5ChW/78nn+8l/chcH3c7qeKN1DuUXoJn4dCbYD /3Zm+X+zsUjUfW4MecG9t2L7ud8PgGOdua03QEkKWgkt7mXZc0RByavYJgbtjVb2hSNq SVDIoEWhddrjGba6UUdK/cjzewkLKG1Zx9wiI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708550463; x=1709155263; h=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=ZkKXSg3jZRC7V4SJiM59h/iLOdCRLiy3ECR/CoAfc1k=; b=reM5HzJ7BkfUGqjUHPyE2Lp8Mv2ROrXIoAqRTwaq6nnB8V+xN7eddbuZhROhdBmv39 YnmVnsBOEFpLapnOO3b3U5h5NfxmqrclG16XpGZguYk3E+v1V/FQTIRtwXJ/ZkUa4KrG fG25crGPwixw5CHms5LTrjbG4yQpf1NSFEaD8I8H2g5C8LiaDV9StLBBphaDkBCNvqzL SJn6Mq+3lM00sjcVyTNRtzT+LXOENQR+hMjODe7wS2jvCkALr5sECs/vevQma1j7xfjZ YAGGsIWAp0XRvIWyU3YsK9cllxhlduQlQc6+UBJfBWNJUAxG5jY13X+jvvbiIl1+81tW 9zig== X-Gm-Message-State: AOJu0YzUzEQwIsh0yJeCUCaunCSdVWb9pkYR5uLuWrVt6pwYrIg06vnv r0q2HISTN1rdVDtXfUwLKiP8KoRDop+iN1Ed2p4UsTWVPUHdQI797IbnhQksT3ZcY93hOTI96Vb kuJKMPbI9R2+2vy60sPvpB/cHMqzVKk0/xma0B1tdjYRvPRV4SnuGrRvI+jcWLgcitzGs1Uy6j9 uOk3MZaeQX8TcEZEoDEtnqT0af5tVV X-Google-Smtp-Source: AGHT+IE9cr22bjrn1dOKG1kMVlzuc1D+Ie7RR3NMBBF75lnVyEYJzZo0UkPfyW9iEHpl1Ybbnr2ucw== X-Received: by 2002:a81:60c2:0:b0:607:87cd:9395 with SMTP id u185-20020a8160c2000000b0060787cd9395mr19525048ywb.17.1708550463267; Wed, 21 Feb 2024 13:21:03 -0800 (PST) Received: from C02GC2QQMD6T.wifi.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id 20-20020ac84e94000000b0042bff97d9a3sm4743467qtp.40.2024.02.21.13.21.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 13:21:02 -0800 (PST) From: Ajit Khaparde To: dev@dpdk.org Cc: ferruh.yigit@amd.com, thomas@monjalon.net, Kalesh AP Subject: [PATCH 01/10] net/bnxt: extend long bd check for VXLAN GPE Date: Wed, 21 Feb 2024 13:20:36 -0800 Message-Id: <20240221212044.27209-2-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.39.2 (Apple Git-143) In-Reply-To: <20240221212044.27209-1-ajit.khaparde@broadcom.com> References: <20240221212044.27209-1-ajit.khaparde@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 Extend long Tx BD check for VXLAN GPE packets. This will allow the long BD to be selected for Tx with VXLAN GPE frames. Signed-off-by: Ajit Khaparde Reviewed-by: Kalesh AP --- drivers/net/bnxt/bnxt_txr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/bnxt/bnxt_txr.c b/drivers/net/bnxt/bnxt_txr.c index 7fc44e989d..7cbb2104a0 100644 --- a/drivers/net/bnxt/bnxt_txr.c +++ b/drivers/net/bnxt/bnxt_txr.c @@ -116,7 +116,7 @@ bnxt_xmit_need_long_bd(struct rte_mbuf *tx_pkt, struct bnxt_tx_queue *txq) RTE_MBUF_F_TX_VLAN | RTE_MBUF_F_TX_OUTER_IP_CKSUM | RTE_MBUF_F_TX_TUNNEL_GRE | RTE_MBUF_F_TX_TUNNEL_VXLAN | RTE_MBUF_F_TX_TUNNEL_GENEVE | RTE_MBUF_F_TX_IEEE1588_TMST | - RTE_MBUF_F_TX_QINQ) || + RTE_MBUF_F_TX_QINQ | RTE_MBUF_F_TX_TUNNEL_VXLAN_GPE) || (BNXT_TRUFLOW_EN(txq->bp) && (txq->bp->tx_cfa_action || txq->vfr_tx_cfa_action))) return true; From patchwork Wed Feb 21 21:20:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajit Khaparde X-Patchwork-Id: 136979 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 9B7FF43B67; Wed, 21 Feb 2024 22:21:19 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 63FA2409FA; Wed, 21 Feb 2024 22:21:09 +0100 (CET) Received: from mail-qt1-f179.google.com (mail-qt1-f179.google.com [209.85.160.179]) by mails.dpdk.org (Postfix) with ESMTP id C68F94067D for ; Wed, 21 Feb 2024 22:21:05 +0100 (CET) Received: by mail-qt1-f179.google.com with SMTP id d75a77b69052e-42c7bbf638bso30047501cf.2 for ; Wed, 21 Feb 2024 13:21:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1708550465; x=1709155265; darn=dpdk.org; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=pKIFp89phllVcMnBwDEz6OTTbpSbgYZhhN2vSNDF/0c=; b=NKopsArlUC8/BQtT2fsgmaBy76cO9bk4DNwhb01lW9j901yBDYlAxN6EVJMrw04rNq Pl2g8ElKGim/7CjtFusSWR8CMUpoQiDouODgRHB6Z8rTpZAP/ZobwHbeOqtMgsKBvzvp 8pQP+cDUBrGauGv14iGYIZEnqFmiEVYRdn4GY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708550465; x=1709155265; h=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=pKIFp89phllVcMnBwDEz6OTTbpSbgYZhhN2vSNDF/0c=; b=uCHvZwYLtL5Qs+Rjqgcplxjuh45bvILzek9r8KsVOWaXoUqU2jUzbHFZEYSud9VWTl OmPp0eaMpgKUHOxc4//RkcS9goNxgZEdckvdBFQhRqsjAbyf7t/966HJdB1xD+GSCHAt Bn7YT84YcGN2eHcBTcq9YbBwJDGq0JAPYhMyv+absNdBITzsO4hxyZMppBAhZ9ucnFlL e428t2grXb6OeVlYxZH2ZAWNHpmR/9gSEdTJNQqoOF1uyvUSYyzuYXu0NN2MmUaVb27E ROoT9kWJWg5jqCiJP8v1533Sf4I+cKrs+zIC7D6Tv946FXkBgnu+iotgOjHMA9k1/DUr cHdw== X-Gm-Message-State: AOJu0Yxi9zpViv10jGtlEfDSLYLamb/zrbYgInsyMEhLmZDPeOfarFh4 XjdB8l0+1WNq1dzPfLn+TOpo0CUp1EeHcBZqoWoR7QkxeS445dw23egbIfORBnSt/7tcXHMEPjj W0BT1W4VCNg/joihkVERJBs4dn55V2iTXDmNUk9nQAkXQQRozxxANSQibOW3QbY9Z4QqF3FcTMn Doi/lsIw5xqOIlbWWRmlOF/yAvJ+5s X-Google-Smtp-Source: AGHT+IHYgNLhWbbDskUQII4ZZHhNIkQyFGBKk4fUa8wzJNg2eUP48YaotHMaq6X/XrkjrR+4YY74LA== X-Received: by 2002:ac8:7d04:0:b0:42c:6ce7:bad1 with SMTP id g4-20020ac87d04000000b0042c6ce7bad1mr25625578qtb.22.1708550464735; Wed, 21 Feb 2024 13:21:04 -0800 (PST) Received: from C02GC2QQMD6T.wifi.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id 20-20020ac84e94000000b0042bff97d9a3sm4743467qtp.40.2024.02.21.13.21.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 13:21:04 -0800 (PST) From: Ajit Khaparde To: dev@dpdk.org Cc: ferruh.yigit@amd.com, thomas@monjalon.net, Kalesh AP Subject: [PATCH 02/10] net/bnxt: add dual rate module detection log Date: Wed, 21 Feb 2024 13:20:37 -0800 Message-Id: <20240221212044.27209-3-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.39.2 (Apple Git-143) In-Reply-To: <20240221212044.27209-1-ajit.khaparde@broadcom.com> References: <20240221212044.27209-1-ajit.khaparde@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: Kalesh AP Firmware sends an async notification to the driver when it detects a Dual rate module. Display below warning message: "Speed change not supported with dual rate transceivers on this board" Signed-off-by: Kalesh AP Reviewed-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_cpr.c | 4 ++++ drivers/net/bnxt/hsi_struct_def_dpdk.h | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/net/bnxt/bnxt_cpr.c b/drivers/net/bnxt/bnxt_cpr.c index fb43bc58da..a4509abd60 100644 --- a/drivers/net/bnxt/bnxt_cpr.c +++ b/drivers/net/bnxt/bnxt_cpr.c @@ -100,6 +100,10 @@ static void bnxt_handle_event_error_report(struct bnxt *bp, PMD_DRV_LOG(WARNING, "Port:%d Pause Storm detected!\n", bp->eth_dev->data->port_id); break; + case HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_DUAL_DATA_RATE_NOT_SUPPORTED: + PMD_DRV_LOG(WARNING, "Port:%d Speed change not supported with dual rate transceivers on this board", + bp->eth_dev->data->port_id); + break; default: PMD_DRV_LOG(INFO, "FW reported unknown error type data1 %d" " data2: %d\n", data1, data2); diff --git a/drivers/net/bnxt/hsi_struct_def_dpdk.h b/drivers/net/bnxt/hsi_struct_def_dpdk.h index 3ee1844e66..9beacd94aa 100644 --- a/drivers/net/bnxt/hsi_struct_def_dpdk.h +++ b/drivers/net/bnxt/hsi_struct_def_dpdk.h @@ -12494,8 +12494,14 @@ struct hwrm_async_event_cmpl_error_report_base { */ #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_THERMAL_THRESHOLD \ UINT32_C(0x5) + /* + * Speed change not supported with dual rate transceivers + * on this board. + */ + #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_DUAL_DATA_RATE_NOT_SUPPORTED \ + UINT32_C(0x6) #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_LAST \ - HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_THERMAL_THRESHOLD + HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_DUAL_DATA_RATE_NOT_SUPPORTED } __rte_packed; /* hwrm_async_event_cmpl_error_report_pause_storm (size:128b/16B) */ From patchwork Wed Feb 21 21:20:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajit Khaparde X-Patchwork-Id: 136980 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 8F90143B67; Wed, 21 Feb 2024 22:21:27 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8AEFB4069D; Wed, 21 Feb 2024 22:21:10 +0100 (CET) Received: from mail-qt1-f176.google.com (mail-qt1-f176.google.com [209.85.160.176]) by mails.dpdk.org (Postfix) with ESMTP id 64E87406BC for ; Wed, 21 Feb 2024 22:21:07 +0100 (CET) Received: by mail-qt1-f176.google.com with SMTP id d75a77b69052e-429f53f0b0bso52154551cf.2 for ; Wed, 21 Feb 2024 13:21:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1708550466; x=1709155266; darn=dpdk.org; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=j0mKZyDybNytluFsHjjqzypNdpdBBUL6tXcKAENof9s=; b=gLPRLOEczbWV8nOgxwBF5Y3jgI6hmvsgHO03cyXsctbeY1Kgzu80l9EglA2927fR0e I8nU/yBiQlIP3EPOrNOqyu3k5KKW/ZLISuptclKuEUurGcVigF6NRt/U4Zqu1B1mNcZr 95PkLOlQ21RhZpCAXVj07pVwz1huqLX12a7kI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708550466; x=1709155266; h=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=j0mKZyDybNytluFsHjjqzypNdpdBBUL6tXcKAENof9s=; b=MARXWrhZa7O0kzb9vataSamzIvAfx5D5U1yUzhIU7v2B7bEh+692XT0mQo3su9VUc8 oY/NBFr5nFiuB/1w7i0CNhAo7PNd0117RMW8uedzPvVDu+1kxusWoLXJeK4r0VUn0hTL HeWSoDgybu6ycoq2vOpiY+GIqPrU8qYx7SVdE1qPxOE90j+zba5ZdabP+iOV09dqaZLU ghkc8j03qLKL1TPF1mxEK7qMnb0jiZmF/JbM05C96P5Fq5c+rraEQEtMoIvl48H71GaY MXUpQa5CAcbTYT14OiKB0hfOquWZp0E0wGnY6XfDsBGNaR2kc80pXxpadEM+3sYqVsWM I1ug== X-Gm-Message-State: AOJu0YwNk+dtmDm5SMIvW5YoRI518RgxYYcKFjOOSuFUTxXhLH7cgCht O0tbCj7Ev+iVhJIZP3Z9xI1radE9AI7tgR7xqI3NKmq6YDpaI2luma4ZubRDNwzmaW4lfiiDyYZ X2z1zP/A4ehPEhEIh/KPnRi8GEkRzYfCwHzNmDcfhl4gxQgbXqPI5BewDN1uuspweNyoKyDmIqO TxP332RLjKMdDEZHn2wpL0pSH5iHvW X-Google-Smtp-Source: AGHT+IFK5htfHwpJcRPsHQMaFX/kmG0FRWrfG41PR+Eg1zqE2eW758NX7zb2v1LVUwu49ZpbBoR9hA== X-Received: by 2002:ac8:4e4b:0:b0:42d:fbd5:c2dc with SMTP id e11-20020ac84e4b000000b0042dfbd5c2dcmr16361566qtw.15.1708550466162; Wed, 21 Feb 2024 13:21:06 -0800 (PST) Received: from C02GC2QQMD6T.wifi.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id 20-20020ac84e94000000b0042bff97d9a3sm4743467qtp.40.2024.02.21.13.21.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 13:21:05 -0800 (PST) From: Ajit Khaparde To: dev@dpdk.org Cc: ferruh.yigit@amd.com, thomas@monjalon.net, Damodharam Ammepalli Subject: [PATCH 03/10] net/bnxt: increase queue size for async handling Date: Wed, 21 Feb 2024 13:20:38 -0800 Message-Id: <20240221212044.27209-4-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.39.2 (Apple Git-143) In-Reply-To: <20240221212044.27209-1-ajit.khaparde@broadcom.com> References: <20240221212044.27209-1-ajit.khaparde@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 Increase the default NQ/CQ depth for async handling. In some cases the hardware can generate a high number of async notifications. Increase the notification/completion queue size to accommodate them. Signed-off-by: Ajit Khaparde Reviewed-by: Damodharam Ammepalli --- drivers/net/bnxt/bnxt_ring.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/bnxt/bnxt_ring.h b/drivers/net/bnxt/bnxt_ring.h index baa60b2627..1bae4b33d9 100644 --- a/drivers/net/bnxt/bnxt_ring.h +++ b/drivers/net/bnxt/bnxt_ring.h @@ -24,7 +24,7 @@ #define DB_KEY_TX_PUSH (0x4 << 28) #define DB_LONG_TX_PUSH (0x2 << 24) -#define DEFAULT_CP_RING_SIZE 256 +#define DEFAULT_CP_RING_SIZE 4096 #define DEFAULT_RX_RING_SIZE 256 #define DEFAULT_TX_RING_SIZE 256 From patchwork Wed Feb 21 21:20:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajit Khaparde X-Patchwork-Id: 136981 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 647C343B67; Wed, 21 Feb 2024 22:21:35 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B4C2640A70; Wed, 21 Feb 2024 22:21:11 +0100 (CET) Received: from mail-ot1-f48.google.com (mail-ot1-f48.google.com [209.85.210.48]) by mails.dpdk.org (Postfix) with ESMTP id AAD6D40A4B for ; Wed, 21 Feb 2024 22:21:08 +0100 (CET) Received: by mail-ot1-f48.google.com with SMTP id 46e09a7af769-6e457006fe5so1427664a34.3 for ; Wed, 21 Feb 2024 13:21:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1708550467; x=1709155267; darn=dpdk.org; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=OinFGu9NEuh09+dPSwCaRBL4W54ZPouaOI8/rsSz10c=; b=LhXLyQz2/bWcd0+L3Iy+YXflf9tM8qLJQRxB9u//yHcUvqW+je/Vaek/59BQA8Z1cN 4KEzSbk8LniL9+KV0y5aa9soa4/L/kBpviAz0rBJwmmp3kEilnqdg+LFpVRDpECSqQEV yXYcQYDqWmN4k93uZyTG7r+wKh4W7rbphoXQY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708550467; x=1709155267; h=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=OinFGu9NEuh09+dPSwCaRBL4W54ZPouaOI8/rsSz10c=; b=ImZKp0CLeUCogRSkiDvl8fFCOiu3+3Fl1/HszGvmCOlAh8OoHIv4Eo7uw+4YDKEtKK I9foepyjaxJ5zMSvSBmRg/GFQzCB4hEStmgzmfqssPZAAUbbI94Bkw6cRggcACtrWlXW hrPkUIU8H1vtcYOFfLahLm4n6VNDZYptFw1Wehhp6g9DcgvKiGwUf70S6FXOPbgYyVzP CTDVZe8CZhfzDzU9xdPhQQQBEJIm9FyZg+xQ4CxNxkNuhYPtF/oxWiyjDQ4t9BU4p9BM McONaousEjdoayuWTr6VSJ/24rY8Nfk92QCVzTClpLFpUEvXzimPq/0i7pr2e+v7b69B s2yQ== X-Gm-Message-State: AOJu0YwSLamG86qSdwLuvnB2qu5MKODCHYjjtuw80Vvd1mzz9VJTBxAz /ddLttdnBncdO5zWKtvqpcRcSTLQzlT55oaOXETw1rzpyLRSVqzijkRCs8S6sQQum80kD/mVUqL cZ154L3PRMUELhqkf850OJuqD1xqj1O6AIEAeos9/JFbxx4CeNZhuA0k9t2fnvjTBDNh8Z9kb5A Ahmv2+TIZ3y3ZslPGG0GQb/FnmdXnI X-Google-Smtp-Source: AGHT+IGOg+Bh4zW/9FxA2uFEftqUi7KLFHDpPjEFmfQx987pP5/MwDWb5/2B0HkOUGuGmN1jVtnxpQ== X-Received: by 2002:a05:6830:d4:b0:6e4:270f:ad77 with SMTP id x20-20020a05683000d400b006e4270fad77mr18937436oto.38.1708550467398; Wed, 21 Feb 2024 13:21:07 -0800 (PST) Received: from C02GC2QQMD6T.wifi.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id 20-20020ac84e94000000b0042bff97d9a3sm4743467qtp.40.2024.02.21.13.21.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 13:21:06 -0800 (PST) From: Ajit Khaparde To: dev@dpdk.org Cc: ferruh.yigit@amd.com, thomas@monjalon.net Subject: [PATCH 04/10] net/bnxt: fix AGG ID computation Date: Wed, 21 Feb 2024 13:20:39 -0800 Message-Id: <20240221212044.27209-5-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.39.2 (Apple Git-143) In-Reply-To: <20240221212044.27209-1-ajit.khaparde@broadcom.com> References: <20240221212044.27209-1-ajit.khaparde@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 Fix the computation of AGG ID for P5 and P7 device families. The AGG ID for TPA completions for P7 device family is being incorrectly obtained. Fix the code to handle it. Fixes: 3b56c3ffc182 ("net/bnxt: refactor code to support P7 devices") Signed-off-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_rxr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/bnxt/bnxt_rxr.h b/drivers/net/bnxt/bnxt_rxr.h index d36cbded1d..5e5496964f 100644 --- a/drivers/net/bnxt/bnxt_rxr.h +++ b/drivers/net/bnxt/bnxt_rxr.h @@ -17,7 +17,7 @@ static inline uint16_t bnxt_tpa_start_agg_id(struct bnxt *bp, struct rx_tpa_start_cmpl *cmp) { - if (BNXT_CHIP_P5(bp)) + if (BNXT_CHIP_P5_P7(bp)) return BNXT_TPA_START_AGG_ID_TH(cmp); else return BNXT_TPA_START_AGG_ID_PRE_TH(cmp); From patchwork Wed Feb 21 21:20:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajit Khaparde X-Patchwork-Id: 136982 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 5D3E143B67; Wed, 21 Feb 2024 22:21:43 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0D89940C35; Wed, 21 Feb 2024 22:21:13 +0100 (CET) Received: from mail-qt1-f182.google.com (mail-qt1-f182.google.com [209.85.160.182]) by mails.dpdk.org (Postfix) with ESMTP id 5029940A67 for ; Wed, 21 Feb 2024 22:21:10 +0100 (CET) Received: by mail-qt1-f182.google.com with SMTP id d75a77b69052e-42a9c21f9ecso35148401cf.0 for ; Wed, 21 Feb 2024 13:21:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1708550469; x=1709155269; darn=dpdk.org; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=pGelwZX894N5zKkxoAL62ocdSU97N1oXPKsMERWAB6s=; b=EDdAI8xFGNIjh9k1i90aTL/LwBxcRoXWwR/EcQx1tFgPuugw0nKt51dGi6i9J2Udyu TTe0ItCzQ0Kaht7qsAo1/y93na1beNZPSfQyDrYm7Cx43oJwJ9YJ7ke28zRC4dIHRDCE MLqTQMClzehUkFoPfHDNpsG2rJZmsUaj9j1Vs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708550469; x=1709155269; h=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=pGelwZX894N5zKkxoAL62ocdSU97N1oXPKsMERWAB6s=; b=Max2DIhiDJI+QCj5i+A38x9862A+vQVsyra765WcysoDv4L+MiRgMeizSjJAJFbey0 JlTa7TEgCKKqnX+uGM4AYlwk5q8LDXGPzlWpe93pLguDPW7DlHHKcEXUH4bkCNCSe32P svmkTMYOfWSiIIGMZJwZjPGSQbj6h1NGZKn4tlNjmPFdlpWxGneciY51osaWP5otpj4S njCh5hwC2MERDczFtRHWwKRQaf6NgrOuSFrTH7u16Tx75iVAu7uIdObl7zK4r7U7ntd1 ZckzoyWa6buGhYz0g2WD5Jg73rvTN0Tl/eIgNF0srHjmyyIchbKYYi01fSZxDtEu2XGc EXtg== X-Gm-Message-State: AOJu0Yxtk5Vhpryh/n9ARPfyPA7fJSM5ddzIPJB7C0IPbIvsaQmWdlF9 0emgbxent8ohjCnz15TguCAkWrN8Oy0tvE4pEwrzx/1AxRmGlOSSif+LvLbQeC+gMjd0LkvKsKf 3/tUg5qguswnfAnNUzgfLaNm3kMBovq4aXSkL49n61kqgthcJ1X68cDR/7hWFscbOdYK/v5QgfR PUo+r0Gma3/aKOmMioNmhWIHC06KVY X-Google-Smtp-Source: AGHT+IF+nWf0cW02yBSu/TAbagCu7+lbsNKu7hIU8yrt9Biuq+Ccs9xMws5jqoFWBLK4ePVpKokdYw== X-Received: by 2002:ac8:7f10:0:b0:42e:43f0:cffd with SMTP id f16-20020ac87f10000000b0042e43f0cffdmr1379217qtk.67.1708550469259; Wed, 21 Feb 2024 13:21:09 -0800 (PST) Received: from C02GC2QQMD6T.wifi.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id 20-20020ac84e94000000b0042bff97d9a3sm4743467qtp.40.2024.02.21.13.21.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 13:21:08 -0800 (PST) From: Ajit Khaparde To: dev@dpdk.org Cc: ferruh.yigit@amd.com, thomas@monjalon.net, Kalesh AP , stable@dpdk.org, Somnath Kotur Subject: [PATCH 05/10] net/bnxt: fix a null pointer dereference Date: Wed, 21 Feb 2024 13:20:40 -0800 Message-Id: <20240221212044.27209-6-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.39.2 (Apple Git-143) In-Reply-To: <20240221212044.27209-1-ajit.khaparde@broadcom.com> References: <20240221212044.27209-1-ajit.khaparde@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: Kalesh AP In the recent changes to rte_eth_dev_release_port() the library sets eth_dev->data to NULL at the end of the routine. This causes a NULL pointer dereference in the bnxt_rep_dev_info_get_op() and bnxt_representor_uninit() routines when it tries to validate parent dev. Add code to handle this. Fixes: 6dc83230b43b ("net/bnxt: support port representor data path") Cc: stable@dpdk.org Signed-off-by: Kalesh AP Reviewed-by: Ajit Khaparde Reviewed-by: Somnath Kotur --- drivers/net/bnxt/bnxt_reps.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/drivers/net/bnxt/bnxt_reps.c b/drivers/net/bnxt/bnxt_reps.c index 3a4720bc3c..edcc27f556 100644 --- a/drivers/net/bnxt/bnxt_reps.c +++ b/drivers/net/bnxt/bnxt_reps.c @@ -32,6 +32,14 @@ static const struct eth_dev_ops bnxt_rep_dev_ops = { .flow_ops_get = bnxt_flow_ops_get_op }; +static bool bnxt_rep_check_parent(struct bnxt_representor *rep) +{ + if (!rep->parent_dev->data->dev_private) + return false; + + return true; +} + uint16_t bnxt_vfr_recv(uint16_t port_id, uint16_t queue_id, struct rte_mbuf *mbuf) { @@ -266,12 +274,12 @@ int bnxt_representor_uninit(struct rte_eth_dev *eth_dev) PMD_DRV_LOG(DEBUG, "BNXT Port:%d VFR uninit\n", eth_dev->data->port_id); eth_dev->data->mac_addrs = NULL; - parent_bp = rep->parent_dev->data->dev_private; - if (!parent_bp) { + if (!bnxt_rep_check_parent(rep)) { PMD_DRV_LOG(DEBUG, "BNXT Port:%d already freed\n", eth_dev->data->port_id); return 0; } + parent_bp = rep->parent_dev->data->dev_private; parent_bp->num_reps--; vf_id = rep->vf_id; @@ -539,11 +547,12 @@ int bnxt_rep_dev_info_get_op(struct rte_eth_dev *eth_dev, int rc = 0; /* MAC Specifics */ - parent_bp = rep_bp->parent_dev->data->dev_private; - if (!parent_bp) { - PMD_DRV_LOG(ERR, "Rep parent NULL!\n"); + if (!bnxt_rep_check_parent(rep_bp)) { + /* Need not be an error scenario, if parent is closed first */ + PMD_DRV_LOG(INFO, "Rep parent port does not exist.\n"); return rc; } + parent_bp = rep_bp->parent_dev->data->dev_private; PMD_DRV_LOG(DEBUG, "Representor dev_info_get_op\n"); dev_info->max_mac_addrs = parent_bp->max_l2_ctx; dev_info->max_hash_mac_addrs = 0; From patchwork Wed Feb 21 21:20:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajit Khaparde X-Patchwork-Id: 136983 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 87EE143B67; Wed, 21 Feb 2024 22:21:50 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4C12540DD8; Wed, 21 Feb 2024 22:21:14 +0100 (CET) Received: from mail-ot1-f46.google.com (mail-ot1-f46.google.com [209.85.210.46]) by mails.dpdk.org (Postfix) with ESMTP id C396040A76 for ; Wed, 21 Feb 2024 22:21:11 +0100 (CET) Received: by mail-ot1-f46.google.com with SMTP id 46e09a7af769-6e2dfc98664so583800a34.2 for ; Wed, 21 Feb 2024 13:21:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1708550471; x=1709155271; darn=dpdk.org; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=uFn7Uy5+vrzbKAsBpXX5g7Ycj/Mf6GSOY0NvKW5cSko=; b=a7yptpivOtMhzGSj8NCd+wO+cnbJQq5VVfYSXX1pcC4/kRQZPyiWJzZF/8NK899kQg AmTjcKLgini0MDaSP52WtYmL/IsiXbovjK2c+5qswbvtPR9x5q68T+n8DCNRpGpDYlnF Mdoqd3K8uFtz4rv16FFomJZpHdmvaOkLRDTt4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708550471; x=1709155271; h=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=uFn7Uy5+vrzbKAsBpXX5g7Ycj/Mf6GSOY0NvKW5cSko=; b=nsNH3O8bAtetg95QWaZi8jbNPFGkc4MYCd5gaoaG3UuZqa/5TRbdfT0AfhsOaMnnx3 K3WzVIwU9WVyXLK+E9Ot7Irky+XsgKyv5iWN0svIk2TwR7DT74yCHiBYVZcBQ3j3gtrL siy6npu1N4vUJ+1skTpKtXtJ4B3pNKBi8n30MC242vLqdqqzCJD5Vz1PN53YvQRvx3El iECiBd2BOiMVM3U8cH8qhHhLi66todUQEhY4dbl/rwVF9OPdE81zUMZThUI+8EojvLgO DggbBQzDGPhN0aeFQ9v8BqcCYJ9mTdU5EElxEry+RgSPe/5wFVu1Jtb48wLNzYdhuD/Q tDMw== X-Gm-Message-State: AOJu0YywetGLzjYUpBOrNKA+uKGZIk4KaXLz7Orz7XE5NQ05pAHJhm8e mrNtrRYoRaydpxuu2KQLICYD75WeTDXftQ0Rg59ryt+mX/GeaiWTTMNUw3docnOtc4AQRCodx7H p21A9In92idCAhkwpzcaHXvdzjhShwYu1QpM+fi/72HPqDyNbGU7xuGywnavj+d9qF0r6R8hkq+ 0snkC8wDAf5VfiB0AgCaNBttXoMX+k X-Google-Smtp-Source: AGHT+IErcQXCmcxoNPZc1mDrFBcIYpwTjhjvYHzTanuzION6Loy939u3FNhZ/R4cwT8i1aTp7XbksQ== X-Received: by 2002:a05:6870:3118:b0:21f:1f78:adc9 with SMTP id v24-20020a056870311800b0021f1f78adc9mr6586240oaa.29.1708550470770; Wed, 21 Feb 2024 13:21:10 -0800 (PST) Received: from C02GC2QQMD6T.wifi.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id 20-20020ac84e94000000b0042bff97d9a3sm4743467qtp.40.2024.02.21.13.21.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 13:21:10 -0800 (PST) From: Ajit Khaparde To: dev@dpdk.org Cc: ferruh.yigit@amd.com, thomas@monjalon.net Subject: [PATCH 06/10] net/bnxt: handle UDP GSO Tx Date: Wed, 21 Feb 2024 13:20:41 -0800 Message-Id: <20240221212044.27209-7-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.39.2 (Apple Git-143) In-Reply-To: <20240221212044.27209-1-ajit.khaparde@broadcom.com> References: <20240221212044.27209-1-ajit.khaparde@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 The UDP GSO capability is not being detected and reported correctly. This is causing UDP GSO to not happen in some cases. This patch fixes the issue. Signed-off-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_hwrm.c | 3 ++- drivers/net/bnxt/bnxt_txr.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index 7923d4cbd2..7f49b4b40e 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -1141,6 +1141,8 @@ static int __bnxt_hwrm_func_qcaps(struct bnxt *bp) bp->max_ring_grps = rte_le_to_cpu_32(resp->max_hw_ring_grps); flags = rte_le_to_cpu_32(resp->flags); + flags_ext2 = rte_le_to_cpu_32(resp->flags_ext2); + if (BNXT_PF(bp)) { bp->pf->port_id = resp->port_id; bp->pf->first_vf_id = rte_le_to_cpu_16(resp->first_vf_id); @@ -1225,7 +1227,6 @@ static int __bnxt_hwrm_func_qcaps(struct bnxt *bp) PMD_DRV_LOG(DEBUG, "Tunnel parsing capability is disabled, flags : %#x\n", bp->tunnel_disable_flag); - flags_ext2 = rte_le_to_cpu_32(resp->flags_ext2); if (flags_ext2 & HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_RX_ALL_PKTS_TIMESTAMPS_SUPPORTED) bp->fw_cap |= BNXT_FW_CAP_RX_ALL_PKT_TS; if (flags_ext2 & HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_UDP_GSO_SUPPORTED) diff --git a/drivers/net/bnxt/bnxt_txr.c b/drivers/net/bnxt/bnxt_txr.c index 7cbb2104a0..83c003d258 100644 --- a/drivers/net/bnxt/bnxt_txr.c +++ b/drivers/net/bnxt/bnxt_txr.c @@ -116,7 +116,8 @@ bnxt_xmit_need_long_bd(struct rte_mbuf *tx_pkt, struct bnxt_tx_queue *txq) RTE_MBUF_F_TX_VLAN | RTE_MBUF_F_TX_OUTER_IP_CKSUM | RTE_MBUF_F_TX_TUNNEL_GRE | RTE_MBUF_F_TX_TUNNEL_VXLAN | RTE_MBUF_F_TX_TUNNEL_GENEVE | RTE_MBUF_F_TX_IEEE1588_TMST | - RTE_MBUF_F_TX_QINQ | RTE_MBUF_F_TX_TUNNEL_VXLAN_GPE) || + RTE_MBUF_F_TX_QINQ | RTE_MBUF_F_TX_TUNNEL_VXLAN_GPE | + RTE_MBUF_F_TX_UDP_SEG) || (BNXT_TRUFLOW_EN(txq->bp) && (txq->bp->tx_cfa_action || txq->vfr_tx_cfa_action))) return true; From patchwork Wed Feb 21 21:20:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajit Khaparde X-Patchwork-Id: 136984 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 0965343B67; Wed, 21 Feb 2024 22:21:59 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DDBCA40E28; Wed, 21 Feb 2024 22:21:15 +0100 (CET) Received: from mail-qt1-f176.google.com (mail-qt1-f176.google.com [209.85.160.176]) by mails.dpdk.org (Postfix) with ESMTP id 323A440DCB for ; Wed, 21 Feb 2024 22:21:13 +0100 (CET) Received: by mail-qt1-f176.google.com with SMTP id d75a77b69052e-42c7c1cb2e9so41331031cf.3 for ; Wed, 21 Feb 2024 13:21:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1708550472; x=1709155272; darn=dpdk.org; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=neb84x1GKXUlAcqC5AYj/hMESukNk2NoxtJ+/bFkU3w=; b=hXjdBGFCLfJJYma0qz4/UehPcpaoUz7f226/hld6JfK4sAmhEeT9v1VXUA3TWjD+rV 6jpRD8RNbyO7kWs36RYYvPBhbllXMbyLpgKAlENUa+iVy+vcd4PpnqyRb4RRbEBbDwDU ikn6o16+5RH6kzkAoxa32fZxiUQ1Fbe9azFyY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708550472; x=1709155272; h=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=neb84x1GKXUlAcqC5AYj/hMESukNk2NoxtJ+/bFkU3w=; b=udh9bEU8I69vPzasrxerVPU+zCOYAqK/pM5AXKPlBcaitFUCYs2UX85krntqBEjjoC IiG3F9VCcd0ONOhxeLgO4woG2sRYoe3JsNFx9k3A2uMkutvXzV9tl/mb+Ygwt9UQHxUE rU9/vN7/RdDuzWUQWmcw5mIKbYAuvrqGxLYD1g3wJI5m822hw0AuGKekmoWTo30vcIHX VNZkcmX2aTj8txYU6nVqQewTMd2M6JGccbjFFRUgTXM1ewoR/b2Y+ghYrMd/1xfVWJCa qvs4MEVqNKNcvCbhL5mF1ArDxriRVF69m38SMzStqfbvASBZbuPHWOXKTkCg7FO+MXj6 1cmg== X-Gm-Message-State: AOJu0Yx98cOEOoRJ/fMa8/iOGWGXKaxLUSwRqnZsEygPpKqzeur176MM LAEDqviimw6YMoXxRowCbnbsYXhRJ7oPEiETFornv1ro0JG5BMmepWp2ytsulObIDecz7aB9h2u NmwFsNAdkfWRTrsNBXu/VvioKbyA2k5dEcDXTP66iq80VxVX9k1lEJu50BaYBl3LnaoT+80fdus hklMXDylzCgyr/r/L01DovQFoeHWc6 X-Google-Smtp-Source: AGHT+IFLthHQWem0K+F7UdAIcC2hE92vucmH3GzZKylVWXcQ390E9+HwmFFduXnlCD9AjpS1kkQDNw== X-Received: by 2002:ac8:7f05:0:b0:42c:7bb1:20f8 with SMTP id f5-20020ac87f05000000b0042c7bb120f8mr23915011qtk.59.1708550472002; Wed, 21 Feb 2024 13:21:12 -0800 (PST) Received: from C02GC2QQMD6T.wifi.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id 20-20020ac84e94000000b0042bff97d9a3sm4743467qtp.40.2024.02.21.13.21.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 13:21:11 -0800 (PST) From: Ajit Khaparde To: dev@dpdk.org Cc: ferruh.yigit@amd.com, thomas@monjalon.net Subject: [PATCH 07/10] net/bnxt: add IPv6 flow label based RSS support Date: Wed, 21 Feb 2024 13:20:42 -0800 Message-Id: <20240221212044.27209-8-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.39.2 (Apple Git-143) In-Reply-To: <20240221212044.27209-1-ajit.khaparde@broadcom.com> References: <20240221212044.27209-1-ajit.khaparde@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 P7 hardware family can support IPv6 flow label based RSS. Check if the firmware indicates capability bit to support IPv6 flow label based RSS and parse the RSS hash types appropriately. Signed-off-by: Ajit Khaparde --- drivers/net/bnxt/bnxt.h | 1 + drivers/net/bnxt/bnxt_ethdev.c | 2 ++ drivers/net/bnxt/bnxt_hwrm.c | 7 +++++++ drivers/net/bnxt/bnxt_vnic.c | 9 +++++++-- 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h index fcf2b8be97..4203e6a055 100644 --- a/drivers/net/bnxt/bnxt.h +++ b/drivers/net/bnxt/bnxt.h @@ -868,6 +868,7 @@ struct bnxt { #define BNXT_VNIC_CAP_OUTER_RSS_TRUSTED_VF BIT(4) #define BNXT_VNIC_CAP_XOR_MODE BIT(5) #define BNXT_VNIC_CAP_CHKSM_MODE BIT(6) +#define BNXT_VNIC_CAP_IPV6_FLOW_LABEL_MODE BIT(7) #define BNXT_VNIC_CAP_L2_CQE_MODE BIT(8) #define BNXT_VNIC_CAP_AH_SPI4_CAP BIT(9) #define BNXT_VNIC_CAP_AH_SPI6_CAP BIT(10) diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index f8d83662f4..d5a4312c5b 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -1087,6 +1087,8 @@ uint64_t bnxt_eth_rss_support(struct bnxt *bp) if (bp->vnic_cap_flags & BNXT_VNIC_CAP_CHKSM_MODE) support |= RTE_ETH_RSS_IPV4_CHKSUM | RTE_ETH_RSS_L4_CHKSUM; + if (bp->vnic_cap_flags & BNXT_VNIC_CAP_IPV6_FLOW_LABEL_MODE) + support |= RTE_ETH_RSS_IPV6_FLOW_LABEL; if (bp->vnic_cap_flags & BNXT_VNIC_CAP_AH_SPI_CAP) support |= RTE_ETH_RSS_AH; if (bp->vnic_cap_flags & BNXT_VNIC_CAP_ESP_SPI_CAP) diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index 7f49b4b40e..6ea7089a3f 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -1308,6 +1308,9 @@ int bnxt_hwrm_vnic_qcaps(struct bnxt *bp) if (flags & HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RING_SELECT_MODE_TOEPLITZ_CHKSM_CAP) bp->vnic_cap_flags |= BNXT_VNIC_CAP_CHKSM_MODE; + if (flags & HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RSS_IPV6_FLOW_LABEL_CAP) + bp->vnic_cap_flags |= BNXT_VNIC_CAP_IPV6_FLOW_LABEL_MODE; + if (flags & HWRM_VNIC_QCAPS_OUTPUT_FLAGS_L2_CQE_MODE_CAP) bp->vnic_cap_flags |= BNXT_VNIC_CAP_L2_CQE_MODE; @@ -2773,6 +2776,10 @@ static uint32_t bnxt_sanitize_rss_type(struct bnxt *bp, uint32_t types) { uint32_t hwrm_type = types; + if (types & HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV6_FLOW_LABEL && + !(bp->vnic_cap_flags & BNXT_VNIC_CAP_IPV6_FLOW_LABEL_MODE)) + hwrm_type &= ~HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV6_FLOW_LABEL; + if (types & HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_ESP_SPI_IPV4 && !(bp->vnic_cap_flags & BNXT_VNIC_CAP_ESP_SPI4_CAP)) hwrm_type &= ~HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_ESP_SPI_IPV4; diff --git a/drivers/net/bnxt/bnxt_vnic.c b/drivers/net/bnxt/bnxt_vnic.c index 5092a7d774..76905ebdd1 100644 --- a/drivers/net/bnxt/bnxt_vnic.c +++ b/drivers/net/bnxt/bnxt_vnic.c @@ -280,6 +280,8 @@ uint32_t bnxt_rte_to_hwrm_hash_types(uint64_t rte_type) hwrm_type |= HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_TCP_IPV6; if (rte_type & RTE_ETH_RSS_NONFRAG_IPV6_UDP) hwrm_type |= HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_UDP_IPV6; + if (rte_type & RTE_ETH_RSS_IPV6_FLOW_LABEL) + hwrm_type |= HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV6_FLOW_LABEL; if (rte_type & RTE_ETH_RSS_ESP) hwrm_type |= HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_ESP_SPI_IPV4 | HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_ESP_SPI_IPV6; @@ -302,6 +304,7 @@ int bnxt_rte_to_hwrm_hash_level(struct bnxt *bp, uint64_t hash_f, uint32_t lvl) bool l3_and_l4 = l3 && l4; bool cksum = !!(hash_f & (RTE_ETH_RSS_IPV4_CHKSUM | RTE_ETH_RSS_L4_CHKSUM)); + bool fl = !!(hash_f & RTE_ETH_RSS_IPV6_FLOW_LABEL); /* If FW has not advertised capability to configure outer/inner * RSS hashing , just log a message. HW will work in default RSS mode. @@ -317,12 +320,12 @@ int bnxt_rte_to_hwrm_hash_level(struct bnxt *bp, uint64_t hash_f, uint32_t lvl) switch (lvl) { case BNXT_RSS_LEVEL_INNERMOST: /* Irrespective of what RTE says, FW always does 4 tuple */ - if (l3_and_l4 || l4 || l3_only || cksum) + if (l3_and_l4 || l4 || l3_only || cksum || fl) mode = BNXT_HASH_MODE_INNERMOST; break; case BNXT_RSS_LEVEL_OUTERMOST: /* Irrespective of what RTE says, FW always does 4 tuple */ - if (l3_and_l4 || l4 || l3_only || cksum) + if (l3_and_l4 || l4 || l3_only || cksum || fl) mode = BNXT_HASH_MODE_OUTERMOST; break; default: @@ -1415,6 +1418,8 @@ void bnxt_hwrm_rss_to_rte_hash_conf(struct bnxt_vnic_info *vnic, *rss_conf |= RTE_ETH_RSS_NONFRAG_IPV6_TCP; if (hash_types & HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_UDP_IPV6) *rss_conf |= RTE_ETH_RSS_NONFRAG_IPV6_UDP; + if (hash_types & HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV6_FLOW_LABEL) + *rss_conf |= RTE_ETH_RSS_IPV6_FLOW_LABEL; if (hash_types & HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_AH_SPI_IPV6 || hash_types & HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_AH_SPI_IPV4) *rss_conf |= RTE_ETH_RSS_AH; From patchwork Wed Feb 21 21:20:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajit Khaparde X-Patchwork-Id: 136985 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 0726843B67; Wed, 21 Feb 2024 22:22:07 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8B23240E96; Wed, 21 Feb 2024 22:21:17 +0100 (CET) Received: from mail-vs1-f50.google.com (mail-vs1-f50.google.com [209.85.217.50]) by mails.dpdk.org (Postfix) with ESMTP id EE6C540DDD for ; Wed, 21 Feb 2024 22:21:14 +0100 (CET) Received: by mail-vs1-f50.google.com with SMTP id ada2fe7eead31-4706feb17ccso415933137.1 for ; Wed, 21 Feb 2024 13:21:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1708550474; x=1709155274; darn=dpdk.org; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=b/f+DgojdcPPYGSzzu+iXrQaYwAdbWlDIlaF/dy0VTE=; b=CPP5D/MysBJpVpDwdDbSTlJx06O42zL61gFvBVSjYGVDKffizYNrusMyBRszek7DHq sx38xfhDn/ZHC7TwjVtNg9XTuKBXmvybAkr95IPPO1L7f1bTRLdyVOQD43JRwEQiTchD N/g4rZ4rCkZ6ie1lIBQEtxrBvCPwAIWUPhrS4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708550474; x=1709155274; h=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=b/f+DgojdcPPYGSzzu+iXrQaYwAdbWlDIlaF/dy0VTE=; b=CgHldrcMQPJxwJi+wvKze/cVbq8MiIAsWPOLLtSFbZVkQ5aDzloGWmAW9aQv22fJIt lQ8KlG9NVCnkrOt5USpXSnAOP3B0oyDaWjOi84NF3E9pSaqZtgUHLkI4G9IpHNw+V3J9 xV0Pc62WQjqz1YkQV/4gjADY6nCXAnSwkhcECFWR8WVhBIhsg0ISxb8ztHScV+6OUT4n re9WIJBjZvuvHJ9nnezBeZO2Px392aV58m1iXGYCJ4qBRPpkdczxPYMxBWWLCqA+Zmoo XfOhZtSkuKbbduZqxETPNNafFpuxY8/x0D3WSBN82qukDgfz5bhuyEzS4P1l0PjYcIEx SvnQ== X-Gm-Message-State: AOJu0Yzu65j397ZOYDE8DrcjfUWF2XEEByn61K9+yg3qzgHFybNolDCF S7mOmIPUQgOy6Tv9OnSISHaB5d8OxVF/bM31ingGWlmgcWuGPv5jISSgybPqVTCc70X0VBw9ZdL Bw+wDfXZ/bvAc+GJOXttsvh5MTJgrWKKWxwGIA9YlVJeEiI1T7EA7ZD3gq6HCVYBZBDEvt9XeI5 MruGchycBsk9ZvruSTurm5/Gl/J+yF X-Google-Smtp-Source: AGHT+IEPxd7hZyrnD43UaQh2nMlJlL/B8XVm8vIBt70crYdskERMTJxezaFsuqJq1+Dvy0Aoszqomw== X-Received: by 2002:a05:6102:3971:b0:470:5227:89d4 with SMTP id ho17-20020a056102397100b00470522789d4mr9803355vsb.31.1708550473706; Wed, 21 Feb 2024 13:21:13 -0800 (PST) Received: from C02GC2QQMD6T.wifi.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id 20-20020ac84e94000000b0042bff97d9a3sm4743467qtp.40.2024.02.21.13.21.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 13:21:12 -0800 (PST) From: Ajit Khaparde To: dev@dpdk.org Cc: ferruh.yigit@amd.com, thomas@monjalon.net Subject: [PATCH 08/10] net/bnxt: fix compressed CQE handling Date: Wed, 21 Feb 2024 13:20:43 -0800 Message-Id: <20240221212044.27209-9-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.39.2 (Apple Git-143) In-Reply-To: <20240221212044.27209-1-ajit.khaparde@broadcom.com> References: <20240221212044.27209-1-ajit.khaparde@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 We were trying to reuse parts of 32-byte CQE handling for compressed CQE handling. And that was causing the packet errors to be misinterpreted. Fix it by using separate code for the compressed CQE handling. Fixes: 812fd99f8c4e ("net/bnxt: add SSE Rx for compressed CQE") Signed-off-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_rxtx_vec_sse.c | 107 ++++++++++++++++++++++++++- 1 file changed, 105 insertions(+), 2 deletions(-) diff --git a/drivers/net/bnxt/bnxt_rxtx_vec_sse.c b/drivers/net/bnxt/bnxt_rxtx_vec_sse.c index 6c0e33200c..b5ce12659c 100644 --- a/drivers/net/bnxt/bnxt_rxtx_vec_sse.c +++ b/drivers/net/bnxt/bnxt_rxtx_vec_sse.c @@ -143,6 +143,109 @@ descs_to_mbufs(__m128i mm_rxcmp[4], __m128i mm_rxcmp1[4], _mm_store_si128((void *)&mbuf[3]->rx_descriptor_fields1, t0); } +static inline void +crx_descs_to_mbufs(__m128i mm_rxcmp[4], __m128i mm_rxcmp1[4], + __m128i mbuf_init, const __m128i shuf_msk, + struct rte_mbuf **mbuf, struct bnxt_rx_ring_info *rxr) +{ + const __m128i flags_type_mask = + _mm_set1_epi32(RX_PKT_COMPRESS_CMPL_FLAGS_ITYPE_MASK); + const __m128i flags2_mask1 = + _mm_set1_epi32(CMPL_FLAGS2_VLAN_TUN_MSK_CRX); + const __m128i flags2_mask2 = + _mm_set1_epi32(RX_PKT_COMPRESS_CMPL_FLAGS_IP_TYPE); + const __m128i rss_mask = + _mm_set1_epi32(RX_PKT_COMPRESS_CMPL_FLAGS_RSS_VALID); + const __m128i cs_err_mask = + _mm_set1_epi32(RX_PKT_COMPRESS_CMPL_CS_ERROR_CALC_MASK | + BNXT_RXC_METADATA1_VLAN_VALID); + const __m128i crx_flags_mask = + _mm_set1_epi32(BNXT_CRX_CQE_CSUM_CALC_MASK); + const __m128i crx_tun_cs = + _mm_set1_epi32(BNXT_CRX_TUN_CS_CALC); + __m128i t0, t1, flags_type, flags, index, errors, rss_flags; + __m128i ptype_idx, is_tunnel; + uint32_t ol_flags; + __m128i cs_err; + __m128i t3, t4; + + /* Validate ptype table indexing at build time. */ + bnxt_check_ptype_constants(); + + /* Compute packet type table indexes for four packets */ + t0 = _mm_unpacklo_epi32(mm_rxcmp[0], mm_rxcmp[1]); + t3 = _mm_unpackhi_epi32(mm_rxcmp[0], mm_rxcmp[1]); + t1 = _mm_unpacklo_epi32(mm_rxcmp[2], mm_rxcmp[3]); + t4 = _mm_unpackhi_epi32(mm_rxcmp[2], mm_rxcmp[3]); + flags_type = _mm_unpacklo_epi64(t0, t1); + ptype_idx = _mm_srli_epi32(_mm_and_si128(flags_type, flags_type_mask), + RX_PKT_CMPL_FLAGS_ITYPE_SFT - BNXT_PTYPE_TBL_TYPE_SFT); + + flags = _mm_unpacklo_epi64(t0, t1); + + ptype_idx = _mm_or_si128(ptype_idx, + _mm_srli_epi32(_mm_and_si128(flags, flags2_mask1), + RX_PKT_CMPL_FLAGS2_META_FORMAT_SFT - + BNXT_PTYPE_TBL_VLAN_SFT)); + ptype_idx = _mm_or_si128(ptype_idx, + _mm_srli_epi32(_mm_and_si128(flags, flags2_mask2), + RX_PKT_CMPL_FLAGS2_IP_TYPE_SFT - + BNXT_PTYPE_TBL_IP_VER_SFT)); + + /* Extract RSS valid flags for four packets. */ + rss_flags = _mm_srli_epi32(_mm_and_si128(flags, rss_mask), 9); + + /* Extract cs_err fields for four packets. */ + cs_err = _mm_unpacklo_epi64(t3, t4); + cs_err = _mm_and_si128(cs_err, cs_err_mask); + flags = _mm_and_si128(cs_err, crx_flags_mask); + + /* Compute ol_flags and checksum error indexes for four packets. */ + is_tunnel = _mm_and_si128(flags, crx_tun_cs); + is_tunnel = _mm_slli_epi32(is_tunnel, 0x20); + flags = _mm_or_si128(flags, is_tunnel); + + flags = _mm_srli_si128(flags, 1); + + errors = _mm_and_si128(cs_err, _mm_set1_epi32(0xF0)); + errors = _mm_and_si128(_mm_srli_epi32(errors, 4), flags); + + index = _mm_andnot_si128(errors, flags); + /* reuse is_tunnel - just shift right one bit to index correctly. */ + errors = _mm_or_si128(errors, _mm_srli_epi32(is_tunnel, 1)); + index = _mm_or_si128(index, is_tunnel); + + /* Update mbuf rearm_data for four packets. */ + GET_OL_FLAGS(rss_flags, index, errors, 0, ol_flags); + _mm_store_si128((void *)&mbuf[0]->rearm_data, + _mm_or_si128(mbuf_init, _mm_set_epi64x(ol_flags, 0))); + + GET_OL_FLAGS(rss_flags, index, errors, 1, ol_flags); + _mm_store_si128((void *)&mbuf[1]->rearm_data, + _mm_or_si128(mbuf_init, _mm_set_epi64x(ol_flags, 0))); + + GET_OL_FLAGS(rss_flags, index, errors, 2, ol_flags); + _mm_store_si128((void *)&mbuf[2]->rearm_data, + _mm_or_si128(mbuf_init, _mm_set_epi64x(ol_flags, 0))); + + GET_OL_FLAGS(rss_flags, index, errors, 3, ol_flags); + _mm_store_si128((void *)&mbuf[3]->rearm_data, + _mm_or_si128(mbuf_init, _mm_set_epi64x(ol_flags, 0))); + + /* Update mbuf rx_descriptor_fields1 for four packes. */ + GET_DESC_FIELDS(mm_rxcmp[0], mm_rxcmp1[0], shuf_msk, ptype_idx, 0, t0); + _mm_store_si128((void *)&mbuf[0]->rx_descriptor_fields1, t0); + + GET_DESC_FIELDS(mm_rxcmp[1], mm_rxcmp1[1], shuf_msk, ptype_idx, 1, t0); + _mm_store_si128((void *)&mbuf[1]->rx_descriptor_fields1, t0); + + GET_DESC_FIELDS(mm_rxcmp[2], mm_rxcmp1[2], shuf_msk, ptype_idx, 2, t0); + _mm_store_si128((void *)&mbuf[2]->rx_descriptor_fields1, t0); + + GET_DESC_FIELDS(mm_rxcmp[3], mm_rxcmp1[3], shuf_msk, ptype_idx, 3, t0); + _mm_store_si128((void *)&mbuf[3]->rx_descriptor_fields1, t0); +} + static uint16_t recv_burst_vec_sse(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) { @@ -392,8 +495,8 @@ crx_burst_vec_sse(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) if (num_valid == 0) break; - descs_to_mbufs(rxcmp, rxcmp1, mbuf_init, shuf_msk, &rx_pkts[nb_rx_pkts], - rxr); + crx_descs_to_mbufs(rxcmp, rxcmp1, mbuf_init, shuf_msk, + &rx_pkts[nb_rx_pkts], rxr); nb_rx_pkts += num_valid; if (num_valid < BNXT_RX_DESCS_PER_LOOP_VEC128) From patchwork Wed Feb 21 21:20:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajit Khaparde X-Patchwork-Id: 136986 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 DF2DB43B67; Wed, 21 Feb 2024 22:22:13 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C687940E32; Wed, 21 Feb 2024 22:21:19 +0100 (CET) Received: from mail-ot1-f44.google.com (mail-ot1-f44.google.com [209.85.210.44]) by mails.dpdk.org (Postfix) with ESMTP id 48B5740E32 for ; Wed, 21 Feb 2024 22:21:16 +0100 (CET) Received: by mail-ot1-f44.google.com with SMTP id 46e09a7af769-6e2dfc98664so583837a34.2 for ; Wed, 21 Feb 2024 13:21:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1708550475; x=1709155275; darn=dpdk.org; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=zwaglXelMh5fuYzV4JeyqTiD59nJfCLp8vk2iun6Njg=; b=B+Am4kV+g13NTOLhyR1lqFWYxLcUQq/wUhV8rYQ+QQVwNQzoPs/nfkPYDi+3e8gbOH R6YospMmf31X0o7LwQ0P5bIfxONxxHClw9sxMNZugEBL+rGe6q4olZRrB43XZaudmRi8 VpxkhGQTITXJVISOk/kG4p5/7APyinH0VJ6Kc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708550475; x=1709155275; h=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=zwaglXelMh5fuYzV4JeyqTiD59nJfCLp8vk2iun6Njg=; b=odwH49Q1bD3DReTcyEVshBh3FdeI7ovgRvmloN93uYLDwvsj6h1XDLuwh5QOT/4DR1 p3jRs3IzwDxI475NEvzMOQgRqdWkOSZvsPznpTu1/HdGnPHAzb0X0Uyr31q3qbJm2NWZ vz3YJkiPCgKt0AYgEHgGYZkcxqwFNPMxmaipjTf7CdLDpswQSL0AlopK8XKfY5hYgbmT DfmGjemdhNmtmIoZPtXHY8qd5uo/xoR++1lZLGKfmy1HFQXkW6dMrZpNYHUr4F4N1zCd vqU4fl/Rf0njJLwJWX3fNBiBxwXq6uQD7KzP8NUbQf4iIHI9ol2m1S7+vKnQX+1/VzUC E85Q== X-Gm-Message-State: AOJu0YwLrg/+KjHglKyHS7ux92Ei9elbXYB2h53/QbHnq2HCpar2n0PO 3sgnbtKutZWuLaULYEacRlDoD7K+75cN0ESqJ9KxcIXv7yHsw/VbdU08G7sSn4nkKH4KB4rUzow wPDRCQXeoMMt4cZEv0VhoTS8HDLdDzyvweatgZCXuhm3a+MJyT6VtICa2lW+7oaMjZUOR1qHOAC EXoG/4EZgn8+1huEIHM7sAg1shsMMR X-Google-Smtp-Source: AGHT+IGYCaq22p+j/pDmoCqSGcKVFCctC3E7tfixIaRufMnyu7UKCkZIZ7mGazVcCa6TdqtTMAWL9g== X-Received: by 2002:a9d:76c4:0:b0:6e4:3c38:fb7d with SMTP id p4-20020a9d76c4000000b006e43c38fb7dmr17328247otl.23.1708550475166; Wed, 21 Feb 2024 13:21:15 -0800 (PST) Received: from C02GC2QQMD6T.wifi.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id 20-20020ac84e94000000b0042bff97d9a3sm4743467qtp.40.2024.02.21.13.21.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 13:21:14 -0800 (PST) From: Ajit Khaparde To: dev@dpdk.org Cc: ferruh.yigit@amd.com, thomas@monjalon.net Subject: [PATCH 09/10] net/bnxt: fix compressed Rx CQE handling Date: Wed, 21 Feb 2024 13:20:44 -0800 Message-Id: <20240221212044.27209-10-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.39.2 (Apple Git-143) In-Reply-To: <20240221212044.27209-1-ajit.khaparde@broadcom.com> References: <20240221212044.27209-1-ajit.khaparde@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 We were trying to reuse 32-byte CQE macros for compressed CQE handling. And that was causing the packet error bits to be misinterpreted. Fix it by using appropriate macros. Fixes: d58c6c077cc2 ("net/bnxt: add AVX2 Rx for compressed CQE") Signed-off-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_rxtx_vec_avx2.c | 39 ++++++++++++++++----------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/drivers/net/bnxt/bnxt_rxtx_vec_avx2.c b/drivers/net/bnxt/bnxt_rxtx_vec_avx2.c index ce6b597611..976f258044 100644 --- a/drivers/net/bnxt/bnxt_rxtx_vec_avx2.c +++ b/drivers/net/bnxt/bnxt_rxtx_vec_avx2.c @@ -392,19 +392,21 @@ crx_burst_vec_avx2(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) 0xFF, 0xFF, 3, 2, /* pkt_len */ 0xFF, 0xFF, 0xFF, 0xFF); /* pkt_type (zeroes) */ const __m256i flags_type_mask = - _mm256_set1_epi32(RX_PKT_CMPL_FLAGS_ITYPE_MASK); + _mm256_set1_epi32(RX_PKT_COMPRESS_CMPL_FLAGS_ITYPE_MASK); const __m256i flags2_mask1 = - _mm256_set1_epi32(CMPL_FLAGS2_VLAN_TUN_MSK); + _mm256_set1_epi32(CMPL_FLAGS2_VLAN_TUN_MSK_CRX); const __m256i flags2_mask2 = - _mm256_set1_epi32(RX_PKT_CMPL_FLAGS2_IP_TYPE); + _mm256_set1_epi32(RX_PKT_COMPRESS_CMPL_FLAGS_IP_TYPE); const __m256i rss_mask = - _mm256_set1_epi32(RX_PKT_CMPL_FLAGS_RSS_VALID); + _mm256_set1_epi32(RX_PKT_COMPRESS_CMPL_FLAGS_RSS_VALID); __m256i t0, t1, flags_type, flags2, index, errors; __m256i ptype_idx, ptypes, is_tunnel; __m256i mbuf01, mbuf23, mbuf45, mbuf67; __m256i rearm0, rearm1, rearm2, rearm3, rearm4, rearm5, rearm6, rearm7; __m256i ol_flags, ol_flags_hi; __m256i rss_flags; + __m256i errors_v2; + __m256i cs_err_v2; /* Validate ptype table indexing at build time. */ bnxt_check_ptype_constants(); @@ -447,7 +449,6 @@ crx_burst_vec_avx2(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) cons += BNXT_RX_DESCS_PER_LOOP_VEC256, mbcons += BNXT_RX_DESCS_PER_LOOP_VEC256) { __m256i rxcmp0_1, rxcmp2_3, rxcmp4_5, rxcmp6_7, info3_v; - __m256i errors_v2; uint32_t num_valid; /* Copy eight mbuf pointers to output array. */ @@ -470,6 +471,7 @@ crx_burst_vec_avx2(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) rxcmp2_3 = _mm256_loadu_si256((void *)&cp_desc_ring[cons + 2]); rte_compiler_barrier(); rxcmp0_1 = _mm256_loadu_si256((void *)&cp_desc_ring[cons + 0]); + rte_compiler_barrier(); /* Compute packet type table indices for eight packets. */ t0 = _mm256_unpacklo_epi32(rxcmp0_1, rxcmp2_3); @@ -477,19 +479,19 @@ crx_burst_vec_avx2(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) flags_type = _mm256_unpacklo_epi64(t0, t1); ptype_idx = _mm256_and_si256(flags_type, flags_type_mask); ptype_idx = _mm256_srli_epi32(ptype_idx, - RX_PKT_CMPL_FLAGS_ITYPE_SFT - + RX_PKT_COMPRESS_CMPL_FLAGS_ITYPE_SFT - BNXT_PTYPE_TBL_TYPE_SFT); - t0 = _mm256_unpacklo_epi32(rxcmp0_1, rxcmp2_3); - t1 = _mm256_unpacklo_epi32(rxcmp4_5, rxcmp6_7); - flags2 = _mm256_unpackhi_epi64(t0, t1); + t0 = _mm256_unpackhi_epi32(rxcmp0_1, rxcmp2_3); + t1 = _mm256_unpackhi_epi32(rxcmp4_5, rxcmp6_7); + cs_err_v2 = _mm256_unpacklo_epi64(t0, t1); - t0 = _mm256_srli_epi32(_mm256_and_si256(flags2, flags2_mask1), - RX_PKT_CMPL_FLAGS2_META_FORMAT_SFT - + t0 = _mm256_srli_epi32(_mm256_and_si256(cs_err_v2, flags2_mask1), + RX_PKT_COMPRESS_CMPL_METADATA1_SFT - BNXT_PTYPE_TBL_VLAN_SFT); ptype_idx = _mm256_or_si256(ptype_idx, t0); - t0 = _mm256_srli_epi32(_mm256_and_si256(flags2, flags2_mask2), + t0 = _mm256_srli_epi32(_mm256_and_si256(cs_err_v2, flags2_mask2), RX_PKT_CMPL_FLAGS2_IP_TYPE_SFT - BNXT_PTYPE_TBL_IP_VER_SFT); ptype_idx = _mm256_or_si256(ptype_idx, t0); @@ -505,17 +507,22 @@ crx_burst_vec_avx2(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) * Compute ol_flags and checksum error table indices for eight * packets. */ - is_tunnel = _mm256_and_si256(flags2, _mm256_set1_epi32(4)); + is_tunnel = _mm256_and_si256(cs_err_v2, + _mm256_set1_epi32(BNXT_CRX_TUN_CS_CALC)); is_tunnel = _mm256_slli_epi32(is_tunnel, 3); - flags2 = _mm256_and_si256(flags2, _mm256_set1_epi32(0x1F)); + + flags2 = _mm256_and_si256(cs_err_v2, + _mm256_set1_epi32(BNXT_CRX_CQE_CSUM_CALC_MASK)); + flags2 = _mm256_srli_epi64(flags2, 8); /* Extract errors_v2 fields for eight packets. */ t0 = _mm256_unpackhi_epi32(rxcmp0_1, rxcmp2_3); t1 = _mm256_unpackhi_epi32(rxcmp4_5, rxcmp6_7); errors_v2 = _mm256_unpacklo_epi64(t0, t1); - errors = _mm256_srli_epi32(errors_v2, 4); - errors = _mm256_and_si256(errors, _mm256_set1_epi32(0xF)); + /* Compute errors out of cs_err_v2 to index into flags table. */ + errors = _mm256_and_si256(cs_err_v2, _mm256_set1_epi32(0xF0)); + errors = _mm256_srli_epi32(errors, 4); errors = _mm256_and_si256(errors, flags2); index = _mm256_andnot_si256(errors, flags2); From patchwork Wed Feb 21 21:20:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajit Khaparde X-Patchwork-Id: 136987 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 6478143B67; Wed, 21 Feb 2024 22:22:19 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1D67740ED0; Wed, 21 Feb 2024 22:21:21 +0100 (CET) Received: from mail-ua1-f48.google.com (mail-ua1-f48.google.com [209.85.222.48]) by mails.dpdk.org (Postfix) with ESMTP id 8EB8440EA5 for ; Wed, 21 Feb 2024 22:21:17 +0100 (CET) Received: by mail-ua1-f48.google.com with SMTP id a1e0cc1a2514c-7d130979108so611522241.1 for ; Wed, 21 Feb 2024 13:21:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1708550476; x=1709155276; darn=dpdk.org; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=ZKJKI2Na/YhnzyMPQ+asTIrqUMTy/X9LRMOrmuOUqaY=; b=I0raSAKrn8HsNEt6YubuqpIHJTcUXkwtQ2Uy1VEy+HKa4ibo+NN6sVSMZX/7ekFi+F q+Wl4nONQkZTnGL6bm9xlQ2H/pPguJx/xHzA8uXAUH2pIjaQmhsKVWVenotS0wrI5/pp jaBAkhxVXjHbOxwCjnuDyhhXI1+8Z3ddO7lGA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708550476; x=1709155276; h=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=ZKJKI2Na/YhnzyMPQ+asTIrqUMTy/X9LRMOrmuOUqaY=; b=ojNJvUutTSz2jQskjdkHL6oJegZT1SUUnM986ruQ7a9BGei/E/MzIEFZSq4Eeks8qF SIujnFWuNSz8wNmej1g3/k8cC5UCiEwxXvu5YSZl717WwpoPKtmbLPYsRUcqmRilz3d7 H+4fctyPw+pw5IuauRSMyV58LWctNoTOTv/YYcQz7xPM89qdI1ak5JiHjmKN6wzW6g7y GIGGTbX2hLIGP0yAoJwv41ejCA1qVeLZI+0SB6SxKq1AHYYz2JmZUSngUiNMmR9NVuFc B1zOhNrr0N1h08GGpkDxxDi6w3OqCv2VqrJF2ykzfQoPuOJh0etYNgywvycoZHav/Nbf Vk+A== X-Gm-Message-State: AOJu0YzskxRIV8ykz9zmTQLICSrSWIipv7O48jRqLlz+Knrt9wxg0chF FljcwpiPqmijdaF4yXAL9t1pVEvUj204fqSOvdlbwI82kOCJsdjLLN9uaUMddX516KNrCDivI59 ug1ayuHh88UT7obypxlh3ld0d122tnne9w6qYU5O4IwfzpMbzsfHrJbJf8FZowlZrADGtAHsswe aaPMbf+lLflPsWssIXfVcJiZvrzvbo X-Google-Smtp-Source: AGHT+IHw3unMJqtriqMnjRNQ0tXKHyh93B+84V42fGnpeSgbKJln+U838+HR+9KblAAy1nGliIWULQ== X-Received: by 2002:a67:ff90:0:b0:470:3ade:7b99 with SMTP id v16-20020a67ff90000000b004703ade7b99mr11660542vsq.23.1708550476395; Wed, 21 Feb 2024 13:21:16 -0800 (PST) Received: from C02GC2QQMD6T.wifi.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id 20-20020ac84e94000000b0042bff97d9a3sm4743467qtp.40.2024.02.21.13.21.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 13:21:15 -0800 (PST) From: Ajit Khaparde To: dev@dpdk.org Cc: ferruh.yigit@amd.com, thomas@monjalon.net Subject: [PATCH 10/10] doc: update release notes for bnxt Date: Wed, 21 Feb 2024 13:20:45 -0800 Message-Id: <20240221212044.27209-11-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.39.2 (Apple Git-143) In-Reply-To: <20240221212044.27209-1-ajit.khaparde@broadcom.com> References: <20240221212044.27209-1-ajit.khaparde@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 Update release notes indicating support in bnxt PMD for 5760X device family. Signed-off-by: Ajit Khaparde --- doc/guides/rel_notes/release_24_03.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/guides/rel_notes/release_24_03.rst b/doc/guides/rel_notes/release_24_03.rst index 32d0ad8cf6..236fed61e3 100644 --- a/doc/guides/rel_notes/release_24_03.rst +++ b/doc/guides/rel_notes/release_24_03.rst @@ -132,6 +132,10 @@ New Features to support TLS v1.2, TLS v1.3 and DTLS v1.2. * Added PMD API to allow raw submission of instructions to CPT. +* **Updated Broadcom bnxt driver.** + + * Added support for 5760X device family. + Removed Items -------------