Skip to content

Commit

Permalink
net: dev: rename queue selection helpers.
Browse files Browse the repository at this point in the history
With the following patches, we are going to use __netdev_pick_tx() in
many modules. Rename it to netdev_pick_tx(), to make it clear is
a public API.

Also rename the existing netdev_pick_tx() to netdev_core_pick_tx(),
to avoid name clashes.

Suggested-by: Eric Dumazet <edumazet@google.com>
Suggested-by: David Miller <davem@davemloft.net>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Paolo Abeni authored and David S. Miller committed Mar 20, 2019
1 parent 0b963ef commit 4bd97d5
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions include/linux/netdevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -2152,9 +2152,9 @@ static inline void netdev_for_each_tx_queue(struct net_device *dev,
&qdisc_xmit_lock_key); \
}

struct netdev_queue *netdev_pick_tx(struct net_device *dev,
struct sk_buff *skb,
struct net_device *sb_dev);
struct netdev_queue *netdev_core_pick_tx(struct net_device *dev,
struct sk_buff *skb,
struct net_device *sb_dev);

/* returns the headroom that the master device needs to take in account
* when forwarding to this dev
Expand Down
18 changes: 9 additions & 9 deletions net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -3704,8 +3704,8 @@ u16 dev_pick_tx_cpu_id(struct net_device *dev, struct sk_buff *skb,
}
EXPORT_SYMBOL(dev_pick_tx_cpu_id);

static u16 __netdev_pick_tx(struct net_device *dev, struct sk_buff *skb,
struct net_device *sb_dev)
static u16 netdev_pick_tx(struct net_device *dev, struct sk_buff *skb,
struct net_device *sb_dev)
{
struct sock *sk = skb->sk;
int queue_index = sk_tx_queue_get(sk);
Expand All @@ -3730,9 +3730,9 @@ static u16 __netdev_pick_tx(struct net_device *dev, struct sk_buff *skb,
return queue_index;
}

struct netdev_queue *netdev_pick_tx(struct net_device *dev,
struct sk_buff *skb,
struct net_device *sb_dev)
struct netdev_queue *netdev_core_pick_tx(struct net_device *dev,
struct sk_buff *skb,
struct net_device *sb_dev)
{
int queue_index = 0;

Expand All @@ -3748,9 +3748,9 @@ struct netdev_queue *netdev_pick_tx(struct net_device *dev,

if (ops->ndo_select_queue)
queue_index = ops->ndo_select_queue(dev, skb, sb_dev,
__netdev_pick_tx);
netdev_pick_tx);
else
queue_index = __netdev_pick_tx(dev, skb, sb_dev);
queue_index = netdev_pick_tx(dev, skb, sb_dev);

queue_index = netdev_cap_txqueue(dev, queue_index);
}
Expand Down Expand Up @@ -3824,7 +3824,7 @@ static int __dev_queue_xmit(struct sk_buff *skb, struct net_device *sb_dev)
else
skb_dst_force(skb);

txq = netdev_pick_tx(dev, skb, sb_dev);
txq = netdev_core_pick_tx(dev, skb, sb_dev);
q = rcu_dereference_bh(txq->qdisc);

trace_net_dev_queue(skb);
Expand Down Expand Up @@ -4429,7 +4429,7 @@ void generic_xdp_tx(struct sk_buff *skb, struct bpf_prog *xdp_prog)
bool free_skb = true;
int cpu, rc;

txq = netdev_pick_tx(dev, skb, NULL);
txq = netdev_core_pick_tx(dev, skb, NULL);
cpu = smp_processor_id();
HARD_TX_LOCK(dev, txq, cpu);
if (!netif_xmit_stopped(txq)) {
Expand Down
2 changes: 1 addition & 1 deletion net/core/netpoll.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ void netpoll_send_skb_on_dev(struct netpoll *np, struct sk_buff *skb,
if (skb_queue_len(&npinfo->txq) == 0 && !netpoll_owner_active(dev)) {
struct netdev_queue *txq;

txq = netdev_pick_tx(dev, skb, NULL);
txq = netdev_core_pick_tx(dev, skb, NULL);

/* try until next clock tick */
for (tries = jiffies_to_usecs(1)/USEC_PER_POLL;
Expand Down
2 changes: 1 addition & 1 deletion net/xfrm/xfrm_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ void xfrm_dev_resume(struct sk_buff *skb)
unsigned long flags;

rcu_read_lock();
txq = netdev_pick_tx(dev, skb, NULL);
txq = netdev_core_pick_tx(dev, skb, NULL);

HARD_TX_LOCK(dev, txq, smp_processor_id());
if (!netif_xmit_frozen_or_stopped(txq))
Expand Down

0 comments on commit 4bd97d5

Please sign in to comment.