From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id 02EB3235 for ; Tue, 21 Nov 2017 14:28:33 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id A348120CEB; Tue, 21 Nov 2017 08:28:33 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Tue, 21 Nov 2017 08:28:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux.org; h=cc:date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=cxOfWW6H8Shb5pgT5 U47euCuRUcg8ofmiuO7TJbvLS0=; b=dn6v9lf13J1go4bqtIieGLitJtOsEHL62 9VPWDFC3f+C73GiNCw/Av4zJciwDN9zKeuouISE53BmxvxBPHlkka2mb/B4HdN6V g9LoiDqZGlP/zSSNQrflaMCJ4O8WUsJlHALvw7cJ+ZoXpJ0p51dl8LMRsS3F+F0U 3DZfnEGxVaF++wcew/thjD3j8vLy0DjjQmdPNP3GzNyg/0UaQC3DppPNA+kuN4Hn 8ZQdr7xJB1QBJh17j0wrmyec/OkOBC9nzVhWrax3rtoqZqRNFdJJcIX4DyrGJiKL adjWBQKOBvbG7qpf3lJ0CXjUK51qTCktZPwGZHQtX/qGRCqbwsfFg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=cxOfWW6H8Shb5pgT5U47euCuRUcg8ofmiuO7TJbvLS0=; b=BB5+N6Dm 6M6BF7ehR1Mae26E1KJj4UKFL4UOyA/F46dLz5oZP43PA5IJdj6WzhRlRPAx1AtB pKtqKdzd/g3LrjiVdU5EHaEWu0viy815naZMXFFJ5F6m+PmM8EaxEF+BOz34RGm+ 2UBcyS2hEEnLogN/tpyreKkuqxFLWfe1Y34ZywwUdc9269AG8Ju7aw67wWFUaa1d 0l6BvlabPAoI/Ix+UF3/oqe+PQc75X9B/mnHA5PGIlzuiuDriwK+WtAdkcohAYtt 7o/0jBefTIy0AJxWbr0OA+w+D1DngSGAXCy/zEzgggq9V3dJ9tKhMIsCzZjCX4wR 1W2OO/SZk99Eug== X-ME-Sender: Received: from localhost.localdomain (unknown [180.158.62.0]) by mail.messagingengine.com (Postfix) with ESMTPA id 5D589248B4; Tue, 21 Nov 2017 08:28:28 -0500 (EST) From: Yuanhan Liu To: Wenzhuo Lu Cc: Cristian Dumitrescu , dpdk stable Date: Tue, 21 Nov 2017 21:18:06 +0800 Message-Id: <1511270333-31002-144-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511270333-31002-1-git-send-email-yliu@fridaylinux.org> References: <1511270333-31002-1-git-send-email-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'net/ixgbe: fix not supporting NULL TM profile' has been queued to stable release 17.08.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: , X-List-Received-Date: Tue, 21 Nov 2017 13:28:34 -0000 Hi, FYI, your patch has been queued to stable release 17.08.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 11/24/17. So please shout if anyone has objections. Thanks. --yliu --- >>From c0ac57f227578fd1f2d2d68c363bf476a18da776 Mon Sep 17 00:00:00 2001 From: Wenzhuo Lu Date: Tue, 17 Oct 2017 13:50:39 +0800 Subject: [PATCH] net/ixgbe: fix not supporting NULL TM profile [ upstream commit a20a3c8c8bcea2bdad97e38494c09fa22e4f4be3 ] It's by design that APP can add a TM node without shaper profile. But ixgbe doesn't support it currently. Fixes: e0ff4d304ccf ("net/ixgbe: support adding TM node") Fixes: 5713ade69776 ("net/ixgbe: support committing TM hierarchy") Signed-off-by: Wenzhuo Lu Acked-by: Cristian Dumitrescu --- drivers/net/ixgbe/ixgbe_tm.c | 40 ++++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/drivers/net/ixgbe/ixgbe_tm.c b/drivers/net/ixgbe/ixgbe_tm.c index 5c9b24c..2b27ac1 100644 --- a/drivers/net/ixgbe/ixgbe_tm.c +++ b/drivers/net/ixgbe/ixgbe_tm.c @@ -588,7 +588,7 @@ ixgbe_node_add(struct rte_eth_dev *dev, uint32_t node_id, IXGBE_DEV_PRIVATE_TO_TM_CONF(dev->data->dev_private); enum ixgbe_tm_node_type node_type = IXGBE_TM_NODE_TYPE_MAX; enum ixgbe_tm_node_type parent_node_type = IXGBE_TM_NODE_TYPE_MAX; - struct ixgbe_tm_shaper_profile *shaper_profile; + struct ixgbe_tm_shaper_profile *shaper_profile = NULL; struct ixgbe_tm_node *tm_node; struct ixgbe_tm_node *parent_node; uint8_t nb_tcs; @@ -619,12 +619,15 @@ ixgbe_node_add(struct rte_eth_dev *dev, uint32_t node_id, } /* check the shaper profile id */ - shaper_profile = ixgbe_shaper_profile_search(dev, - params->shaper_profile_id); - if (!shaper_profile) { - error->type = RTE_TM_ERROR_TYPE_NODE_PARAMS_SHAPER_PROFILE_ID; - error->message = "shaper profile not exist"; - return -EINVAL; + if (params->shaper_profile_id != RTE_TM_SHAPER_PROFILE_ID_NONE) { + shaper_profile = ixgbe_shaper_profile_search( + dev, params->shaper_profile_id); + if (!shaper_profile) { + error->type = + RTE_TM_ERROR_TYPE_NODE_PARAMS_SHAPER_PROFILE_ID; + error->message = "shaper profile not exist"; + return -EINVAL; + } } /* root node if not have a parent */ @@ -662,7 +665,8 @@ ixgbe_node_add(struct rte_eth_dev *dev, uint32_t node_id, tm_conf->root = tm_node; /* increase the reference counter of the shaper profile */ - shaper_profile->reference_count++; + if (shaper_profile) + shaper_profile->reference_count++; return 0; } @@ -753,7 +757,8 @@ ixgbe_node_add(struct rte_eth_dev *dev, uint32_t node_id, tm_node->parent->reference_count++; /* increase the reference counter of the shaper profile */ - shaper_profile->reference_count++; + if (shaper_profile) + shaper_profile->reference_count++; return 0; } @@ -801,14 +806,16 @@ ixgbe_node_delete(struct rte_eth_dev *dev, uint32_t node_id, /* root node */ if (node_type == IXGBE_TM_NODE_TYPE_PORT) { - tm_node->shaper_profile->reference_count--; + if (tm_node->shaper_profile) + tm_node->shaper_profile->reference_count--; rte_free(tm_node); tm_conf->root = NULL; return 0; } /* TC or queue node */ - tm_node->shaper_profile->reference_count--; + if (tm_node->shaper_profile) + tm_node->shaper_profile->reference_count--; tm_node->parent->reference_count--; if (node_type == IXGBE_TM_NODE_TYPE_TC) { TAILQ_REMOVE(&tm_conf->tc_list, tm_node, node); @@ -1003,7 +1010,8 @@ ixgbe_hierarchy_commit(struct rte_eth_dev *dev, goto done; /* not support port max bandwidth yet */ - if (tm_conf->root->shaper_profile->profile.peak.rate) { + if (tm_conf->root->shaper_profile && + tm_conf->root->shaper_profile->profile.peak.rate) { error->type = RTE_TM_ERROR_TYPE_SHAPER_PROFILE; error->message = "no port max bandwidth"; goto fail_clear; @@ -1011,7 +1019,8 @@ ixgbe_hierarchy_commit(struct rte_eth_dev *dev, /* HW not support TC max bandwidth */ TAILQ_FOREACH(tm_node, &tm_conf->tc_list, node) { - if (tm_node->shaper_profile->profile.peak.rate) { + if (tm_node->shaper_profile && + tm_node->shaper_profile->profile.peak.rate) { error->type = RTE_TM_ERROR_TYPE_SHAPER_PROFILE; error->message = "no TC max bandwidth"; goto fail_clear; @@ -1020,7 +1029,10 @@ ixgbe_hierarchy_commit(struct rte_eth_dev *dev, /* queue max bandwidth */ TAILQ_FOREACH(tm_node, &tm_conf->queue_list, node) { - bw = tm_node->shaper_profile->profile.peak.rate; + if (tm_node->shaper_profile) + bw = tm_node->shaper_profile->profile.peak.rate; + else + bw = 0; if (bw) { /* interpret Bps to Mbps */ bw = bw * 8 / 1000 / 1000; -- 2.7.4