netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Borkmann <dborkman@redhat.com>
To: Tom Herbert <therbert@google.com>
Cc: David Miller <davem@davemloft.net>,
	Linux Netdev List <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next] net: add skb_get_tx_queue() helper
Date: Wed, 27 Aug 2014 11:12:50 +0200	[thread overview]
Message-ID: <53FDA112.3090005@redhat.com> (raw)
In-Reply-To: <CA+mtBx855UwnZsRwn3ugLU35gzrL0=7WD9G6g43MgVST86oWhA@mail.gmail.com>

On 08/27/2014 01:51 AM, Tom Herbert wrote:
> On Tue, Aug 26, 2014 at 2:06 PM, Daniel Borkmann <dborkman@redhat.com> wrote:
>> Replace occurences of skb_get_queue_mapping() and follow-up
>> netdev_get_tx_queue() with an actual helper function.
>>
>> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
>> ---
>>   include/linux/netdevice.h | 8 ++++++++
>>   net/core/netpoll.c        | 2 +-
>>   net/core/pktgen.c         | 4 +---
>>   net/packet/af_packet.c    | 4 +---
>>   net/sched/sch_generic.c   | 6 ++++--
>>   5 files changed, 15 insertions(+), 9 deletions(-)
>>
>> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
>> index 039b237..200ee4f 100644
>> --- a/include/linux/netdevice.h
>> +++ b/include/linux/netdevice.h
>> @@ -1747,6 +1747,14 @@ struct netdev_queue *netdev_get_tx_queue(const struct net_device *dev,
>>          return &dev->_tx[index];
>>   }
>>
>> +static inline struct netdev_queue *skb_get_tx_queue(const struct net_device *dev,
>> +                                                   const struct sk_buff *skb)
>> +{
>> +       u16 index = skb_get_queue_mapping(skb);
>> +
>> +       return netdev_get_tx_queue(dev, index);
>> +}
>> +
> return netdev_get_tx_queue(dev, skb_get_queue_mapping(skb));
>
> if you want to be a little more concise.

That's fine by me too, lets keep it a one-liner.

      reply	other threads:[~2014-08-27  9:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-26 21:06 [PATCH net-next] net: add skb_get_tx_queue() helper Daniel Borkmann
2014-08-26 23:51 ` Tom Herbert
2014-08-27  9:12   ` Daniel Borkmann [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53FDA112.3090005@redhat.com \
    --to=dborkman@redhat.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=therbert@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).