<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/net/bridge/br_device.c, branch linux-3.7.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.7.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.7.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2012-08-15T22:09:41Z</updated>
<entry>
<title>bridge: fix rcu dereference outside of rcu_read_lock</title>
<updated>2012-08-15T22:09:41Z</updated>
<author>
<name>Stephen Hemminger</name>
</author>
<published>2012-08-14T15:19:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c03307eab68d583ea6db917681afa14ed1fb3b84'/>
<id>urn:sha1:c03307eab68d583ea6db917681afa14ed1fb3b84</id>
<content type='text'>
Alternative solution for problem found by Linux Driver Verification
project (linuxtesting.org).

As it noted in the comment before the br_handle_frame_finish
function, this function should be called under rcu_read_lock.

The problem callgraph:
br_dev_xmit -&gt; br_nf_pre_routing_finish_bridge_slow -&gt;
 -&gt; br_handle_frame_finish -&gt; br_port_get_rcu -&gt; rcu_dereference

And in this case there is no read-lock section.

Reported-by: Denis Efremov &lt;yefremov.denis@gmail.com&gt;
Signed-off-by: Stephen Hemminger &lt;shemminger@vyatta.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>bridge: use list_for_each_entry() in netpoll functions</title>
<updated>2012-08-14T21:33:31Z</updated>
<author>
<name>Amerigo Wang</name>
</author>
<published>2012-08-10T01:24:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4e3828c4bfd90b00a951cad7c8da27d1966beefe'/>
<id>urn:sha1:4e3828c4bfd90b00a951cad7c8da27d1966beefe</id>
<content type='text'>
We don't delete 'p' from the list in the loop,
so we can just use list_for_each_entry().

Cc: David Miller &lt;davem@davemloft.net&gt;
Cc: Stephen Hemminger &lt;shemminger@vyatta.com&gt;
Signed-off-by: Cong Wang &lt;amwang@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>netpoll: make __netpoll_cleanup non-block</title>
<updated>2012-08-14T21:33:30Z</updated>
<author>
<name>Amerigo Wang</name>
</author>
<published>2012-08-10T01:24:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=38e6bc185d9544dfad1774b3f8902a0b061aea25'/>
<id>urn:sha1:38e6bc185d9544dfad1774b3f8902a0b061aea25</id>
<content type='text'>
Like the previous patch, slave_disable_netpoll() and __netpoll_cleanup()
may be called with read_lock() held too, so we should make them
non-block, by moving the cleanup and kfree() to call_rcu_bh() callbacks.

Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
Signed-off-by: Cong Wang &lt;amwang@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>netpoll: use GFP_ATOMIC in slave_enable_netpoll() and __netpoll_setup()</title>
<updated>2012-08-14T21:33:30Z</updated>
<author>
<name>Amerigo Wang</name>
</author>
<published>2012-08-10T01:24:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=47be03a28cc6c80e3aa2b3e8ed6d960ff0c5c0af'/>
<id>urn:sha1:47be03a28cc6c80e3aa2b3e8ed6d960ff0c5c0af</id>
<content type='text'>
slave_enable_netpoll() and __netpoll_setup() may be called
with read_lock() held, so should use GFP_ATOMIC to allocate
memory. Eric suggested to pass gfp flags to __netpoll_setup().

Cc: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: Cong Wang &lt;amwang@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: fix race condition in several drivers when reading stats</title>
<updated>2012-07-22T19:12:32Z</updated>
<author>
<name>Kevin Groeneveld</name>
</author>
<published>2012-07-21T06:30:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e3906486f616da7cc086a3ba06c0df4e5a48b4ab'/>
<id>urn:sha1:e3906486f616da7cc086a3ba06c0df4e5a48b4ab</id>
<content type='text'>
Fix race condition in several network drivers when reading stats on 32bit
UP architectures.  These drivers update their stats in a BH context and
therefore should use u64_stats_fetch_begin_bh/u64_stats_fetch_retry_bh
instead of u64_stats_fetch_begin/u64_stats_fetch_retry when reading the
stats.

