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 C2B14A3160 for ; Fri, 11 Oct 2019 17:38:35 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9EE551EB36; Fri, 11 Oct 2019 17:38:34 +0200 (CEST) Received: from mail-qt1-f194.google.com (mail-qt1-f194.google.com [209.85.160.194]) by dpdk.org (Postfix) with ESMTP id 25EEF1C2A5 for ; Fri, 11 Oct 2019 17:38:33 +0200 (CEST) Received: by mail-qt1-f194.google.com with SMTP id u40so14416293qth.11 for ; Fri, 11 Oct 2019 08:38:33 -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=vUegAtCdwMVeeWx1OViNziPQFBGbOJnjzNaxi6w32ss=; b=WuYOaSMHckmV5weDlzFnI2SWe6zUtPPtDVqyayYNcq5/WjzckZ0qB/cwIKn1gduyAg 6xIBSRiwvQQ8QVY6k7hJGK91b71DYHTUJJpP/TTvbYqKOvz1OXq2oze5eQw/OV99Oth5 OR9AQigFeII/nLYyq4fipdjb6yLKF5FkrkIlYaBWeU+7xhOYayWVPRvFCxsXp8of7eSS NuTpYX/5pNglBnyX2UCKzYL/fhmP62eWCPjpyg3a0zUDCW+hABx8kbMc8kEzvOyMiKOe qiWhXcFFBb+3YejdCDvQvNt8g5yQvoFLphxlUEejG8gOpaWs5q8mceyNFi97J84heYwF fqUg== 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=vUegAtCdwMVeeWx1OViNziPQFBGbOJnjzNaxi6w32ss=; b=PZqI4XPYwGE5Fl3rm9fR08rx8TXolqmqsq8I5ydZcwFJ84vXklFbqwewsZ+FOXR56Z DNoh+qCxXQoQG0Y5s5lAZX+pX5U1qsuGLSM24+aJGSYTNfQeRnSoDa+F2wlWw5VWvnxI t1ZZzrhhoyYUD2JnFmUT4YM5pybmzJw9zungLDj0Tfay1IzHINxUPunIjzQ6Qku4o+54 UKzBQEAwLKdNeLN6IAfAIl+SeBivTEMQvJoCl6adXmzGJ6di26m/ZetgM6vw8iopErxr 5m995+o/F3icQfouwC5QbDgB6FCnr0Lp1d6JaO9xpDFneGkWxMyiFQe7w1OxraQjYR7k oHKw== X-Gm-Message-State: APjAAAV9vyPCBlz4WZ+tZ+639ZEy11Jm5bem3pHOMiKwsYlDP5nHbYW4 knQde2eCTKU85xaQisPr2Wo= X-Google-Smtp-Source: APXvYqxNGJ/XEpGfqXvCwykoWjvnEc0THrfBoPnxPymmNq0wV9zeVSFRp63czxInFFS5qid0zRS9Ww== X-Received: by 2002:aed:230a:: with SMTP id h10mr17215897qtc.84.1570808312414; Fri, 11 Oct 2019 08:38:32 -0700 (PDT) Received: from [192.168.1.10] (pool-96-255-60-31.washdc.fios.verizon.net. [96.255.60.31]) by smtp.gmail.com with ESMTPSA id 199sm4365699qkk.112.2019.10.11.08.38.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 11 Oct 2019 08:38:31 -0700 (PDT) To: kkanas@marvell.com, dev@dpdk.org, david.marchand@redhat.com, ferruh.yigit@linux.intel.com, Chas Williams Cc: danielx.t.mrzyglod@intel.com References: <20191011063456.19637-1-kkanas@marvell.com> From: Chas Williams <3chas3@gmail.com> Message-ID: <2320f934-d755-13e0-3b61-9117913e7bd0@gmail.com> Date: Fri, 11 Oct 2019 11:38:30 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20191011063456.19637-1-kkanas@marvell.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v3] net/bonding: fix selection logic 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" This looks better. While reviewing this I noticed that a few lines: case AGG_STABLE: if (default_slave == slaves_count) new_agg_id = slave_id; <<<<<<<<<<<<<<<<< else new_agg_id = slaves[default_slave]; break; default: if (default_slave == slaves_count) new_agg_id = slave_id; <<<<<<<<<<<<< else new_agg_id = slaves[default_slave]; break; } I don't think the new_agg_id should be the slave_id directly but rather slaves[slave_id]. Would you mind fixing that as well here if that is the case? On 10/11/19 2:34 AM, kkanas@marvell.com wrote: > From: Krzysztof Kanas > > Arrays agg_count and agg_bandwidth should be indexed by slave_id not by > aggregator port_id. > > Fixes: 6d72657ce379 ("net/bonding: add other aggregator modes") > Cc: danielx.t.mrzyglod@intel.com > > Signed-off-by: Krzysztof Kanas > --- > v3: > * fix incorrect reabse > v2: > * rebase patch to latest master > > drivers/net/bonding/rte_eth_bond_8023ad.c | 15 +++++++-------- > 1 file changed, 7 insertions(+), 8 deletions(-) > -- > > diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c > index 7d8da2b318f5..698311e15c31 100644 > --- a/drivers/net/bonding/rte_eth_bond_8023ad.c > +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c > @@ -673,9 +673,8 @@ selection_logic(struct bond_dev_private *internals, uint16_t slave_id) > uint64_t agg_bandwidth[RTE_MAX_ETHPORTS] = {0}; > uint64_t agg_count[RTE_MAX_ETHPORTS] = {0}; > uint16_t default_slave = 0; > - uint16_t mode_count_id; > - uint16_t mode_band_id; > struct rte_eth_link link_info; > + uint16_t agg_new_idx = 0; > int ret; > > slaves = internals->active_slaves; > @@ -696,8 +695,8 @@ selection_logic(struct bond_dev_private *internals, uint16_t slave_id) > slaves[i], rte_strerror(-ret)); > continue; > } > - agg_count[agg->aggregator_port_id] += 1; > - agg_bandwidth[agg->aggregator_port_id] += link_info.link_speed; > + agg_count[i] += 1; > + agg_bandwidth[i] += link_info.link_speed; > > /* Actors system ID is not checked since all slave device have the same > * ID (MAC address). */ > @@ -718,12 +717,12 @@ selection_logic(struct bond_dev_private *internals, uint16_t slave_id) > > switch (internals->mode4.agg_selection) { > case AGG_COUNT: > - mode_count_id = max_index(agg_count, slaves_count); > - new_agg_id = mode_count_id; > + agg_new_idx = max_index(agg_count, slaves_count); > + new_agg_id = slaves[agg_new_idx]; > break; > case AGG_BANDWIDTH: > - mode_band_id = max_index(agg_bandwidth, slaves_count); > - new_agg_id = mode_band_id; > + agg_new_idx = max_index(agg_bandwidth, slaves_count); > + new_agg_id = slaves[agg_new_idx]; > break; > case AGG_STABLE: > if (default_slave == slaves_count) >