<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/openvswitch.git/datapath/vport-internal_dev.c, branch master</title>
<subtitle>github.com: openvswitch/ovs.git
</subtitle>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/openvswitch.git/'/>
<entry>
<title>make: Remove the Linux datapath.</title>
<updated>2022-07-15T11:45:55+00:00</updated>
<author>
<name>Greg Rose</name>
<email>gvrose8192@gmail.com</email>
</author>
<published>2022-07-14T21:23:29+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/openvswitch.git/commit/?id=422e90437854c441a0b274d3bf06ce7d6bbf9de0'/>
<id>422e90437854c441a0b274d3bf06ce7d6bbf9de0</id>
<content type='text'>
Update the necessary make and configure files to remove the Linux
datapath and then remove the datapath.

Move datapath/linux/compat/include/linux/openvswitch.h to
include/linux/openvswitch.h because it is needed to generate header
files used by the userspace switch.

Also remove references to the Linux datapath from auxiliary files
and utilities since it is no longer supported.

Signed-off-by: Greg Rose &lt;gvrose8192@gmail.com&gt;
Reviewed-by: David Marchand &lt;david.marchand@redhat.com&gt;
Signed-off-by: Ilya Maximets &lt;i.maximets@ovn.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Update the necessary make and configure files to remove the Linux
datapath and then remove the datapath.

Move datapath/linux/compat/include/linux/openvswitch.h to
include/linux/openvswitch.h because it is needed to generate header
files used by the userspace switch.

Also remove references to the Linux datapath from auxiliary files
and utilities since it is no longer supported.

Signed-off-by: Greg Rose &lt;gvrose8192@gmail.com&gt;
Reviewed-by: David Marchand &lt;david.marchand@redhat.com&gt;
Signed-off-by: Ilya Maximets &lt;i.maximets@ovn.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>datapath: compat: drop bridge nf reset from nf_reset</title>
<updated>2019-10-18T14:22:12+00:00</updated>
<author>
<name>Greg Rose</name>
<email>gvrose8192@gmail.com</email>
</author>
<published>2019-10-09T21:22:14+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/openvswitch.git/commit/?id=efcae7df6c9f43ac542e13f687d03f8c698c181f'/>
<id>efcae7df6c9f43ac542e13f687d03f8c698c181f</id>
<content type='text'>
Upstream commmit:
    commit 895b5c9f206eb7d25dc1360a8ccfc5958895eb89
    Author: Florian Westphal &lt;fw@strlen.de&gt;
    Date:   Sun Sep 29 20:54:03 2019 +0200

    netfilter: drop bridge nf reset from nf_reset

    commit 174e23810cd31
    ("sk_buff: drop all skb extensions on free and skb scrubbing") made napi
    recycle always drop skb extensions.  The additional skb_ext_del() that is
    performed via nf_reset on napi skb recycle is not needed anymore.

    Most nf_reset() calls in the stack are there so queued skb won't block
    'rmmod nf_conntrack' indefinitely.

    This removes the skb_ext_del from nf_reset, and renames it to a more
    fitting nf_reset_ct().

    In a few selected places, add a call to skb_ext_reset to make sure that
    no active extensions remain.

    I am submitting this for "net", because we're still early in the release
    cycle.  The patch applies to net-next too, but I think the rename causes
    needless divergence between those trees.

    Suggested-by: Eric Dumazet &lt;edumazet@google.com&gt;
    Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt;
    Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;

Added some compat layer fixups for nf_reset_ct.  This is just a portion
of the upstream commit that applies to openvswitch.

