]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit - net/packet/af_packet.c
packet: rework packet_pick_tx_queue() to use common code selection
authorPaolo Abeni <pabeni@redhat.com>
Wed, 20 Mar 2019 10:02:05 +0000 (11:02 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 20 Mar 2019 18:18:55 +0000 (11:18 -0700)
commitb71b5837f8711dbc4bc0424cb5c75e5921be055c
tree4a731ba20e46226c135ae28213de18152338a2dd
parent4bd97d51a5e602ea1fbdab8c2d653513dea17115
packet: rework packet_pick_tx_queue() to use common code selection

Currently packet_pick_tx_queue() is the only caller of
ndo_select_queue() using a fallback argument other than
netdev_pick_tx.

Leveraging rx queue, we can obtain a similar queue selection
behavior using core helpers. After this change, ndo_select_queue()
is always invoked with netdev_pick_tx() as fallback.
We can change ndo_select_queue() signature in a followup patch,
dropping an indirect call per transmitted packet in some scenarios
(e.g. TCP syn and XDP generic xmit)

This changes slightly how af packet queue selection happens when
PACKET_QDISC_BYPASS is set. It's now more similar to plan dev_queue_xmit()
tacking in account both XPS and TC mapping.

 v1  -> v2:
  - rebased after helper name change
 RFC -> v1:
  - initialize sender_cpu to the expected value

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/netdevice.h
net/core/dev.c
net/packet/af_packet.c