or' content='cgit v1.2.3-54-g00ecf'/>
<meta name='robots' content='noindex, nofollow'/>
<link rel='stylesheet' type='text/css' href='/cgit.css'/>
<script type='text/javascript' src='/cgit.js'></script>
<link rel='shortcut icon' href='http://distanz.ch/favicon.ico'/>
<link rel='alternate' title='Atom feed' href='https://git.distanz.ch/cgit.cgi/linux/net-next.git/atom/net/bridge/br_netlink.c?h=master' type='application/atom+xml'/>
<link rel='vcs-git' href='git://git.distanz.ch/linux/net-next.git' title='net-next.git Git repository'/>
<link rel='vcs-git' href='http:///git.distanz.ch/cgit.cgi/linux/net-next.git' title='net-next.git Git repository'/>
</head>
<body>
<div id='cgit'><table id='header'>
<tr>
<td class='logo' rowspan='2'><a href='/cgit.cgi/'><img src='/cgit.png' alt='cgit logo'/></a></td>
<td class='main'><a href='/cgit.cgi/'>index</a> : <a href='/cgit.cgi/linux/net-next.git/'>net-next.git</a></td><td class='form'><form method='get'>
<input type='hidden' name='id' value='94b5e0f970258828bf163b5ef076da4e4b0802e0'/><input type='hidden' name='showmsg' value='1'/><select name='h' onchange='this.form.submit();'>
<option value='emaclite-cleanup'>emaclite-cleanup</option>
<option value='master' selected='selected'>master</option>
<option value='nds-private-remove'>nds-private-remove</option>
<option value='packet-loop-back'>packet-loop-back</option>
<option value='packet-rx-pump-back'>packet-rx-pump-back</option>
</select> <input type='submit' value='switch'/></form></td></tr>
<tr><td class='sub'>net-next plumbings</td><td class='sub right'>Tobias Klauser</td></tr></table>
<table class='tabs'><tr><td>
<a href='/cgit.cgi/linux/net-next.git/'>summary</a><a href='/cgit.cgi/linux/net-next.git/refs/?id=94b5e0f970258828bf163b5ef076da4e4b0802e0'>refs</a><a class='active' href='/cgit.cgi/linux/net-next.git/log/net/bridge/br_netlink.c?showmsg=1'>log</a><a href='/cgit.cgi/linux/net-next.git/tree/net/bridge/br_netlink.c?id=94b5e0f970258828bf163b5ef076da4e4b0802e0'>tree</a><a href='/cgit.cgi/linux/net-next.git/commit/net/bridge/br_netlink.c?id=94b5e0f970258828bf163b5ef076da4e4b0802e0'>commit</a><a href='/cgit.cgi/linux/net-next.git/diff/net/bridge/br_netlink.c?id=94b5e0f970258828bf163b5ef076da4e4b0802e0'>diff</a></td><td class='form'><form class='right' method='get' action='/cgit.cgi/linux/net-next.git/log/net/bridge/br_netlink.c'>
<input type='hidden' name='id' value='94b5e0f970258828bf163b5ef076da4e4b0802e0'/><input type='hidden' name='showmsg' value='1'/><select name='qt'>
<option value='grep'>log msg</option>
<option value='author'>author</option>
<option value='committer'>committer</option>
<option value='range'>range</option>
</select>
<input class='txt' type='search' size='10' name='q' value=''/>
<input type='submit' value='search'/>
</form>
</td></tr></table>
<div class='path'>path: <a href='/cgit.cgi/linux/net-next.git/log/?id=94b5e0f970258828bf163b5ef076da4e4b0802e0&amp;showmsg=1'>root</a>/<a href='/cgit.cgi/linux/net-next.git/log/net?id=94b5e0f970258828bf163b5ef076da4e4b0802e0&amp;showmsg=1'>net</a>/<a href='/cgit.cgi/linux/net-next.git/log/net/bridge?id=94b5e0f970258828bf163b5ef076da4e4b0802e0&amp;showmsg=1'>bridge</a>/<a href='/cgit.cgi/linux/net-next.git/log/net/bridge/br_netlink.c?id=94b5e0f970258828bf163b5ef076da4e4b0802e0&amp;showmsg=1'>br_netlink.c</a></div><div class='content'><table class='list nowrap'><tr class='nohover'><th class='left'>Age</th><th class='left'>Commit message (<a href='/cgit.cgi/linux/net-next.git/log/net/bridge/br_netlink.c?id=94b5e0f970258828bf163b5ef076da4e4b0802e0'>Collapse</a>)</th><th class='left'>Author</th><th class='left'>Files</th><th class='left'>Lines</th></tr>
<tr class='logheader'><td><span title='2017-02-03 15:21:22 -0500'>2017-02-03</span></td><td class='logsubject'><a href='/cgit.cgi/linux/net-next.git/commit/net/bridge/br_netlink.c?id=efa5356b0d9753b9d7e63e41459eba106cce30f3'>bridge: per vlan dst_metadata netlink support</a></td><td>Roopa Prabhu</td><td>1</td><td><span class='deletions'>-45</span>/<span class='insertions'>+95</span></td></tr>
<tr class='nohover-highlight'><td/><td colspan='5' class='logmsg'>
This patch adds support to attach per vlan tunnel info dst
metadata. This enables bridge driver to map vlan to tunnel_info
at ingress and egress. It uses the kernel dst_metadata infrastructure.

The initial use case is vlan to vni bridging, but the api is generic
to extend to any tunnel_info in the future:
    - Uapi to configure/unconfigure/dump per vlan tunnel data
    - netlink functions to configure vlan and tunnel_info mapping
    - Introduces bridge port flag BR_LWT_VLAN to enable attach/detach
    dst_metadata to bridged packets on ports. off by default.
    - changes to existing code is mainly refactor some existing vlan
    handling netlink code + hooks for new vlan tunnel code
    - I have kept the vlan tunnel code isolated in separate files.
    - most of the netlink vlan tunnel code is handling of vlan-tunid
    ranges (follows the vlan range handling code). To conserve space
    vlan-tunid by default are always dumped in ranges if applicable.

Use case:
example use for this is a vxlan bridging gateway or vtep
which maps vlans to vn-segments (or vnis).

iproute2 example (patched and pruned iproute2 output to just show
relevant fdb entries):
example shows same host mac learnt on two vni's and
vlan 100 maps to vni 1000, vlan 101 maps to vni 1001

before (netdev per vni):
$bridge fdb show | grep "00:02:00:00:00:03"
00:02:00:00:00:03 dev vxlan1001 vlan 101 master bridge
00:02:00:00:00:03 dev vxlan1001 dst 12.0.0.8 self
00:02:00:00:00:03 dev vxlan1000 vlan 100 master bridge
00:02:00:00:00:03 dev vxlan1000 dst 12.0.0.8 self

after this patch with collect metdata in bridged mode (single netdev):
$bridge fdb show | grep "00:02:00:00:00:03"
00:02:00:00:00:03 dev vxlan0 vlan 101 master bridge
00:02:00:00:00:03 dev vxlan0 src_vni 1001 dst 12.0.0.8 self
00:02:00:00:00:03 dev vxlan0 vlan 100 master bridge
00:02:00:00:00:03 dev vxlan0 src_vni 1000 dst 12.0.0.8 self

CC: Nikolay Aleksandrov &lt;nikolay@cumulusnetworks.com&gt;
Signed-off-by: Roopa Prabhu &lt;roopa@cumulusnetworks.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;


</td></tr>