Cc: Florian Westphal &lt;fw@strlen.de&gt;
Signed-off-by: Greg Rose &lt;gvrose8192@gmail.com&gt;
Acked-by: Yi-Hung Wei &lt;yihung.wei@gmail.com&gt;
Signed-off-by: Simon Horman &lt;simon.horman@netronome.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Upstream commmit:
    commit 895b5c9f206eb7d25dc1360a8ccfc5958895eb89
    Author: Florian Westphal &lt;fw@strlen.de&gt;
    Date:   Sun Sep 29 20:54:03 2019 +0200

    netfilter: drop bridge nf reset from nf_reset

    commit 174e23810cd31
    ("sk_buff: drop all skb extensions on free and skb scrubbing") made napi
    recycle always drop skb extensions.  The additional skb_ext_del() that is
    performed via nf_reset on napi skb recycle is not needed anymore.

    Most nf_reset() calls in the stack are there so queued skb won't block
    'rmmod nf_conntrack' indefinitely.

    This removes the skb_ext_del from nf_reset, and renames it to a more
    fitting nf_reset_ct().

    In a few selected places, add a call to skb_ext_reset to make sure that
    no active extensions remain.

    I am submitting this for "net", because we're still early in the release
    cycle.  The patch applies to net-next too, but I think the rename causes
    needless divergence between those trees.

    Suggested-by: Eric Dumazet &lt;edumazet@google.com&gt;
    Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt;
    Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;

Added some compat layer fixups for nf_reset_ct.  This is just a portion
of the upstream commit that applies to openvswitch.

Cc: Florian Westphal &lt;fw@strlen.de&gt;
Signed-off-by: Greg Rose &lt;gvrose8192@gmail.com&gt;
Acked-by: Yi-Hung Wei &lt;yihung.wei@gmail.com&gt;
Signed-off-by: Simon Horman &lt;simon.horman@netronome.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>datapath: fix return type of ndo_start_xmit function</title>
<updated>2018-12-15T16:13:23+00:00</updated>
<author>
<name>YueHaibing</name>
<email>yuehaibing@huawei.com</email>
</author>
<published>2018-12-13T23:08:23+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/openvswitch.git/commit/?id=d1cf49e9f15d128e3bed00d37021b0c1391b62fb'/>
<id>d1cf49e9f15d128e3bed00d37021b0c1391b62fb</id>
<content type='text'>
Upstream commit:
    commit eddf11e18dff0e8671e06ce54e64cfc843303ab9
    Author: YueHaibing &lt;yuehaibing@huawei.com&gt;
    Date:   Wed Sep 26 17:15:38 2018 +0800

    net: ovs: fix return type of ndo_start_xmit function

    The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
    which is a typedef for an enum type, so make sure the implementation in
    this driver has returns 'netdev_tx_t' value, and change the function
    return type to netdev_tx_t.

    Found by coccinelle.

    Signed-off-by: YueHaibing &lt;yuehaibing@huawei.com&gt;
    Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;

CC: YueHaibing &lt;yuehaibing@huawei.com&gt;
Acked-by: William Tu &lt;u9012063@gmail.com&gt;
Signed-off-by: Greg Rose &lt;gvrose8192@gmail.com&gt;
Signed-off-by: Ben Pfaff &lt;blp@ovn.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Upstream commit:
    commit eddf11e18dff0e8671e06ce54e64cfc843303ab9
    Author: YueHaibing &lt;yuehaibing@huawei.com&gt;
    Date:   Wed Sep 26 17:15:38 2018 +0800

    net: ovs: fix return type of ndo_start_xmit function

    The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
    which is a typedef for an enum type, so make sure the implementation in
    this driver has returns 'netdev_tx_t' value, and change the function
    return type to netdev_tx_t.

    Found by coccinelle.

    Signed-off-by: YueHaibing &lt;yuehaibing@huawei.com&gt;
    Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;