Signed-off-by: Kevin Groeneveld &lt;kgroeneveld@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>netpoll: move np-&gt;dev and np-&gt;dev_name init into __netpoll_setup()</title>
<updated>2012-07-17T16:02:36Z</updated>
<author>
<name>Jiri Pirko</name>
</author>
<published>2012-07-17T05:22:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=30fdd8a082a00126a6feec994e43e8dc12f5bccb'/>
<id>urn:sha1:30fdd8a082a00126a6feec994e43e8dc12f5bccb</id>
<content type='text'>
Signed-off-by: Jiri Pirko &lt;jiri@resnulli.us&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>bridge: Convert compare_ether_addr to ether_addr_equal</title>
<updated>2012-05-10T00:49:17Z</updated>
<author>
<name>Joe Perches</name>
</author>
<published>2012-05-08T18:56:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9a7b6ef9b9938a1f5cb91ccc0b713b9443edc79f'/>
<id>urn:sha1:9a7b6ef9b9938a1f5cb91ccc0b713b9443edc79f</id>
<content type='text'>
Use the new bool function ether_addr_equal to add
some clarity and reduce the likelihood for misuse
of compare_ether_addr for sorting.

Done via cocci script:

$ cat compare_ether_addr.cocci
@@
expression a,b;
@@
-	!compare_ether_addr(a, b)
+	ether_addr_equal(a, b)

@@
expression a,b;
@@
-	compare_ether_addr(a, b)
+	!ether_addr_equal(a, b)

@@
expression a,b;
@@
-	!ether_addr_equal(a, b) == 0
+	ether_addr_equal(a, b)

@@
expression a,b;
@@
-	!ether_addr_equal(a, b) != 0
+	!ether_addr_equal(a, b)

@@
expression a,b;
@@
-	ether_addr_equal(a, b) == 0
+	!ether_addr_equal(a, b)

@@
expression a,b;
@@
-	ether_addr_equal(a, b) != 0
+	ether_addr_equal(a, b)

@@
expression a,b;
@@
-	!!ether_addr_equal(a, b)
+	ether_addr_equal(a, b)

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: add generic PF_BRIDGE:RTM_ FDB hooks</title>
<updated>2012-04-15T17:06:04Z</updated>
<author>
<name>John Fastabend</name>
</author>
<published>2012-04-15T06:43:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=77162022ab26a1f99d3af30c03760a76f86e193d'/>
<id>urn:sha1:77162022ab26a1f99d3af30c03760a76f86e193d</id>
<content type='text'>
This adds two new flags NTF_MASTER and NTF_SELF that can
now be used to specify where PF_BRIDGE netlink commands should
be sent. NTF_MASTER sends the commands to the 'dev-&gt;master'
device for parsing. Typically this will be the linux net/bridge,
or open-vswitch devices. Also without any flags set the command
will be handled by the master device as well so that current user
space tools continue to work as expected.

The NTF_SELF flag will push the PF_BRIDGE commands to the
device. In the basic example below the commands are then parsed
and programmed in the embedded bridge.

Note if both NTF_SELF and NTF_MASTER bits are set then the
command will be sent to both 'dev-&gt;master' and 'dev' this allows
user space to easily keep the embedded bridge and software bridge
in sync.

There is a slight complication in the case with both flags set
when an error occurs. To resolve this the rtnl handler clears
the NTF_ flag in the netlink ack to indicate which sets completed
successfully. The add/del handlers will abort as soon as any
error occurs.

To support this new net device ops were added to call into
the device and the existing bridging code was refactored
to use these. There should be no required changes in user space
to support the current bridge behavior.

