<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/drivers/net/ethernet, branch master</title>
<subtitle>Linux Kernel</subtitle>
<id>https://git.etezian.org/cgit.cgi/linux.git/atom?h=master</id>
<link rel='self' href='https://git.etezian.org/cgit.cgi/linux.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.etezian.org/cgit.cgi/linux.git/'/>
<updated>2017-02-10T18:40:30+00:00</updated>
<entry>
<title>net: hns: Fix the device being used for dma mapping during TX</title>
<updated>2017-02-10T18:40:30+00:00</updated>
<author>
<name>Kejian Yan</name>
<email>yankejian@huawei.com</email>
</author>
<published>2017-02-09T11:46:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.etezian.org/cgit.cgi/linux.git/commit/?id=b85ea006b6bebb692628f11882af41c3e12e1e09'/>
<id>urn:sha1:b85ea006b6bebb692628f11882af41c3e12e1e09</id>
<content type='text'>
This patch fixes the device being used to DMA map skb-&gt;data.
Erroneous device assignment causes the crash when SMMU is enabled.
This happens during TX since buffer gets DMA mapped with device
correspondign to net_device and gets unmapped using the device
related to DSAF.

Signed-off-by: Kejian Yan &lt;yankejian@huawei.com&gt;
Reviewed-by: Yisen Zhuang &lt;yisen.zhuang@huawei.com&gt;
Signed-off-by: Salil Mehta &lt;salil.mehta@huawei.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: thunderx: Fix PHY autoneg for SGMII QLM mode</title>
<updated>2017-02-08T20:47:37+00:00</updated>
<author>
<name>Thanneeru Srinivasulu</name>
<email>tsrinivasulu@cavium.com</email>
</author>
<published>2017-02-08T12:39:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.etezian.org/cgit.cgi/linux.git/commit/?id=075ad765ef7541b2860de8408c165a92b78aefa3'/>
<id>urn:sha1:075ad765ef7541b2860de8408c165a92b78aefa3</id>
<content type='text'>
This patch fixes the case where there is no phydev attached
to a LMAC in DT due to non-existance of a PHY driver or due
to usage of non-stanadard PHY which doesn't support autoneg.
Changes dependeds on firmware to send correct info w.r.t
PHY and autoneg capability.

This patch also covers a case where a 10G/40G interface is used
as a 1G with convertors with Cortina PHY in between.

Signed-off-by: Thanneeru Srinivasulu &lt;tsrinivasulu@cavium.com&gt;
Signed-off-by: Sunil Goutham &lt;sgoutham@cavium.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>mlx4: Invoke softirqs after napi_reschedule</title>
<updated>2017-02-07T17:50:43+00:00</updated>
<author>
<name>Benjamin Poirier</name>
<email>bpoirier@suse.com</email>
</author>
<published>2017-02-06T18:14:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.etezian.org/cgit.cgi/linux.git/commit/?id=bd4ce941c8d5b862b2f83364be5dbe8fc8ab48f8'/>
<id>urn:sha1:bd4ce941c8d5b862b2f83364be5dbe8fc8ab48f8</id>
<content type='text'>
mlx4 may schedule napi from a workqueue. Afterwards, softirqs are not run
in a deterministic time frame and the following message may be logged:
NOHZ: local_softirq_pending 08

The problem is the same as what was described in commit ec13ee80145c
("virtio_net: invoke softirqs after __napi_schedule") and this patch
applies the same fix to mlx4.

Fixes: 07841f9d94c1 ("net/mlx4_en: Schedule napi when RX buffers allocation fails")
Cc: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Signed-off-by: Benjamin Poirier &lt;bpoirier@suse.com&gt;
Acked-by: Eric Dumazet &lt;edumazet@google.com&gt;
Reviewed-by: Tariq Toukan &lt;tariqt@mellanox.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>hns: avoid stack overflow with CONFIG_KASAN</title>
<updated>2017-02-06T17:02:32+00:00</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2017-02-03T16:35:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.etezian.org/cgit.cgi/linux.git/commit/?id=b3f2d07f4649adcf6905953a10d217b5683e4077'/>
<id>urn:sha1:b3f2d07f4649adcf6905953a10d217b5683e4077</id>
<content type='text'>
The use of ACCESS_ONCE() looks like a micro-optimization to force gcc to use
an indexed load for the register address, but it has an absolutely detrimental
effect on builds with gcc-5 and CONFIG_KASAN=y, leading to a very likely
kernel stack overflow aside from very complex object code:

