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 20672A0C47 for ; Mon, 26 Jul 2021 15:54:08 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1602540DDA; Mon, 26 Jul 2021 15:54:08 +0200 (CEST) Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) by mails.dpdk.org (Postfix) with ESMTP id E900840DDA for ; Mon, 26 Jul 2021 15:54:06 +0200 (CEST) Received: by mail-wr1-f51.google.com with SMTP id q3so11268028wrx.0 for ; Mon, 26 Jul 2021 06:54:06 -0700 (PDT) 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=JBfNI3i/AwQgtAZRuFhVENKiKMB84+mtIgMDvTg2yRI=; b=MqUkGj4y7Bpaci/v/wMQwopnlRMTAqlR433Zuiy4DgKlsEU1JicmkgDl2hpHyWzZNc JKD1lB7vXICPyRlVeHjbh7etTGdzkyE+Yd2eRl6d/+CFgcuJBpjUf2113TAfF60dYzTI IbG9H/cO9q1R72jkGDILkjl6v252amF3yzjn7/mIwfhspg2t94ZMzAhjYu42eOCym767 apUvfc2AtUZjXzLqbs77G2tQcbkYMUG82I8DkYQSeBYFjCVMiylOxH3eOtL5Q6YQ7kTO zXmtozxq4B8z7Rj7pEFf4T6aDI1Ef/+A05RJQccc6tGqflBqHFyAAMSLBDyCyC9D2hid mA1Q== 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=JBfNI3i/AwQgtAZRuFhVENKiKMB84+mtIgMDvTg2yRI=; b=JeIsXYxMYd+ytYBvjNLe8CmwzYmKi5my31FNdpTK0aO+7HaFpfp1oQR+0UAukf+4lD Y5yriGYtnqUW2xwIKsXiWZyiNDvwGZb6SfUdhaMmjC5kDErls8BsFFVlGFq6X5E+5QbU z3zNGdOdpChEJRSOHXOYJVYEpSvCg+OBnKMlglFaEyD+6w41tkAxfKkK6uZO+RXrbNjA ZrYyi7pV9EBG2fUTK2VfjHNGYiN/WDWaIqXKctZywdyIZx2x1Cv3g+Brb6kTLXSh2pzR 8XF9aCFihieQ4rQRF2hR+dOZbceAfgfdxZqSpr4viOZLuUfE2GzLGX1kFAz2f1/Ops3A JL5Q== X-Gm-Message-State: AOAM532a9cy6uL17vfmFS1bwJnzIIUNvFJ6SvWJ7mrYJWr1tJOPZCzCC v9b4Gx350gLiD/nww0qLb6A= X-Google-Smtp-Source: ABdhPJwR1+h1UITkRy5A1bgEIrTgYJ/wQdCJSRu9YsqsSt15qb7V+8sDvBCuru7GhJWjXeyhPxgAkA== X-Received: by 2002:adf:f704:: with SMTP id r4mr3054685wrp.389.1627307646722; Mon, 26 Jul 2021 06:54:06 -0700 (PDT) Received: from localhost ([137.220.125.106]) by smtp.gmail.com with ESMTPSA id s6sm50420314wrt.45.2021.07.26.06.54.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jul 2021 06:54:05 -0700 (PDT) From: luca.boccassi@gmail.com To: Dana Vardi Cc: Liron Himi , dpdk stable Date: Mon, 26 Jul 2021 14:52:34 +0100 Message-Id: <20210726135322.149850-11-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210726135322.149850-1-luca.boccassi@gmail.com> References: <20210712130551.2462159-1-luca.boccassi@gmail.com> <20210726135322.149850-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/mvpp2: fix configured state dependency' has been queued to stable release 20.11.3 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 Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/28/21. 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. Queued patches are on a temporary branch at: https://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/6595f06986d7e8802ece9042191a614fc2675a86 Thanks. Luca Boccassi --- >From 6595f06986d7e8802ece9042191a614fc2675a86 Mon Sep 17 00:00:00 2001 From: Dana Vardi Date: Sun, 11 Jul 2021 16:12:49 +0300 Subject: [PATCH] net/mvpp2: fix configured state dependency [ upstream commit e622c1a88e3507dc6d2c9dd6ec555905d1b5baf1 ] Need to set configure flag to allow create and commit mrvl tm hierarchy tree. tm configuration depends on parameters that are being set in port configure stage, e.g. nb_tx_queues. This also aligned with the tm api description. Fixes: 429c394417 ("net/mvpp2: support traffic manager") Signed-off-by: Dana Vardi Reviewed-by: Liron Himi --- drivers/net/mvpp2/mrvl_ethdev.c | 12 ++++-- drivers/net/mvpp2/mrvl_ethdev.h | 3 +- drivers/net/mvpp2/mrvl_tm.c | 65 +++++++++++++++++++++++++++++++++ 3 files changed, 76 insertions(+), 4 deletions(-) diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c index 6cd5acd337..7133d56852 100644 --- a/drivers/net/mvpp2/mrvl_ethdev.c +++ b/drivers/net/mvpp2/mrvl_ethdev.c @@ -398,12 +398,18 @@ mrvl_dev_configure(struct rte_eth_dev *dev) dev->data->dev_conf.rxmode.mq_mode == ETH_MQ_RX_RSS) { MRVL_LOG(WARNING, "Disabling hash for 1 rx queue"); priv->ppio_params.inqs_params.hash_type = PP2_PPIO_HASH_T_NONE; - + priv->configured = 1; return 0; } - return mrvl_configure_rss(priv, - &dev->data->dev_conf.rx_adv_conf.rss_conf); + ret = mrvl_configure_rss(priv, + &dev->data->dev_conf.rx_adv_conf.rss_conf); + if (ret < 0) + return ret; + + priv->configured = 1; + + return 0; } /** diff --git a/drivers/net/mvpp2/mrvl_ethdev.h b/drivers/net/mvpp2/mrvl_ethdev.h index eee5182ce8..c7ab0e4932 100644 --- a/drivers/net/mvpp2/mrvl_ethdev.h +++ b/drivers/net/mvpp2/mrvl_ethdev.h @@ -208,9 +208,10 @@ struct mrvl_priv { LIST_HEAD(shaper_profiles, mrvl_tm_shaper_profile) shaper_profiles; LIST_HEAD(nodes, mrvl_tm_node) nodes; uint64_t rate_max; + + uint8_t configured; /** indicates if device has been configured */ }; -/** Flow operations forward declaration. */ extern const struct rte_flow_ops mrvl_flow_ops; /** Meter operations forward declaration. */ diff --git a/drivers/net/mvpp2/mrvl_tm.c b/drivers/net/mvpp2/mrvl_tm.c index 7e3c46f956..9fac80b867 100644 --- a/drivers/net/mvpp2/mrvl_tm.c +++ b/drivers/net/mvpp2/mrvl_tm.c @@ -146,6 +146,11 @@ mrvl_node_type_get(struct rte_eth_dev *dev, uint32_t node_id, int *is_leaf, struct mrvl_priv *priv = dev->data->dev_private; struct mrvl_tm_node *node; + if (!priv->configured) + return -rte_tm_error_set(error, ENODEV, + RTE_TM_ERROR_TYPE_UNSPECIFIED, + NULL, "Port didn't configured\n"); + if (!is_leaf) return -rte_tm_error_set(error, EINVAL, RTE_TM_ERROR_TYPE_UNSPECIFIED, @@ -177,6 +182,11 @@ mrvl_capabilities_get(struct rte_eth_dev *dev, { struct mrvl_priv *priv = dev->data->dev_private; + if (!priv->configured) + return -rte_tm_error_set(error, ENODEV, + RTE_TM_ERROR_TYPE_UNSPECIFIED, + NULL, "Port didn't configured\n"); + if (!cap) return -rte_tm_error_set(error, EINVAL, RTE_TM_ERROR_TYPE_UNSPECIFIED, @@ -228,6 +238,11 @@ mrvl_level_capabilities_get(struct rte_eth_dev *dev, { struct mrvl_priv *priv = dev->data->dev_private; + if (!priv->configured) + return -rte_tm_error_set(error, ENODEV, + RTE_TM_ERROR_TYPE_UNSPECIFIED, + NULL, "Port didn't configured\n"); + if (!cap) return -rte_tm_error_set(error, EINVAL, RTE_TM_ERROR_TYPE_UNSPECIFIED, @@ -294,6 +309,11 @@ mrvl_node_capabilities_get(struct rte_eth_dev *dev, uint32_t node_id, struct mrvl_priv *priv = dev->data->dev_private; struct mrvl_tm_node *node; + if (!priv->configured) + return -rte_tm_error_set(error, ENODEV, + RTE_TM_ERROR_TYPE_UNSPECIFIED, + NULL, "Port didn't configured\n"); + if (!cap) return -rte_tm_error_set(error, EINVAL, RTE_TM_ERROR_TYPE_UNSPECIFIED, @@ -366,6 +386,11 @@ mrvl_shaper_profile_add(struct rte_eth_dev *dev, uint32_t shaper_profile_id, struct mrvl_priv *priv = dev->data->dev_private; struct mrvl_tm_shaper_profile *profile; + if (!priv->configured) + return -rte_tm_error_set(error, ENODEV, + RTE_TM_ERROR_TYPE_UNSPECIFIED, + NULL, "Port didn't configured\n"); + if (!params) return -rte_tm_error_set(error, EINVAL, RTE_TM_ERROR_TYPE_UNSPECIFIED, @@ -434,6 +459,11 @@ mrvl_shaper_profile_delete(struct rte_eth_dev *dev, uint32_t shaper_profile_id, struct mrvl_priv *priv = dev->data->dev_private; struct mrvl_tm_shaper_profile *profile; + if (!priv->configured) + return -rte_tm_error_set(error, ENODEV, + RTE_TM_ERROR_TYPE_UNSPECIFIED, + NULL, "Port didn't configured\n"); + profile = mrvl_shaper_profile_from_id(priv, shaper_profile_id); if (!profile) return -rte_tm_error_set(error, ENODEV, @@ -580,6 +610,11 @@ mrvl_node_add(struct rte_eth_dev *dev, uint32_t node_id, struct mrvl_tm_node *node, *parent = NULL; int ret; + if (!priv->configured) + return -rte_tm_error_set(error, ENODEV, + RTE_TM_ERROR_TYPE_UNSPECIFIED, + NULL, "Port didn't configured\n"); + if (priv->ppio) return -rte_tm_error_set(error, EPERM, RTE_TM_ERROR_TYPE_UNSPECIFIED, @@ -665,6 +700,11 @@ mrvl_node_delete(struct rte_eth_dev *dev, uint32_t node_id, struct mrvl_priv *priv = dev->data->dev_private; struct mrvl_tm_node *node; + if (!priv->configured) + return -rte_tm_error_set(error, ENODEV, + RTE_TM_ERROR_TYPE_UNSPECIFIED, + NULL, "Port didn't configured\n"); + if (priv->ppio) { return -rte_tm_error_set(error, EPERM, RTE_TM_ERROR_TYPE_UNSPECIFIED, @@ -729,6 +769,11 @@ mrvl_node_suspend(struct rte_eth_dev *dev, uint32_t node_id, struct mrvl_tm_node *node, *tmp; int ret; + if (!priv->configured) + return -rte_tm_error_set(error, ENODEV, + RTE_TM_ERROR_TYPE_UNSPECIFIED, + NULL, "Port didn't configured\n"); + node = mrvl_node_from_id(priv, node_id); if (!node) return -rte_tm_error_set(error, ENODEV, @@ -770,6 +815,11 @@ mrvl_node_resume(struct rte_eth_dev *dev, uint32_t node_id, struct mrvl_tm_node *node; int ret; + if (!priv->configured) + return -rte_tm_error_set(error, ENODEV, + RTE_TM_ERROR_TYPE_UNSPECIFIED, + NULL, "Port didn't configured\n"); + node = mrvl_node_from_id(priv, node_id); if (!node) return -rte_tm_error_set(error, ENODEV, @@ -806,6 +856,11 @@ mrvl_hierarchy_commit(struct rte_eth_dev *dev, int clear_on_fail, struct mrvl_tm_node *node; int ret; + if (!priv->configured) + return -rte_tm_error_set(error, ENODEV, + RTE_TM_ERROR_TYPE_UNSPECIFIED, + NULL, "Port didn't configured\n"); + if (priv->ppio) { ret = -rte_tm_error_set(error, EPERM, RTE_TM_ERROR_TYPE_UNSPECIFIED, @@ -912,6 +967,11 @@ mrvl_node_stats_read(struct rte_eth_dev *dev, uint32_t node_id, struct mrvl_tm_node *node; int ret; + if (!priv->configured) + return -rte_tm_error_set(error, ENODEV, + RTE_TM_ERROR_TYPE_UNSPECIFIED, + NULL, "Port didn't configured\n"); + if (!priv->ppio) { return -rte_tm_error_set(error, EPERM, RTE_TM_ERROR_TYPE_UNSPECIFIED, @@ -981,6 +1041,11 @@ mrvl_node_stats_update(struct rte_eth_dev *dev, uint32_t node_id, struct mrvl_priv *priv = dev->data->dev_private; struct mrvl_tm_node *node; + if (!priv->configured) + return -rte_tm_error_set(error, ENODEV, + RTE_TM_ERROR_TYPE_UNSPECIFIED, + NULL, "Port didn't configured\n"); + node = mrvl_node_from_id(priv, node_id); if (!node) return -rte_tm_error_set(error, ENODEV, -- 2.30.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-07-26 13:53:16.492729315 +0100 +++ 0011-net-mvpp2-fix-configured-state-dependency.patch 2021-07-26 13:53:15.809291782 +0100 @@ -1 +1 @@ -From e622c1a88e3507dc6d2c9dd6ec555905d1b5baf1 Mon Sep 17 00:00:00 2001 +From 6595f06986d7e8802ece9042191a614fc2675a86 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit e622c1a88e3507dc6d2c9dd6ec555905d1b5baf1 ] + @@ -12 +13,0 @@ -Cc: stable@dpdk.org @@ -17,2 +18,2 @@ - drivers/net/mvpp2/mrvl_ethdev.c | 10 ++++- - drivers/net/mvpp2/mrvl_ethdev.h | 2 + + drivers/net/mvpp2/mrvl_ethdev.c | 12 ++++-- + drivers/net/mvpp2/mrvl_ethdev.h | 3 +- @@ -20 +21 @@ - 3 files changed, 75 insertions(+), 2 deletions(-) + 3 files changed, 76 insertions(+), 4 deletions(-) @@ -23 +24 @@ -index 63d348e279..1802695a0e 100644 +index 6cd5acd337..7133d56852 100644 @@ -26 +27 @@ -@@ -533,12 +533,18 @@ mrvl_dev_configure(struct rte_eth_dev *dev) +@@ -398,12 +398,18 @@ mrvl_dev_configure(struct rte_eth_dev *dev) @@ -35,0 +37 @@ +- &dev->data->dev_conf.rx_adv_conf.rss_conf); @@ -37 +39 @@ - &dev->data->dev_conf.rx_adv_conf.rss_conf); ++ &dev->data->dev_conf.rx_adv_conf.rss_conf); @@ -48 +50 @@ -index fda239a53c..426cf33548 100644 +index eee5182ce8..c7ab0e4932 100644 @@ -51,4 +53,4 @@ -@@ -186,6 +186,8 @@ struct mrvl_priv { - - uint8_t forward_bad_frames; - uint32_t fill_bpool_buffs; +@@ -208,9 +208,10 @@ struct mrvl_priv { + LIST_HEAD(shaper_profiles, mrvl_tm_shaper_profile) shaper_profiles; + LIST_HEAD(nodes, mrvl_tm_node) nodes; + uint64_t rate_max; @@ -59 +61,4 @@ - /** Flow operations forward declaration. */ +-/** Flow operations forward declaration. */ + extern const struct rte_flow_ops mrvl_flow_ops; + + /** Meter operations forward declaration. */