<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/net/core/dev.c, branch v3.13</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v3.13</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v3.13'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2014-01-10T18:23:08Z</updated>
<entry>
<title>net: core: explicitly select a txq before doing l2 forwarding</title>
<updated>2014-01-10T18:23:08Z</updated>
<author>
<name>Jason Wang</name>
<email>jasowang@redhat.com</email>
</author>
<published>2014-01-10T08:18:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f663dd9aaf9ed124f25f0f8452edf238f087ad50'/>
<id>urn:sha1:f663dd9aaf9ed124f25f0f8452edf238f087ad50</id>
<content type='text'>
Currently, the tx queue were selected implicitly in ndo_dfwd_start_xmit(). The
will cause several issues:

- NETIF_F_LLTX were removed for macvlan, so txq lock were done for macvlan
  instead of lower device which misses the necessary txq synchronization for
  lower device such as txq stopping or frozen required by dev watchdog or
  control path.
- dev_hard_start_xmit() was called with NULL txq which bypasses the net device
  watchdog.
- dev_hard_start_xmit() does not check txq everywhere which will lead a crash
  when tso is disabled for lower device.

Fix this by explicitly introducing a new param for .ndo_select_queue() for just
selecting queues in the case of l2 forwarding offload. netdev_pick_tx() was also
extended to accept this parameter and dev_queue_xmit_accel() was used to do l2
forwarding transmission.

With this fixes, NETIF_F_LLTX could be preserved for macvlan and there's no need
to check txq against NULL in dev_hard_start_xmit(). Also there's no need to keep
a dedicated ndo_dfwd_start_xmit() and we can just reuse the code of
dev_queue_xmit() to do the transmission.

In the future, it was also required for macvtap l2 forwarding support since it
provides a necessary synchronization method.

Cc: John Fastabend &lt;john.r.fastabend@intel.com&gt;
Cc: Neil Horman &lt;nhorman@tuxdriver.com&gt;
Cc: e1000-devel@lists.sourceforge.net
Signed-off-by: Jason Wang &lt;jasowang@redhat.com&gt;
Acked-by: Neil Horman &lt;nhorman@tuxdriver.com&gt;
Acked-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>net: allow netdev_all_upper_get_next_dev_rcu with rtnl lock held</title>
<updated>2013-12-18T05:19:08Z</updated>
<author>
<name>John Fastabend</name>
<email>john.r.fastabend@intel.com</email>
</author>
<published>2013-11-26T06:33:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=85328240c625f322af9f69c7b60e619717101d77'/>
<id>urn:sha1:85328240c625f322af9f69c7b60e619717101d77</id>
<content type='text'>
It is useful to be able to walk all upper devices when bringing
a device online where the RTNL lock is held. In this case it
is safe to walk the all_adj_list because the RTNL lock is used
to protect the write side as well.

This patch adds a check to see if the rtnl lock is held before
throwing a warning in netdev_all_upper_get_next_dev_rcu().

Also because we now have a call site for lockdep_rtnl_is_held()
outside COFIG_LOCK_PROVING an inline definition returning 1 is
needed. Similar to the rcu_read_lock_is_held().

Fixes: 2a47fa45d4df ("ixgbe: enable l2 forwarding acceleration for macvlans")
CC: Veaceslav Falico &lt;vfalico@redhat.com&gt;
Reported-by: Yuanhan Liu &lt;yuanhan.liu@linux.intel.com&gt;
Signed-off-by: John Fastabend &lt;john.r.fastabend@intel.com&gt;
Tested-by: Phil Schmitt &lt;phillip.j.schmitt@intel.com&gt;
Signed-off-by: Jeff Kirsher &lt;jeffrey.t.kirsher@intel.com&gt;
</content>
</entry>
<entry>
<title>net: core: Always propagate flag changes to interfaces</title>
<updated>2013-11-20T20:29:56Z</updated>
<author>
<name>Vlad Yasevich</name>
<email>vyasevic@redhat.com</email>
</author>
<published>2013-11-20T01:47:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d2615bf450694c1302d86b9cc8a8958edfe4c3a4'/>
<id>urn:sha1:d2615bf450694c1302d86b9cc8a8958edfe4c3a4</id>
<content type='text'>
The following commit:
    b6c40d68ff6498b7f63ddf97cf0aa818d748dee7
    net: only invoke dev-&gt;change_rx_flags when device is UP

