<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/net/switchdev, branch v4.9.69</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.9.69</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.9.69'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2016-10-19T14:58:04Z</updated>
<entry>
<title>switchdev: Execute bridge ndos only for bridge ports</title>
<updated>2016-10-19T14:58:04Z</updated>
<author>
<name>Ido Schimmel</name>
<email>idosch@mellanox.com</email>
</author>
<published>2016-10-18T16:50:23Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=97c242902c209e7d46e365335db5202634484dcb'/>
<id>urn:sha1:97c242902c209e7d46e365335db5202634484dcb</id>
<content type='text'>
We recently got the following warning after setting up a vlan device on
top of an offloaded bridge and executing 'bridge link':

WARNING: CPU: 0 PID: 18566 at drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c:81 mlxsw_sp_port_orig_get.part.9+0x55/0x70 [mlxsw_spectrum]
[...]
 CPU: 0 PID: 18566 Comm: bridge Not tainted 4.8.0-rc7 #1
 Hardware name: Mellanox Technologies Ltd. Mellanox switch/Mellanox switch, BIOS 4.6.5 05/21/2015
  0000000000000286 00000000e64ab94f ffff880406e6f8f0 ffffffff8135eaa3
  0000000000000000 0000000000000000 ffff880406e6f930 ffffffff8108c43b
  0000005106e6f988 ffff8803df398840 ffff880403c60108 ffff880406e6f990
 Call Trace:
  [&lt;ffffffff8135eaa3&gt;] dump_stack+0x63/0x90
  [&lt;ffffffff8108c43b&gt;] __warn+0xcb/0xf0
  [&lt;ffffffff8108c56d&gt;] warn_slowpath_null+0x1d/0x20
  [&lt;ffffffffa01420d5&gt;] mlxsw_sp_port_orig_get.part.9+0x55/0x70 [mlxsw_spectrum]
  [&lt;ffffffffa0142195&gt;] mlxsw_sp_port_attr_get+0xa5/0xb0 [mlxsw_spectrum]
  [&lt;ffffffff816f151f&gt;] switchdev_port_attr_get+0x4f/0x140
  [&lt;ffffffff816f15d0&gt;] switchdev_port_attr_get+0x100/0x140
  [&lt;ffffffff816f15d0&gt;] switchdev_port_attr_get+0x100/0x140
  [&lt;ffffffff816f1d6b&gt;] switchdev_port_bridge_getlink+0x5b/0xc0
  [&lt;ffffffff816f2680&gt;] ? switchdev_port_fdb_dump+0x90/0x90
  [&lt;ffffffff815f5427&gt;] rtnl_bridge_getlink+0xe7/0x190
  [&lt;ffffffff8161a1b2&gt;] netlink_dump+0x122/0x290
  [&lt;ffffffff8161b0df&gt;] __netlink_dump_start+0x15f/0x190
  [&lt;ffffffff815f5340&gt;] ? rtnl_bridge_dellink+0x230/0x230
  [&lt;ffffffff815fab46&gt;] rtnetlink_rcv_msg+0x1a6/0x220
  [&lt;ffffffff81208118&gt;] ? __kmalloc_node_track_caller+0x208/0x2c0
  [&lt;ffffffff815f5340&gt;] ? rtnl_bridge_dellink+0x230/0x230
  [&lt;ffffffff815fa9a0&gt;] ? rtnl_newlink+0x890/0x890
  [&lt;ffffffff8161cf54&gt;] netlink_rcv_skb+0xa4/0xc0
  [&lt;ffffffff815f56f8&gt;] rtnetlink_rcv+0x28/0x30
  [&lt;ffffffff8161c92c&gt;] netlink_unicast+0x18c/0x240
  [&lt;ffffffff8161ccdb&gt;] netlink_sendmsg+0x2fb/0x3a0
  [&lt;ffffffff815c5a48&gt;] sock_sendmsg+0x38/0x50
  [&lt;ffffffff815c6031&gt;] SYSC_sendto+0x101/0x190
  [&lt;ffffffff815c7111&gt;] ? __sys_recvmsg+0x51/0x90
  [&lt;ffffffff815c6b6e&gt;] SyS_sendto+0xe/0x10
  [&lt;ffffffff817017f2&gt;] entry_SYSCALL_64_fastpath+0x1a/0xa4

The problem is that the 8021q module propagates the call to
ndo_bridge_getlink() via switchdev ops, but the switch driver doesn't
recognize the netdev, as it's not offloaded.

While we can ignore calls being made to non-bridge ports inside the
driver, a better fix would be to push this check up to the switchdev
layer.

Note that these ndos can be called for non-bridged netdev, but this only
happens in certain PF drivers which don't call the corresponding
switchdev functions anyway.

