<feed xmlns='http://www.w3.org/2005/Atom'>
<title>lwn.git/net/8021q, branch v3.16.4</title>
<subtitle>Linux kernel documentation tree maintained by Jonathan Corbet</subtitle>
<id>http://mirrors.hust.edu.cn/git/lwn.git/atom?h=v3.16.4</id>
<link rel='self' href='http://mirrors.hust.edu.cn/git/lwn.git/atom?h=v3.16.4'/>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/'/>
<updated>2014-07-03T00:02:05+00:00</updated>
<entry>
<title>vlan: free percpu stats in device destructor</title>
<updated>2014-07-03T00:02:05+00:00</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2014-07-02T09:25:15+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=a48e5fafecfb9c0c807d7e7284b5ff884dfb7a3a'/>
<id>urn:sha1:a48e5fafecfb9c0c807d7e7284b5ff884dfb7a3a</id>
<content type='text'>
Madalin-Cristian reported crashs happening after a recent commit
(5a4ae5f6e7d4 "vlan: unnecessary to check if vlan_pcpu_stats is NULL")

-----------------------------------------------------------------------
root@p5040ds:~# vconfig add eth8 1
root@p5040ds:~# vconfig rem eth8.1
Unable to handle kernel paging request for data at address 0x2bc88028
Faulting instruction address: 0xc058e950
Oops: Kernel access of bad area, sig: 11 [#1]
SMP NR_CPUS=8 CoreNet Generic
Modules linked in:
CPU: 3 PID: 2167 Comm: vconfig Tainted: G        W     3.16.0-rc3-00346-g65e85bf #2
task: e7264d90 ti: e2c2c000 task.ti: e2c2c000
NIP: c058e950 LR: c058ea30 CTR: c058e900
REGS: e2c2db20 TRAP: 0300   Tainted: G        W      (3.16.0-rc3-00346-g65e85bf)
MSR: 00029002 &lt;CE,EE,ME&gt;  CR: 48000428  XER: 20000000
DEAR: 2bc88028 ESR: 00000000
GPR00: c047299c e2c2dbd0 e7264d90 00000000 2bc88000 00000000 ffffffff 00000000
GPR08: 0000000f 00000000 000000ff 00000000 28000422 10121928 10100000 10100000
GPR16: 10100000 00000000 c07c5968 00000000 00000000 00000000 e2c2dc48 e7838000
GPR24: c07c5bac c07c58a8 e77290cc c07b0000 00000000 c05de6c0 e7838000 e2c2dc48
NIP [c058e950] vlan_dev_get_stats64+0x50/0x170
LR [c058ea30] vlan_dev_get_stats64+0x130/0x170
Call Trace:
[e2c2dbd0] [ffffffea] 0xffffffea (unreliable)
[e2c2dc20] [c047299c] dev_get_stats+0x4c/0x140
[e2c2dc40] [c0488ca8] rtnl_fill_ifinfo+0x3d8/0x960
[e2c2dd70] [c0489f4c] rtmsg_ifinfo+0x6c/0x110
[e2c2dd90] [c04731d4] rollback_registered_many+0x344/0x3b0
[e2c2ddd0] [c047332c] rollback_registered+0x2c/0x50
[e2c2ddf0] [c0476058] unregister_netdevice_queue+0x78/0xf0
[e2c2de00] [c058d800] unregister_vlan_dev+0xc0/0x160
[e2c2de20] [c058e360] vlan_ioctl_handler+0x1c0/0x550
[e2c2de90] [c045d11c] sock_ioctl+0x28c/0x2f0
[e2c2deb0] [c010d070] do_vfs_ioctl+0x90/0x7b0
[e2c2df20] [c010d7d0] SyS_ioctl+0x40/0x80
[e2c2df40] [c000f924] ret_from_syscall+0x0/0x3c

Fix this problem by freeing percpu stats from dev-&gt;destructor() instead
of ndo_uninit()

Reported-by: Madalin-Cristian Bucur &lt;madalin.bucur@freescale.com&gt;
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Tested-by: Madalin-Cristian Bucur &lt;madalin.bucur@freescale.com&gt;
Fixes: 5a4ae5f6e7d4 ("vlan: unnecessary to check if vlan_pcpu_stats is NULL")
Cc: Li RongQing &lt;roy.qing.li@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>8021q: fix a potential memory leak</title>
<updated>2014-06-21T22:12:13+00:00</updated>
<author>
<name>Li RongQing</name>
<email>roy.qing.li@gmail.com</email>
</author>
<published>2014-06-18T05:46:02+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=916c1689a09bc1ca81f2d7a34876f8d35aadd11b'/>
<id>urn:sha1:916c1689a09bc1ca81f2d7a34876f8d35aadd11b</id>
<content type='text'>
skb_cow called in vlan_reorder_header does not free the skb when it failed,
and vlan_reorder_header returns NULL to reset original skb when it is called
in vlan_untag, lead to a memory leak.

Signed-off-by: Li RongQing &lt;roy.qing.li@gmail.com&gt;
Acked-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net</title>
<updated>2014-05-24T04:32:30+00:00</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2014-05-24T04:32:30+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=54e5c4def0614ab540fbdf68e45342a4af141702'/>
<id>urn:sha1:54e5c4def0614ab540fbdf68e45342a4af141702</id>
<content type='text'>
Conflicts:
	drivers/net/bonding/bond_alb.c
	drivers/net/ethernet/altera/altera_msgdma.c
	drivers/net/ethernet/altera/altera_sgdma.c
	net/ipv6/xfrm6_output.c

Several cases of overlapping changes.

The xfrm6_output.c has a bug fix which overlaps the renaming
of skb-&gt;local_df to skb-&gt;ignore_df.

In the Altera TSE driver cases, the register access cleanups
in net-next overlapped with bug fixes done in net.

Similarly a bug fix to send ALB packets in the bonding driver using
the right source address overlaps with cleanups in net-next.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>vlan: more careful checksum features handling</title>
<updated>2014-05-22T19:07:23+00:00</updated>
<author>
<name>Michal Kubeček</name>
<email>mkubecek@suse.cz</email>
</author>
<published>2014-05-20T06:29:25+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=da08143b85203b581f4a6461b149186b0e9592df'/>
<id>urn:sha1:da08143b85203b581f4a6461b149186b0e9592df</id>
<content type='text'>
When combining real_dev's features and vlan_features, simple
bitwise AND is used. This doesn't work well for checksum
offloading features as if one set has NETIF_F_HW_CSUM and the
other NETIF_F_IP_CSUM and/or NETIF_F_IPV6_CSUM, we end up with
no checksum offloading. However, from the logical point of view
(how can_checksum_protocol() works), NETIF_F_HW_CSUM contains
the functionality of NETIF_F_IP_CSUM and NETIF_F_IPV6_CSUM so
that the result should be IP/IPV6.

Add helper function netdev_intersect_features() implementing
this logic and use it in vlan_dev_fix_features().

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>vlan: Fix lockdep warning with stacked vlan devices.</title>
<updated>2014-05-17T02:14:49+00:00</updated>
<author>
<name>Vlad Yasevich</name>
<email>vyasevic@redhat.com</email>
</author>
<published>2014-05-16T21:04:55+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=d38569ab2bba6e6b3233acfc3a84cdbcfbd1f79f'/>
<id>urn:sha1:d38569ab2bba6e6b3233acfc3a84cdbcfbd1f79f</id>
<content type='text'>
This reverts commit dc8eaaa006350d24030502a4521542e74b5cb39f.
	vlan: Fix lockdep warning when vlan dev handle notification

Instead we use the new new API to find the lock subclass of
our vlan device.  This way we can support configurations where
vlans are interspersed with other devices:
  bond -&gt; vlan -&gt; macvlan -&gt; vlan

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>vlan: rename __vlan_find_dev_deep() to __vlan_find_dev_deep_rcu()</title>
<updated>2014-05-12T18:39:13+00:00</updated>
<author>
<name>dingtianhong</name>
<email>dingtianhong@huawei.com</email>
</author>
<published>2014-05-09T06:58:05+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=f06c7f9f92295faf701a9628b383156c4efb6119'/>
<id>urn:sha1:f06c7f9f92295faf701a9628b383156c4efb6119</id>
<content type='text'>
The __vlan_find_dev_deep should always called in RCU, according
David's suggestion, rename to __vlan_find_dev_deep_rcu looks more
reasonable.

Signed-off-by: Ding Tianhong &lt;dingtianhong@huawei.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>vlan: unnecessary to check if vlan_pcpu_stats is NULL</title>
<updated>2014-04-23T01:27:57+00:00</updated>
<author>
<name>Li RongQing</name>
<email>roy.qing.li@gmail.com</email>
</author>
<published>2014-04-21T11:49:08+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=5a4ae5f6e7d4b2b5a9b8981d513345053e40b6ac'/>
<id>urn:sha1:5a4ae5f6e7d4b2b5a9b8981d513345053e40b6ac</id>
<content type='text'>
if allocating memory for vlan_pcpu_stats failed, the device can not be operated

Signed-off-by: Li RongQing &lt;roy.qing.li@gmail.com&gt;
Cc: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>vlan: Fix lockdep warning when vlan dev handle notification</title>
<updated>2014-04-18T21:48:30+00:00</updated>
<author>
<name>dingtianhong</name>
<email>dingtianhong@huawei.com</email>
</author>
<published>2014-04-17T10:40:36+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=dc8eaaa006350d24030502a4521542e74b5cb39f'/>
<id>urn:sha1:dc8eaaa006350d24030502a4521542e74b5cb39f</id>
<content type='text'>
When I open the LOCKDEP config and run these steps:

modprobe 8021q
vconfig add eth2 20
vconfig add eth2.20 30
ifconfig eth2 xx.xx.xx.xx

then the Call Trace happened:

[32524.386288] =============================================
[32524.386293] [ INFO: possible recursive locking detected ]
[32524.386298] 3.14.0-rc2-0.7-default+ #35 Tainted: G           O
[32524.386302] ---------------------------------------------
[32524.386306] ifconfig/3103 is trying to acquire lock:
[32524.386310]  (&amp;vlan_netdev_addr_lock_key/1){+.....}, at: [&lt;ffffffff814275f4&gt;] dev_mc_sync+0x64/0xb0
[32524.386326]
[32524.386326] but task is already holding lock:
[32524.386330]  (&amp;vlan_netdev_addr_lock_key/1){+.....}, at: [&lt;ffffffff8141af83&gt;] dev_set_rx_mode+0x23/0x40
[32524.386341]
[32524.386341] other info that might help us debug this:
[32524.386345]  Possible unsafe locking scenario:
[32524.386345]
[32524.386350]        CPU0
[32524.386352]        ----
[32524.386354]   lock(&amp;vlan_netdev_addr_lock_key/1);
[32524.386359]   lock(&amp;vlan_netdev_addr_lock_key/1);
[32524.386364]
[32524.386364]  *** DEADLOCK ***
[32524.386364]
[32524.386368]  May be due to missing lock nesting notation
[32524.386368]
[32524.386373] 2 locks held by ifconfig/3103:
[32524.386376]  #0:  (rtnl_mutex){+.+.+.}, at: [&lt;ffffffff81431d42&gt;] rtnl_lock+0x12/0x20
[32524.386387]  #1:  (&amp;vlan_netdev_addr_lock_key/1){+.....}, at: [&lt;ffffffff8141af83&gt;] dev_set_rx_mode+0x23/0x40
[32524.386398]
[32524.386398] stack backtrace:
[32524.386403] CPU: 1 PID: 3103 Comm: ifconfig Tainted: G           O 3.14.0-rc2-0.7-default+ #35
[32524.386409] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2007
[32524.386414]  ffffffff81ffae40 ffff8800d9625ae8 ffffffff814f68a2 ffff8800d9625bc8
[32524.386421]  ffffffff810a35fb ffff8800d8a8d9d0 00000000d9625b28 ffff8800d8a8e5d0
[32524.386428]  000003cc00000000 0000000000000002 ffff8800d8a8e5f8 0000000000000000
[32524.386435] Call Trace:
[32524.386441]  [&lt;ffffffff814f68a2&gt;] dump_stack+0x6a/0x78
[32524.386448]  [&lt;ffffffff810a35fb&gt;] __lock_acquire+0x7ab/0x1940
[32524.386454]  [&lt;ffffffff810a323a&gt;] ? __lock_acquire+0x3ea/0x1940
[32524.386459]  [&lt;ffffffff810a4874&gt;] lock_acquire+0xe4/0x110
[32524.386464]  [&lt;ffffffff814275f4&gt;] ? dev_mc_sync+0x64/0xb0
[32524.386471]  [&lt;ffffffff814fc07a&gt;] _raw_spin_lock_nested+0x2a/0x40
[32524.386476]  [&lt;ffffffff814275f4&gt;] ? dev_mc_sync+0x64/0xb0
[32524.386481]  [&lt;ffffffff814275f4&gt;] dev_mc_sync+0x64/0xb0
[32524.386489]  [&lt;ffffffffa0500cab&gt;] vlan_dev_set_rx_mode+0x2b/0x50 [8021q]
[32524.386495]  [&lt;ffffffff8141addf&gt;] __dev_set_rx_mode+0x5f/0xb0
[32524.386500]  [&lt;ffffffff8141af8b&gt;] dev_set_rx_mode+0x2b/0x40
[32524.386506]  [&lt;ffffffff8141b3cf&gt;] __dev_open+0xef/0x150
[32524.386511]  [&lt;ffffffff8141b177&gt;] __dev_change_flags+0xa7/0x190
[32524.386516]  [&lt;ffffffff8141b292&gt;] dev_change_flags+0x32/0x80
[32524.386524]  [&lt;ffffffff8149ca56&gt;] devinet_ioctl+0x7d6/0x830
[32524.386532]  [&lt;ffffffff81437b0b&gt;] ? dev_ioctl+0x34b/0x660
[32524.386540]  [&lt;ffffffff814a05b0&gt;] inet_ioctl+0x80/0xa0
[32524.386550]  [&lt;ffffffff8140199d&gt;] sock_do_ioctl+0x2d/0x60
[32524.386558]  [&lt;ffffffff81401a52&gt;] sock_ioctl+0x82/0x2a0
[32524.386568]  [&lt;ffffffff811a7123&gt;] do_vfs_ioctl+0x93/0x590
[32524.386578]  [&lt;ffffffff811b2705&gt;] ? rcu_read_lock_held+0x45/0x50
[32524.386586]  [&lt;ffffffff811b39e5&gt;] ? __fget_light+0x105/0x110
[32524.386594]  [&lt;ffffffff811a76b1&gt;] SyS_ioctl+0x91/0xb0
[32524.386604]  [&lt;ffffffff815057e2&gt;] system_call_fastpath+0x16/0x1b

========================================================================

The reason is that all of the addr_lock_key for vlan dev have the same class,
so if we change the status for vlan dev, the vlan dev and its real dev will
hold the same class of addr_lock_key together, so the warning happened.

we should distinguish the lock depth for vlan dev and its real dev.

v1-&gt;v2: Convert the vlan_netdev_addr_lock_key to an array of eight elements, which
	could support to add 8 vlan id on a same vlan dev, I think it is enough for current
	scene, because a netdev's name is limited to IFNAMSIZ which could not hold 8 vlan id,
	and the vlan dev would not meet the same class key with its real dev.

	The new function vlan_dev_get_lockdep_subkey() will return the subkey and make the vlan
	dev could get a suitable class key.

v2-&gt;v3: According David's suggestion, I use the subclass to distinguish the lock key for vlan dev
	and its real dev, but it make no sense, because the difference for subclass in the
	lock_class_key doesn't mean that the difference class for lock_key, so I use lock_depth
	to distinguish the different depth for every vlan dev, the same depth of the vlan dev
	could have the same lock_class_key, I import the MAX_LOCK_DEPTH from the include/linux/sched.h,
	I think it is enough here, the lockdep should never exceed that value.

v3-&gt;v4: Add a huge array of locking keys will waste static kernel memory and is not a appropriate method,
	we could use _nested() variants to fix the problem, calculate the depth for every vlan dev,
	and use the depth as the subclass for addr_lock_key.

Signed-off-by: Ding Tianhong &lt;dingtianhong@huawei.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net</title>
<updated>2014-03-29T22:48:54+00:00</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2014-03-29T22:48:54+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=64c27237a07129758e33f5f824ba5c33b7f57417'/>
<id>urn:sha1:64c27237a07129758e33f5f824ba5c33b7f57417</id>
<content type='text'>
Conflicts:
	drivers/net/ethernet/marvell/mvneta.c

The mvneta.c conflict is a case of overlapping changes,
a conversion to devm_ioremap_resource() vs. a conversion
to netdev_alloc_pcpu_stats.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>netpoll: Remove gfp parameter from __netpoll_setup</title>
<updated>2014-03-29T21:58:37+00:00</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2014-03-27T22:36:38+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=a8779ec1c5e60548b7b661a8d74a8cecf7775690'/>
<id>urn:sha1:a8779ec1c5e60548b7b661a8d74a8cecf7775690</id>
<content type='text'>
The gfp parameter was added in:
commit 47be03a28cc6c80e3aa2b3e8ed6d960ff0c5c0af
Author: Amerigo Wang &lt;amwang@redhat.com&gt;
Date:   Fri Aug 10 01:24:37 2012 +0000

    netpoll: use GFP_ATOMIC in slave_enable_netpoll() and __netpoll_setup()

    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;

The reason for the gfp parameter was removed in:
commit c4cdef9b7183159c23c7302aaf270d64c549f557
Author: dingtianhong &lt;dingtianhong@huawei.com&gt;
Date:   Tue Jul 23 15:25:27 2013 +0800

    bonding: don't call slave_xxx_netpoll under spinlocks

    The slave_xxx_netpoll will call synchronize_rcu_bh(),
    so the function may schedule and sleep, it should't be
    called under spinlocks.

    bond_netpoll_setup() and bond_netpoll_cleanup() are always
    protected by rtnl lock, it is no need to take the read lock,
    as the slave list couldn't be changed outside rtnl lock.

    Signed-off-by: Ding Tianhong &lt;dingtianhong@huawei.com&gt;
    Cc: Jay Vosburgh &lt;fubar@us.ibm.com&gt;
    Cc: Andy Gospodarek &lt;andy@greyhouse.net&gt;
    Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;

Nothing else that calls __netpoll_setup or ndo_netpoll_setup
requires a gfp paramter, so remove the gfp parameter from both
of these functions making the code clearer.

Signed-off-by: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
