From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <3chas3@gmail.com> Received: from mail-qk1-f193.google.com (mail-qk1-f193.google.com [209.85.222.193]) by dpdk.org (Postfix) with ESMTP id 48247137D; Sun, 24 Mar 2019 14:28:51 +0100 (CET) Received: by mail-qk1-f193.google.com with SMTP id n68so3852133qka.1; Sun, 24 Mar 2019 06:28:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=0Ys0pnKnU23iq8dBr4rjjOtnHVR6KyCWR5ZdOkX9sDI=; b=EAkcAotLtOOe/kKZ+mQ3v0Q5rq22BAY5yd2nHViJzFbeET5zyRIyGm84pvVp4rSop/ 8WPYXxj9Cf1gH41nUZxy1SVJbaaVRinNZdyCCCgGLhzmZzJcoqFgWKv3/0BYEp103cJk c/5gxX0zoX+nOkN5+gKD6rDRvZDmfbuGuvCkMaP/qlT7IU76d+zKnlCKjqvOA4hb1AQO fb5+YmJPIMAM/RnaWC4VIpzTq7a6LUozZKvIUP4FNRUT2F0zkmjl+8Qew9LCCa8Ji38n t6Nd8KT5lhE05eXoM564B3xhclOJTzFNcnxQouqV6NH3R3z6ReM0wvkHOyjj+jWNt9Uc sdxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=0Ys0pnKnU23iq8dBr4rjjOtnHVR6KyCWR5ZdOkX9sDI=; b=r9FLgj4LAv6RIi4dBAVb/ZasAG9/ETIL2U0HGpeyrSFOFEu/+Q6um+KT4ef9EUO2aV WWFkPc4PA75D556u/PPcV6p8RFKMjvqhiV8pgg5NnPoYv1KbyRBxnSch6MyCuMCp+2lb gizoFU7SXIDUdmESF34SItHkwdQKLgiIFvnBNNcSl/vJACATUy6an3opJiE/P8IDJUlh 4j1ovXHpLXSr5pCGLgtYvOzmuqAvM92CgHqiXKTeh7mBWUt1NypO15YR12YHWuPkXMgs XuHSEIkmZ1/1pTZQDvE6qEef/1e1eYiqPC84DD4QLG/AGG0Mk/etBVGR4AjCO2DQSCkZ 45Zg== X-Gm-Message-State: APjAAAXg5lGRu/T9NOBg/OakAB4WR5pvtIHa+RZS07ZfbEbQ9wgXk8EQ Mj0ec896FDhvh+jaywXJJM35Gajq X-Google-Smtp-Source: APXvYqxfSYD4S+sLuaF4fLXP4iFyMgsNYxVOwmuxv5mATZuuIKtfqsORxjEJw9ynCNEcPlDzeb/Xpw== X-Received: by 2002:a05:620a:1424:: with SMTP id k4mr15058393qkj.17.1553434130536; Sun, 24 Mar 2019 06:28:50 -0700 (PDT) Received: from [192.168.1.10] (pool-96-255-82-34.washdc.fios.verizon.net. [96.255.82.34]) by smtp.gmail.com with ESMTPSA id o188sm8161119qkd.30.2019.03.24.06.28.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 24 Mar 2019 06:28:49 -0700 (PDT) To: David Marchand , dev@dpdk.org Cc: ferruh.yigit@intel.com, chas3@att.com, zhaohui8@huawei.com, stable@dpdk.org References: <1553200094-5487-1-git-send-email-david.marchand@redhat.com> From: Chas Williams <3chas3@gmail.com> Message-ID: <8001e759-dfc7-28f7-3a14-80d6af8943a5@gmail.com> Date: Sun, 24 Mar 2019 09:28:48 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <1553200094-5487-1-git-send-email-david.marchand@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH 1/2] net/bonding: fix more incorrect slave id types 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: , X-List-Received-Date: Sun, 24 Mar 2019 13:28:51 -0000 See inline. On 3/21/19 4:28 PM, David Marchand wrote: > From: Zhaohui > > mode_bond_id and mode_band_id are slave ids, stored on 16bits. Please change mode_bond_id to mode_count_id in this commit message. Otherwise, this looks fine. > Fixes: f8244c6399d9 ("ethdev: increase port id range") > Cc: stable@dpdk.org > > Signed-off-by: Zhaohui > Signed-off-by: David Marchand > --- > drivers/net/bonding/rte_eth_bond_8023ad.c | 11 +++++------ > 1 file changed, 5 insertions(+), 6 deletions(-) > > diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c > index 1e6a3fc..3943ec1 100644 > --- a/drivers/net/bonding/rte_eth_bond_8023ad.c > +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c > @@ -638,7 +638,7 @@ > SM_FLAG_CLR(port, NTT); > } > > -static uint8_t > +static uint16_t > max_index(uint64_t *a, int n) > { > if (n <= 0) > @@ -672,7 +672,8 @@ > uint64_t agg_bandwidth[8] = {0}; > uint64_t agg_count[8] = {0}; > uint16_t default_slave = 0; > - uint8_t mode_count_id, mode_band_id; > + uint16_t mode_count_id; > + uint16_t mode_band_id; > struct rte_eth_link link_info; > > slaves = internals->active_slaves; > @@ -708,13 +709,11 @@ > > switch (internals->mode4.agg_selection) { > case AGG_COUNT: > - mode_count_id = max_index( > - (uint64_t *)agg_count, slaves_count); > + mode_count_id = max_index(agg_count, slaves_count); > new_agg_id = mode_count_id; > break; > case AGG_BANDWIDTH: > - mode_band_id = max_index( > - (uint64_t *)agg_bandwidth, slaves_count); > + mode_band_id = max_index(agg_bandwidth, slaves_count); > new_agg_id = mode_band_id; > break; > case AGG_STABLE: > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 25127A05D3 for ; Sun, 24 Mar 2019 14:28:54 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AD5C825D9; Sun, 24 Mar 2019 14:28:52 +0100 (CET) Received: from mail-qk1-f193.google.com (mail-qk1-f193.google.com [209.85.222.193]) by dpdk.org (Postfix) with ESMTP id 48247137D; Sun, 24 Mar 2019 14:28:51 +0100 (CET) Received: by mail-qk1-f193.google.com with SMTP id n68so3852133qka.1; Sun, 24 Mar 2019 06:28:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=0Ys0pnKnU23iq8dBr4rjjOtnHVR6KyCWR5ZdOkX9sDI=; b=EAkcAotLtOOe/kKZ+mQ3v0Q5rq22BAY5yd2nHViJzFbeET5zyRIyGm84pvVp4rSop/ 8WPYXxj9Cf1gH41nUZxy1SVJbaaVRinNZdyCCCgGLhzmZzJcoqFgWKv3/0BYEp103cJk c/5gxX0zoX+nOkN5+gKD6rDRvZDmfbuGuvCkMaP/qlT7IU76d+zKnlCKjqvOA4hb1AQO fb5+YmJPIMAM/RnaWC4VIpzTq7a6LUozZKvIUP4FNRUT2F0zkmjl+8Qew9LCCa8Ji38n t6Nd8KT5lhE05eXoM564B3xhclOJTzFNcnxQouqV6NH3R3z6ReM0wvkHOyjj+jWNt9Uc sdxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=0Ys0pnKnU23iq8dBr4rjjOtnHVR6KyCWR5ZdOkX9sDI=; b=r9FLgj4LAv6RIi4dBAVb/ZasAG9/ETIL2U0HGpeyrSFOFEu/+Q6um+KT4ef9EUO2aV WWFkPc4PA75D556u/PPcV6p8RFKMjvqhiV8pgg5NnPoYv1KbyRBxnSch6MyCuMCp+2lb gizoFU7SXIDUdmESF34SItHkwdQKLgiIFvnBNNcSl/vJACATUy6an3opJiE/P8IDJUlh 4j1ovXHpLXSr5pCGLgtYvOzmuqAvM92CgHqiXKTeh7mBWUt1NypO15YR12YHWuPkXMgs XuHSEIkmZ1/1pTZQDvE6qEef/1e1eYiqPC84DD4QLG/AGG0Mk/etBVGR4AjCO2DQSCkZ 45Zg== X-Gm-Message-State: APjAAAXg5lGRu/T9NOBg/OakAB4WR5pvtIHa+RZS07ZfbEbQ9wgXk8EQ Mj0ec896FDhvh+jaywXJJM35Gajq X-Google-Smtp-Source: APXvYqxfSYD4S+sLuaF4fLXP4iFyMgsNYxVOwmuxv5mATZuuIKtfqsORxjEJw9ynCNEcPlDzeb/Xpw== X-Received: by 2002:a05:620a:1424:: with SMTP id k4mr15058393qkj.17.1553434130536; Sun, 24 Mar 2019 06:28:50 -0700 (PDT) Received: from [192.168.1.10] (pool-96-255-82-34.washdc.fios.verizon.net. [96.255.82.34]) by smtp.gmail.com with ESMTPSA id o188sm8161119qkd.30.2019.03.24.06.28.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 24 Mar 2019 06:28:49 -0700 (PDT) To: David Marchand , dev@dpdk.org Cc: ferruh.yigit@intel.com, chas3@att.com, zhaohui8@huawei.com, stable@dpdk.org References: <1553200094-5487-1-git-send-email-david.marchand@redhat.com> From: Chas Williams <3chas3@gmail.com> Message-ID: <8001e759-dfc7-28f7-3a14-80d6af8943a5@gmail.com> Date: Sun, 24 Mar 2019 09:28:48 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <1553200094-5487-1-git-send-email-david.marchand@redhat.com> Content-Type: text/plain; charset="UTF-8"; format="flowed" Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH 1/2] net/bonding: fix more incorrect slave id types 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" Message-ID: <20190324132848.6sl7AMBYq7mGYH3ZSieMcfJsEiqvIsmoVhIc1c7YdFE@z> See inline. On 3/21/19 4:28 PM, David Marchand wrote: > From: Zhaohui > > mode_bond_id and mode_band_id are slave ids, stored on 16bits. Please change mode_bond_id to mode_count_id in this commit message. Otherwise, this looks fine. > Fixes: f8244c6399d9 ("ethdev: increase port id range") > Cc: stable@dpdk.org > > Signed-off-by: Zhaohui > Signed-off-by: David Marchand > --- > drivers/net/bonding/rte_eth_bond_8023ad.c | 11 +++++------ > 1 file changed, 5 insertions(+), 6 deletions(-) > > diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c > index 1e6a3fc..3943ec1 100644 > --- a/drivers/net/bonding/rte_eth_bond_8023ad.c > +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c > @@ -638,7 +638,7 @@ > SM_FLAG_CLR(port, NTT); > } > > -static uint8_t > +static uint16_t > max_index(uint64_t *a, int n) > { > if (n <= 0) > @@ -672,7 +672,8 @@ > uint64_t agg_bandwidth[8] = {0}; > uint64_t agg_count[8] = {0}; > uint16_t default_slave = 0; > - uint8_t mode_count_id, mode_band_id; > + uint16_t mode_count_id; > + uint16_t mode_band_id; > struct rte_eth_link link_info; > > slaves = internals->active_slaves; > @@ -708,13 +709,11 @@ > > switch (internals->mode4.agg_selection) { > case AGG_COUNT: > - mode_count_id = max_index( > - (uint64_t *)agg_count, slaves_count); > + mode_count_id = max_index(agg_count, slaves_count); > new_agg_id = mode_count_id; > break; > case AGG_BANDWIDTH: > - mode_band_id = max_index( > - (uint64_t *)agg_bandwidth, slaves_count); > + mode_band_id = max_index(agg_bandwidth, slaves_count); > new_agg_id = mode_band_id; > break; > case AGG_STABLE: >