CC: YueHaibing &lt;yuehaibing@huawei.com&gt;
Acked-by: William Tu &lt;u9012063@gmail.com&gt;
Signed-off-by: Greg Rose &lt;gvrose8192@gmail.com&gt;
Signed-off-by: Ben Pfaff &lt;blp@ovn.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>datapath: Fix compiler warning for HAVE_RHEL7_MAX_MTU.</title>
<updated>2018-06-20T17:00:57+00:00</updated>
<author>
<name>Justin Pettit</name>
<email>jpettit@ovn.org</email>
</author>
<published>2018-06-19T21:10:17+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/openvswitch.git/commit/?id=b59974806c2c84f1a37262aae23762020c66f8dc'/>
<id>b59974806c2c84f1a37262aae23762020c66f8dc</id>
<content type='text'>
Fixes: 1e40b541bc ("datapath: Fix max MTU size on RHEL 7.5 kernel")
Signed-off-by: Justin Pettit &lt;jpettit@ovn.org&gt;
Reviewed-by: Greg Rose &lt;gvrose8192@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes: 1e40b541bc ("datapath: Fix max MTU size on RHEL 7.5 kernel")
Signed-off-by: Justin Pettit &lt;jpettit@ovn.org&gt;
Reviewed-by: Greg Rose &lt;gvrose8192@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>datapath: Fix max MTU size on RHEL 7.5 kernel</title>
<updated>2018-06-14T19:56:04+00:00</updated>
<author>
<name>Yi-Hung Wei</name>
<email>yihung.wei@gmail.com</email>
</author>
<published>2018-06-12T00:50:21+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/openvswitch.git/commit/?id=1e40b541bc9bd0a768986172ec63e41708a3e1f6'/>
<id>1e40b541bc9bd0a768986172ec63e41708a3e1f6</id>
<content type='text'>
Without the patch, in RHEL 7.5, the maximum configurable MTU of vport
internal device is 1500, which shall be 65535.  This patch fixes this
issue.

Fixes: 39ca338374ab ("datapath: compat: Fix build on RHEL 7.5")
Reported-by: Lucas Alvares Gomes &lt;lucasagomes@gmail.com&gt;
Signed-off-by: Yi-Hung Wei &lt;yihung.wei@gmail.com&gt;
Signed-off-by: Ben Pfaff &lt;blp@ovn.org&gt;
Reviewed-by: Greg Rose &lt;gvrose8192@gmail.com&gt;
Tested-by: Greg Rose &lt;gvrose8192@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Without the patch, in RHEL 7.5, the maximum configurable MTU of vport
internal device is 1500, which shall be 65535.  This patch fixes this
issue.

Fixes: 39ca338374ab ("datapath: compat: Fix build on RHEL 7.5")
Reported-by: Lucas Alvares Gomes &lt;lucasagomes@gmail.com&gt;
Signed-off-by: Yi-Hung Wei &lt;yihung.wei@gmail.com&gt;
Signed-off-by: Ben Pfaff &lt;blp@ovn.org&gt;
Reviewed-by: Greg Rose &lt;gvrose8192@gmail.com&gt;
Tested-by: Greg Rose &lt;gvrose8192@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>datapath: compat: Fix build on RHEL 7.5</title>
<updated>2018-05-15T01:36:18+00:00</updated>
<author>
<name>Yi-Hung Wei</name>
<email>yihung.wei@gmail.com</email>
</author>
<published>2018-05-11T17:32:12+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/openvswitch.git/commit/?id=39ca338374abe367e28a2247bac9159695f19710'/>
<id>39ca338374abe367e28a2247bac9159695f19710</id>
<content type='text'>
1) OVS datapath compat modules breaks on RHEL 7.5, because it moves
ndo_change_mtu function pointer from 'struct net_device_ops' to
'struct net_device_ops_extended'.

2) RHEL 7.5 introduces the MTU range checking as mentioned in
6c0bf091 ("datapath: use core MTU range checking in core net infra").
However, the max_mtu field is defined in 'struct net_device_extended'
but not in 'struct net_device' as upstream kernel.

This patch defines a new symbol HAVE_RHEL7_MAX_MTU that determines
the previous 2 conditions, and fixes the backport issue.

Signed-off-by: Yi-Hung Wei &lt;yihung.wei@gmail.com&gt;
Acked-by: Lucas Alvares Gomes &lt;lucasagomes@gmail.com&gt;
Signed-off-by: Pravin B Shelar &lt;pshelar@ovn.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
1) OVS datapath compat modules breaks on RHEL 7.5, because it moves
ndo_change_mtu function pointer from 'struct net_device_ops' to
'struct net_device_ops_extended'.

