From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id BB671A0566; Mon, 17 Oct 2022 14:40:56 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8002C4021D; Mon, 17 Oct 2022 14:40:56 +0200 (CEST) Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) by mails.dpdk.org (Postfix) with ESMTP id 6CB8A4069C; Mon, 17 Oct 2022 14:40:55 +0200 (CEST) Received: by mail-qk1-f169.google.com with SMTP id j21so6472726qkk.9; Mon, 17 Oct 2022 05:40:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=WIt5Xwj6YoCVbKqqgr3YL6be96FFZIEBolVRu3CgHRE=; b=GARTNZxaq1BKD5u99XFn7HwNyiPmKPAZaz+9NqLzmJQkEkzpuIKqK8ULLXIkPnaTUn 4nxffxmBfDkeJn9DEPoIwuj3Ss20C+VdMGZXCxx3cRJZirWHqSSP2aIknSN4oMS8bQmX 1RWOkb75WHmkI7nfn00TgujhToP3vhskYm7uvooFTKKNDC5iXOCoF8t0/+jBteIve6or OW7P/RWM2sYMETnoldCLCWUdo7b1ufvd98BNSmJPFbZ/fFJqoXKFKDKHZ9G8eo3ml4yj YGi8XfUUqYcVzeJAuTWJwIsTfu5zM7j+QJ4Wy1dpZGSDGK69MMU6ymz8fGMR+f/C+5hX lT1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=WIt5Xwj6YoCVbKqqgr3YL6be96FFZIEBolVRu3CgHRE=; b=HdPattIjcYOCAacemRxSgyXTyeyM3MeYnis0I175mGxJkD2WVn+O4An2i+6qqHg+Iu 1hvDL33U1eFMu1ghZ1VQOiQL6kIosRQo8MqFBeUpCCp9wYxCbZ31AiT3QKPAc8KjmoVg eBYFpVWV+gw05bLVbGsZsHrqS8dvigPLsjCcenxCS/jQZMi0OCS4OcaXaoszp4Mko1OA SePsuheVoIghRk+udQUpJSTZquKB7+HWFWgDdtLM+psTCq7RhtiDietyJVEenXkBjyBK VbkvFLUPGsDNe0mxz5Ej+O127oH7o+tPRfiw+YIrIHksMFrL3RKkn2ATg7dsSlAOZHes W8VA== X-Gm-Message-State: ACrzQf1v+JtXV7Z7nqD7UuhSJJKOwG37l/wUAlajXmrcaT4do7WqJ5kR uIuYB8zEUOuxmaArothb59I= X-Google-Smtp-Source: AMsMyM4TrHYdmSUvA1Zh0CpwznKjVkzYqWk5rooUeeanGxGtrEN3EHwp/3ORYV7qPCsZD8jYNQpC/w== X-Received: by 2002:a05:620a:24d5:b0:6ee:d4bb:e5ba with SMTP id m21-20020a05620a24d500b006eed4bbe5bamr7486105qkn.457.1666010454818; Mon, 17 Oct 2022 05:40:54 -0700 (PDT) Received: from ?IPV6:2600:4040:225b:ea00:6063:8c9b:774a:6cf4? ([2600:4040:225b:ea00:6063:8c9b:774a:6cf4]) by smtp.googlemail.com with ESMTPSA id fu26-20020a05622a5d9a00b00359961365f1sm7659823qtb.68.2022.10.17.05.40.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 17 Oct 2022 05:40:54 -0700 (PDT) Message-ID: Date: Mon, 17 Oct 2022 08:40:53 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PATCH] net/bonding: fix descriptor limit reporting Content-Language: en-US To: Andrew Rybchenko , Chas Williams , "Min Hu (Connor)" Cc: stable@dpdk.org, Hari Kumar Vemula , Ivan Malov , dev@dpdk.org References: <20220911121901.3989343-1-ivan.malov@oktetlabs.ru> <8c5c2c63-20de-c1a5-ff06-142bfbc49c47@oktetlabs.ru> From: Chas Williams <3chas3@gmail.com> In-Reply-To: <8c5c2c63-20de-c1a5-ff06-142bfbc49c47@oktetlabs.ru> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Acked-by: Chas Williams <3chas3@gmail.com> On 10/17/22 04:40, Andrew Rybchenko wrote: > Chas, Cornor, could you review the patch, please. > > Thanks, > Andrew. > > On 9/11/22 15:19, Ivan Malov wrote: >> Commit 5be3b40fea60 ("net/bonding: fix values of descriptor limits") >> breaks reporting of "nb_min" and "nb_align" values obtained from >> back-end devices' descriptor limits. This means that work done >> by eth_bond_slave_inherit_desc_lim_first() as well as >> eth_bond_slave_inherit_desc_lim_next() gets dismissed. >> >> Revert the offending commit and use proper workaround >> for the test case mentioned in the said commit. >> >> Meanwhile, the test case itself might be poorly constructed. >> It tries to run a bond with no back-end devices attached, >> but, according to [1] ("Requirements / Limitations"), >> at least one back-end device must be attached. >> >> [1] doc/guides/prog_guide/link_bonding_poll_mode_drv_lib.rst >> >> Fixes: 5be3b40fea60 ("net/bonding: fix values of descriptor limits") >> Cc: stable@dpdk.org >> >> Signed-off-by: Ivan Malov >> Reviewed-by: Andrew Rybchenko >> --- >>   drivers/net/bonding/rte_eth_bond_pmd.c | 21 +++++++++++---------- >>   1 file changed, 11 insertions(+), 10 deletions(-) >> >> diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c >> b/drivers/net/bonding/rte_eth_bond_pmd.c >> index 3191158ca7..a5429f5e97 100644 >> --- a/drivers/net/bonding/rte_eth_bond_pmd.c >> +++ b/drivers/net/bonding/rte_eth_bond_pmd.c >> @@ -2200,8 +2200,6 @@ bond_ethdev_info(struct rte_eth_dev *dev, struct >> rte_eth_dev_info *dev_info) >>       uint16_t max_nb_rx_queues = UINT16_MAX; >>       uint16_t max_nb_tx_queues = UINT16_MAX; >> -    uint16_t max_rx_desc_lim = UINT16_MAX; >> -    uint16_t max_tx_desc_lim = UINT16_MAX; >>       dev_info->max_mac_addrs = BOND_MAX_MAC_ADDRS; >> @@ -2235,12 +2233,6 @@ bond_ethdev_info(struct rte_eth_dev *dev, >> struct rte_eth_dev_info *dev_info) >>               if (slave_info.max_tx_queues < max_nb_tx_queues) >>                   max_nb_tx_queues = slave_info.max_tx_queues; >> - >> -            if (slave_info.rx_desc_lim.nb_max < max_rx_desc_lim) >> -                max_rx_desc_lim = slave_info.rx_desc_lim.nb_max; >> - >> -            if (slave_info.tx_desc_lim.nb_max < max_tx_desc_lim) >> -                max_tx_desc_lim = slave_info.tx_desc_lim.nb_max; >>           } >>       } >> @@ -2252,8 +2244,10 @@ bond_ethdev_info(struct rte_eth_dev *dev, >> struct rte_eth_dev_info *dev_info) >>       memcpy(&dev_info->default_txconf, &internals->default_txconf, >>              sizeof(dev_info->default_txconf)); >> -    dev_info->rx_desc_lim.nb_max = max_rx_desc_lim; >> -    dev_info->tx_desc_lim.nb_max = max_tx_desc_lim; >> +    memcpy(&dev_info->rx_desc_lim, &internals->rx_desc_lim, >> +           sizeof(dev_info->rx_desc_lim)); >> +    memcpy(&dev_info->tx_desc_lim, &internals->tx_desc_lim, >> +           sizeof(dev_info->tx_desc_lim)); >>       /** >>        * If dedicated hw queues enabled for link bonding device in >> LACP mode >> @@ -3387,6 +3381,13 @@ bond_alloc(struct rte_vdev_device *dev, uint8_t >> mode) >>       memset(&internals->rx_desc_lim, 0, sizeof(internals->rx_desc_lim)); >>       memset(&internals->tx_desc_lim, 0, sizeof(internals->tx_desc_lim)); >> +    /* >> +     * Do not restrict descriptor counts until >> +     * the first back-end device gets attached. >> +     */ >> +    internals->rx_desc_lim.nb_max = UINT16_MAX; >> +    internals->tx_desc_lim.nb_max = UINT16_MAX; >> + >>       memset(internals->active_slaves, 0, >> sizeof(internals->active_slaves)); >>       memset(internals->slaves, 0, sizeof(internals->slaves)); >