hisilicon/hns/hns_dsaf_gmac.c: In function 'hns_gmac_update_stats':
hisilicon/hns/hns_dsaf_gmac.c:419:1: error: the frame size of 2912 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
hisilicon/hns/hns_dsaf_ppe.c: In function 'hns_ppe_reset_common':
hisilicon/hns/hns_dsaf_ppe.c:390:1: error: the frame size of 1184 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
hisilicon/hns/hns_dsaf_ppe.c: In function 'hns_ppe_get_regs':
hisilicon/hns/hns_dsaf_ppe.c:621:1: error: the frame size of 3632 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
hisilicon/hns/hns_dsaf_rcb.c: In function 'hns_rcb_get_common_regs':
hisilicon/hns/hns_dsaf_rcb.c:970:1: error: the frame size of 2784 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
hisilicon/hns/hns_dsaf_gmac.c: In function 'hns_gmac_get_regs':
hisilicon/hns/hns_dsaf_gmac.c:641:1: error: the frame size of 5728 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
hisilicon/hns/hns_dsaf_rcb.c: In function 'hns_rcb_get_ring_regs':
hisilicon/hns/hns_dsaf_rcb.c:1021:1: error: the frame size of 2208 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
hisilicon/hns/hns_dsaf_main.c: In function 'hns_dsaf_comm_init':
hisilicon/hns/hns_dsaf_main.c:1209:1: error: the frame size of 1904 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
hisilicon/hns/hns_dsaf_xgmac.c: In function 'hns_xgmac_get_regs':
hisilicon/hns/hns_dsaf_xgmac.c:748:1: error: the frame size of 4704 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
hisilicon/hns/hns_dsaf_main.c: In function 'hns_dsaf_update_stats':
hisilicon/hns/hns_dsaf_main.c:2420:1: error: the frame size of 1088 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
hisilicon/hns/hns_dsaf_main.c: In function 'hns_dsaf_get_regs':
hisilicon/hns/hns_dsaf_main.c:2753:1: error: the frame size of 10768 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]

This does not seem to happen any more with gcc-7, but removing the ACCESS_ONCE
seems safe anyway and it avoids a serious issue for some people. I have verified
that with gcc-5.3.1, the object code we get is better in the new version
both with and without CONFIG_KASAN, as we no longer allocate a 1344 byte
stack frame for hns_dsaf_get_regs() but otherwise have practically identical
object code.

With gcc-7.0.0, removing ACCESS_ONCE has no effect, the object code is already
good either way.

This patch is probably not urgent to get into 4.11 as only KASAN=y builds
with certain compilers are affected, but I still think it makes sense to
backport into older kernels.

Cc: stable@vger.kernel.org
Fixes: 511e6bc ("net: add Hisilicon Network Subsystem DSAF support")
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>mlx4: xdp_prog becomes inactive after ethtool '-L' or '-G'</title>
<updated>2017-02-03T02:27:05+00:00</updated>
<author>
<name>Martin KaFai Lau</name>
<email>kafai@fb.com</email>
</author>
<published>2017-02-01T06:35:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.etezian.org/cgit.cgi/linux.git/commit/?id=770f82253dbd7e6892a88018f2f6cd395f48d214'/>
<id>urn:sha1:770f82253dbd7e6892a88018f2f6cd395f48d214</id>
<content type='text'>
After calling mlx4_en_try_alloc_resources (e.g. by changing the
number of rx-queues with ethtool -L), the existing xdp_prog becomes
inactive.

The bug is that the xdp_prog ptr has not been carried over from
the old rx-queues to the new rx-queues

