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 4FEBDA04B7; Fri, 11 Sep 2020 15:16:45 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AECFE1C117; Fri, 11 Sep 2020 15:16:09 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 1C9161C0CC; Fri, 11 Sep 2020 15:16:04 +0200 (CEST) IronPort-SDR: Mwoeqre70rQilq3/Zzteb/tj6BvwOhCeW1wOpntF4hOkup+sDP0auINxnSuNcGz+w/0UV6fJFa rNASzIidLM5g== X-IronPort-AV: E=McAfee;i="6000,8403,9740"; a="146482112" X-IronPort-AV: E=Sophos;i="5.76,415,1592895600"; d="scan'208";a="146482112" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Sep 2020 06:16:04 -0700 IronPort-SDR: CJ0phjyYGjf5I7jXSZH9/lxuWwDtE8riJGCAWLwykMhNWY6dkW/cptQWNbdXPlG6zH3zPBIm8K aiby0Ab+do6A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,415,1592895600"; d="scan'208";a="342296439" Received: from dpdk51.sh.intel.com ([10.67.111.82]) by FMSMGA003.fm.intel.com with ESMTP; 11 Sep 2020 06:16:03 -0700 From: Qi Zhang To: ferruh.yigit@intel.com Cc: dev@dpdk.org, Qi Zhang , stable@dpdk.org, Victor Raj Date: Fri, 11 Sep 2020 21:19:18 +0800 Message-Id: <20200911131954.15999-5-qi.z.zhang@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20200911131954.15999-1-qi.z.zhang@intel.com> References: <20200907112826.48493-1-qi.z.zhang@intel.com> <20200911131954.15999-1-qi.z.zhang@intel.com> Subject: [dpdk-dev] [PATCH v2 04/40] net/ice/base: fix issues around move nodes X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 1. Fixed the max children check when moving the last(8th) children. This allows the parent node to hold 8 children instead of 7. 2. Check whether the VSI is already part of the given aggregator subtree before moving it. Fixes: 29a0c11489ef ("net/ice/base: clean code") Cc: stable@dpdk.org Signed-off-by: Victor Raj Signed-off-by: Qi Zhang Acked-by: Qiming Yang --- drivers/net/ice/base/ice_sched.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/ice/base/ice_sched.c b/drivers/net/ice/base/ice_sched.c index cf9a6a777..edd90aecb 100644 --- a/drivers/net/ice/base/ice_sched.c +++ b/drivers/net/ice/base/ice_sched.c @@ -2267,7 +2267,7 @@ ice_sched_move_nodes(struct ice_port_info *pi, struct ice_sched_node *parent, return ICE_ERR_PARAM; /* Does parent have enough space */ - if (parent->num_children + num_items >= + if (parent->num_children + num_items > hw->max_children[parent->tx_sched_layer]) return ICE_ERR_AQ_FULL; @@ -2335,6 +2335,10 @@ ice_sched_move_vsi_to_agg(struct ice_port_info *pi, u16 vsi_handle, u32 agg_id, if (!vsi_node) return ICE_ERR_DOES_NOT_EXIST; + /* Is this VSI already part of given aggregator? */ + if (ice_sched_find_node_in_subtree(pi->hw, agg_node, vsi_node)) + return ICE_SUCCESS; + aggl = ice_sched_get_agg_layer(pi->hw); vsil = ice_sched_get_vsi_layer(pi->hw); -- 2.13.6