tried to fix a problem with VLAN devices and promiscuouse flag setting.
The issue was that VLAN device was setting a flag on an interface that
was down, thus resulting in bad promiscuity count.
This commit blocked flag propagation to any device that is currently
down.

A later commit:
    deede2fabe24e00bd7e246eb81cd5767dc6fcfc7
    vlan: Don't propagate flag changes on down interfaces

fixed VLAN code to only propagate flags when the VLAN interface is up,
thus fixing the same issue as above, only localized to VLAN.

The problem we have now is that if we have create a complex stack
involving multiple software devices like bridges, bonds, and vlans,
then it is possible that the flags would not propagate properly to
the physical devices.  A simple examle of the scenario is the
following:

  eth0----&gt; bond0 ----&gt; bridge0 ---&gt; vlan50

If bond0 or eth0 happen to be down at the time bond0 is added to
the bridge, then eth0 will never have promisc mode set which is
currently required for operation as part of the bridge.  As a
result, packets with vlan50 will be dropped by the interface.

The only 2 devices that implement the special flag handling are
VLAN and DSA and they both have required code to prevent incorrect
flag propagation.  As a result we can remove the generic solution
introduced in b6c40d68ff6498b7f63ddf97cf0aa818d748dee7 and leave
it to the individual devices to decide whether they will block
flag propagation or not.

Reported-by: Stefan Priebe &lt;s.priebe@profihost.ag&gt;
Suggested-by: Veaceslav Falico &lt;vfalico@redhat.com&gt;
Signed-off-by: Vlad Yasevich &lt;vyasevic@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>macvlan: disable LRO on lower device instead of macvlan</title>
<updated>2013-11-15T22:55:48Z</updated>
<author>
<name>Michal Kubeček</name>
<email>mkubecek@suse.cz</email>
</author>
<published>2013-11-15T05:18:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=529d04895446f02449077a4ff49185b593283e19'/>
<id>urn:sha1:529d04895446f02449077a4ff49185b593283e19</id>
<content type='text'>
A macvlan device has always LRO disabled so that calling
dev_disable_lro() on it does nothing. If we need to disable LRO
e.g. because

  - the macvlan device is inserted into a bridge
  - IPv6 forwarding is enabled for it
  - it is in a different namespace than lowerdev and IPv4
    forwarding is enabled in it

we need to disable LRO on its underlying device instead (as we
do for 802.1q VLAN devices).

v2: use newly introduced netif_is_macvlan()

Signed-off-by: Michal Kubecek &lt;mkubecek@suse.cz&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>core/dev: do not ignore dmac in dev_forward_skb()</title>
<updated>2013-11-14T07:39:53Z</updated>
<author>
<name>Alexei Starovoitov</name>
<email>ast@plumgrid.com</email>
</author>
<published>2013-11-12T22:39:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=81b9eab5ebbf0d5d54da4fc168cfb02c2adc76b8'/>
<id>urn:sha1:81b9eab5ebbf0d5d54da4fc168cfb02c2adc76b8</id>
<content type='text'>
commit 06a23fe31ca3
("core/dev: set pkt_type after eth_type_trans() in dev_forward_skb()")
and refactoring 64261f230a91
("dev: move skb_scrub_packet() after eth_type_trans()")

are forcing pkt_type to be PACKET_HOST when skb traverses veth.

which means that ip forwarding will kick in inside netns
even if skb-&gt;eth-&gt;h_dest != dev-&gt;dev_addr

Fix order of eth_type_trans() and skb_scrub_packet() in dev_forward_skb()
and in ip_tunnel_rcv()