Fixes: 99f44bb3527b ("mlxsw: spectrum: Enable L3 interfaces on top of bridge devices")
Signed-off-by: Ido Schimmel &lt;idosch@mellanox.com&gt;
Reported-by: Tamir Winetroub &lt;tamirw@mellanox.com&gt;
Tested-by: Tamir Winetroub &lt;tamirw@mellanox.com&gt;
Signed-off-by: Jiri Pirko &lt;jiri@mellanox.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>switchdev: remove FIB offload infrastructure</title>
<updated>2016-09-28T08:48:00Z</updated>
<author>
<name>Jiri Pirko</name>
<email>jiri@mellanox.com</email>
</author>
<published>2016-09-26T10:52:33Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=347e3b28c1ba24c1ae2f30290d8247480ab9ce14'/>
<id>urn:sha1:347e3b28c1ba24c1ae2f30290d8247480ab9ce14</id>
<content type='text'>
Since this is now taken care of by FIB notifier, remove the code, with
all unused dependencies.

Signed-off-by: Jiri Pirko &lt;jiri@mellanox.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>fib: introduce FIB info offload flag helpers</title>
<updated>2016-09-28T08:48:00Z</updated>
<author>
<name>Jiri Pirko</name>
<email>jiri@mellanox.com</email>
</author>
<published>2016-09-26T10:52:30Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c98501879b1b1af90c7325574f2672e9efca592c'/>
<id>urn:sha1:c98501879b1b1af90c7325574f2672e9efca592c</id>
<content type='text'>
These helpers are to be used in case someone offloads the FIB entry. The
result is that if the entry is offloaded to at least one device, the
offload flag is set.

Signed-off-by: Jiri Pirko &lt;jiri@mellanox.com&gt;
Reviewed-by: Ido Schimmel &lt;idosch@mellanox.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>rtnetlink: fdb dump: optimize by saving last interface markers</title>
<updated>2016-09-01T23:56:15Z</updated>
<author>
<name>Roopa Prabhu</name>
<email>roopa@cumulusnetworks.com</email>
</author>
<published>2016-08-31T04:56:45Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d297653dd6f07afbe7e6c702a4bcd7615680002e'/>
<id>urn:sha1:d297653dd6f07afbe7e6c702a4bcd7615680002e</id>
<content type='text'>
fdb dumps spanning multiple skb's currently restart from the first
interface again for every skb. This results in unnecessary
iterations on the already visited interfaces and their fdb
entries. In large scale setups, we have seen this to slow
down fdb dumps considerably. On a system with 30k macs we
see fdb dumps spanning across more than 300 skbs.

To fix the problem, this patch replaces the existing single fdb
marker with three markers: netdev hash entries, netdevs and fdb
index to continue where we left off instead of restarting from the
first netdev. This is consistent with link dumps.

In the process of fixing the performance issue, this patch also
re-implements fix done by
commit 472681d57a5d ("net: ndo_fdb_dump should report -EMSGSIZE to rtnl_fdb_dump")
(with an internal fix from Wilson Kok) in the following ways:
- change ndo_fdb_dump handlers to return error code instead
of the last fdb index
- use cb-&gt;args strictly for dump frag markers and not error codes.
This is consistent with other dump functions.

Below results were taken on a system with 1000 netdevs
and 35085 fdb entries:
before patch:
$time bridge fdb show | wc -l
15065

real    1m11.791s
user    0m0.070s
sys 1m8.395s

(existing code does not return all macs)

after patch:
$time bridge fdb show | wc -l
35085

real    0m2.017s
user    0m0.113s
sys 0m1.942s

Signed-off-by: Roopa Prabhu &lt;roopa@cumulusnetworks.com&gt;
Signed-off-by: Wilson Kok &lt;wkok@cumulusnetworks.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>bridge: switchdev: Add forward mark support for stacked devices</title>
<updated>2016-08-26T20:13:36Z</updated>
<author>
<name>Ido Schimmel</name>
<email>idosch@mellanox.com</email>
</author>
<published>2016-08-25T16:42:37Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=6bc506b4fb065eac3d89ca1ce37082e174493d9e'/>
<id>urn:sha1:6bc506b4fb065eac3d89ca1ce37082e174493d9e</id>
<content type='text'>
switchdev_port_fwd_mark_set() is used to set the 'offload_fwd_mark' of
port netdevs so that packets being flooded by the device won't be
flooded twice.

It works by assigning a unique identifier (the ifindex of the first
bridge port) to bridge ports sharing the same parent ID. This prevents
packets from being flooded twice by the same switch, but will flood
packets through bridge ports belonging to a different switch.

This method is problematic when stacked devices are taken into account,
such as VLANs. In such cases, a physical port netdev can have upper
devices being members in two different bridges, thus requiring two
different 'offload_fwd_mark's to be configured on the port netdev, which
is impossible.