2) RHEL 7.5 introduces the MTU range checking as mentioned in
6c0bf091 ("datapath: use core MTU range checking in core net infra").
However, the max_mtu field is defined in 'struct net_device_extended'
but not in 'struct net_device' as upstream kernel.

This patch defines a new symbol HAVE_RHEL7_MAX_MTU that determines
the previous 2 conditions, and fixes the backport issue.

Signed-off-by: Yi-Hung Wei &lt;yihung.wei@gmail.com&gt;
Acked-by: Lucas Alvares Gomes &lt;lucasagomes@gmail.com&gt;
Signed-off-by: Pravin B Shelar &lt;pshelar@ovn.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>datapath: remove unused hardirq.h</title>
<updated>2018-02-16T08:41:22+00:00</updated>
<author>
<name>Yang Shi</name>
<email>yang.s@alibaba-inc.com</email>
</author>
<published>2018-02-14T23:18:06+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/openvswitch.git/commit/?id=cd8b9e742123b55560f39c8d62c94413d1b665b5'/>
<id>cd8b9e742123b55560f39c8d62c94413d1b665b5</id>
<content type='text'>
Upstream commit:
    commit 419091f1cc8afce943fd12af0df26201ee20c1c0
    Author: Yang Shi &lt;yang.s@alibaba-inc.com&gt;
    Date:   Tue Jan 9 03:52:53 2018 +0800

    net: ovs: remove unused hardirq.h

    Preempt counter APIs have been split out, currently, hardirq.h just
    includes irq_enter/exit APIs which are not used by openvswitch at all.

    So, remove the unused hardirq.h.

    Signed-off-by: Yang Shi &lt;yang.s@alibaba-inc.com&gt;
    Acked-by: Pravin B Shelar &lt;pshelar@ovn.org&gt;
    Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
    Cc: dev@openvswitch.org
    Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;

Cc: Yang Shi &lt;yang.s@alibaba-inc.com&gt;
Signed-off-by: Greg Rose &lt;gvrose8192@gmail.com&gt;

Acked-by: Pravin B Shelar &lt;pshelar@ovn.org&gt;
Acked-by： Yang Shi &lt;yang.shi@linux.alibaba.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Upstream commit:
    commit 419091f1cc8afce943fd12af0df26201ee20c1c0
    Author: Yang Shi &lt;yang.s@alibaba-inc.com&gt;
    Date:   Tue Jan 9 03:52:53 2018 +0800

    net: ovs: remove unused hardirq.h

    Preempt counter APIs have been split out, currently, hardirq.h just
    includes irq_enter/exit APIs which are not used by openvswitch at all.

    So, remove the unused hardirq.h.

    Signed-off-by: Yang Shi &lt;yang.s@alibaba-inc.com&gt;
    Acked-by: Pravin B Shelar &lt;pshelar@ovn.org&gt;
    Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
    Cc: dev@openvswitch.org
    Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;

Cc: Yang Shi &lt;yang.s@alibaba-inc.com&gt;
Signed-off-by: Greg Rose &lt;gvrose8192@gmail.com&gt;