Fixes: 06a23fe31ca3 ("core/dev: set pkt_type after eth_type_trans() in dev_forward_skb()")
CC: Isaku Yamahata &lt;yamahatanetdev@gmail.com&gt;
CC: Maciej Zenczykowski &lt;zenczykowski@gmail.com&gt;
CC: Nicolas Dichtel &lt;nicolas.dichtel@6wind.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@plumgrid.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: Add layer 2 hardware acceleration operations for macvlan devices</title>
<updated>2013-11-08T00:11:41Z</updated>
<author>
<name>John Fastabend</name>
<email>john.r.fastabend@intel.com</email>
</author>
<published>2013-11-06T17:54:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a6cc0cfa72e0b6d9f2c8fd858aacc32313c4f272'/>
<id>urn:sha1:a6cc0cfa72e0b6d9f2c8fd858aacc32313c4f272</id>
<content type='text'>
Add a operations structure that allows a network interface to export
the fact that it supports package forwarding in hardware between
physical interfaces and other mac layer devices assigned to it (such
as macvlans). This operaions structure can be used by virtual mac
devices to bypass software switching so that forwarding can be done
in hardware more efficiently.

Signed-off-by: John Fastabend &lt;john.r.fastabend@intel.com&gt;
Signed-off-by: Neil Horman &lt;nhorman@tuxdriver.com&gt;
CC: Andy Gospodarek &lt;andy@greyhouse.net&gt;
CC: "David S. Miller" &lt;davem@davemloft.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: extend net_device allocation to vmalloc()</title>
<updated>2013-11-04T04:19:00Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2013-10-30T20:10:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=74d332c13b2148ae934ea94dac1745ae92efe8e5'/>
<id>urn:sha1:74d332c13b2148ae934ea94dac1745ae92efe8e5</id>
<content type='text'>
Joby Poriyath provided a xen-netback patch to reduce the size of
xenvif structure as some netdev allocation could fail under
memory pressure/fragmentation.

This patch is handling the problem at the core level, allowing
any netdev structures to use vmalloc() if kmalloc() failed.

As vmalloc() adds overhead on a critical network path, add __GFP_REPEAT
to kzalloc() flags to do this fallback only when really needed.

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Reported-by: Joby Poriyath &lt;joby.poriyath@citrix.com&gt;
Cc: Ben Hutchings &lt;bhutchings@solarflare.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: fix rtnl notification in atomic context</title>
<updated>2013-10-25T23:03:45Z</updated>
<author>
<name>Alexei Starovoitov</name>
<email>ast@plumgrid.com</email>
</author>
<published>2013-10-23T23:02:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7f29405403d7c17f539c099987972b862e7e5255'/>
<id>urn:sha1:7f29405403d7c17f539c099987972b862e7e5255</id>
<content type='text'>
commit 991fb3f74c "dev: always advertise rx_flags changes via netlink"
introduced rtnl notification from __dev_set_promiscuity(),
which can be called in atomic context.

Steps to reproduce:
ip tuntap add dev tap1 mode tap
ifconfig tap1 up
tcpdump -nei tap1 &amp;
ip tuntap del dev tap1 mode tap

