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 69CAF42C61 for ; Thu, 8 Jun 2023 17:41:18 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 65133410D3; Thu, 8 Jun 2023 17:41:18 +0200 (CEST) Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) by mails.dpdk.org (Postfix) with ESMTP id E769140A84 for ; Thu, 8 Jun 2023 17:41:16 +0200 (CEST) Received: by mail-pj1-f49.google.com with SMTP id 98e67ed59e1d1-25690e009c8so408947a91.0 for ; Thu, 08 Jun 2023 08:41:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1686238876; x=1688830876; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=pGZ5/J5jQzmvCxFauGqV18xxeQ97ZSjHVhB9BY5+jH8=; b=f3o3YX1PxAo9RdWkktMvW1GAxc4UODrVQMmRt0sxVH/oCQXtzG4xz9oJJaQrstRSNW 7z0QsF6gdPANOScdih/9tniw+kZ1I0qieJ5svzuTQTmY8kIcBCR+p3hhxAREVi5XjCzP XooyMRDZ/cPBaekIxFZp4Z03yFXx7xo/+vuTc6gnQ5y8cV02D1CU0IznZUueB7+kp7F7 eGfP7z3xh3MVBY/WbXu5a1qUqUh/hnFd29AbENlb7fY9rjx9MC1TIEHdGRSdgl2MJ6Al 0y6J7awQKvXSjWVjwJ7h2Ipb7+PdSclS3t/96asYhVATVlR7eKMTr2pGmSqaedTr6Ezj GZvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686238876; x=1688830876; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pGZ5/J5jQzmvCxFauGqV18xxeQ97ZSjHVhB9BY5+jH8=; b=MGPljSWJKpzS+6BIbAWfDs6Pyesh3ahaSvQ5AR/dVquOHiNGNtSfbfFSskx7o5KUWY mlgVTDjxz85BlannBFuNmeR8v+F1E6xq0AvQMPLAF0Z0QvSxBxAwL7imBnR7/rKrF4Os ULiDT3p0irHik/61VVgdVM4iHf6xua+YyrOm1XiQVoDL80Hus6VQdZdYIfgf875bMFFx XEJmA4gfFJQYMcTnpT9k2h6eOyMZApnLa4jdyRkSopacTM2C/bGdg9eAzjI8yz1O14c1 wJoZwFtvaJ8NE1q5ZJ/bij6ccKJH8bOx2LGpvsQXtEvIQh12js1tU3f0jyGQtarYKJYn 3zAA== X-Gm-Message-State: AC+VfDyHaAtsl1ZNHZUWjv5xZZ3W60ZSjBFTcBIQYV2cNrcvf1/G2Wv0 9fGVa9cwYw07V/U80CZ9M18txw== X-Google-Smtp-Source: ACHHUZ5Isr0EqSAgKf7G4oqa5zKVTTQnAX6spkw/MDTPg5Hw/JqhNezb8itv4Ibj4X2c7nMiZzDPNQ== X-Received: by 2002:a17:90a:c503:b0:259:cd69:39e6 with SMTP id k3-20020a17090ac50300b00259cd6939e6mr2766366pjt.23.1686238875691; Thu, 08 Jun 2023 08:41:15 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id bg1-20020a17090b0d8100b0024752ff8061sm1466036pjb.12.2023.06.08.08.41.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jun 2023 08:41:15 -0700 (PDT) Date: Thu, 8 Jun 2023 08:41:13 -0700 From: Stephen Hemminger To: Kaiwen Deng Cc: dev@dpdk.org, stable@dpdk.org, qiming.yang@intel.com, yidingx.zhou@intel.com, Chas Williams , "Min Hu (Connor)" , Declan Doherty , Daniel Mrzyglod Subject: Re: [PATCH] net/bonding: fix iavf bond device query stats Message-ID: <20230608084113.06e6594f@hermes.local> In-Reply-To: <20230608072636.426803-1-kaiwenx.deng@intel.com> References: <20230608072636.426803-1-kaiwenx.deng@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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 On Thu, 8 Jun 2023 15:26:36 +0800 Kaiwen Deng wrote: > If the rte_eth_stats_get function does not work properly, > the update function of the slave device does not work > properly When device is bonded as BONDING_MODE_TLB mode. > > This commit adds handling for functions that do not get > stats properly. > > Fixes: 7c76a747e68c ("bond: add mode 5") > Cc: stable@dpdk.org > > Signed-off-by: Kaiwen Deng > --- > drivers/net/bonding/rte_eth_bond_pmd.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c > index f0c4f7d26b..edce621496 100644 > --- a/drivers/net/bonding/rte_eth_bond_pmd.c > +++ b/drivers/net/bonding/rte_eth_bond_pmd.c > @@ -894,6 +894,7 @@ bond_ethdev_update_tlb_slave_cb(void *arg) > uint8_t update_stats = 0; > uint16_t slave_id; > uint16_t i; > + int ret; > > internals->slave_update_idx++; > > @@ -903,7 +904,10 @@ bond_ethdev_update_tlb_slave_cb(void *arg) > > for (i = 0; i < internals->active_slave_count; i++) { > slave_id = internals->active_slaves[i]; > - rte_eth_stats_get(slave_id, &slave_stats); > + ret = rte_eth_stats_get(slave_id, &slave_stats); > + if (ret) > + goto OUT; > + > tx_bytes = slave_stats.obytes - tlb_last_obytets[slave_id]; > bandwidth_left(slave_id, tx_bytes, > internals->slave_update_idx, &bwg_array[i]); > @@ -922,6 +926,7 @@ bond_ethdev_update_tlb_slave_cb(void *arg) > for (i = 0; i < slave_count; i++) > internals->tlb_slaves_order[i] = bwg_array[i].slave; > > +OUT: > rte_eal_alarm_set(REORDER_PERIOD_MS * 1000, bond_ethdev_update_tlb_slave_cb, > (struct bond_dev_private *)internals); > } Why is stats get failing on a device, looks like the real bug is there? Better to fix the buggy driver. Other usages might already be affected. Silently ignoring the error without logging is also not good. Lastly, DPDK coding style is to use lower case for goto labels.