From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 269A3A051C for ; Tue, 11 Feb 2020 12:41:09 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1D8631BFF3; Tue, 11 Feb 2020 12:41:09 +0100 (CET) Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) by dpdk.org (Postfix) with ESMTP id 547D71BFA7 for ; Tue, 11 Feb 2020 12:41:08 +0100 (CET) Received: by mail-wr1-f41.google.com with SMTP id m16so11909524wrx.11 for ; Tue, 11 Feb 2020 03:41:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3kS5955hb6b9klXs8Zsf0/dGP1D5bPBcwf9baFN/oTc=; b=V7gCXyTVr2iA/iLQnYEradPTLKRyH3Sc6SaVNFCHzuFQsHSdQkWZ222Zqh/WQDCzwP vEeju8pQgi5snpe/pZVV2G7L7CKvZ0J2LexK/z2rxz1CKZ6pKGozIAhTYJULfoXwiPcq jhfPf1BKhDxS0yEnWHHqEtoJTtz60TKlGSPBLK/KCExjaa36R9Ci7ocu3j8jSMSz7mSs vVEoB8EIudKXh20duJN3nsLqfnOKTpbFyQ5ijcJka+4rL/+npkDwe11Gw7mXeyU0thYm epcejCfr8ilXwt5yB6rho1J8NC+zfMXUbOJCl6SFSPNO/yJiA9zjpL3GQzdIASlBhOsA 9VQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3kS5955hb6b9klXs8Zsf0/dGP1D5bPBcwf9baFN/oTc=; b=XLsExUDOjx54pa7ytjmXftAX5HUg3HPOx/cIbpQuLpJGM1TXz9g0p7UhRKFtNL+wvR hcX1MQ7rsDyUGgKorFldetcvf7zd3FprsBkj+eo2QZ4Fh5CfnEZD/KOlzOdQBsdaj1Rn +q+WMpxoOrc5szTiFNe6qM78We5fjEUx/YzsqWpVbjNlIBFfQL8766aNiKGKcfz5ohbM p0bK/Tl1ja8Q/nXV1lkbIYt/je8LhsitHpkYUh52f8NbDjUCBObB5PkrQwE0KxnuSSwd DN35izVhpOHu8LrhUEyuVat3duX69aq4admSr6F1p2ZTcbubpzbOR8rSK009m1pK56pI LPnA== X-Gm-Message-State: APjAAAWmCv7h1fx1cQ6t95b/gq7wR7awBm0C9FVBdHujznOx/CjdI06F yz+pHh2Y0CoE9L6pb8M4420= X-Google-Smtp-Source: APXvYqxmYw+D+seC07kavBkDXq9uX8vIRdNdWZIF1avb+YM8NpqWbC4YnpdItLYY4p9XQT3NCfIbMg== X-Received: by 2002:adf:b352:: with SMTP id k18mr8009916wrd.242.1581421268006; Tue, 11 Feb 2020 03:41:08 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id x6sm3296340wmi.44.2020.02.11.03.41.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2020 03:41:07 -0800 (PST) From: luca.boccassi@gmail.com To: Somnath Kotur Cc: Ajit Khaparde , dpdk stable Date: Tue, 11 Feb 2020 11:21:47 +0000 Message-Id: <20200211112216.3929-161-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200211112216.3929-1-luca.boccassi@gmail.com> References: <20200211112216.3929-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/bnxt: allow group ID 0 for RSS action' has been queued to stable release 19.11.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 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 Sender: "stable" Hi, FYI, your patch has been queued to stable release 19.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/13/20. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Thanks. Luca Boccassi --- >From 445d0526a863db8d8d035ab964754fd3fb942430 Mon Sep 17 00:00:00 2001 From: Somnath Kotur Date: Tue, 28 Jan 2020 12:59:17 +0530 Subject: [PATCH] net/bnxt: allow group ID 0 for RSS action [ upstream commit db8241fea26073971ace2a76d53bcf73385b774b ] Allow RSS action with group ID 0. The RSS match check will ensure if requested RSS action configuration parameters should be allowed as per the VNIC's RSS configuration or not and if it does match as it is by design in OVS-DPDK use case, the default vnic can be used to create the filter. As part of this ensure that rx_queue_cnt for the default vnic is setup during init as this field was being set only for non-zero vnics while handling RSS action for flow create. Check for out of bounds error while accessing the vnic array. Fixes: adc0f81c6552 ("net/bnxt: support RSS action") Reviewed-by: Ajit Khaparde Signed-off-by: Somnath Kotur --- drivers/net/bnxt/bnxt.h | 14 +++++++++++++- drivers/net/bnxt/bnxt_flow.c | 33 ++++----------------------------- 2 files changed, 17 insertions(+), 30 deletions(-) diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h index ca54c74155..46600e163a 100644 --- a/drivers/net/bnxt/bnxt.h +++ b/drivers/net/bnxt/bnxt.h @@ -689,11 +689,23 @@ extern const struct rte_flow_ops bnxt_flow_ops; #define bnxt_release_flow_lock(bp) \ pthread_mutex_unlock(&(bp)->flow_lock) +#define BNXT_VALID_VNIC_OR_RET(bp, vnic_id) do { \ + if ((vnic_id) >= (bp)->max_vnics) { \ + rte_flow_error_set(error, \ + EINVAL, \ + RTE_FLOW_ERROR_TYPE_ATTR_GROUP, \ + NULL, \ + "Group id is invalid!"); \ + rc = -rte_errno; \ + goto ret; \ + } \ +} while (0) + extern int bnxt_logtype_driver; #define PMD_DRV_LOG_RAW(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, bnxt_logtype_driver, "%s(): " fmt, \ __func__, ## args) #define PMD_DRV_LOG(level, fmt, args...) \ - PMD_DRV_LOG_RAW(level, fmt, ## args) + PMD_DRV_LOG_RAW(level, fmt, ## args) #endif diff --git a/drivers/net/bnxt/bnxt_flow.c b/drivers/net/bnxt/bnxt_flow.c index 60c390448a..d901479ee1 100644 --- a/drivers/net/bnxt/bnxt_flow.c +++ b/drivers/net/bnxt/bnxt_flow.c @@ -1056,16 +1056,9 @@ bnxt_validate_and_parse_flow(struct rte_eth_dev *dev, vnic_id = act_q->index; } + BNXT_VALID_VNIC_OR_RET(bp, vnic_id); + vnic = &bp->vnic_info[vnic_id]; - if (vnic == NULL) { - rte_flow_error_set(error, - EINVAL, - RTE_FLOW_ERROR_TYPE_ACTION, - act, - "No matching VNIC found."); - rc = -rte_errno; - goto ret; - } if (vnic->rx_queue_cnt) { if (vnic->start_grp_id != act_q->index) { PMD_DRV_LOG(ERR, @@ -1263,28 +1256,10 @@ use_vnic: rss = (const struct rte_flow_action_rss *)act->conf; vnic_id = attr->group; - if (!vnic_id) { - PMD_DRV_LOG(ERR, "Group id cannot be 0\n"); - rte_flow_error_set(error, - EINVAL, - RTE_FLOW_ERROR_TYPE_ATTR, - NULL, - "Group id cannot be 0"); - rc = -rte_errno; - goto ret; - } + + BNXT_VALID_VNIC_OR_RET(bp, vnic_id); vnic = &bp->vnic_info[vnic_id]; - if (vnic == NULL) { - rte_flow_error_set(error, - EINVAL, - RTE_FLOW_ERROR_TYPE_ACTION, - act, - "No matching VNIC for RSS group."); - rc = -rte_errno; - goto ret; - } - PMD_DRV_LOG(DEBUG, "VNIC found\n"); /* Check if requested RSS config matches RSS config of VNIC * only if it is not a fresh VNIC configuration. -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-02-11 11:17:44.217985718 +0000 +++ 0161-net-bnxt-allow-group-ID-0-for-RSS-action.patch 2020-02-11 11:17:38.768008228 +0000 @@ -1,8 +1,10 @@ -From db8241fea26073971ace2a76d53bcf73385b774b Mon Sep 17 00:00:00 2001 +From 445d0526a863db8d8d035ab964754fd3fb942430 Mon Sep 17 00:00:00 2001 From: Somnath Kotur Date: Tue, 28 Jan 2020 12:59:17 +0530 Subject: [PATCH] net/bnxt: allow group ID 0 for RSS action +[ upstream commit db8241fea26073971ace2a76d53bcf73385b774b ] + Allow RSS action with group ID 0. The RSS match check will ensure if requested RSS action configuration parameters should be allowed as per the VNIC's RSS configuration or not and if it does match as it is @@ -13,21 +15,19 @@ Check for out of bounds error while accessing the vnic array. Fixes: adc0f81c6552 ("net/bnxt: support RSS action") -Cc: stable@dpdk.org Reviewed-by: Ajit Khaparde Signed-off-by: Somnath Kotur --- - drivers/net/bnxt/bnxt.h | 14 +++++++++++++- - drivers/net/bnxt/bnxt_ethdev.c | 4 ++++ - drivers/net/bnxt/bnxt_flow.c | 33 ++++----------------------------- - 3 files changed, 21 insertions(+), 30 deletions(-) + drivers/net/bnxt/bnxt.h | 14 +++++++++++++- + drivers/net/bnxt/bnxt_flow.c | 33 ++++----------------------------- + 2 files changed, 17 insertions(+), 30 deletions(-) diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h -index ddb26814ce..bca9ad418b 100644 +index ca54c74155..46600e163a 100644 --- a/drivers/net/bnxt/bnxt.h +++ b/drivers/net/bnxt/bnxt.h -@@ -696,11 +696,23 @@ extern const struct rte_flow_ops bnxt_flow_ops; +@@ -689,11 +689,23 @@ extern const struct rte_flow_ops bnxt_flow_ops; #define bnxt_release_flow_lock(bp) \ pthread_mutex_unlock(&(bp)->flow_lock) @@ -52,28 +52,11 @@ - PMD_DRV_LOG_RAW(level, fmt, ## args) + PMD_DRV_LOG_RAW(level, fmt, ## args) #endif -diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c -index 2ef1169b88..fc3f1a8db8 100644 ---- a/drivers/net/bnxt/bnxt_ethdev.c -+++ b/drivers/net/bnxt/bnxt_ethdev.c -@@ -295,8 +295,12 @@ static int bnxt_setup_one_vnic(struct bnxt *bp, uint16_t vnic_id) - - if (BNXT_HAS_RING_GRPS(bp) && rxq->rx_deferred_start) - rxq->vnic->fw_grp_ids[j] = INVALID_HW_RING_ID; -+ else -+ vnic->rx_queue_cnt++; - } - -+ PMD_DRV_LOG(DEBUG, "vnic->rx_queue_cnt = %d\n", vnic->rx_queue_cnt); -+ - rc = bnxt_vnic_rss_configure(bp, vnic); - if (rc) - goto err_out; diff --git a/drivers/net/bnxt/bnxt_flow.c b/drivers/net/bnxt/bnxt_flow.c -index 4b3b597956..bd6c726232 100644 +index 60c390448a..d901479ee1 100644 --- a/drivers/net/bnxt/bnxt_flow.c +++ b/drivers/net/bnxt/bnxt_flow.c -@@ -1059,16 +1059,9 @@ start: +@@ -1056,16 +1056,9 @@ bnxt_validate_and_parse_flow(struct rte_eth_dev *dev, vnic_id = act_q->index; } @@ -92,7 +75,7 @@ if (vnic->rx_queue_cnt) { if (vnic->start_grp_id != act_q->index) { PMD_DRV_LOG(ERR, -@@ -1268,28 +1261,10 @@ use_vnic: +@@ -1263,28 +1256,10 @@ use_vnic: rss = (const struct rte_flow_action_rss *)act->conf; vnic_id = attr->group;