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 82E75A04B5 for ; Mon, 7 Sep 2020 13:24:43 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 569DF1C120; Mon, 7 Sep 2020 13:24:43 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id E3E4B1C0D0; Mon, 7 Sep 2020 13:24:37 +0200 (CEST) IronPort-SDR: 1Fnovo3jNppuGHwXjubQuRJ49uhE7Oe+IWAkxfgvvENISFrIlXQF+f96MJchWfL0n93b5jz+ZR E1rDTLPiIKTw== X-IronPort-AV: E=McAfee;i="6000,8403,9736"; a="157252580" X-IronPort-AV: E=Sophos;i="5.76,401,1592895600"; d="scan'208";a="157252580" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Sep 2020 04:24:37 -0700 IronPort-SDR: B3tCp+iEgCrrG5uRjrkj0wdADJTaK2K4uguRHk36XC2WZqJ/ae9UO9dMN5mVv4uq6IdBf0SEBP hMx2LR/hH+Vg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,401,1592895600"; d="scan'208";a="328058738" Received: from dpdk51.sh.intel.com ([10.67.111.82]) by fmsmga004.fm.intel.com with ESMTP; 07 Sep 2020 04:24:36 -0700 From: Qi Zhang To: qiming.yang@intel.com Cc: dev@dpdk.org, Qi Zhang , stable@dpdk.org, Victor Raj Date: Mon, 7 Sep 2020 19:27:50 +0800 Message-Id: <20200907112826.48493-5-qi.z.zhang@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20200907112826.48493-1-qi.z.zhang@intel.com> References: <20200907112826.48493-1-qi.z.zhang@intel.com> Subject: [dpdk-stable] [PATCH 04/40] net/ice/base: fix issues around move nodes 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" 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 --- 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