[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOrHB_DL0ALY64VWtKGQCY8efxFHEz1DsKzVGvbGk+8q=j1kzQ@mail.gmail.com>
Date: Tue, 23 Feb 2016 11:20:56 -0800
From: pravin shelar <pshelar@....org>
To: Paolo Abeni <pabeni@...hat.com>
Cc: Linux Kernel Network Developers <netdev@...r.kernel.org>,
"David S. Miller" <davem@...emloft.net>,
Stephen Hemminger <stephen@...workplumber.org>,
Pravin Shelar <pshelar@...ira.com>,
Jesse Gross <jesse@...nel.org>,
Flavio Leitner <fbl@...close.org>,
Hannes Frederic Sowa <hannes@...essinduktion.org>
Subject: Re: [PATCH net-next 3/5] ovs: propagate per dp max headroom to all vports
On Tue, Feb 23, 2016 at 4:53 AM, Paolo Abeni <pabeni@...hat.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@...hat.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.
Powered by blists - more mailing lists