Acked-by: Pravin B Shelar &lt;pshelar@ovn.org&gt;
Acked-by： Yang Shi &lt;yang.shi@linux.alibaba.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>datapath: do not propagate headroom updates to internal port</title>
<updated>2018-02-16T08:41:22+00:00</updated>
<author>
<name>paolo abeni</name>
<email>pabeni@redhat.com</email>
</author>
<published>2018-02-14T23:18:03+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/openvswitch.git/commit/?id=c497350a53805f01c31586bae6600d96e1f41228'/>
<id>c497350a53805f01c31586bae6600d96e1f41228</id>
<content type='text'>
Upstream commit:
    commit 183dea5818315c0a172d21ecbcd2554894bf01e3
    Author: Paolo Abeni &lt;pabeni@redhat.com&gt;
    Date:   Thu Nov 30 15:35:33 2017 +0100

    openvswitch: do not propagate headroom updates to internal port

    After commit 3a927bc7cf9d ("ovs: propagate per dp max headroom to
    all vports") the need_headroom for the internal vport is updated
    accordingly to the max needed headroom in its datapath.

    That avoids the pskb_expand_head() costs when sending/forwarding
    packets towards tunnel devices, at least for some scenarios.

    We still require such copy when using the ovs-preferred configuration
    for vxlan tunnels:

        br_int
      /       \
    tap      vxlan
               (remote_ip:X)

    br_phy
         \
        NIC

    where the route towards the IP 'X' is via 'br_phy'.

    When forwarding traffic from the tap towards the vxlan device, we
    will call pskb_expand_head() in vxlan_build_skb() because
    br-phy-&gt;needed_headroom is equal to tun-&gt;needed_headroom.

    With this change we avoid updating the internal vport needed_headroom,
    so that in the above scenario no head copy is needed, giving 5%
    performance improvement in UDP throughput test.

    As a trade-off, packets sent from the internal port towards a tunnel
    device will now experience the head copy overhead. The rationale is
    that the latter use-case is less relevant performance-wise.

    Signed-off-by: paolo abeni &lt;pabeni@redhat.com&gt;
    Acked-by: Pravin B Shelar &lt;pshelar@ovn.org&gt;
    Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;

Cc: paolo abeni &lt;pabeni@redhat.com&gt;
Signed-off-by: Greg Rose &lt;gvrose8192@gmail.com&gt;
Acked-by: Pravin B Shelar &lt;pshelar@ovn.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Upstream commit:
    commit 183dea5818315c0a172d21ecbcd2554894bf01e3
    Author: Paolo Abeni &lt;pabeni@redhat.com&gt;
    Date:   Thu Nov 30 15:35:33 2017 +0100

    openvswitch: do not propagate headroom updates to internal port

    After commit 3a927bc7cf9d ("ovs: propagate per dp max headroom to
    all vports") the need_headroom for the internal vport is updated
    accordingly to the max needed headroom in its datapath.

    That avoids the pskb_expand_head() costs when sending/forwarding
    packets towards tunnel devices, at least for some scenarios.

    We still require such copy when using the ovs-preferred configuration
    for vxlan tunnels:

        br_int
      /       \
    tap      vxlan
               (remote_ip:X)

    br_phy
         \
        NIC

    where the route towards the IP 'X' is via 'br_phy'.

    When forwarding traffic from the tap towards the vxlan device, we
    will call pskb_expand_head() in vxlan_build_skb() because
    br-phy-&gt;needed_headroom is equal to tun-&gt;needed_headroom.

    With this change we avoid updating the internal vport needed_headroom,
    so that in the above scenario no head copy is needed, giving 5%
    performance improvement in UDP throughput test.

    As a trade-off, packets sent from the internal port towards a tunnel
    device will now experience the head copy overhead. The rationale is
    that the latter use-case is less relevant performance-wise.

    Signed-off-by: paolo abeni &lt;pabeni@redhat.com&gt;
    Acked-by: Pravin B Shelar &lt;pshelar@ovn.org&gt;
    Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;

Cc: paolo abeni &lt;pabeni@redhat.com&gt;
Signed-off-by: Greg Rose &lt;gvrose8192@gmail.com&gt;
Acked-by: Pravin B Shelar &lt;pshelar@ovn.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>datapath: Fix inconsistent teardown and release of private netdev state.</title>
<updated>2017-07-24T18:24:32+00:00</updated>
<author>
<name>Greg Rose</name>
<email>gvrose8192@gmail.com</email>
</author>
<published>2017-07-21T23:46:06+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/openvswitch.git/commit/?id=7f15e8dd25d15b6245f0e09d707672196b5243cf'/>
<id>7f15e8dd25d15b6245f0e09d707672196b5243cf</id>
<content type='text'>
Upstream commit:
    commit cf124db566e6b036b8bcbe8decbed740bdfac8c6
    Author: David S. Miller &lt;davem@davemloft.net&gt;
    Date:   Mon May 8 12:52:56 2017 -0400

    net: Fix inconsistent teardown and release of private netdev state.

    Network devices can allocate reasources and private memory using
    netdev_ops-&gt;ndo_init().  However, the release of these resources
    can occur in one of two different places.

    Either netdev_ops-&gt;ndo_uninit() or netdev-&gt;destructor().

    The decision of which operation frees the resources depends upon
    whether it is necessary for all netdev refs to be released before it
    is safe to perform the freeing.

    netdev_ops-&gt;ndo_uninit() presumably can occur right after the
    NETDEV_UNREGISTER notifier completes and the unicast and multicast
    address lists are flushed.

    netdev-&gt;destructor(), on the other hand, does not run until the
    netdev references all go away.

    Further complicating the situation is that netdev-&gt;destructor()
    almost universally does also a free_netdev().

    This creates a problem for the logic in register_netdevice().
    Because all callers of register_netdevice() manage the freeing
    of the netdev, and invoke free_netdev(dev) if register_netdevice()
    fails.

    If netdev_ops-&gt;ndo_init() succeeds, but something else fails inside
    of register_netdevice(), it does call ndo_ops-&gt;ndo_uninit().  But
    it is not able to invoke netdev-&gt;destructor().

    This is because netdev-&gt;destructor() will do a free_netdev() and
    then the caller of register_netdevice() will do the same.

    However, this means that the resources that would normally be released
    by netdev-&gt;destructor() will not be.

    Over the years drivers have added local hacks to deal with this, by
    invoking their destructor parts by hand when register_netdevice()
    fails.

    Many drivers do not try to deal with this, and instead we have leaks.

    Let's close this hole by formalizing the distinction between what
    private things need to be freed up by netdev-&gt;destructor() and whether
    the driver needs unregister_netdevice() to perform the free_netdev().

    netdev-&gt;priv_destructor() performs all actions to free up the private
    resources that used to be freed by netdev-&gt;destructor(), except for
    free_netdev().

    netdev-&gt;needs_free_netdev is a boolean that indicates whether
    free_netdev() should be done at the end of unregister_netdevice().

    Now, register_netdevice() can sanely release all resources after
    ndo_ops-&gt;ndo_init() succeeds, by invoking both ndo_ops-&gt;ndo_uninit()
    and netdev-&gt;priv_destructor().

    And at the end of unregister_netdevice(), we invoke
    netdev-&gt;priv_destructor() and optionally call free_netdev().

    Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;

Applied the portion of the commit applicable to openvswitch.

Signed-off-by: Greg Rose &lt;gvrose8192@gmail.com&gt;
Signed-off-by: Joe Stringer &lt;joe@ovn.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Upstream commit:
    commit cf124db566e6b036b8bcbe8decbed740bdfac8c6
    Author: David S. Miller &lt;davem@davemloft.net&gt;
    Date:   Mon May 8 12:52:56 2017 -0400

    net: Fix inconsistent teardown and release of private netdev state.

    Network devices can allocate reasources and private memory using
    netdev_ops-&gt;ndo_init().  However, the release of these resources
    can occur in one of two different places.

    Either netdev_ops-&gt;ndo_uninit() or netdev-&gt;destructor().

    The decision of which operation frees the resources depends upon
    whether it is necessary for all netdev refs to be released before it
    is safe to perform the freeing.

    netdev_ops-&gt;ndo_uninit() presumably can occur right after the
    NETDEV_UNREGISTER notifier completes and the unicast and multicast
    address lists are flushed.

    netdev-&gt;destructor(), on the other hand, does not run until the
    netdev references all go away.

    Further complicating the situation is that netdev-&gt;destructor()
    almost universally does also a free_netdev().

    This creates a problem for the logic in register_netdevice().
    Because all callers of register_netdevice() manage the freeing
    of the netdev, and invoke free_netdev(dev) if register_netdevice()
    fails.

    If netdev_ops-&gt;ndo_init() succeeds, but something else fails inside
    of register_netdevice(), it does call ndo_ops-&gt;ndo_uninit().  But
    it is not able to invoke netdev-&gt;destructor().

    This is because netdev-&gt;destructor() will do a free_netdev() and
    then the caller of register_netdevice() will do the same.

    However, this means that the resources that would normally be released
    by netdev-&gt;destructor() will not be.

    Over the years drivers have added local hacks to deal with this, by
    invoking their destructor parts by hand when register_netdevice()
    fails.

    Many drivers do not try to deal with this, and instead we have leaks.

    Let's close this hole by formalizing the distinction between what
    private things need to be freed up by netdev-&gt;destructor() and whether
    the driver needs unregister_netdevice() to perform the free_netdev().

    netdev-&gt;priv_destructor() performs all actions to free up the private
    resources that used to be freed by netdev-&gt;destructor(), except for
    free_netdev().

    netdev-&gt;needs_free_netdev is a boolean that indicates whether
    free_netdev() should be done at the end of unregister_netdevice().

    Now, register_netdevice() can sanely release all resources after
    ndo_ops-&gt;ndo_init() succeeds, by invoking both ndo_ops-&gt;ndo_uninit()
    and netdev-&gt;priv_destructor().

    And at the end of unregister_netdevice(), we invoke
    netdev-&gt;priv_destructor() and optionally call free_netdev().

    Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;

Applied the portion of the commit applicable to openvswitch.

Signed-off-by: Greg Rose &lt;gvrose8192@gmail.com&gt;
Signed-off-by: Joe Stringer &lt;joe@ovn.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>datapath: make ndo_get_stats64 a void function</title>
<updated>2017-03-03T22:40:17+00:00</updated>
<author>
<name>stephen hemminger</name>
<email>stephen@networkplumber.org</email>
</author>
<published>2017-03-01T01:17:17+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/openvswitch.git/commit/?id=3c82e35dcf2481e23e74c6d894a5e468c0ec8b9f'/>
<id>3c82e35dcf2481e23e74c6d894a5e468c0ec8b9f</id>
<content type='text'>
Upstream commit:
    commit bc1f44709cf27fb2a5766cadafe7e2ad5e9cb221
    Author: stephen hemminger &lt;stephen@networkplumber.org&gt;
    Date:   Fri Jan 6 19:12:52 2017 -0800

    net: make ndo_get_stats64 a void function

    The network device operation for reading statistics is only called
    in one place, and it ignores the return value. Having a structure
    return value is potentially confusing because some future driver could
    incorrectly assume that the return value was used.

    Fix all drivers with ndo_get_stats64 to have a void function.

    Signed-off-by: Stephen Hemminger &lt;sthemmin@microsoft.com&gt;
    Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;

This seems to be fine for all prior Linux versions as well.

Signed-off-by: Jarno Rajahalme &lt;jarno@ovn.org&gt;
Signed-off-by: Joe Stringer &lt;joe@ovn.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Upstream commit:
    commit bc1f44709cf27fb2a5766cadafe7e2ad5e9cb221
    Author: stephen hemminger &lt;stephen@networkplumber.org&gt;
    Date:   Fri Jan 6 19:12:52 2017 -0800

    net: make ndo_get_stats64 a void function

    The network device operation for reading statistics is only called
    in one place, and it ignores the return value. Having a structure
    return value is potentially confusing because some future driver could
    incorrectly assume that the return value was used.

    Fix all drivers with ndo_get_stats64 to have a void function.

    Signed-off-by: Stephen Hemminger &lt;sthemmin@microsoft.com&gt;
    Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;

This seems to be fine for all prior Linux versions as well.

Signed-off-by: Jarno Rajahalme &lt;jarno@ovn.org&gt;
Signed-off-by: Joe Stringer &lt;joe@ovn.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
