<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/drivers/net/vmxnet3, branch v4.5</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>vmxnet3: avoid calling pskb_may_pull with interrupts disabled</title>
<updated>2016-03-07T20:15:24+00:00</updated>
<author>
<name>Neil Horman</name>
<email>nhorman@tuxdriver.com</email>
</author>
<published>2016-03-04T18:40:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=cec05562fb1dcdf09ef7b46e1e3eade98e488893'/>
<id>cec05562fb1dcdf09ef7b46e1e3eade98e488893</id>
<content type='text'>
vmxnet3 has a function vmxnet3_parse_and_copy_hdr which, among other operations,
uses pskb_may_pull to linearize the header portion of an skb.  That operation
eventually uses local_bh_disable/enable to ensure that it doesn't race with the
drivers bottom half handler.  Unfortunately, vmxnet3 preforms this
parse_and_copy operation with a spinlock held and interrupts disabled.  This
causes us to run afoul of the WARN_ON_ONCE(irqs_disabled()) warning in
local_bh_enable, resulting in this:

WARNING: at kernel/softirq.c:159 local_bh_enable+0x59/0x90() (Not tainted)
Hardware name: VMware Virtual Platform
Modules linked in: ipv6 ppdev parport_pc parport microcode e1000 vmware_balloon
vmxnet3 i2c_piix4 sg ext4 jbd2 mbcache sd_mod crc_t10dif sr_mod cdrom mptspi
mptscsih mptbase scsi_transport_spi pata_acpi ata_generic ata_piix vmwgfx ttm
drm_kms_helper drm i2c_core dm_mirror dm_region_hash dm_log dm_mod [last
unloaded: mperf]
Pid: 6229, comm: sshd Not tainted 2.6.32-616.el6.i686 #1
Call Trace:
 [&lt;c04624d9&gt;] ? warn_slowpath_common+0x89/0xe0
 [&lt;c0469e99&gt;] ? local_bh_enable+0x59/0x90
 [&lt;c046254b&gt;] ? warn_slowpath_null+0x1b/0x20
 [&lt;c0469e99&gt;] ? local_bh_enable+0x59/0x90
 [&lt;c07bb936&gt;] ? skb_copy_bits+0x126/0x210
 [&lt;f8d1d9fe&gt;] ? ext4_ext_find_extent+0x24e/0x2d0 [ext4]
 [&lt;c07bc49e&gt;] ? __pskb_pull_tail+0x6e/0x2b0
 [&lt;f95a6164&gt;] ? vmxnet3_xmit_frame+0xba4/0xef0 [vmxnet3]
 [&lt;c05d15a6&gt;] ? selinux_ip_postroute+0x56/0x320
 [&lt;c0615988&gt;] ? cfq_add_rq_rb+0x98/0x110
 [&lt;c0852df8&gt;] ? packet_rcv+0x48/0x350
 [&lt;c07c5839&gt;] ? dev_queue_xmit_nit+0xc9/0x140
...

Fix it by splitting vmxnet3_parse_and_copy_hdr into two functions:

vmxnet3_parse_hdr, which sets up the internal/on stack ctx datastructure, and
pulls the skb (both of which can be done without holding the spinlock with irqs
disabled

and

vmxnet3_copy_header, which just copies the skb to the tx ring under the lock
safely.

tested and shown to correct the described problem.  Applies cleanly to the head
of the net tree

Signed-off-by: Neil Horman &lt;nhorman@tuxdriver.com&gt;
CC: Shrikrishna Khare &lt;skhare@vmware.com&gt;
CC: "VMware, Inc." &lt;pv-drivers@vmware.com&gt;
CC: "David S. Miller" &lt;davem@davemloft.net&gt;
Acked-by: Shrikrishna Khare &lt;skhare@vmware.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
vmxnet3 has a function vmxnet3_parse_and_copy_hdr which, among other operations,
uses pskb_may_pull to linearize the header portion of an skb.  That operation
eventually uses local_bh_disable/enable to ensure that it doesn't race with the
drivers bottom half handler.  Unfortunately, vmxnet3 preforms this
parse_and_copy operation with a spinlock held and interrupts disabled.  This
causes us to run afoul of the WARN_ON_ONCE(irqs_disabled()) warning in
local_bh_enable, resulting in this:

WARNING: at kernel/softirq.c:159 local_bh_enable+0x59/0x90() (Not tainted)
Hardware name: VMware Virtual Platform
Modules linked in: ipv6 ppdev parport_pc parport microcode e1000 vmware_balloon
vmxnet3 i2c_piix4 sg ext4 jbd2 mbcache sd_mod crc_t10dif sr_mod cdrom mptspi
mptscsih mptbase scsi_transport_spi pata_acpi ata_generic ata_piix vmwgfx ttm
drm_kms_helper drm i2c_core dm_mirror dm_region_hash dm_log dm_mod [last
unloaded: mperf]
Pid: 6229, comm: sshd Not tainted 2.6.32-616.el6.i686 #1
Call Trace:
 [&lt;c04624d9&gt;] ? warn_slowpath_common+0x89/0xe0
 [&lt;c0469e99&gt;] ? local_bh_enable+0x59/0x90
 [&lt;c046254b&gt;] ? warn_slowpath_null+0x1b/0x20
 [&lt;c0469e99&gt;] ? local_bh_enable+0x59/0x90
 [&lt;c07bb936&gt;] ? skb_copy_bits+0x126/0x210
 [&lt;f8d1d9fe&gt;] ? ext4_ext_find_extent+0x24e/0x2d0 [ext4]
 [&lt;c07bc49e&gt;] ? __pskb_pull_tail+0x6e/0x2b0
 [&lt;f95a6164&gt;] ? vmxnet3_xmit_frame+0xba4/0xef0 [vmxnet3]
 [&lt;c05d15a6&gt;] ? selinux_ip_postroute+0x56/0x320
 [&lt;c0615988&gt;] ? cfq_add_rq_rb+0x98/0x110
 [&lt;c0852df8&gt;] ? packet_rcv+0x48/0x350
 [&lt;c07c5839&gt;] ? dev_queue_xmit_nit+0xc9/0x140
...

Fix it by splitting vmxnet3_parse_and_copy_hdr into two functions:

vmxnet3_parse_hdr, which sets up the internal/on stack ctx datastructure, and
pulls the skb (both of which can be done without holding the spinlock with irqs
disabled

and

vmxnet3_copy_header, which just copies the skb to the tx ring under the lock
safely.

tested and shown to correct the described problem.  Applies cleanly to the head
of the net tree

Signed-off-by: Neil Horman &lt;nhorman@tuxdriver.com&gt;
CC: Shrikrishna Khare &lt;skhare@vmware.com&gt;
CC: "VMware, Inc." &lt;pv-drivers@vmware.com&gt;
CC: "David S. Miller" &lt;davem@davemloft.net&gt;
Acked-by: Shrikrishna Khare &lt;skhare@vmware.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Driver: Vmxnet3: Update Rx ring 2 max size</title>
<updated>2016-02-22T03:04:15+00:00</updated>
<author>
<name>Shrikrishna Khare</name>
<email>skhare@vmware.com</email>
</author>
<published>2016-02-19T19:19:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=14112ca5625db8a7fbdc724783510751577a8a1b'/>
<id>14112ca5625db8a7fbdc724783510751577a8a1b</id>
<content type='text'>
Device emulation supports max size of 4096.

Signed-off-by: Shrikrishna Khare &lt;skhare@vmware.com&gt;
Signed-off-by: Bhavesh Davda &lt;bhavesh@vmware.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Device emulation supports max size of 4096.

Signed-off-by: Shrikrishna Khare &lt;skhare@vmware.com&gt;
Signed-off-by: Bhavesh Davda &lt;bhavesh@vmware.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Driver: Vmxnet3: Fix regression caused by 5738a09</title>
<updated>2016-01-06T21:20:13+00:00</updated>
<author>
<name>Shrikrishna Khare</name>
<email>skhare@vmware.com</email>
</author>
<published>2016-01-06T18:44:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=58caf637365fef97c8e84ea5699a8e34d68fce93'/>
<id>58caf637365fef97c8e84ea5699a8e34d68fce93</id>
<content type='text'>
Reported-by: Bingkuo Liu &lt;bingkuol@vmware.com&gt;
Signed-off-by: Shrikrishna Khare &lt;skhare@vmware.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reported-by: Bingkuo Liu &lt;bingkuol@vmware.com&gt;
Signed-off-by: Shrikrishna Khare &lt;skhare@vmware.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>vmxnet3: fix checks for dma mapping errors</title>
<updated>2015-12-01T20:19:16+00:00</updated>
<author>
<name>Alexey Khoroshilov</name>
<email>khoroshilov@ispras.ru</email>
</author>
<published>2015-11-27T22:29:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=5738a09d58d5ad2871f1f9a42bf6a3aa9ece5b3c'/>
<id>5738a09d58d5ad2871f1f9a42bf6a3aa9ece5b3c</id>
<content type='text'>
vmxnet3_drv does not check dma_addr with dma_mapping_error()
after mapping dma memory. The patch adds the checks and
tries to handle failures.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov &lt;khoroshilov@ispras.ru&gt;
Acked-by: Shrikrishna Khare &lt;skhare@vmware.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
vmxnet3_drv does not check dma_addr with dma_mapping_error()
after mapping dma memory. The patch adds the checks and
tries to handle failures.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov &lt;khoroshilov@ispras.ru&gt;
Acked-by: Shrikrishna Khare &lt;skhare@vmware.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Driver: Vmxnet3: Fix use of mfTableLen for big endian architectures</title>
<updated>2015-11-16T20:06:47+00:00</updated>
<author>
<name>Shrikrishna Khare</name>
<email>skhare@vmware.com</email>
</author>
<published>2015-11-13T23:42:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=d37d5ec861b0d937c0bdd70f0138e2750aacccdb'/>
<id>d37d5ec861b0d937c0bdd70f0138e2750aacccdb</id>
<content type='text'>
Signed-off-by: Shrikrishna Khare &lt;skhare@vmware.com&gt;
Reported-by: Masao Uebayashi &lt;uebayasi@gmail.com&gt;
Signed-off-by: Bhavesh Davda &lt;bhavesh@vmware.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Shrikrishna Khare &lt;skhare@vmware.com&gt;
Reported-by: Masao Uebayashi &lt;uebayasi@gmail.com&gt;
Signed-off-by: Bhavesh Davda &lt;bhavesh@vmware.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drivers/net: get rid of unnecessary initializations in .get_drvinfo()</title>
<updated>2015-10-16T07:24:10+00:00</updated>
<author>
<name>Ivan Vecera</name>
<email>ivecera@redhat.com</email>
</author>
<published>2015-10-15T19:28:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=47ea0325337b166c1c8695119aa6e83cdc035ef5'/>
<id>47ea0325337b166c1c8695119aa6e83cdc035ef5</id>
<content type='text'>
Many drivers initialize uselessly n_priv_flags, n_stats, testinfo_len,
eedump_len &amp; regdump_len fields in their .get_drvinfo() ethtool op.
It's not necessary as these fields is filled in ethtool_get_drvinfo().

v2: removed unused variable
v3: removed another unused variable

Signed-off-by: Ivan Vecera &lt;ivecera@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Many drivers initialize uselessly n_priv_flags, n_stats, testinfo_len,
eedump_len &amp; regdump_len fields in their .get_drvinfo() ethtool op.
It's not necessary as these fields is filled in ethtool_get_drvinfo().

v2: removed unused variable
v3: removed another unused variable

Signed-off-by: Ivan Vecera &lt;ivecera@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Driver: Vmxnet3: Extend register dump support</title>
<updated>2015-09-23T22:06:27+00:00</updated>
<author>
<name>Shrikrishna Khare</name>
<email>skhare@vmware.com</email>
</author>
<published>2015-09-22T03:01:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=b6bd9b5448a9362e3ca33b21f1461baa5500520f'/>
<id>b6bd9b5448a9362e3ca33b21f1461baa5500520f</id>
<content type='text'>
Signed-off-by: Shrikrishna Khare &lt;skhare@vmware.com&gt;
Signed-off-by: Bhavesh Davda &lt;bhavesh@vmware.com&gt;
Acked-by: Srividya Murali &lt;smurali@vmware.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Shrikrishna Khare &lt;skhare@vmware.com&gt;
Signed-off-by: Bhavesh Davda &lt;bhavesh@vmware.com&gt;
Acked-by: Srividya Murali &lt;smurali@vmware.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>vmxnet3: prevent receive getting out of sequence on napi poll</title>
<updated>2015-07-09T06:36:11+00:00</updated>
<author>
<name>Neil Horman</name>
<email>nhorman@tuxdriver.com</email>
</author>
<published>2015-07-07T18:02:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=0769636cb5b95665ebadcd1a41c46f331f5a397d'/>
<id>0769636cb5b95665ebadcd1a41c46f331f5a397d</id>
<content type='text'>
vmxnet3's current napi path is built to count every rx descriptor we recieve,
and use that as a count of the napi budget.  That means its possible to return
from a napi poll halfway through recieving a fragmented packet accross multiple
dma descriptors.  If that happens, the next napi poll will start with the
descriptor ring in an improper state (e.g. the first descriptor we look at may
have the end-of-packet bit set), which will cause a BUG halt in the driver.

Fix the issue by only counting whole received packets in the napi poll and
returning that value, rather than the descriptor count.

Tested by the reporter and myself, successfully

Signed-off-by: Neil Horman &lt;nhorman@tuxdriver.com&gt;
CC: Shreyas Bhatewara &lt;sbhatewara@vmware.com&gt;
CC: "David S. Miller" &lt;davem@davemloft.net&gt;
Acked-by: Andy Gospodarek &lt;gospo@cumulusnetworks.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
vmxnet3's current napi path is built to count every rx descriptor we recieve,
and use that as a count of the napi budget.  That means its possible to return
from a napi poll halfway through recieving a fragmented packet accross multiple
dma descriptors.  If that happens, the next napi poll will start with the
descriptor ring in an improper state (e.g. the first descriptor we look at may
have the end-of-packet bit set), which will cause a BUG halt in the driver.

Fix the issue by only counting whole received packets in the napi poll and
returning that value, rather than the descriptor count.

Tested by the reporter and myself, successfully

Signed-off-by: Neil Horman &lt;nhorman@tuxdriver.com&gt;
CC: Shreyas Bhatewara &lt;sbhatewara@vmware.com&gt;
CC: "David S. Miller" &lt;davem@davemloft.net&gt;
Acked-by: Andy Gospodarek &lt;gospo@cumulusnetworks.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>vmxnet3: Bump up driver version number</title>
<updated>2015-06-29T16:27:45+00:00</updated>
<author>
<name>Shreyas Bhatewara</name>
<email>sbhatewara@vmware.com</email>
</author>
<published>2015-06-29T11:14:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=a694717437c14efd489566540e821bc83ec234f3'/>
<id>a694717437c14efd489566540e821bc83ec234f3</id>
<content type='text'>
Bump up the driver version number to reflect the changes done to
work with vmxnet3 adapter version 2

Signed-off-by: Shreyas N Bhatewara &lt;sbhatewara@vmware.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Bump up the driver version number to reflect the changes done to
work with vmxnet3 adapter version 2

Signed-off-by: Shreyas N Bhatewara &lt;sbhatewara@vmware.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>vmxnet3: Changes for vmxnet3 adapter version 2 (fwd)</title>
<updated>2015-06-23T13:26:01+00:00</updated>
<author>
<name>Shreyas Bhatewara</name>
<email>sbhatewara@vmware.com</email>
</author>
<published>2015-06-19T20:38:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=45dac1d6ea045ae56e4df8d9c70c92c7412bd4fc'/>
<id>45dac1d6ea045ae56e4df8d9c70c92c7412bd4fc</id>
<content type='text'>
Make the driver understand adapter version 2.

Cc: Rachel Lunnon &lt;rachel_lunnon@stormagic.com&gt;
Signed-off-by: Guolin Yang &lt;gyang@vmware.com&gt;
Signed-off-by: Shreyas N Bhatewara &lt;sbhatewara@vmware.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Make the driver understand adapter version 2.

Cc: Rachel Lunnon &lt;rachel_lunnon@stormagic.com&gt;
Signed-off-by: Guolin Yang &lt;gyang@vmware.com&gt;
Signed-off-by: Shreyas N Bhatewara &lt;sbhatewara@vmware.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
</feed>
