* [PATCH] eth: dpaa2: constify dpaa2_ethtool_stats and dpaa2_ethtool_extras
@ 2026-05-23 15:07 Len Bao
2026-05-25 14:40 ` Ioana Ciornei
2026-05-25 21:30 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 4+ messages in thread
From: Len Bao @ 2026-05-23 15:07 UTC (permalink / raw)
To: Ioana Ciornei, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni
Cc: Len Bao, netdev, linux-kernel
The 'dpaa2_ethtool_stats' and 'dpaa2_ethtool_extras' structures are
initialized in their declarations and never changed. So, constify them
to reduce the attack surface.
Before the patch (size dpaa2-ethtool.o):
text data bss dec hex
33433 5992 0 39425 9a01
After the patch (size dpaa2-ethtool.o):
text data bss dec hex
34937 4488 0 39425 9a01
Signed-off-by: Len Bao <len.bao@gmx.us>
---
drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c
index 59f5c778d..fcc0a30a9 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c
@@ -10,7 +10,7 @@
#include "dpaa2-eth.h"
/* To be kept in sync with DPNI statistics */
-static char dpaa2_ethtool_stats[][ETH_GSTRING_LEN] = {
+static const char dpaa2_ethtool_stats[][ETH_GSTRING_LEN] = {
"[hw] rx frames",
"[hw] rx bytes",
"[hw] rx mcast frames",
@@ -37,7 +37,7 @@ static char dpaa2_ethtool_stats[][ETH_GSTRING_LEN] = {
#define DPAA2_ETH_NUM_STATS ARRAY_SIZE(dpaa2_ethtool_stats)
-static char dpaa2_ethtool_extras[][ETH_GSTRING_LEN] = {
+static const char dpaa2_ethtool_extras[][ETH_GSTRING_LEN] = {
/* per-cpu stats */
"[drv] tx conf frames",
"[drv] tx conf bytes",
--
2.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] eth: dpaa2: constify dpaa2_ethtool_stats and dpaa2_ethtool_extras
2026-05-23 15:07 [PATCH] eth: dpaa2: constify dpaa2_ethtool_stats and dpaa2_ethtool_extras Len Bao
@ 2026-05-25 14:40 ` Ioana Ciornei
2026-05-30 10:48 ` Len Bao
2026-05-25 21:30 ` patchwork-bot+netdevbpf
1 sibling, 1 reply; 4+ messages in thread
From: Ioana Ciornei @ 2026-05-25 14:40 UTC (permalink / raw)
To: Len Bao
Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, netdev, linux-kernel
On Sat, May 23, 2026 at 03:07:35PM +0000, Len Bao wrote:
> The 'dpaa2_ethtool_stats' and 'dpaa2_ethtool_extras' structures are
> initialized in their declarations and never changed. So, constify them
> to reduce the attack surface.
>
> Before the patch (size dpaa2-ethtool.o):
>
> text data bss dec hex
> 33433 5992 0 39425 9a01
>
> After the patch (size dpaa2-ethtool.o):
>
> text data bss dec hex
> 34937 4488 0 39425 9a01
>
> Signed-off-by: Len Bao <len.bao@gmx.us>
Reviewed-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Next time, please mention the target tree name in the subject prefix. In
this case, it would have been net-next.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] eth: dpaa2: constify dpaa2_ethtool_stats and dpaa2_ethtool_extras
2026-05-23 15:07 [PATCH] eth: dpaa2: constify dpaa2_ethtool_stats and dpaa2_ethtool_extras Len Bao
2026-05-25 14:40 ` Ioana Ciornei
@ 2026-05-25 21:30 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-05-25 21:30 UTC (permalink / raw)
To: Len Bao
Cc: ioana.ciornei, andrew+netdev, davem, edumazet, kuba, pabeni,
netdev, linux-kernel
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Sat, 23 May 2026 15:07:35 +0000 you wrote:
> The 'dpaa2_ethtool_stats' and 'dpaa2_ethtool_extras' structures are
> initialized in their declarations and never changed. So, constify them
> to reduce the attack surface.
>
> Before the patch (size dpaa2-ethtool.o):
>
> text data bss dec hex
> 33433 5992 0 39425 9a01
>
> [...]
Here is the summary with links:
- eth: dpaa2: constify dpaa2_ethtool_stats and dpaa2_ethtool_extras
https://git.kernel.org/netdev/net-next/c/3baa7ba4ab98
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] 4+ messages in thread
* Re: [PATCH] eth: dpaa2: constify dpaa2_ethtool_stats and dpaa2_ethtool_extras
2026-05-25 14:40 ` Ioana Ciornei
@ 2026-05-30 10:48 ` Len Bao
0 siblings, 0 replies; 4+ messages in thread
From: Len Bao @ 2026-05-30 10:48 UTC (permalink / raw)
To: Ioana Ciornei
Cc: Len Bao, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, netdev, linux-kernel
Hi Ioana,
On Mon, May 25, 2026 at 05:40:46PM +0300, Ioana Ciornei wrote:
> On Sat, May 23, 2026 at 03:07:35PM +0000, Len Bao wrote:
> > The 'dpaa2_ethtool_stats' and 'dpaa2_ethtool_extras' structures are
> > initialized in their declarations and never changed. So, constify them
> > to reduce the attack surface.
> >
> > Before the patch (size dpaa2-ethtool.o):
> >
> > text data bss dec hex
> > 33433 5992 0 39425 9a01
> >
> > After the patch (size dpaa2-ethtool.o):
> >
> > text data bss dec hex
> > 34937 4488 0 39425 9a01
> >
> > Signed-off-by: Len Bao <len.bao@gmx.us>
>
> Reviewed-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Thanks for the review.
> Next time, please mention the target tree name in the subject prefix. In
> this case, it would have been net-next.
Ok, next time I will do what you suggest. Thank you for the guidance.
Regards,
Len
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-05-30 10:49 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-23 15:07 [PATCH] eth: dpaa2: constify dpaa2_ethtool_stats and dpaa2_ethtool_extras Len Bao
2026-05-25 14:40 ` Ioana Ciornei
2026-05-30 10:48 ` Len Bao
2026-05-25 21:30 ` 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