Fixes: 47a38e155037 ("net/mlx4_en: add support for fast rx drop bpf program")
Cc: Brenden Blanco &lt;bblanco@plumgrid.com&gt;
Cc: Saeed Mahameed &lt;saeedm@mellanox.com&gt;
Cc: Tariq Toukan &lt;tariqt@mellanox.com&gt;
Signed-off-by: Martin KaFai Lau &lt;kafai@fb.com&gt;
Reviewed-by: Tariq Toukan &lt;tariqt@mellanox.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>mlx4: Fix memory leak after mlx4_en_update_priv()</title>
<updated>2017-02-03T02:27:05+00:00</updated>
<author>
<name>Martin KaFai Lau</name>
<email>kafai@fb.com</email>
</author>
<published>2017-02-01T06:35:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.etezian.org/cgit.cgi/linux.git/commit/?id=f32b20e89e82c9ff1825fc5c5d69753ff5558ccd'/>
<id>urn:sha1:f32b20e89e82c9ff1825fc5c5d69753ff5558ccd</id>
<content type='text'>
In mlx4_en_update_priv(), dst-&gt;tx_ring[t] and dst-&gt;tx_cq[t]
are over-written by src-&gt;tx_ring[t] and src-&gt;tx_cq[t] without
first calling kfree.

One of the reproducible code paths is by doing 'ethtool -L'.

The fix is to do the kfree in mlx4_en_free_resources().

Here is the kmemleak report:
unreferenced object 0xffff880841211800 (size 2048):
  comm "ethtool", pid 3096, jiffies 4294716940 (age 528.353s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;ffffffff81930718&gt;] kmemleak_alloc+0x28/0x50
    [&lt;ffffffff8120b213&gt;] kmem_cache_alloc_trace+0x103/0x260
    [&lt;ffffffff8170e0a8&gt;] mlx4_en_try_alloc_resources+0x118/0x1a0
    [&lt;ffffffff817065a9&gt;] mlx4_en_set_ringparam+0x169/0x210
    [&lt;ffffffff818040c5&gt;] dev_ethtool+0xae5/0x2190
    [&lt;ffffffff8181b898&gt;] dev_ioctl+0x168/0x6f0
    [&lt;ffffffff817d7a72&gt;] sock_do_ioctl+0x42/0x50
    [&lt;ffffffff817d819b&gt;] sock_ioctl+0x21b/0x2d0
    [&lt;ffffffff81247a73&gt;] do_vfs_ioctl+0x93/0x6a0
    [&lt;ffffffff812480f9&gt;] SyS_ioctl+0x79/0x90
    [&lt;ffffffff8193d7ea&gt;] entry_SYSCALL_64_fastpath+0x18/0xad
    [&lt;ffffffffffffffff&gt;] 0xffffffffffffffff
unreferenced object 0xffff880841213000 (size 2048):
  comm "ethtool", pid 3096, jiffies 4294716940 (age 528.353s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;ffffffff81930718&gt;] kmemleak_alloc+0x28/0x50
    [&lt;ffffffff8120b213&gt;] kmem_cache_alloc_trace+0x103/0x260
    [&lt;ffffffff8170e0cb&gt;] mlx4_en_try_alloc_resources+0x13b/0x1a0
    [&lt;ffffffff817065a9&gt;] mlx4_en_set_ringparam+0x169/0x210
    [&lt;ffffffff818040c5&gt;] dev_ethtool+0xae5/0x2190
    [&lt;ffffffff8181b898&gt;] dev_ioctl+0x168/0x6f0
    [&lt;ffffffff817d7a72&gt;] sock_do_ioctl+0x42/0x50
    [&lt;ffffffff817d819b&gt;] sock_ioctl+0x21b/0x2d0
    [&lt;ffffffff81247a73&gt;] do_vfs_ioctl+0x93/0x6a0
    [&lt;ffffffff812480f9&gt;] SyS_ioctl+0x79/0x90
    [&lt;ffffffff8193d7ea&gt;] entry_SYSCALL_64_fastpath+0x18/0xad
    [&lt;ffffffffffffffff&gt;] 0xffffffffffffffff

