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 3/5] ovs: propagate per dp max headroom to all vports
Date: Wed, 24 Feb 2016 09:59:07 +0100	[thread overview]
Message-ID: <1456304347.5436.21.camel@redhat.com> (raw)
In-Reply-To: <CAOrHB_DL0ALY64VWtKGQCY8efxFHEz1DsKzVGvbGk+8q=j1kzQ@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 patch implements bookkeeping support to compute the maximum
> > headroom for all the devices in each datapath. When said value
> > changes, the underlying devs are notified via the
> > ndo_set_rx_headroom method.
> >
> > This also increases the internal vports xmit performance.
> >
> > Signed-off-by: Paolo Abeni <pabeni@redhat•com>
> > ---
> >  net/openvswitch/datapath.c           | 48 ++++++++++++++++++++++++++++++++++++
> >  net/openvswitch/datapath.h           |  4 +++
> >  net/openvswitch/vport-internal_dev.c | 10 +++++++-
> >  3 files changed, 61 insertions(+), 1 deletion(-)
> >
> > diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
> > index c4e8455..7b37288 100644
> > --- a/net/openvswitch/datapath.c
> > +++ b/net/openvswitch/datapath.c
> > @@ -1908,6 +1908,34 @@ static struct vport *lookup_vport(struct net *net,
> >                 return ERR_PTR(-EINVAL);
> >  }
> >
> > +/* Called with ovs_mutex */
> > +static void update_headroom(struct datapath *dp)
> > +{
> > +       int i;
> > +       struct vport *vport;
> > +       struct net_device *dev;
> > +       unsigned dev_headroom, max_headroom = 0;
> > +
> > +       for (i = 0; i < DP_VPORT_HASH_BUCKETS; i++) {
> > +               hlist_for_each_entry_rcu(vport, &dp->ports[i], dp_hash_node) {
> > +                       dev = vport->dev;
> > +                       dev_headroom = netdev_get_fwd_headroom(dev);
> > +                       if (dev_headroom > max_headroom)
> > +                               max_headroom = dev_headroom;
> > +               }
> > +       }
> > +
> > +       dp->max_headroom = max_headroom;
> > +       for (i = 0; i < DP_VPORT_HASH_BUCKETS; i++) {
> > +               hlist_for_each_entry_rcu(vport, &dp->ports[i], dp_hash_node) {
> > +                       dev = vport->dev;
> > +                       if (dev->netdev_ops->ndo_set_rx_headroom)
> > +                               dev->netdev_ops->ndo_set_rx_headroom(dev,
> > +                                                                 max_headroom);
> > +               }
> > +       }
> > +}
> > +
> Code looks fine. But It could be kept in sync with bridge code from patch 2.

You are right. 

I can had an helper to wrap the conditional ndo_set_rx_headroom()
invocation, so that all the code here and in the bridge will be devices
traversal only.

Paolo

  reply	other threads:[~2016-02-24  8:59 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
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 [this message]
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=1456304347.5436.21.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