* [PATCH net-next v2 0/3] net/mlx4_en: Use ethtool_puts/sprintf
@ 2024-06-17 17:23 Kamal Heib
2024-06-17 17:23 ` [PATCH net-next v2 1/3] net/mlx4_en: Use ethtool_puts to fill priv flags strings Kamal Heib
2024-06-19 1:30 ` [PATCH net-next v2 0/3] net/mlx4_en: Use ethtool_puts/sprintf patchwork-bot+netdevbpf
0 siblings, 2 replies; 8+ messages in thread
From: Kamal Heib @ 2024-06-17 17:23 UTC (permalink / raw)
To: netdev
Cc: Tariq Toukan, David S . Miller, Jakub Kicinski, Paolo Abeni,
Kamal Heib
This patchset updates the mlx4_en driver to use the ethtool_puts and
ethtool_sprintf helper functions.
Changes from v1:
- Remove unused variable.
Signed-off-by: Kamal Heib <kheib@redhat.com>
Kamal Heib (3):
net/mlx4_en: Use ethtool_puts to fill priv flags strings
net/mlx4_en: Use ethtool_puts to fill selftest strings
net/mlx4_en: Use ethtool_puts/sprintf to fill stats strings
.../net/ethernet/mellanox/mlx4/en_ethtool.c | 59 +++++++------------
1 file changed, 20 insertions(+), 39 deletions(-)
--
2.45.2
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH net-next v2 1/3] net/mlx4_en: Use ethtool_puts to fill priv flags strings
2024-06-17 17:23 [PATCH net-next v2 0/3] net/mlx4_en: Use ethtool_puts/sprintf Kamal Heib
@ 2024-06-17 17:23 ` Kamal Heib
2024-06-17 17:23 ` [PATCH net-next v2 2/3] net/mlx4_en: Use ethtool_puts to fill selftest strings Kamal Heib
2024-06-18 18:02 ` [PATCH net-next v2 1/3] net/mlx4_en: Use ethtool_puts to fill priv flags strings Simon Horman
2024-06-19 1:30 ` [PATCH net-next v2 0/3] net/mlx4_en: Use ethtool_puts/sprintf patchwork-bot+netdevbpf
1 sibling, 2 replies; 8+ messages in thread
From: Kamal Heib @ 2024-06-17 17:23 UTC (permalink / raw)
To: netdev
Cc: Tariq Toukan, David S . Miller, Jakub Kicinski, Paolo Abeni,
Kamal Heib
Use the ethtool_puts helper to print the priv flags strings into the
ethtool strings interface.
Signed-off-by: Kamal Heib <kheib@redhat.com>
---
drivers/net/ethernet/mellanox/mlx4/en_ethtool.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
index 619e1c3ef7f9..50a4a017a3f4 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
@@ -536,8 +536,7 @@ static void mlx4_en_get_strings(struct net_device *dev,
break;
case ETH_SS_PRIV_FLAGS:
for (i = 0; i < ARRAY_SIZE(mlx4_en_priv_flags); i++)
- strcpy(data + i * ETH_GSTRING_LEN,
- mlx4_en_priv_flags[i]);
+ ethtool_puts(&data, mlx4_en_priv_flags[i]);
break;
}
--
2.45.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH net-next v2 2/3] net/mlx4_en: Use ethtool_puts to fill selftest strings
2024-06-17 17:23 ` [PATCH net-next v2 1/3] net/mlx4_en: Use ethtool_puts to fill priv flags strings Kamal Heib
@ 2024-06-17 17:23 ` Kamal Heib
2024-06-17 17:23 ` [PATCH net-next v2 3/3] net/mlx4_en: Use ethtool_puts/sprintf to fill stats strings Kamal Heib
2024-06-18 18:02 ` [PATCH net-next v2 2/3] net/mlx4_en: Use ethtool_puts to fill selftest strings Simon Horman
2024-06-18 18:02 ` [PATCH net-next v2 1/3] net/mlx4_en: Use ethtool_puts to fill priv flags strings Simon Horman
1 sibling, 2 replies; 8+ messages in thread
From: Kamal Heib @ 2024-06-17 17:23 UTC (permalink / raw)
To: netdev
Cc: Tariq Toukan, David S . Miller, Jakub Kicinski, Paolo Abeni,
Kamal Heib
Use the ethtool_puts helper to print the selftest strings into the
ethtool strings interface.
Signed-off-by: Kamal Heib <kheib@redhat.com>
---
drivers/net/ethernet/mellanox/mlx4/en_ethtool.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
index 50a4a017a3f4..fee02a94ed2f 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
@@ -459,10 +459,10 @@ static void mlx4_en_get_strings(struct net_device *dev,
switch (stringset) {
case ETH_SS_TEST:
for (i = 0; i < MLX4_EN_NUM_SELF_TEST - 2; i++)
- strcpy(data + i * ETH_GSTRING_LEN, mlx4_en_test_names[i]);
+ ethtool_puts(&data, mlx4_en_test_names[i]);
if (priv->mdev->dev->caps.flags & MLX4_DEV_CAP_FLAG_UC_LOOPBACK)
for (; i < MLX4_EN_NUM_SELF_TEST; i++)
- strcpy(data + i * ETH_GSTRING_LEN, mlx4_en_test_names[i]);
+ ethtool_puts(&data, mlx4_en_test_names[i]);
break;
case ETH_SS_STATS:
--
2.45.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH net-next v2 3/3] net/mlx4_en: Use ethtool_puts/sprintf to fill stats strings
2024-06-17 17:23 ` [PATCH net-next v2 2/3] net/mlx4_en: Use ethtool_puts to fill selftest strings Kamal Heib
@ 2024-06-17 17:23 ` Kamal Heib
2024-06-18 18:03 ` Simon Horman
2024-06-18 18:02 ` [PATCH net-next v2 2/3] net/mlx4_en: Use ethtool_puts to fill selftest strings Simon Horman
1 sibling, 1 reply; 8+ messages in thread
From: Kamal Heib @ 2024-06-17 17:23 UTC (permalink / raw)
To: netdev
Cc: Tariq Toukan, David S . Miller, Jakub Kicinski, Paolo Abeni,
Kamal Heib
Use the ethtool_puts/ethtool_sprintf helper to print the stats strings
into the ethtool strings interface.
Signed-off-by: Kamal Heib <kheib@redhat.com>
---
.../net/ethernet/mellanox/mlx4/en_ethtool.c | 52 ++++++-------------
1 file changed, 17 insertions(+), 35 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
index fee02a94ed2f..0606f18e5bbe 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
@@ -450,7 +450,6 @@ static void mlx4_en_get_strings(struct net_device *dev,
uint32_t stringset, uint8_t *data)
{
struct mlx4_en_priv *priv = netdev_priv(dev);
- int index = 0;
int i, strings = 0;
struct bitmap_iterator it;
@@ -470,68 +469,51 @@ static void mlx4_en_get_strings(struct net_device *dev,
for (i = 0; i < NUM_MAIN_STATS; i++, strings++,
bitmap_iterator_inc(&it))
if (bitmap_iterator_test(&it))
- strcpy(data + (index++) * ETH_GSTRING_LEN,
- main_strings[strings]);
+ ethtool_puts(&data, main_strings[strings]);
for (i = 0; i < NUM_PORT_STATS; i++, strings++,
bitmap_iterator_inc(&it))
if (bitmap_iterator_test(&it))
- strcpy(data + (index++) * ETH_GSTRING_LEN,
- main_strings[strings]);
+ ethtool_puts(&data, main_strings[strings]);
for (i = 0; i < NUM_PF_STATS; i++, strings++,
bitmap_iterator_inc(&it))
if (bitmap_iterator_test(&it))
- strcpy(data + (index++) * ETH_GSTRING_LEN,
- main_strings[strings]);
+ ethtool_puts(&data, main_strings[strings]);
for (i = 0; i < NUM_FLOW_STATS; i++, strings++,
bitmap_iterator_inc(&it))
if (bitmap_iterator_test(&it))
- strcpy(data + (index++) * ETH_GSTRING_LEN,
- main_strings[strings]);
+ ethtool_puts(&data, main_strings[strings]);
for (i = 0; i < NUM_PKT_STATS; i++, strings++,
bitmap_iterator_inc(&it))
if (bitmap_iterator_test(&it))
- strcpy(data + (index++) * ETH_GSTRING_LEN,
- main_strings[strings]);
+ ethtool_puts(&data, main_strings[strings]);
for (i = 0; i < NUM_XDP_STATS; i++, strings++,
bitmap_iterator_inc(&it))
if (bitmap_iterator_test(&it))
- strcpy(data + (index++) * ETH_GSTRING_LEN,
- main_strings[strings]);
+ ethtool_puts(&data, main_strings[strings]);
for (i = 0; i < NUM_PHY_STATS; i++, strings++,
bitmap_iterator_inc(&it))
if (bitmap_iterator_test(&it))
- strcpy(data + (index++) * ETH_GSTRING_LEN,
- main_strings[strings]);
+ ethtool_puts(&data, main_strings[strings]);
for (i = 0; i < priv->tx_ring_num[TX]; i++) {
- sprintf(data + (index++) * ETH_GSTRING_LEN,
- "tx%d_packets", i);
- sprintf(data + (index++) * ETH_GSTRING_LEN,
- "tx%d_bytes", i);
+ ethtool_sprintf(&data, "tx%d_packets", i);
+ ethtool_sprintf(&data, "tx%d_bytes", i);
}
for (i = 0; i < priv->rx_ring_num; i++) {
- sprintf(data + (index++) * ETH_GSTRING_LEN,
- "rx%d_packets", i);
- sprintf(data + (index++) * ETH_GSTRING_LEN,
- "rx%d_bytes", i);
- sprintf(data + (index++) * ETH_GSTRING_LEN,
- "rx%d_dropped", i);
- sprintf(data + (index++) * ETH_GSTRING_LEN,
- "rx%d_xdp_drop", i);
- sprintf(data + (index++) * ETH_GSTRING_LEN,
- "rx%d_xdp_redirect", i);
- sprintf(data + (index++) * ETH_GSTRING_LEN,
- "rx%d_xdp_redirect_fail", i);
- sprintf(data + (index++) * ETH_GSTRING_LEN,
- "rx%d_xdp_tx", i);
- sprintf(data + (index++) * ETH_GSTRING_LEN,
- "rx%d_xdp_tx_full", i);
+ ethtool_sprintf(&data, "rx%d_packets", i);
+ ethtool_sprintf(&data, "rx%d_bytes", i);
+ ethtool_sprintf(&data, "rx%d_dropped", i);
+ ethtool_sprintf(&data, "rx%d_xdp_drop", i);
+ ethtool_sprintf(&data, "rx%d_xdp_redirect", i);
+ ethtool_sprintf(&data, "rx%d_xdp_redirect_fail", i);
+ ethtool_sprintf(&data, "rx%d_xdp_tx", i);
+ ethtool_sprintf(&data, "rx%d_xdp_tx_full", i);
}
break;
case ETH_SS_PRIV_FLAGS:
--
2.45.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH net-next v2 1/3] net/mlx4_en: Use ethtool_puts to fill priv flags strings
2024-06-17 17:23 ` [PATCH net-next v2 1/3] net/mlx4_en: Use ethtool_puts to fill priv flags strings Kamal Heib
2024-06-17 17:23 ` [PATCH net-next v2 2/3] net/mlx4_en: Use ethtool_puts to fill selftest strings Kamal Heib
@ 2024-06-18 18:02 ` Simon Horman
1 sibling, 0 replies; 8+ messages in thread
From: Simon Horman @ 2024-06-18 18:02 UTC (permalink / raw)
To: Kamal Heib
Cc: netdev, Tariq Toukan, David S . Miller, Jakub Kicinski,
Paolo Abeni
On Mon, Jun 17, 2024 at 01:23:27PM -0400, Kamal Heib wrote:
> Use the ethtool_puts helper to print the priv flags strings into the
> ethtool strings interface.
>
> Signed-off-by: Kamal Heib <kheib@redhat.com>
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net-next v2 2/3] net/mlx4_en: Use ethtool_puts to fill selftest strings
2024-06-17 17:23 ` [PATCH net-next v2 2/3] net/mlx4_en: Use ethtool_puts to fill selftest strings Kamal Heib
2024-06-17 17:23 ` [PATCH net-next v2 3/3] net/mlx4_en: Use ethtool_puts/sprintf to fill stats strings Kamal Heib
@ 2024-06-18 18:02 ` Simon Horman
1 sibling, 0 replies; 8+ messages in thread
From: Simon Horman @ 2024-06-18 18:02 UTC (permalink / raw)
To: Kamal Heib
Cc: netdev, Tariq Toukan, David S . Miller, Jakub Kicinski,
Paolo Abeni
On Mon, Jun 17, 2024 at 01:23:28PM -0400, Kamal Heib wrote:
> Use the ethtool_puts helper to print the selftest strings into the
> ethtool strings interface.
>
> Signed-off-by: Kamal Heib <kheib@redhat.com>
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net-next v2 3/3] net/mlx4_en: Use ethtool_puts/sprintf to fill stats strings
2024-06-17 17:23 ` [PATCH net-next v2 3/3] net/mlx4_en: Use ethtool_puts/sprintf to fill stats strings Kamal Heib
@ 2024-06-18 18:03 ` Simon Horman
0 siblings, 0 replies; 8+ messages in thread
From: Simon Horman @ 2024-06-18 18:03 UTC (permalink / raw)
To: Kamal Heib
Cc: netdev, Tariq Toukan, David S . Miller, Jakub Kicinski,
Paolo Abeni
On Mon, Jun 17, 2024 at 01:23:29PM -0400, Kamal Heib wrote:
> Use the ethtool_puts/ethtool_sprintf helper to print the stats strings
> into the ethtool strings interface.
>
> Signed-off-by: Kamal Heib <kheib@redhat.com>
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net-next v2 0/3] net/mlx4_en: Use ethtool_puts/sprintf
2024-06-17 17:23 [PATCH net-next v2 0/3] net/mlx4_en: Use ethtool_puts/sprintf Kamal Heib
2024-06-17 17:23 ` [PATCH net-next v2 1/3] net/mlx4_en: Use ethtool_puts to fill priv flags strings Kamal Heib
@ 2024-06-19 1:30 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 8+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-06-19 1:30 UTC (permalink / raw)
To: Kamal Heib; +Cc: netdev, tariqt, davem, kuba, pabeni
Hello:
This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Mon, 17 Jun 2024 13:23:26 -0400 you wrote:
> This patchset updates the mlx4_en driver to use the ethtool_puts and
> ethtool_sprintf helper functions.
>
> Changes from v1:
> - Remove unused variable.
>
> Signed-off-by: Kamal Heib <kheib@redhat.com>
>
> [...]
Here is the summary with links:
- [net-next,v2,1/3] net/mlx4_en: Use ethtool_puts to fill priv flags strings
https://git.kernel.org/netdev/net-next/c/e52e010395dc
- [net-next,v2,2/3] net/mlx4_en: Use ethtool_puts to fill selftest strings
https://git.kernel.org/netdev/net-next/c/4454929c345d
- [net-next,v2,3/3] net/mlx4_en: Use ethtool_puts/sprintf to fill stats strings
https://git.kernel.org/netdev/net-next/c/6c7dd432dcbc
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2024-06-19 1:30 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-17 17:23 [PATCH net-next v2 0/3] net/mlx4_en: Use ethtool_puts/sprintf Kamal Heib
2024-06-17 17:23 ` [PATCH net-next v2 1/3] net/mlx4_en: Use ethtool_puts to fill priv flags strings Kamal Heib
2024-06-17 17:23 ` [PATCH net-next v2 2/3] net/mlx4_en: Use ethtool_puts to fill selftest strings Kamal Heib
2024-06-17 17:23 ` [PATCH net-next v2 3/3] net/mlx4_en: Use ethtool_puts/sprintf to fill stats strings Kamal Heib
2024-06-18 18:03 ` Simon Horman
2024-06-18 18:02 ` [PATCH net-next v2 2/3] net/mlx4_en: Use ethtool_puts to fill selftest strings Simon Horman
2024-06-18 18:02 ` [PATCH net-next v2 1/3] net/mlx4_en: Use ethtool_puts to fill priv flags strings Simon Horman
2024-06-19 1:30 ` [PATCH net-next v2 0/3] net/mlx4_en: Use ethtool_puts/sprintf patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).