(gdb) list *mlx4_en_try_alloc_resources+0x118
0xffffffff8170e0a8 is in mlx4_en_try_alloc_resources (drivers/net/ethernet/mellanox/mlx4/en_netdev.c:2145).
2140                    if (!dst-&gt;tx_ring_num[t])
2141                            continue;
2142
2143                    dst-&gt;tx_ring[t] = kzalloc(sizeof(struct mlx4_en_tx_ring *) *
2144                                              MAX_TX_RINGS, GFP_KERNEL);
2145                    if (!dst-&gt;tx_ring[t])
2146                            goto err_free_tx;
2147
2148                    dst-&gt;tx_cq[t] = kzalloc(sizeof(struct mlx4_en_cq *) *
2149                                            MAX_TX_RINGS, GFP_KERNEL);
(gdb) list *mlx4_en_try_alloc_resources+0x13b
0xffffffff8170e0cb is in mlx4_en_try_alloc_resources (drivers/net/ethernet/mellanox/mlx4/en_netdev.c:2150).
2145                    if (!dst-&gt;tx_ring[t])
2146                            goto err_free_tx;
2147
2148                    dst-&gt;tx_cq[t] = kzalloc(sizeof(struct mlx4_en_cq *) *
2149                                            MAX_TX_RINGS, GFP_KERNEL);
2150                    if (!dst-&gt;tx_cq[t]) {
2151                            kfree(dst-&gt;tx_ring[t]);
2152                            goto err_free_tx;
2153                    }
2154            }

Fixes: ec25bc04ed8e ("net/mlx4_en: Add resilience in low memory systems")
Cc: Eugenia Emantayev &lt;eugenia@mellanox.com&gt;
Cc: Saeed Mahameed &lt;saeedm@mellanox.com&gt;
Cc: Tariq Toukan &lt;tariqt@mellanox.com&gt;
Signed-off-by: Martin KaFai Lau &lt;kafai@fb.com&gt;
Reviewed-by: Tariq Toukan &lt;tariqt@mellanox.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>be2net: fix initial MAC setting</title>
<updated>2017-02-01T16:11:41+00:00</updated>
<author>
<name>Ivan Vecera</name>
<email>cera@cera.cz</email>
</author>
<published>2017-01-31T19:01:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.etezian.org/cgit.cgi/linux.git/commit/?id=4993b39ab04b083ff6ee1147e7e7f120feb6bf7f'/>
<id>urn:sha1:4993b39ab04b083ff6ee1147e7e7f120feb6bf7f</id>
<content type='text'>
Recent commit 34393529163a ("be2net: fix MAC addr setting on privileged
BE3 VFs") allows privileged BE3 VFs to set its MAC address during
initialization. Although the initial MAC for such VFs is already
programmed by parent PF the subsequent setting performed by VF is OK,
but in certain cases (after fresh boot) this command in VF can fail.

The MAC should be initialized only when:
1) no MAC is programmed (always except BE3 VFs during first init)
2) programmed MAC is different from requested (e.g. MAC is set when
   interface is down). In this case the initial MAC programmed by PF
   needs to be deleted.

The adapter-&gt;dev_mac contains MAC address currently programmed in HW so
it should be zeroed when the MAC is deleted from HW and should not be
filled when MAC is set when interface is down in be_mac_addr_set() as
no programming is performed in this case.

Example of failure without the fix (immediately after fresh boot):

# ip link set eth0 up  &lt;- eth0 is BE3 PF
be2net 0000:01:00.0 eth0: Link is Up

# echo 1 &gt; /sys/class/net/eth0/device/sriov_numvfs  &lt;- Create 1 VF
...
be2net 0000:01:04.0: Emulex OneConnect(be3): VF  port 0

# ip link set eth8 up  &lt;- eth8 is created privileged VF
be2net 0000:01:04.0: opcode 59-1 failed:status 1-76
RTNETLINK answers: Input/output error

# echo 0 &gt; /sys/class/net/eth0/device/sriov_numvfs  &lt;- Delete VF
iommu: Removing device 0000:01:04.0 from group 33
...

# echo 1 &gt; /sys/class/net/eth0/device/sriov_numvfs  &lt;- Create it again
iommu: Removing device 0000:01:04.0 from group 33
...

# ip link set eth8 up
be2net 0000:01:04.0 eth8: Link is Up

Initialization is now OK.

