[SRU][Xenial][PATCH 0/3] Fixes for LP:1768143

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[SRU][Xenial][PATCH 0/3] Fixes for LP:1768143

Joseph Salisbury-3
BugLink: http://bugs.launchpad.net/bugs/1768143

== SRU Justification ==
Recently, a couple of fixes went in vmxnet3 driver related to LRO, transmit
reset and rxvlan disabled fix. These fixes are being requested in
Bionic and Xenial.

The Bionic patches are slightly different, so they will be SRU'd
separatly.

A backport was needed to update version info in vmxnet3_int.h

== Fixes ==
7a4c003d6921 ("vmxnet3: avoid xmit reset due to a race in vmxnet3)"
034f40579389 ("vmxnet3: use correct flag to indicate LRO feature")
65ec0bd1c7c1 ("vmxnet3: fix incorrect dereference when rxvlan is disabled")

== Regression Potential ==
Low.  Limited to vmxnet3 driver.

== Test Case ==
A test kernel was built with these patches and tested by the original bug reporter.
The bug reporter states the test kernel resolved the bug.

Ronak Doshi (3):
  vmxnet3: avoid xmit reset due to a race in vmxnet3
  vmxnet3: use correct flag to indicate LRO feature
  vmxnet3: fix incorrect dereference when rxvlan is disabled

 drivers/net/vmxnet3/vmxnet3_drv.c | 33 +++++++++++++++++++++++----------
 drivers/net/vmxnet3/vmxnet3_int.h |  5 ++---
 2 files changed, 25 insertions(+), 13 deletions(-)

--
2.7.4


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[SRU][Xenial][PATCH 1/3] vmxnet3: avoid xmit reset due to a race in vmxnet3

Joseph Salisbury-3
From: Ronak Doshi <[hidden email]>

BugLink: http://bugs.launchpad.net/bugs/1768143

The field txNumDeferred is used by the driver to keep track of the number
of packets it has pushed to the emulation. The driver increments it on
pushing the packet to the emulation and the emulation resets it to 0 at
the end of the transmit.

There is a possibility of a race either when (a) ESX is under heavy load or
(b) workload inside VM is of low packet rate.

This race results in xmit hangs when network coalescing is disabled. This
change creates a local copy of txNumDeferred and uses it to perform ring
arithmetic.

Reported-by: Noriho Tanaka <[hidden email]>
Signed-off-by: Ronak Doshi <[hidden email]>
Acked-by: Shrikrishna Khare <[hidden email]>
Signed-off-by: David S. Miller <[hidden email]>
(back ported from commit 7a4c003d6921e2af215f4790aa43a292bdc78be0)
Signed-off-by: Joseph Salisbury <[hidden email]>
---
 drivers/net/vmxnet3/vmxnet3_drv.c | 13 ++++++++-----
 drivers/net/vmxnet3/vmxnet3_int.h |  4 ++--
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
index adec7c7..9e1349d 100644
--- a/drivers/net/vmxnet3/vmxnet3_drv.c
+++ b/drivers/net/vmxnet3/vmxnet3_drv.c
@@ -957,6 +957,8 @@ vmxnet3_tq_xmit(struct sk_buff *skb, struct vmxnet3_tx_queue *tq,
 {
  int ret;
  u32 count;
+ int num_pkts;
+ int tx_num_deferred;
  unsigned long flags;
  struct vmxnet3_tx_ctx ctx;
  union Vmxnet3_GenericDesc *gdesc;
@@ -1051,12 +1053,12 @@ vmxnet3_tq_xmit(struct sk_buff *skb, struct vmxnet3_tx_queue *tq,
 #else
  gdesc = ctx.sop_txd;
 #endif
+ tx_num_deferred = le32_to_cpu(tq->shared->txNumDeferred);
  if (ctx.mss) {
  gdesc->txd.hlen = ctx.eth_ip_hdr_size + ctx.l4_hdr_size;
  gdesc->txd.om = VMXNET3_OM_TSO;
  gdesc->txd.msscof = ctx.mss;
- le32_add_cpu(&tq->shared->txNumDeferred, (skb->len -
-     gdesc->txd.hlen + ctx.mss - 1) / ctx.mss);
+ num_pkts = (skb->len - gdesc->txd.hlen + ctx.mss - 1) / ctx.mss;
  } else {
  if (skb->ip_summed == CHECKSUM_PARTIAL) {
  gdesc->txd.hlen = ctx.eth_ip_hdr_size;
@@ -1067,8 +1069,10 @@ vmxnet3_tq_xmit(struct sk_buff *skb, struct vmxnet3_tx_queue *tq,
  gdesc->txd.om = 0;
  gdesc->txd.msscof = 0;
  }
- le32_add_cpu(&tq->shared->txNumDeferred, 1);
+ num_pkts = 1;
  }
+ le32_add_cpu(&tq->shared->txNumDeferred, num_pkts);
+ tx_num_deferred += num_pkts;
 
  if (skb_vlan_tag_present(skb)) {
  gdesc->txd.ti = 1;
@@ -1094,8 +1098,7 @@ vmxnet3_tq_xmit(struct sk_buff *skb, struct vmxnet3_tx_queue *tq,
 
  spin_unlock_irqrestore(&tq->tx_lock, flags);
 
- if (le32_to_cpu(tq->shared->txNumDeferred) >=
- le32_to_cpu(tq->shared->txThreshold)) {
+ if (tx_num_deferred >= le32_to_cpu(tq->shared->txThreshold)) {
  tq->shared->txNumDeferred = 0;
  VMXNET3_WRITE_BAR0_REG(adapter,
        VMXNET3_REG_TXPROD + tq->qid * 8,
diff --git a/drivers/net/vmxnet3/vmxnet3_int.h b/drivers/net/vmxnet3/vmxnet3_int.h
index c482539..7a8c771 100644
--- a/drivers/net/vmxnet3/vmxnet3_int.h
+++ b/drivers/net/vmxnet3/vmxnet3_int.h
@@ -69,10 +69,10 @@
 /*
  * Version numbers
  */
-#define VMXNET3_DRIVER_VERSION_STRING   "1.4.7.0-k"
+#define VMXNET3_DRIVER_VERSION_STRING   "1.4.12.0-k"
 
 /* a 32-bit int, each byte encode a verion number in VMXNET3_DRIVER_VERSION */
-#define VMXNET3_DRIVER_VERSION_NUM      0x01040700
+#define VMXNET3_DRIVER_VERSION_NUM      0x01040c00
 
 #if defined(CONFIG_PCI_MSI)
  /* RSS only makes sense if MSI-X is supported. */
--
2.7.4


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[SRU][Xenial][PATCH 2/3] vmxnet3: use correct flag to indicate LRO feature

Joseph Salisbury-3
In reply to this post by Joseph Salisbury-3
From: Ronak Doshi <[hidden email]>

BugLink: http://bugs.launchpad.net/bugs/1768143

'Commit 45dac1d6ea04 ("vmxnet3: Changes for vmxnet3 adapter version 2
(fwd)")' introduced a flag "lro" in structure vmxnet3_adapter which is
used to indicate whether LRO is enabled or not. However, the patch
did not set the flag and hence it was never exercised.

So, when LRO is enabled, it resulted in poor TCP performance due to
delayed acks. This issue is seen with packets which are larger than
the mss getting a delayed ack rather than an immediate ack, thus
resulting in high latency.

This patch removes the lro flag and directly uses device features
against NETIF_F_LRO to check if lro is enabled.

Fixes: 45dac1d6ea04 ("vmxnet3: Changes for vmxnet3 adapter version 2 (fwd)")
Reported-by: Rachel Lunnon <[hidden email]>
Signed-off-by: Ronak Doshi <[hidden email]>
Acked-by: Shrikrishna Khare <[hidden email]>
Signed-off-by: David S. Miller <[hidden email]>
(cherry picked from commit 034f405793897a3c8f642935f5494b86c340cde7)
Signed-off-by: Joseph Salisbury <[hidden email]>
---
 drivers/net/vmxnet3/vmxnet3_drv.c | 3 ++-
 drivers/net/vmxnet3/vmxnet3_int.h | 5 ++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
index 9e1349d..168b706 100644
--- a/drivers/net/vmxnet3/vmxnet3_drv.c
+++ b/drivers/net/vmxnet3/vmxnet3_drv.c
@@ -1424,7 +1424,8 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq,
  vmxnet3_rx_csum(adapter, skb,
  (union Vmxnet3_GenericDesc *)rcd);
  skb->protocol = eth_type_trans(skb, adapter->netdev);
- if (!rcd->tcp || !adapter->lro)
+ if (!rcd->tcp ||
+    !(adapter->netdev->features & NETIF_F_LRO))
  goto not_lro;
 
  if (segCnt != 0 && mss != 0) {
diff --git a/drivers/net/vmxnet3/vmxnet3_int.h b/drivers/net/vmxnet3/vmxnet3_int.h
index 7a8c771..9b1194c 100644
--- a/drivers/net/vmxnet3/vmxnet3_int.h
+++ b/drivers/net/vmxnet3/vmxnet3_int.h
@@ -69,10 +69,10 @@
 /*
  * Version numbers
  */
-#define VMXNET3_DRIVER_VERSION_STRING   "1.4.12.0-k"
+#define VMXNET3_DRIVER_VERSION_STRING   "1.4.13.0-k"
 
 /* a 32-bit int, each byte encode a verion number in VMXNET3_DRIVER_VERSION */
-#define VMXNET3_DRIVER_VERSION_NUM      0x01040c00
+#define VMXNET3_DRIVER_VERSION_NUM      0x01040d00
 
 #if defined(CONFIG_PCI_MSI)
  /* RSS only makes sense if MSI-X is supported. */
@@ -331,7 +331,6 @@ struct vmxnet3_adapter {
  u8                              version;
 
  bool rxcsum;
- bool lro;
 
 #ifdef VMXNET3_RSS
  struct UPT1_RSSConf *rss_conf;
--
2.7.4


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[SRU][Xenial][PATCH 3/3] vmxnet3: fix incorrect dereference when rxvlan is disabled

Joseph Salisbury-3
In reply to this post by Joseph Salisbury-3
From: Ronak Doshi <[hidden email]>

BugLink: http://bugs.launchpad.net/bugs/1768143

vmxnet3_get_hdr_len() is used to calculate the header length which in
turn is used to calculate the gso_size for skb. When rxvlan offload is
disabled, vlan tag is present in the header and the function references
ip header from sizeof(ethhdr) and leads to incorrect pointer reference.

This patch fixes this issue by taking sizeof(vlan_ethhdr) into account
if vlan tag is present and correctly references the ip hdr.

Signed-off-by: Ronak Doshi <[hidden email]>
Acked-by: Guolin Yang <[hidden email]>
Acked-by: Louis Luo <[hidden email]>
Signed-off-by: David S. Miller <[hidden email]>
(cherry picked from commit 65ec0bd1c7c14522670a5294de35710fb577a7fd)
Signed-off-by: Joseph Salisbury <[hidden email]>
---
 drivers/net/vmxnet3/vmxnet3_drv.c | 17 +++++++++++++----
 drivers/net/vmxnet3/vmxnet3_int.h |  4 ++--
 2 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
index 168b706..ce3cb18 100644
--- a/drivers/net/vmxnet3/vmxnet3_drv.c
+++ b/drivers/net/vmxnet3/vmxnet3_drv.c
@@ -1196,6 +1196,7 @@ vmxnet3_get_hdr_len(struct vmxnet3_adapter *adapter, struct sk_buff *skb,
  union {
  void *ptr;
  struct ethhdr *eth;
+ struct vlan_ethhdr *veth;
  struct iphdr *ipv4;
  struct ipv6hdr *ipv6;
  struct tcphdr *tcp;
@@ -1206,16 +1207,24 @@ vmxnet3_get_hdr_len(struct vmxnet3_adapter *adapter, struct sk_buff *skb,
  if (unlikely(sizeof(struct iphdr) + sizeof(struct tcphdr) > maplen))
  return 0;
 
+ if (skb->protocol == cpu_to_be16(ETH_P_8021Q) ||
+    skb->protocol == cpu_to_be16(ETH_P_8021AD))
+ hlen = sizeof(struct vlan_ethhdr);
+ else
+ hlen = sizeof(struct ethhdr);
+
  hdr.eth = eth_hdr(skb);
  if (gdesc->rcd.v4) {
- BUG_ON(hdr.eth->h_proto != htons(ETH_P_IP));
- hdr.ptr += sizeof(struct ethhdr);
+ BUG_ON(hdr.eth->h_proto != htons(ETH_P_IP) &&
+       hdr.veth->h_vlan_encapsulated_proto != htons(ETH_P_IP));
+ hdr.ptr += hlen;
  BUG_ON(hdr.ipv4->protocol != IPPROTO_TCP);
  hlen = hdr.ipv4->ihl << 2;
  hdr.ptr += hdr.ipv4->ihl << 2;
  } else if (gdesc->rcd.v6) {
- BUG_ON(hdr.eth->h_proto != htons(ETH_P_IPV6));
- hdr.ptr += sizeof(struct ethhdr);
+ BUG_ON(hdr.eth->h_proto != htons(ETH_P_IPV6) &&
+       hdr.veth->h_vlan_encapsulated_proto != htons(ETH_P_IPV6));
+ hdr.ptr += hlen;
  /* Use an estimated value, since we also need to handle
  * TSO case.
  */
diff --git a/drivers/net/vmxnet3/vmxnet3_int.h b/drivers/net/vmxnet3/vmxnet3_int.h
index 9b1194c..63f549d 100644
--- a/drivers/net/vmxnet3/vmxnet3_int.h
+++ b/drivers/net/vmxnet3/vmxnet3_int.h
@@ -69,10 +69,10 @@
 /*
  * Version numbers
  */
-#define VMXNET3_DRIVER_VERSION_STRING   "1.4.13.0-k"
+#define VMXNET3_DRIVER_VERSION_STRING   "1.4.14.0-k"
 
 /* a 32-bit int, each byte encode a verion number in VMXNET3_DRIVER_VERSION */
-#define VMXNET3_DRIVER_VERSION_NUM      0x01040d00
+#define VMXNET3_DRIVER_VERSION_NUM      0x01040e00
 
 #if defined(CONFIG_PCI_MSI)
  /* RSS only makes sense if MSI-X is supported. */
--
2.7.4


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

ACK: [SRU][Xenial][PATCH 0/3] Fixes for LP:1768143

Kleber Sacilotto de Souza
In reply to this post by Joseph Salisbury-3
On 06/01/18 09:10, Joseph Salisbury wrote:

> BugLink: http://bugs.launchpad.net/bugs/1768143
>
> == SRU Justification ==
> Recently, a couple of fixes went in vmxnet3 driver related to LRO, transmit
> reset and rxvlan disabled fix. These fixes are being requested in
> Bionic and Xenial.
>
> The Bionic patches are slightly different, so they will be SRU'd
> separatly.
>
> A backport was needed to update version info in vmxnet3_int.h
>
> == Fixes ==
> 7a4c003d6921 ("vmxnet3: avoid xmit reset due to a race in vmxnet3)"
> 034f40579389 ("vmxnet3: use correct flag to indicate LRO feature")
> 65ec0bd1c7c1 ("vmxnet3: fix incorrect dereference when rxvlan is disabled")
>
> == Regression Potential ==
> Low.  Limited to vmxnet3 driver.
>
> == Test Case ==
> A test kernel was built with these patches and tested by the original bug reporter.
> The bug reporter states the test kernel resolved the bug.
>
> Ronak Doshi (3):
>   vmxnet3: avoid xmit reset due to a race in vmxnet3
>   vmxnet3: use correct flag to indicate LRO feature
>   vmxnet3: fix incorrect dereference when rxvlan is disabled
>
>  drivers/net/vmxnet3/vmxnet3_drv.c | 33 +++++++++++++++++++++++----------
>  drivers/net/vmxnet3/vmxnet3_int.h |  5 ++---
>  2 files changed, 25 insertions(+), 13 deletions(-)
>

Acked-by: Kleber Sacilotto de Souza <[hidden email]>

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

ACK/cmnt: [SRU][Xenial][PATCH 0/3] Fixes for LP:1768143

Stefan Bader-2
In reply to this post by Joseph Salisbury-3
On 01.06.2018 09:10, Joseph Salisbury wrote:

> BugLink: http://bugs.launchpad.net/bugs/1768143
>
> == SRU Justification ==
> Recently, a couple of fixes went in vmxnet3 driver related to LRO, transmit
> reset and rxvlan disabled fix. These fixes are being requested in
> Bionic and Xenial.
>
> The Bionic patches are slightly different, so they will be SRU'd
> separatly.
>
> A backport was needed to update version info in vmxnet3_int.h
>
> == Fixes ==
> 7a4c003d6921 ("vmxnet3: avoid xmit reset due to a race in vmxnet3)"
> 034f40579389 ("vmxnet3: use correct flag to indicate LRO feature")
> 65ec0bd1c7c1 ("vmxnet3: fix incorrect dereference when rxvlan is disabled")
>
> == Regression Potential ==
> Low.  Limited to vmxnet3 driver.
>
> == Test Case ==
> A test kernel was built with these patches and tested by the original bug reporter.
> The bug reporter states the test kernel resolved the bug.
>
> Ronak Doshi (3):
>   vmxnet3: avoid xmit reset due to a race in vmxnet3
>   vmxnet3: use correct flag to indicate LRO feature
>   vmxnet3: fix incorrect dereference when rxvlan is disabled
>
>  drivers/net/vmxnet3/vmxnet3_drv.c | 33 +++++++++++++++++++++++----------
>  drivers/net/vmxnet3/vmxnet3_int.h |  5 ++---
>  2 files changed, 25 insertions(+), 13 deletions(-)
>
Again "back ported" -> "backported"

Acked-by: Stefan Bader <[hidden email]>



--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team

signature.asc (836 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

APPLIED: [SRU][Xenial][PATCH 0/3] Fixes for LP:1768143

Khaled Elmously
In reply to this post by Joseph Salisbury-3
Applied to Xenial


On 2018-06-01 12:10:10 , Joseph Salisbury wrote:

> BugLink: http://bugs.launchpad.net/bugs/1768143
>
> == SRU Justification ==
> Recently, a couple of fixes went in vmxnet3 driver related to LRO, transmit
> reset and rxvlan disabled fix. These fixes are being requested in
> Bionic and Xenial.
>
> The Bionic patches are slightly different, so they will be SRU'd
> separatly.
>
> A backport was needed to update version info in vmxnet3_int.h
>
> == Fixes ==
> 7a4c003d6921 ("vmxnet3: avoid xmit reset due to a race in vmxnet3)"
> 034f40579389 ("vmxnet3: use correct flag to indicate LRO feature")
> 65ec0bd1c7c1 ("vmxnet3: fix incorrect dereference when rxvlan is disabled")
>
> == Regression Potential ==
> Low.  Limited to vmxnet3 driver.
>
> == Test Case ==
> A test kernel was built with these patches and tested by the original bug reporter.
> The bug reporter states the test kernel resolved the bug.
>
> Ronak Doshi (3):
>   vmxnet3: avoid xmit reset due to a race in vmxnet3
>   vmxnet3: use correct flag to indicate LRO feature
>   vmxnet3: fix incorrect dereference when rxvlan is disabled
>
>  drivers/net/vmxnet3/vmxnet3_drv.c | 33 +++++++++++++++++++++++----------
>  drivers/net/vmxnet3/vmxnet3_int.h |  5 ++---
>  2 files changed, 25 insertions(+), 13 deletions(-)
>
> --
> 2.7.4
>
>
> --
> kernel-team mailing list
> [hidden email]
> https://lists.ubuntu.com/mailman/listinfo/kernel-team

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team