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 7C70CA0527 for ; Mon, 9 Nov 2020 19:42:54 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 74E3A72E9; Mon, 9 Nov 2020 19:42:53 +0100 (CET) Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by dpdk.org (Postfix) with ESMTP id F2E3069C8 for ; Mon, 9 Nov 2020 19:42:51 +0100 (CET) Received: by mail-wr1-f43.google.com with SMTP id j7so2620556wrp.3 for ; Mon, 09 Nov 2020 10:42:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4d7yiVYWMM359fOoMBY5qC0jgvJ9gdacRudgXCg4q14=; b=E+e3g0nEBDheAStNT9PwiySqW3DUYYDCFOgt3UtzLqkhC7/gh7jHz+GeHU3DxM4HeI Ylv9rkrZp5hwyj9vr18+h5BC3HkdQS7k5NmNSYtrK1gxbPSSnYUD6wiiUhMyal4StHc7 7MD2a9aJeNtb3zlWSdNlm1161vpjeViAWNic1PTxGxsB/iqRlxCgAm9nDdqBsNyehBJq cc3XuFXIJ89xn3MIMyxaPAS1vHvSNSdr+4QgHGE00jvUipQgIDfuvcrSkiIs5lNsx8l9 7B3m1WjBcQTU8y7xca+GoYEBxDUSQAK1AbKQ4vt2HbquqSxIxDJIpWQNxyvCTivgUHbo u5jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4d7yiVYWMM359fOoMBY5qC0jgvJ9gdacRudgXCg4q14=; b=bs5JLgaJcHllAOpUea3Sr3xJKaECjAoQw9ChVudu6d3KmpzPSPSyCAxvA8WQQdE6NG i3Eg2TcLciQ6NydxK7HIALbj9Kf2HORSjR/pCv0aBo20cfw0k4OqEliwppW1IpFoQAZy uNnHXk7f2TOO/yox9hez91zoyEc6vv4AeTAoC0winuxJFjeLPD0afwI7Lv1Mj39YmXpN cfWNeZqMQcGml/c/Xb9M2YgMl2SMxcgCSNmeZMke/BFV1/XoDZgfWMKLFnMzlzVC81ci YU1OrFDCqb9ZYCPreJcopIfo3YqKtw9K8BoohFAjMKzd9zdbSqM+X737hQN9dObS19ja dfbg== X-Gm-Message-State: AOAM533ESmBR/sj0JFeKOwwNE6bM2rxefLcWzkiAHA7vEfAbtbESH0WE D7mec6KnIo1DGmrZaosXXfM= X-Google-Smtp-Source: ABdhPJy3UykRzpx1vxh39VrpFoo66Xajoeq5icwVJtt1yK03o4lALZDeB3gk3BogSyNzQVvy4j5HZQ== X-Received: by 2002:adf:eb4d:: with SMTP id u13mr18539844wrn.146.1604947370697; Mon, 09 Nov 2020 10:42:50 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id g17sm14400812wrw.37.2020.11.09.10.42.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2020 10:42:50 -0800 (PST) From: luca.boccassi@gmail.com To: Ferruh Yigit Cc: Ajit Khaparde , dpdk stable Date: Mon, 9 Nov 2020 18:40:16 +0000 Message-Id: <20201109184111.3463090-28-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201109184111.3463090-1-luca.boccassi@gmail.com> References: <20201028104606.3504127-207-luca.boccassi@gmail.com> <20201109184111.3463090-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/bnxt: fix xstats by id' has been queued to stable release 19.11.6 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" Hi, FYI, your patch has been queued to stable release 19.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/11/20. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/f9f235f69970211bff39a39f6a7753f622d34bc1 Thanks. Luca Boccassi --- >From f9f235f69970211bff39a39f6a7753f622d34bc1 Mon Sep 17 00:00:00 2001 From: Ferruh Yigit Date: Tue, 16 Jun 2020 16:36:13 +0100 Subject: [PATCH] net/bnxt: fix xstats by id [ upstream commit 0b42b92ae42953e6984622afe91c76a43b59ab69 ] The xstat by id device operation seems wrong, it fills 'xstats' struct via 'bnxt_dev_xstats_get_op()' call, but the retrieved values are not transferred to user input 'values' array. ethdev layer 'rte_eth_xstats_get_by_id()' & 'rte_eth_xstats_get_names_by_id' already provides "by id" support when device operations are missing. It is good for PMD to provide these device operations if it has a more performant way to get by id. But current implementation in PMD already does same thing with the ethdev APIs, so removing them provides same functionality. Fixes: 88920136688c ("net/bnxt: support xstats get by id") Signed-off-by: Ferruh Yigit Reviewed-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_ethdev.c | 2 - drivers/net/bnxt/bnxt_stats.c | 67 ---------------------------------- 2 files changed, 69 deletions(-) diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 1b1f130ed3..65527a0637 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -3811,8 +3811,6 @@ static const struct eth_dev_ops bnxt_dev_ops = { .txq_info_get = bnxt_txq_info_get_op, .dev_led_on = bnxt_dev_led_on_op, .dev_led_off = bnxt_dev_led_off_op, - .xstats_get_by_id = bnxt_dev_xstats_get_by_id_op, - .xstats_get_names_by_id = bnxt_dev_xstats_get_names_by_id_op, .rx_queue_count = bnxt_rx_queue_count_op, .rx_descriptor_status = bnxt_rx_descriptor_status_op, .tx_descriptor_status = bnxt_tx_descriptor_status_op, diff --git a/drivers/net/bnxt/bnxt_stats.c b/drivers/net/bnxt/bnxt_stats.c index be5b514f49..84011fc3ea 100644 --- a/drivers/net/bnxt/bnxt_stats.c +++ b/drivers/net/bnxt/bnxt_stats.c @@ -617,70 +617,3 @@ int bnxt_dev_xstats_reset_op(struct rte_eth_dev *eth_dev) return ret; } - -int bnxt_dev_xstats_get_by_id_op(struct rte_eth_dev *dev, const uint64_t *ids, - uint64_t *values, unsigned int limit) -{ - /* Account for the Tx drop pkts aka the Anti spoof counter */ - const unsigned int stat_cnt = RTE_DIM(bnxt_rx_stats_strings) + - RTE_DIM(bnxt_tx_stats_strings) + 1 + - RTE_DIM(bnxt_rx_ext_stats_strings) + - RTE_DIM(bnxt_tx_ext_stats_strings); - struct bnxt *bp = dev->data->dev_private; - struct rte_eth_xstat xstats[stat_cnt]; - uint64_t values_copy[stat_cnt]; - uint16_t i; - int rc; - - rc = is_bnxt_in_error(bp); - if (rc) - return rc; - - if (!ids) - return bnxt_dev_xstats_get_op(dev, xstats, stat_cnt); - - bnxt_dev_xstats_get_by_id_op(dev, NULL, values_copy, stat_cnt); - for (i = 0; i < limit; i++) { - if (ids[i] >= stat_cnt) { - PMD_DRV_LOG(ERR, "id value isn't valid"); - return -EINVAL; - } - values[i] = values_copy[ids[i]]; - } - return stat_cnt; -} - -int bnxt_dev_xstats_get_names_by_id_op(struct rte_eth_dev *dev, - struct rte_eth_xstat_name *xstats_names, - const uint64_t *ids, unsigned int limit) -{ - /* Account for the Tx drop pkts aka the Anti spoof counter */ - const unsigned int stat_cnt = RTE_DIM(bnxt_rx_stats_strings) + - RTE_DIM(bnxt_tx_stats_strings) + 1 + - RTE_DIM(bnxt_rx_ext_stats_strings) + - RTE_DIM(bnxt_tx_ext_stats_strings); - struct rte_eth_xstat_name xstats_names_copy[stat_cnt]; - struct bnxt *bp = dev->data->dev_private; - uint16_t i; - int rc; - - rc = is_bnxt_in_error(bp); - if (rc) - return rc; - - if (!ids) - return bnxt_dev_xstats_get_names_op(dev, xstats_names, - stat_cnt); - bnxt_dev_xstats_get_names_by_id_op(dev, xstats_names_copy, NULL, - stat_cnt); - - for (i = 0; i < limit; i++) { - if (ids[i] >= stat_cnt) { - PMD_DRV_LOG(ERR, "id value isn't valid"); - return -EINVAL; - } - strcpy(xstats_names[i].name, - xstats_names_copy[ids[i]].name); - } - return stat_cnt; -} -- 2.27.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-11-09 18:40:12.339225409 +0000 +++ 0028-net-bnxt-fix-xstats-by-id.patch 2020-11-09 18:40:11.131311282 +0000 @@ -1 +1 @@ -From 0b42b92ae42953e6984622afe91c76a43b59ab69 Mon Sep 17 00:00:00 2001 +From f9f235f69970211bff39a39f6a7753f622d34bc1 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 0b42b92ae42953e6984622afe91c76a43b59ab69 ] + @@ -19 +20,0 @@ -Cc: stable@dpdk.org @@ -25,2 +26,2 @@ - drivers/net/bnxt/bnxt_stats.c | 69 ---------------------------------- - 2 files changed, 71 deletions(-) + drivers/net/bnxt/bnxt_stats.c | 67 ---------------------------------- + 2 files changed, 69 deletions(-) @@ -29 +30 @@ -index f1350d39da..e2b66c4712 100644 +index 1b1f130ed3..65527a0637 100644 @@ -32,2 +33,2 @@ -@@ -4344,8 +4344,6 @@ static const struct eth_dev_ops bnxt_dev_ops = { - .tx_burst_mode_get = bnxt_tx_burst_mode_get, +@@ -3811,8 +3811,6 @@ static const struct eth_dev_ops bnxt_dev_ops = { + .txq_info_get = bnxt_txq_info_get_op, @@ -38,3 +39,3 @@ - .rx_queue_start = bnxt_rx_queue_start, - .rx_queue_stop = bnxt_rx_queue_stop, - .tx_queue_start = bnxt_tx_queue_start, + .rx_queue_count = bnxt_rx_queue_count_op, + .rx_descriptor_status = bnxt_rx_descriptor_status_op, + .tx_descriptor_status = bnxt_tx_descriptor_status_op, @@ -42 +43 @@ -index cb7756d54f..3c9715f5fa 100644 +index be5b514f49..84011fc3ea 100644 @@ -45 +46,2 @@ -@@ -828,75 +828,6 @@ int bnxt_dev_xstats_reset_op(struct rte_eth_dev *eth_dev) +@@ -617,70 +617,3 @@ int bnxt_dev_xstats_reset_op(struct rte_eth_dev *eth_dev) + @@ -48 +50 @@ - +- @@ -52 +54 @@ -- struct bnxt *bp = dev->data->dev_private; +- /* Account for the Tx drop pkts aka the Anti spoof counter */ @@ -54,2 +56 @@ -- RTE_DIM(bnxt_tx_stats_strings) + -- RTE_DIM(bnxt_func_stats_strings) + +- RTE_DIM(bnxt_tx_stats_strings) + 1 + @@ -57,2 +58,2 @@ -- RTE_DIM(bnxt_tx_ext_stats_strings) + -- bnxt_flow_stats_cnt(bp); +- RTE_DIM(bnxt_tx_ext_stats_strings); +- struct bnxt *bp = dev->data->dev_private; @@ -86 +87 @@ -- struct bnxt *bp = dev->data->dev_private; +- /* Account for the Tx drop pkts aka the Anti spoof counter */ @@ -88,2 +89 @@ -- RTE_DIM(bnxt_tx_stats_strings) + -- RTE_DIM(bnxt_func_stats_strings) + +- RTE_DIM(bnxt_tx_stats_strings) + 1 + @@ -91,2 +91 @@ -- RTE_DIM(bnxt_tx_ext_stats_strings) + -- bnxt_flow_stats_cnt(bp); +- RTE_DIM(bnxt_tx_ext_stats_strings); @@ -93,0 +93 @@ +- struct bnxt *bp = dev->data->dev_private; @@ -117,4 +116,0 @@ -- - /* Update the input context memory with the flow counter IDs - * of the flows that we are interested in. - * Also, update the output tables with the current local values