The main problem is that packet and netdev marking is performed at the
physical netdev level, whereas flooding occurs between bridge ports,
which are not necessarily port netdevs.

Instead, packet and netdev marking should really be done in the bridge
driver with the switch driver only telling it which packets it already
forwarded. The bridge driver will mark such packets using the mark
assigned to the ingress bridge port and will prevent the packet from
being forwarded through any bridge port sharing the same mark (i.e.
having the same parent ID).

Remove the current switchdev 'offload_fwd_mark' implementation and
instead implement the proposed method. In addition, make rocker - the
sole user of the mark - use the proposed method.

Signed-off-by: Ido Schimmel &lt;idosch@mellanox.com&gt;
Signed-off-by: Jiri Pirko &lt;jiri@mellanox.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>switchdev: Support parent ID comparison for stacked devices</title>
<updated>2016-08-26T20:13:36Z</updated>
<author>
<name>Ido Schimmel</name>
<email>idosch@mellanox.com</email>
</author>
<published>2016-08-25T16:42:36Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=5c326ab49e5ee014ba5314c076fe9b93fd8b0406'/>
<id>urn:sha1:5c326ab49e5ee014ba5314c076fe9b93fd8b0406</id>
<content type='text'>
switchdev_port_same_parent_id() currently expects port netdevs, but we
need it to support stacked devices in the next patch, so drop the
NO_RECURSE flag.

Signed-off-by: Ido Schimmel &lt;idosch@mellanox.com&gt;
Signed-off-by: Jiri Pirko &lt;jiri@mellanox.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>switchdev: Put export declaration in the right place</title>
<updated>2016-08-15T20:37:50Z</updated>
<author>
<name>Or Gerlitz</name>
<email>ogerlitz@mellanox.com</email>
</author>
<published>2016-08-15T11:51:54Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=2eb03e6c4e305b71bdd2d0ce4250b9c9099d9128'/>
<id>urn:sha1:2eb03e6c4e305b71bdd2d0ce4250b9c9099d9128</id>
<content type='text'>
Move exporting of switchdev_port_same_parent_id to be right
below it and not elsewhere.

Signed-off-by: Or Gerlitz &lt;ogerlitz@mellanox.com&gt;
Reported-by: Ido Schimmel &lt;idosch@mellanox.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net/switchdev: Export the same parent ID service function</title>
<updated>2016-07-14T20:34:29Z</updated>
<author>
<name>Or Gerlitz</name>
<email>ogerlitz@mellanox.com</email>
</author>
<published>2016-07-14T07:32:43Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=8438884d4ab423161b974854ebb90c08219dd678'/>
<id>urn:sha1:8438884d4ab423161b974854ebb90c08219dd678</id>
<content type='text'>
This helper serves to know if two switchdev port netdevices belong to the
same HW ASIC, e.g to figure out if forwarding offload is possible between them.

Signed-off-by: Or Gerlitz &lt;ogerlitz@mellanox.com&gt;
Signed-off-by: Saeed Mahameed &lt;saeedm@mellanox.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>switchdev: pass pointer to fib_info instead of copy</title>
<updated>2016-05-17T17:58:49Z</updated>
<author>
<name>Jiri Pirko</name>
<email>jiri@mellanox.com</email>
</author>
<published>2016-05-17T16:58:08Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=da4ed55165d41b1073f9a476f1c18493e9bf8c8e'/>
<id>urn:sha1:da4ed55165d41b1073f9a476f1c18493e9bf8c8e</id>
<content type='text'>
The problem is that fib_info-&gt;nh is [0] so the struct fib_info
allocation size depends on number of nexthops. If we just copy fib_info,
we do not copy the nexthops info and driver accesses memory which is not
ours.

Given the fact that fib4 does not defer operations and therefore it does
not need copy, just pass the pointer down to drivers as it was done
before.

Fixes: 850d0cbc91 ("switchdev: remove pointers from switchdev objects")
Signed-off-by: Jiri Pirko &lt;jiri@mellanox.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: switchdev: Drop EXPERIMENTAL from description</title>
<updated>2016-05-14T21:06:37Z</updated>
<author>
<name>Florian Fainelli</name>
<email>f.fainelli@gmail.com</email>
</author>
<published>2016-05-14T19:49:54Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=8fbb89c6fbfd1cda9ae413cd1e042837a8edbdeb'/>
<id>urn:sha1:8fbb89c6fbfd1cda9ae413cd1e042837a8edbdeb</id>
<content type='text'>
Switchdev has been around for quite a while now, putting "EXPERIMENTAL"
in the description is no longer accurate, drop it.

Signed-off-by: Florian Fainelli &lt;f.fainelli@gmail.com&gt;
Acked-by: Jiri Pirko &lt;jiri@mellanox.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