v2 - Corrected the comment and condition check suggested by Suresh &amp; Harsha

Fixes: 34393529163a ("be2net: fix MAC addr setting on privileged BE3 VFs")
Cc: Sathya Perla &lt;sathya.perla@broadcom.com&gt;
Cc: Ajit Khaparde &lt;ajit.khaparde@broadcom.com&gt;
Cc: Sriharsha Basavapatna &lt;sriharsha.basavapatna@broadcom.com&gt;
Cc: Somnath Kotur &lt;somnath.kotur@broadcom.com&gt;
Signed-off-by: Ivan Vecera &lt;cera@cera.cz&gt;
Acked-by: Sriharsha Basavapatna &lt;sriharsha.basavapatna@broadcom.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: thunderx: avoid dereferencing xcv when NULL</title>
<updated>2017-01-31T18:07:40+00:00</updated>
<author>
<name>Vincent</name>
<email>vincent.stehle@laposte.net</email>
</author>
<published>2017-01-30T14:06:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.etezian.org/cgit.cgi/linux.git/commit/?id=c73e44269369e936165f0f9b61f1f09a11dae01c'/>
<id>urn:sha1:c73e44269369e936165f0f9b61f1f09a11dae01c</id>
<content type='text'>
This fixes the following smatch and coccinelle warnings:

  drivers/net/ethernet/cavium/thunder/thunder_xcv.c:119 xcv_setup_link() error: we previously assumed 'xcv' could be null (see line 118) [smatch]
  drivers/net/ethernet/cavium/thunder/thunder_xcv.c:119:16-20: ERROR: xcv is NULL but dereferenced. [coccinelle]

Fixes: 6465859aba1e66a5 ("net: thunderx: Add RGMII interface type support")
Signed-off-by: Vincent Stehlé &lt;vincent.stehle@laposte.net&gt;
Cc: Sunil Goutham &lt;sgoutham@cavium.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net/mlx4_core: Avoid command timeouts during VF driver device shutdown</title>
<updated>2017-01-30T20:45:27+00:00</updated>
<author>
<name>Jack Morgenstein</name>
<email>jackm@dev.mellanox.co.il</email>
</author>
<published>2017-01-30T13:11:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.etezian.org/cgit.cgi/linux.git/commit/?id=d585df1c5ccf995fcee910705ad7a9cdd11d4152'/>
<id>urn:sha1:d585df1c5ccf995fcee910705ad7a9cdd11d4152</id>
<content type='text'>
Some Hypervisors detach VFs from VMs by instantly causing an FLR event
to be generated for a VF.

In the mlx4 case, this will cause that VF's comm channel to be disabled
before the VM has an opportunity to invoke the VF device's "shutdown"
method.

The result is that the VF driver on the VM will experience a command
timeout during the shutdown process when the Hypervisor does not deliver
a command-completion event to the VM.

To avoid FW command timeouts on the VM when the driver's shutdown method
is invoked, we detect the absence of the VF's comm channel at the very
start of the shutdown process. If the comm-channel has already been
disabled, we cause all FW commands during the device shutdown process to
immediately return success (and thus avoid all command timeouts).

Signed-off-by: Jack Morgenstein &lt;jackm@dev.mellanox.co.il&gt;
Signed-off-by: Tariq Toukan &lt;tariqt@mellanox.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>Merge tag 'mlx5-fixes-2017-01-27' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux</title>
<updated>2017-01-30T20:44:05+00:00</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2017-01-30T20:44:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.etezian.org/cgit.cgi/linux.git/commit/?id=6415aa5039bd40022e0377afb8ce53f8637080e7'/>
<id>urn:sha1:6415aa5039bd40022e0377afb8ce53f8637080e7</id>
<content type='text'>
Saeed Mahameed says:

====================
mlx5-fixes-2017-01-27

A couple of mlx5 core and ethernet driver fixes.

From Or, A couple of error return values and error handling fixes.
From Hadar, Support TC encapsulation offloads even when the mlx5e uplink
device is stacked  under an upper device.
From Gal, Two patches to fix RSS hash modifications via ethtool.
From Moshe, Added a needed ets capability check.
====================

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