diff mbox series

[net-next] net: remove dev_pick_tx_cpu_id()

Message ID 20240906161059.715546-1-kuba@kernel.org (mailing list archive)
State Accepted
Commit 17245a195df4c86b1fd38718d8cdc532c040c08e
Delegated to: Netdev Maintainers
Headers show
Series [net-next] net: remove dev_pick_tx_cpu_id() | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next, async
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 54 this patch: 54
netdev/build_tools success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers success CCed 4 of 4 maintainers
netdev/build_clang success Errors and warnings before: 100 this patch: 100
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 4063 this patch: 4063
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 21 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 101 this patch: 101
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-09-07--06-00 (tests: 722)

Commit Message

Jakub Kicinski Sept. 6, 2024, 4:10 p.m. UTC
dev_pick_tx_cpu_id() has been introduced with two users by
commit a4ea8a3dacc3 ("net: Add generic ndo_select_queue functions").
The use in AF_PACKET has been removed in 2019 by
commit b71b5837f871 ("packet: rework packet_pick_tx_queue() to use common code selection")
The other user was a Netlogic XLP driver, removed in 2021 by
commit 47ac6f567c28 ("staging: Remove Netlogic XLP network driver").

It's relatively unlikely that any modern driver will need an
.ndo_select_queue implementation which picks purely based on CPU ID
and skips XPS, delete dev_pick_tx_cpu_id()

Found by code inspection.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
 include/linux/netdevice.h | 2 --
 net/core/dev.c            | 7 -------
 2 files changed, 9 deletions(-)

Comments

Eric Dumazet Sept. 6, 2024, 4:32 p.m. UTC | #1
On Fri, Sep 6, 2024 at 6:11 PM Jakub Kicinski <kuba@kernel.org> wrote:
>
> dev_pick_tx_cpu_id() has been introduced with two users by
> commit a4ea8a3dacc3 ("net: Add generic ndo_select_queue functions").
> The use in AF_PACKET has been removed in 2019 by
> commit b71b5837f871 ("packet: rework packet_pick_tx_queue() to use common code selection")
> The other user was a Netlogic XLP driver, removed in 2021 by
> commit 47ac6f567c28 ("staging: Remove Netlogic XLP network driver").
>
> It's relatively unlikely that any modern driver will need an
> .ndo_select_queue implementation which picks purely based on CPU ID
> and skips XPS, delete dev_pick_tx_cpu_id()
>
> Found by code inspection.
>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Reviewed-by: Eric Dumazet <edumazet@google.com>
patchwork-bot+netdevbpf@kernel.org Sept. 10, 2024, 12:20 a.m. UTC | #2
Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Fri,  6 Sep 2024 09:10:59 -0700 you wrote:
> dev_pick_tx_cpu_id() has been introduced with two users by
> commit a4ea8a3dacc3 ("net: Add generic ndo_select_queue functions").
> The use in AF_PACKET has been removed in 2019 by
> commit b71b5837f871 ("packet: rework packet_pick_tx_queue() to use common code selection")
> The other user was a Netlogic XLP driver, removed in 2021 by
> commit 47ac6f567c28 ("staging: Remove Netlogic XLP network driver").
> 
> [...]

Here is the summary with links:
  - [net-next] net: remove dev_pick_tx_cpu_id()
    https://git.kernel.org/netdev/net-next/c/17245a195df4

You are awesome, thank you!
diff mbox series

Patch

diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 9168449a51bd..ff184959770b 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -3106,8 +3106,6 @@  void dev_disable_lro(struct net_device *dev);
 int dev_loopback_xmit(struct net *net, struct sock *sk, struct sk_buff *newskb);
 u16 dev_pick_tx_zero(struct net_device *dev, struct sk_buff *skb,
 		     struct net_device *sb_dev);
-u16 dev_pick_tx_cpu_id(struct net_device *dev, struct sk_buff *skb,
-		       struct net_device *sb_dev);
 
 int __dev_queue_xmit(struct sk_buff *skb, struct net_device *sb_dev);
 int __dev_direct_xmit(struct sk_buff *skb, u16 queue_id);
diff --git a/net/core/dev.c b/net/core/dev.c
index 33629a9d0661..f85fcfb48457 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4249,13 +4249,6 @@  u16 dev_pick_tx_zero(struct net_device *dev, struct sk_buff *skb,
 }
 EXPORT_SYMBOL(dev_pick_tx_zero);
 
-u16 dev_pick_tx_cpu_id(struct net_device *dev, struct sk_buff *skb,
-		       struct net_device *sb_dev)
-{
-	return (u16)raw_smp_processor_id() % dev->real_num_tx_queues;
-}
-EXPORT_SYMBOL(dev_pick_tx_cpu_id);
-
 u16 netdev_pick_tx(struct net_device *dev, struct sk_buff *skb,
 		     struct net_device *sb_dev)
 {