public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat•com>
To: pravin shelar <pshelar@ovn•org>
Cc: Linux Kernel Network Developers <netdev@vger•kernel.org>,
	"David S. Miller" <davem@davemloft•net>,
	Stephen Hemminger <stephen@networkplumber•org>,
	Pravin Shelar <pshelar@nicira•com>,
	Jesse Gross <jesse@kernel•org>, Flavio Leitner <fbl@sysclose•org>,
	Hannes Frederic Sowa <hannes@stressinduktion•org>
Subject: Re: [PATCH net-next 1/5] netdev: introduce ndo_set_rx_headroom
Date: Wed, 24 Feb 2016 09:37:56 +0100	[thread overview]
Message-ID: <1456303076.5436.4.camel@redhat.com> (raw)
In-Reply-To: <CAOrHB_DgzNed9bD6F1zytxq=0m+6oXECRokRvMuP0qa7Vu7NYw@mail.gmail.com>

On Tue, 2016-02-23 at 11:20 -0800, pravin shelar wrote:
> On Tue, Feb 23, 2016 at 4:53 AM, Paolo Abeni <pabeni@redhat•com> wrote:
> > This method allows the controlling device (i.e. the bridge) to specify
> > additional headroom to be allocated for skb head on frame reception.
> >
> > Signed-off-by: Paolo Abeni <pabeni@redhat•com>
> > ---
> >  include/linux/netdevice.h | 20 ++++++++++++++++++++
> >  1 file changed, 20 insertions(+)
> >
> > diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> > index 47671ce0..fb74277 100644
> > --- a/include/linux/netdevice.h
> > +++ b/include/linux/netdevice.h
> > @@ -1093,6 +1093,12 @@ struct tc_to_netdev {
> >   *     This function is used to get egress tunnel information for given skb.
> >   *     This is useful for retrieving outer tunnel header parameters while
> >   *     sampling packet.
> ...
> 
> >  /**
> > @@ -1315,6 +1323,8 @@ struct net_device_ops {
> >   * @IFF_L3MDEV_SLAVE: device is enslaved to an L3 master device
> >   * @IFF_TEAM: device is a team device
> >   * @IFF_RXFH_CONFIGURED: device has had Rx Flow indirection table configured
> > + * @IFF_PHONY_HEADROOM: the headroom value is controlled by an external
> > + *     entity (i.e. the master device for bridged veth)
> >   */
> >  enum netdev_priv_flags {
> >         IFF_802_1Q_VLAN                 = 1<<0,
> > @@ -1343,6 +1353,7 @@ enum netdev_priv_flags {
> >         IFF_L3MDEV_SLAVE                = 1<<23,
> >         IFF_TEAM                        = 1<<24,
> >         IFF_RXFH_CONFIGURED             = 1<<25,
> > +       IFF_PHONY_HEADROOM              = 1<<26,
> >  };
> >
> >  #define IFF_802_1Q_VLAN                        IFF_802_1Q_VLAN
> > @@ -1937,6 +1948,15 @@ struct netdev_queue *netdev_pick_tx(struct net_device *dev,
> >                                     struct sk_buff *skb,
> >                                     void *accel_priv);
> >
> > +/* returns the headroom that the master device needs to take in account
> > + * when forwarding to this dev
> > + */
> > +static inline unsigned netdev_get_fwd_headroom(struct net_device *dev)
> > +{
> > +       return (dev->priv_flags && IFF_PHONY_HEADROOM) ? dev->needed_headroom :
> > +               0;
> > +}
> > +
> This looks like typo. It should '&' to check for the bitfield.

You are right! Thank you for spotting it.

There is also another error here; the code should be:

return (dev->priv_flags & IFF_PHONY_HEADROOM) ? 0 : dev->needed_headroom;

i.e. when computing the rx/forwarding headroom, we want to ignore
devices with phony headroom, since they actually will not requires
additional skb headroom on xmit.

I'll fix this in v2.

Paolo

  reply	other threads:[~2016-02-24  8:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-23 12:53 [PATCH net-next 0/5] bridge/ovs: avoid skb head copy on frame forwarding Paolo Abeni
2016-02-23 12:53 ` [PATCH net-next 1/5] netdev: introduce ndo_set_rx_headroom Paolo Abeni
2016-02-23 19:20   ` pravin shelar
2016-02-24  8:37     ` Paolo Abeni [this message]
2016-02-23 12:53 ` [PATCH net-next 2/5] bridge: notify ensabled devices of headroom changes Paolo Abeni
2016-02-23 19:20   ` pravin shelar
2016-02-24  8:43     ` Paolo Abeni
2016-02-23 12:53 ` [PATCH net-next 3/5] ovs: propagate per dp max headroom to all vports Paolo Abeni
2016-02-23 19:20   ` pravin shelar
2016-02-24  8:59     ` Paolo Abeni
2016-02-23 12:53 ` [PATCH net-next 4/5] net/tun: implement ndo_set_rx_headroom Paolo Abeni
2016-02-25 10:49   ` Paolo Abeni
2016-02-23 12:53 ` [PATCH net-next 5/5] veth: " Paolo Abeni
2016-02-23 19:21   ` pravin shelar
2016-02-24  9:17     ` Paolo Abeni

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=1456303076.5436.4.camel@redhat.com \
    --to=pabeni@redhat$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=fbl@sysclose$(echo .)org \
    --cc=hannes@stressinduktion$(echo .)org \
    --cc=jesse@kernel$(echo .)org \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=pshelar@nicira$(echo .)com \
    --cc=pshelar@ovn$(echo .)org \
    --cc=stephen@networkplumber$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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