Commit 40b8c2a1 authored by Ronak Doshi's avatar Ronak Doshi Committed by David S. Miller

vmxnet3: correctly report encapsulated LRO packet

Commit dacce2be ("vmxnet3: add geneve and vxlan tunnel offload
support") added support for encapsulation offload. However, the
pathc did not report correctly the encapsulated packet which is
LRO'ed by the hypervisor.

This patch fixes this issue by using correct callback for the LRO'ed
encapsulated packet.

Fixes: dacce2be ("vmxnet3: add geneve and vxlan tunnel offload support")
Signed-off-by: default avatarRonak Doshi <doshir@vmware.com>
Acked-by: default avatarGuolin Yang <gyang@vmware.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4eb0c285
...@@ -1396,6 +1396,7 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq, ...@@ -1396,6 +1396,7 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq,
}; };
u32 num_pkts = 0; u32 num_pkts = 0;
bool skip_page_frags = false; bool skip_page_frags = false;
bool encap_lro = false;
struct Vmxnet3_RxCompDesc *rcd; struct Vmxnet3_RxCompDesc *rcd;
struct vmxnet3_rx_ctx *ctx = &rq->rx_ctx; struct vmxnet3_rx_ctx *ctx = &rq->rx_ctx;
u16 segCnt = 0, mss = 0; u16 segCnt = 0, mss = 0;
...@@ -1556,13 +1557,18 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq, ...@@ -1556,13 +1557,18 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq,
if (VMXNET3_VERSION_GE_2(adapter) && if (VMXNET3_VERSION_GE_2(adapter) &&
rcd->type == VMXNET3_CDTYPE_RXCOMP_LRO) { rcd->type == VMXNET3_CDTYPE_RXCOMP_LRO) {
struct Vmxnet3_RxCompDescExt *rcdlro; struct Vmxnet3_RxCompDescExt *rcdlro;
union Vmxnet3_GenericDesc *gdesc;
rcdlro = (struct Vmxnet3_RxCompDescExt *)rcd; rcdlro = (struct Vmxnet3_RxCompDescExt *)rcd;
gdesc = (union Vmxnet3_GenericDesc *)rcd;
segCnt = rcdlro->segCnt; segCnt = rcdlro->segCnt;
WARN_ON_ONCE(segCnt == 0); WARN_ON_ONCE(segCnt == 0);
mss = rcdlro->mss; mss = rcdlro->mss;
if (unlikely(segCnt <= 1)) if (unlikely(segCnt <= 1))
segCnt = 0; segCnt = 0;
encap_lro = (le32_to_cpu(gdesc->dword[0]) &
(1UL << VMXNET3_RCD_HDR_INNER_SHIFT));
} else { } else {
segCnt = 0; segCnt = 0;
} }
...@@ -1630,7 +1636,7 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq, ...@@ -1630,7 +1636,7 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq,
vmxnet3_rx_csum(adapter, skb, vmxnet3_rx_csum(adapter, skb,
(union Vmxnet3_GenericDesc *)rcd); (union Vmxnet3_GenericDesc *)rcd);
skb->protocol = eth_type_trans(skb, adapter->netdev); skb->protocol = eth_type_trans(skb, adapter->netdev);
if (!rcd->tcp || if ((!rcd->tcp && !encap_lro) ||
!(adapter->netdev->features & NETIF_F_LRO)) !(adapter->netdev->features & NETIF_F_LRO))
goto not_lro; goto not_lro;
...@@ -1639,7 +1645,7 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq, ...@@ -1639,7 +1645,7 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq,
SKB_GSO_TCPV4 : SKB_GSO_TCPV6; SKB_GSO_TCPV4 : SKB_GSO_TCPV6;
skb_shinfo(skb)->gso_size = mss; skb_shinfo(skb)->gso_size = mss;
skb_shinfo(skb)->gso_segs = segCnt; skb_shinfo(skb)->gso_segs = segCnt;
} else if (segCnt != 0 || skb->len > mtu) { } else if ((segCnt != 0 || skb->len > mtu) && !encap_lro) {
u32 hlen; u32 hlen;
hlen = vmxnet3_get_hdr_len(adapter, skb, hlen = vmxnet3_get_hdr_len(adapter, skb,
...@@ -1668,6 +1674,7 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq, ...@@ -1668,6 +1674,7 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq,
napi_gro_receive(&rq->napi, skb); napi_gro_receive(&rq->napi, skb);
ctx->skb = NULL; ctx->skb = NULL;
encap_lro = false;
num_pkts++; num_pkts++;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment