Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp15443767rwb; Mon, 28 Nov 2022 11:37:18 -0800 (PST) X-Google-Smtp-Source: AA0mqf63/QxUbBtxDwB5LNdJXjBN5Xw8XDFKtWBFs9gzEJZAE6c/f07lNVJ1iWpJ9+oZjlZP42dA X-Received: by 2002:a17:906:198d:b0:7a5:f8a5:6f84 with SMTP id g13-20020a170906198d00b007a5f8a56f84mr26919926ejd.569.1669664237834; Mon, 28 Nov 2022 11:37:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669664237; cv=none; d=google.com; s=arc-20160816; b=usPGpiG7pyCzu2AymInscI70PxAX/pHfgc5G9fpfDs9/cfTLkPTkZZGKsoX2ug1JG3 P8ABfJ4YwQsVq59+krWJcjkcKsxD2pyUWUYTBwpP9Urfgieb0Iiaga0FmDMRVo+3wm+u UKQGlGr7YqJir1c0kWJEYIbGx7SpQ9uXuEp4iAdVKIZWtpNgAb6Y9hy+yEWaF4hbyXqb gpQSv3/VZwit0pz9e7Hi3flh0KJfXWR84HXJsNPZl1GWOLZvZSBUsoq8yde2eHOulPJR 8Mr7o6V81GiUdTJ1/IYx0tUoqHz25yabaI8Sdu2t7ttP4ttNcVPL4BXJxOXM5eJQ04YB SOYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=QUJMWrLlm9IEHGxbBgkN9Yp8GDk305AArScPpFoLZdw=; b=qKDnPOlRZfSXqa0PDIW9c40e+hBZnwVOYByD4DkCRog9w1fzCMthh4j7bY8hqAV5AR PVEW7v3Hprwll+CJdNtdrm9zvzrlu6LQbcV6Slvw1KH/uUVUFVpt4ZmJWpMkLRF4cchV 0hfoxJjszzI/ZaQ8El4dz2vivusZtctZ1LBJ8naPmyqg3D2HySvxk5TQk17jHniiQCkg QktEeuG1EkPctXOZNVjuqujo2mJMXnOvpjVbAG0fdw8MsPTgAgq7NVh0dMdsJzOwbnjD SqSKPIZh81rsgvdF9pbyWAwnNVGU+aXihEJGuwBIhPfyESeALyYcusvEnlbTrW++i4BP JIkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@vmware.com header.s=s1024 header.b=wLqYOehS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=vmware.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id xa3-20020a170906fd8300b0078e0e850902si9452637ejb.868.2022.11.28.11.36.48; Mon, 28 Nov 2022 11:37:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@vmware.com header.s=s1024 header.b=wLqYOehS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=vmware.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233785AbiK1Tc0 (ORCPT + 84 others); Mon, 28 Nov 2022 14:32:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234092AbiK1TcI (ORCPT ); Mon, 28 Nov 2022 14:32:08 -0500 Received: from EX-PRD-EDGE02.vmware.com (ex-prd-edge02.vmware.com [208.91.3.34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E0232D1FE; Mon, 28 Nov 2022 11:32:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=s1024; d=vmware.com; h=from:to:cc:subject:date:message-id:in-reply-to:mime-version: content-type; bh=QUJMWrLlm9IEHGxbBgkN9Yp8GDk305AArScPpFoLZdw=; b=wLqYOehSxSyaopsfO20/hSRNJdj7t/D/VsgxI9oxaiqwNDDGNHX0uY0r1Bg8ed 8pgxSeEDhtqqVsIOF9/2qNpWBbdXV11mpyR5k7a0e0SvuNEtlYwqWRdeEE33hN LDMk+3RpU11YUc/nIcVZ2C6m5h/Mjh9imcadxA6PhIw9qNc= Received: from sc9-mailhost1.vmware.com (10.113.161.71) by EX-PRD-EDGE02.vmware.com (10.188.245.7) with Microsoft SMTP Server id 15.1.2308.14; Mon, 28 Nov 2022 11:31:52 -0800 Received: from htb-1n-eng-dhcp122.eng.vmware.com (unknown [10.20.114.216]) by sc9-mailhost1.vmware.com (Postfix) with ESMTP id 39B2520253; Mon, 28 Nov 2022 11:32:06 -0800 (PST) Received: by htb-1n-eng-dhcp122.eng.vmware.com (Postfix, from userid 0) id 3459CAE1B0; Mon, 28 Nov 2022 11:32:06 -0800 (PST) From: Ronak Doshi To: CC: Ronak Doshi , VMware PV-Drivers Reviewers , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , open list Subject: [PATCH v1 net 1/2] vmxnet3: correctly report encapsulated LRO packet Date: Mon, 28 Nov 2022 11:32:03 -0800 Message-ID: <20221128193205.3820-2-doshir@vmware.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20221128193205.3820-1-doshir@vmware.com> References: <20221128193205.3820-1-doshir@vmware.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: None (EX-PRD-EDGE02.vmware.com: doshir@vmware.com does not designate permitted sender hosts) X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit dacce2be3312 ("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: dacce2be3312 ("vmxnet3: add geneve and vxlan tunnel offload support") Signed-off-by: Ronak Doshi Acked-by: Guolin Yang --- drivers/net/vmxnet3/vmxnet3_drv.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c index d3e7b27eb933..611e8a85de17 100644 --- a/drivers/net/vmxnet3/vmxnet3_drv.c +++ b/drivers/net/vmxnet3/vmxnet3_drv.c @@ -1396,6 +1396,7 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq, }; u32 num_pkts = 0; bool skip_page_frags = false; + bool encap_lro = false; struct Vmxnet3_RxCompDesc *rcd; struct vmxnet3_rx_ctx *ctx = &rq->rx_ctx; u16 segCnt = 0, mss = 0; @@ -1556,13 +1557,18 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq, if (VMXNET3_VERSION_GE_2(adapter) && rcd->type == VMXNET3_CDTYPE_RXCOMP_LRO) { struct Vmxnet3_RxCompDescExt *rcdlro; + union Vmxnet3_GenericDesc *gdesc; + rcdlro = (struct Vmxnet3_RxCompDescExt *)rcd; + gdesc = (union Vmxnet3_GenericDesc *)rcd; segCnt = rcdlro->segCnt; WARN_ON_ONCE(segCnt == 0); mss = rcdlro->mss; if (unlikely(segCnt <= 1)) segCnt = 0; + encap_lro = (le32_to_cpu(gdesc->dword[0]) & + (1UL << VMXNET3_RCD_HDR_INNER_SHIFT)); } else { segCnt = 0; } @@ -1630,7 +1636,7 @@ 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 || + if ((!rcd->tcp && !encap_lro) || !(adapter->netdev->features & NETIF_F_LRO)) goto not_lro; @@ -1639,7 +1645,7 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq, SKB_GSO_TCPV4 : SKB_GSO_TCPV6; skb_shinfo(skb)->gso_size = mss; skb_shinfo(skb)->gso_segs = segCnt; - } else if (segCnt != 0 || skb->len > mtu) { + } else if ((segCnt != 0 || skb->len > mtu) && !encap_lro) { u32 hlen; hlen = vmxnet3_get_hdr_len(adapter, skb, @@ -1668,6 +1674,8 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq, napi_gro_receive(&rq->napi, skb); ctx->skb = NULL; + if (encap_lro) + encap_lro = false; num_pkts++; } -- 2.11.0