[  271.627994] device tap1 left promiscuous mode
[  271.639897] BUG: sleeping function called from invalid context at mm/slub.c:940
[  271.664491] in_atomic(): 1, irqs_disabled(): 0, pid: 3394, name: ip
[  271.677525] INFO: lockdep is turned off.
[  271.690503] CPU: 0 PID: 3394 Comm: ip Tainted: G        W    3.12.0-rc3+ #73
[  271.703996] Hardware name: System manufacturer System Product Name/P8Z77 WS, BIOS 3007 07/26/2012
[  271.731254]  ffffffff81a58506 ffff8807f0d57a58 ffffffff817544e5 ffff88082fa0f428
[  271.760261]  ffff8808071f5f40 ffff8807f0d57a88 ffffffff8108bad1 ffffffff81110ff8
[  271.790683]  0000000000000010 00000000000000d0 00000000000000d0 ffff8807f0d57af8
[  271.822332] Call Trace:
[  271.838234]  [&lt;ffffffff817544e5&gt;] dump_stack+0x55/0x76
[  271.854446]  [&lt;ffffffff8108bad1&gt;] __might_sleep+0x181/0x240
[  271.870836]  [&lt;ffffffff81110ff8&gt;] ? rcu_irq_exit+0x68/0xb0
[  271.887076]  [&lt;ffffffff811a80be&gt;] kmem_cache_alloc_node+0x4e/0x2a0
[  271.903368]  [&lt;ffffffff810b4ddc&gt;] ? vprintk_emit+0x1dc/0x5a0
[  271.919716]  [&lt;ffffffff81614d67&gt;] ? __alloc_skb+0x57/0x2a0
[  271.936088]  [&lt;ffffffff810b4de0&gt;] ? vprintk_emit+0x1e0/0x5a0
[  271.952504]  [&lt;ffffffff81614d67&gt;] __alloc_skb+0x57/0x2a0
[  271.968902]  [&lt;ffffffff8163a0b2&gt;] rtmsg_ifinfo+0x52/0x100
[  271.985302]  [&lt;ffffffff8162ac6d&gt;] __dev_notify_flags+0xad/0xc0
[  272.001642]  [&lt;ffffffff8162ad0c&gt;] __dev_set_promiscuity+0x8c/0x1c0
[  272.017917]  [&lt;ffffffff81731ea5&gt;] ? packet_notifier+0x5/0x380
[  272.033961]  [&lt;ffffffff8162b109&gt;] dev_set_promiscuity+0x29/0x50
[  272.049855]  [&lt;ffffffff8172e937&gt;] packet_dev_mc+0x87/0xc0
[  272.065494]  [&lt;ffffffff81732052&gt;] packet_notifier+0x1b2/0x380
[  272.080915]  [&lt;ffffffff81731ea5&gt;] ? packet_notifier+0x5/0x380
[  272.096009]  [&lt;ffffffff81761c66&gt;] notifier_call_chain+0x66/0x150
[  272.110803]  [&lt;ffffffff8108503e&gt;] __raw_notifier_call_chain+0xe/0x10
[  272.125468]  [&lt;ffffffff81085056&gt;] raw_notifier_call_chain+0x16/0x20
[  272.139984]  [&lt;ffffffff81620190&gt;] call_netdevice_notifiers_info+0x40/0x70
[  272.154523]  [&lt;ffffffff816201d6&gt;] call_netdevice_notifiers+0x16/0x20
[  272.168552]  [&lt;ffffffff816224c5&gt;] rollback_registered_many+0x145/0x240
[  272.182263]  [&lt;ffffffff81622641&gt;] rollback_registered+0x31/0x40
[  272.195369]  [&lt;ffffffff816229c8&gt;] unregister_netdevice_queue+0x58/0x90
[  272.208230]  [&lt;ffffffff81547ca0&gt;] __tun_detach+0x140/0x340
[  272.220686]  [&lt;ffffffff81547ed6&gt;] tun_chr_close+0x36/0x60

Signed-off-by: Alexei Starovoitov &lt;ast@plumgrid.com&gt;
Acked-by: Nicolas Dichtel &lt;nicolas.dichtel@6wind.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: add missing dev_put() in __netdev_adjacent_dev_insert</title>
<updated>2013-10-25T23:03:39Z</updated>
<author>
<name>Nikolay Aleksandrov</name>
<email>nikolay@redhat.com</email>
</author>
<published>2013-10-23T13:28:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=974daef7f8bb5d7be78fae3a240fcce43cae0135'/>
<id>urn:sha1:974daef7f8bb5d7be78fae3a240fcce43cae0135</id>
<content type='text'>
I think that a dev_put() is needed in the error path to preserve the
proper dev refcount.

CC: Veaceslav Falico &lt;vfalico@redhat.com&gt;
Signed-off-by: Nikolay Aleksandrov &lt;nikolay@redhat.com&gt;
Acked-by: Veaceslav Falico &lt;vfalico@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ipv4: gso: make inet_gso_segment() stackable</title>
<updated>2013-10-19T23:36:18Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2013-10-19T18:42:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3347c960295583eee3fd58e5c539fb1972fbc005'/>
<id>urn:sha1:3347c960295583eee3fd58e5c539fb1972fbc005</id>
<content type='text'>
In order to support GSO on IPIP, we need to make
inet_gso_segment() stackable.

It should not assume network header starts right after mac
header.

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
