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 F0FB445D39; Mon, 18 Nov 2024 18:36:28 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6B2BB410FB; Mon, 18 Nov 2024 18:36:23 +0100 (CET) Received: from mail-pg1-f181.google.com (mail-pg1-f181.google.com [209.85.215.181]) by mails.dpdk.org (Postfix) with ESMTP id 3AAA4410D4 for ; Mon, 18 Nov 2024 18:36:20 +0100 (CET) Received: by mail-pg1-f181.google.com with SMTP id 41be03b00d2f7-7ea8de14848so1830134a12.2 for ; Mon, 18 Nov 2024 09:36:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1731951379; x=1732556179; 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=FspJsoOE3JTM61D0JHSzFeo7osLzbLtdyOF0dJ9SyYA=; b=GhORzTpK7fPnyg2VKGpZpeIl0VdRxM1O+y1xq4nyx5azvk6hKJgLP4JKybrBqahad5 tB6/LcmQGXuXbtgvZbssnmLQFJO31V5E8yKK2oS0Dz1hnGmdI/mLslsVqOoa+CGs/q4H EwMT/CZLhF47D9H6AwA6pw4iN4qTjx5b1f/Uk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731951379; x=1732556179; 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=FspJsoOE3JTM61D0JHSzFeo7osLzbLtdyOF0dJ9SyYA=; b=KDe3wO3Uz2iKxWyO3ic1UFkVwKFaTmi44haCnYn1KtLp6PQAv4Gatlj2CUV6ImV2wT GB9ZpJFLTOK8zD41uijT8cxBVXcAveMN4OGZc6Dn4+KX9W2DID1zhNjzYcPw2/bpwwCI dAJR3ExxBC+miYGk1BUBZujyzLkCgv2tLEk/kmsesdiY3Adap85ThYxieuhNNoTsDhoQ E9fNHSQSVR20BxKQsKIZNTQl0TbztIRFSWN45EWK3+OXcOuaJ3YiFJ1/K9+a1Fjfce8s nSet7fNxDEMs/kQAGZm0Krgr7ekMDnGPxOqg6+VRttv5DXBuS7J84vJ7n63DzVmamOvU JRpA== X-Gm-Message-State: AOJu0YwSkpoj4CtfSv3TooMQ2VkSqA8xdU20SgI1qIvL+5uzQWzR7xUT 56yaJ3zs1pEqqtn+bqoyw+iPsdvGSBDAYV+jX5i7vIp7fedeV8F4vfoBGvsU625nrlzITImzj4A rKC7aajpfTTPf/FWzaLSokQDIfOXga0WoB5YyD04o6QDcgpj/jI96S9zd+9Z07Aic1nFZhCplmX HWsh+nKtVweRqM9XMStsvyTS9d8H1k X-Google-Smtp-Source: AGHT+IFA6ypd37Gi8h+VaQC/USAmkxeooTVkbcoDJKKliPOuJsDcb8WaWHq4aNcifrvuOZQ3qoTtXQ== X-Received: by 2002:a05:6a20:2447:b0:1db:de38:294b with SMTP id adf61e73a8af0-1dc90c1a822mr21156260637.38.1731951378757; Mon, 18 Nov 2024 09:36:18 -0800 (PST) Received: from C02GC2QQMD6T.wifi.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-724771229d2sm6410438b3a.80.2024.11.18.09.36.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Nov 2024 09:36:17 -0800 (PST) From: Ajit Khaparde To: dev@dpdk.org Cc: Andy Gospodarek Subject: [PATCH 2/3] net/bnxt: add support for Rx profile selection Date: Mon, 18 Nov 2024 09:36:12 -0800 Message-Id: <20241118173613.94224-3-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.39.5 (Apple Git-154) In-Reply-To: <20241118173613.94224-1-ajit.khaparde@broadcom.com> References: <20241118173613.94224-1-ajit.khaparde@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 Some firmware versions can support the selection of Rx profile during Rx and AGG ring allocation. Check if the firmware sets the HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT3_RX_RATE_PROFILE_SEL_SUPPORTED flag and set the new Rx profile. Signed-off-by: Ajit Khaparde Reviewed-by: Andy Gospodarek --- drivers/net/bnxt/bnxt.h | 1 + drivers/net/bnxt/bnxt_hwrm.c | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h index 771349de6c..0402de3eb9 100644 --- a/drivers/net/bnxt/bnxt.h +++ b/drivers/net/bnxt/bnxt.h @@ -866,6 +866,7 @@ struct bnxt { #define BNXT_FW_CAP_TX_COAL_CMPL BIT(10) #define BNXT_FW_CAP_RX_ALL_PKT_TS BIT(11) #define BNXT_FW_CAP_BACKING_STORE_V2 BIT(12) +#define BNXT_FW_CAP_RX_RATE_PROFILE BIT(17) #define BNXT_FW_BACKING_STORE_V2_EN(bp) \ ((bp)->fw_cap & BNXT_FW_CAP_BACKING_STORE_V2) #define BNXT_FW_BACKING_STORE_V1_EN(bp) \ diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index 351effb28f..d015ba2b9c 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -1139,8 +1139,8 @@ static int __bnxt_hwrm_func_qcaps(struct bnxt *bp) int rc = 0; struct hwrm_func_qcaps_input req = {.req_type = 0 }; struct hwrm_func_qcaps_output *resp = bp->hwrm_cmd_resp_addr; + uint32_t flags, flags_ext2, flags_ext3; uint16_t new_max_vfs; - uint32_t flags, flags_ext2; HWRM_PREP(&req, HWRM_FUNC_QCAPS, BNXT_USE_CHIMP_MB); @@ -1153,6 +1153,7 @@ 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); + flags_ext3 = rte_le_to_cpu_32(resp->flags_ext3); if (BNXT_PF(bp)) { bp->pf->port_id = resp->port_id; @@ -1259,6 +1260,8 @@ static int __bnxt_hwrm_func_qcaps(struct bnxt *bp) bp->fw_cap |= BNXT_FW_CAP_RX_ALL_PKT_TS; if (flags_ext2 & HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_UDP_GSO_SUPPORTED) bp->fw_cap |= BNXT_FW_CAP_UDP_GSO; + if (flags_ext3 & HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT3_RX_RATE_PROFILE_SEL_SUPPORTED) + bp->fw_cap |= BNXT_FW_CAP_RX_RATE_PROFILE; unlock: HWRM_UNLOCK(); @@ -2227,6 +2230,11 @@ int bnxt_hwrm_ring_alloc(struct bnxt *bp, if (stats_ctx_id != INVALID_STATS_CTX_ID) enables |= HWRM_RING_ALLOC_INPUT_ENABLES_STAT_CTX_ID_VALID; + if (bp->fw_cap & BNXT_FW_CAP_RX_RATE_PROFILE) { + req.rx_rate_profile_sel = + HWRM_RING_ALLOC_INPUT_RX_RATE_PROFILE_SEL_POLL_MODE; + enables |= HWRM_RING_ALLOC_INPUT_ENABLES_RX_RATE_PROFILE_VALID; + } break; case HWRM_RING_ALLOC_INPUT_RING_TYPE_L2_CMPL: req.ring_type = ring_type; @@ -2257,6 +2265,11 @@ int bnxt_hwrm_ring_alloc(struct bnxt *bp, enables |= HWRM_RING_ALLOC_INPUT_ENABLES_RX_RING_ID_VALID | HWRM_RING_ALLOC_INPUT_ENABLES_RX_BUF_SIZE_VALID | HWRM_RING_ALLOC_INPUT_ENABLES_STAT_CTX_ID_VALID; + if (bp->fw_cap & BNXT_FW_CAP_RX_RATE_PROFILE) { + req.rx_rate_profile_sel = + HWRM_RING_ALLOC_INPUT_RX_RATE_PROFILE_SEL_POLL_MODE; + enables |= HWRM_RING_ALLOC_INPUT_ENABLES_RX_RATE_PROFILE_VALID; + } break; default: PMD_DRV_LOG_LINE(ERR, "hwrm alloc invalid ring type %d", -- 2.39.5 (Apple Git-154)