A basic setup with a SR-IOV enabled NIC looks like this,

          veth0  veth2
            |      |
          ------------
          |  bridge0 |   &lt;---- software bridging
          ------------
               /
               /
  ethx.y      ethx
    VF         PF
     \         \          &lt;---- propagate FDB entries to HW
     \         \
  --------------------
  |  Embedded Bridge |    &lt;---- hardware offloaded switching
  --------------------

In this case the embedded bridge must be managed to allow 'veth0'
to communicate with 'ethx.y' correctly. At present drivers managing
the embedded bridge either send frames onto the network which
then get dropped by the switch OR the embedded bridge will flood
these frames. With this patch we have a mechanism to manage the
embedded bridge correctly from user space. This example is specific
to SR-IOV but replacing the VF with another PF or dropping this
into the DSA framework generates similar management issues.

Examples session using the 'br'[1] tool to add, dump and then
delete a mac address with a new "embedded" option and enabled
ixgbe driver:

# br fdb add 22:35:19:ac:60:59 dev eth3
# br fdb
port    mac addr                flags
veth0   22:35:19:ac:60:58       static
veth0   9a:5f:81:f7:f6:ec       local
eth3    00:1b:21:55:23:59       local
eth3    22:35:19:ac:60:59       static
veth0   22:35:19:ac:60:57       static
#br fdb add 22:35:19:ac:60:59 embedded dev eth3
#br fdb
port    mac addr                flags
veth0   22:35:19:ac:60:58       static
veth0   9a:5f:81:f7:f6:ec       local
eth3    00:1b:21:55:23:59       local
eth3    22:35:19:ac:60:59       static
veth0   22:35:19:ac:60:57       static
eth3    22:35:19:ac:60:59       local embedded
#br fdb del 22:35:19:ac:60:59 embedded dev eth3

I added a couple lines to 'br' to set the flags correctly is all. It
is my opinion that the merit of this patch is now embedded and SW
bridges can both be modeled correctly in user space using very nearly
the same message passing.

[1] 'br' tool was published as an RFC here and will be renamed 'bridge'
    http://patchwork.ozlabs.org/patch/117664/

Thanks to Jamal Hadi Salim, Stephen Hemminger and Ben Hutchings for
valuable feedback, suggestions, and review.

v2: fixed api descriptions and error case with both NTF_SELF and
    NTF_MASTER set plus updated patch description.

Signed-off-by: John Fastabend &lt;john.r.fastabend@intel.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>br_device: unify return value of .ndo_set_mac_address if address is invalid</title>
<updated>2012-02-23T22:03:20Z</updated>
<author>
<name>Danny Kukawka</name>
</author>
<published>2012-02-21T02:07:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7ca1e11ab7d83ec76f3a8ef8704adca8c7518f41'/>
<id>urn:sha1:7ca1e11ab7d83ec76f3a8ef8704adca8c7518f41</id>
<content type='text'>
Unify return value of .ndo_set_mac_address if the given address
isn't valid. Return -EADDRNOTAVAIL as eth_mac_addr() already does
if is_valid_ether_addr() fails.

Signed-off-by: Danny Kukawka &lt;danny.kukawka@bisect.de&gt;
Acked-by: Stephen Hemminger &lt;shemminger@vyatta.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: use eth_hw_addr_random() and reset addr_assign_type</title>
<updated>2012-02-15T20:34:17Z</updated>
<author>
<name>Danny Kukawka</name>
</author>
<published>2012-02-15T06:45:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7ce5d222190cb3ce3ae88bafde7c4fa52a5103e0'/>
<id>urn:sha1:7ce5d222190cb3ce3ae88bafde7c4fa52a5103e0</id>
<content type='text'>
Use eth_hw_addr_random() instead of calling random_ether_addr()
to set addr_assign_type correctly to NET_ADDR_RANDOM.

Reset the state to NET_ADDR_PERM as soon as the MAC get
changed via .ndo_set_mac_address.

v2: adapt to renamed eth_hw_addr_random()

Signed-off-by: Danny Kukawka &lt;danny.kukawka@bisect.de&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
