Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2299794iof; Wed, 8 Jun 2022 01:51:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxK7otVzSOCXXoa3XN/Ur/EiwecZTMDfxlH6sEe1EEgxXyQUcbjchmnfJDy69npSyooiC8F X-Received: by 2002:a17:90b:3a87:b0:1e8:789d:c60 with SMTP id om7-20020a17090b3a8700b001e8789d0c60mr17468859pjb.77.1654678291973; Wed, 08 Jun 2022 01:51:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654678291; cv=none; d=google.com; s=arc-20160816; b=VtUD5CwxgmKhK/+GMpCHciTs5D3hx+3BOINNC2bI1f8WhZIHQwCYFdZwXqDZtblO4l pLNv71j72u2QnCD1utacf6breE4QLxiH5T22fRJ0JXN4Rf5l5klrE4a/NeXEwd8LbKhs L0kVrPrDHjCg4rPPO+3cdzYlfhtzvFlKDB+fN8VIH6UXYSfwBnwMDD9tRa5PFP5SQFyT v+/YtWA1lj3KZOEeuOzNXVE+DqXp7eyEycBAYTM+R1cYK6IA8NM/Bwf9UUG+txb0sl80 h0CHflS+bIBvP3aWSsXf2i0QerIRAEICgxeOD0yVUm7OHss026LK50ySJPgUdwDItYKi ExKg== 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=q1Tg/wqCzr6O6IDRP6nkjppRtmGVU7CRSaKK5KQoZrA=; b=DwpIp0J+2K4kiBVCKBgK7DkoZe/NBpoOBVyDw+p1JMyZmUMNsUyaeZwgoxselATa3l gLAnI3PU3qmsFvDs0hO65PYcm330hTBFrdGGW40vEbIkxmIS4KgdmxMWGiRXhe3F5+GH pWGi29B/7tXWHigSDIGNhLTJjkKu/Du9Csp5Zh9OBA2XuxprEeqmqKwkgmgfcZyq13ys cgbDm0ey4lOozKXjEGy3vnOOa8BC0fBsXn9NGrPnTyZzd2yYxV9M6y94foZ70In0pkcM M29pYu16a2bV/ghNnX0vvyXEIMtqBvdIt9bAxjW2Esoq+q+LFmZss67TPQsvkzpRDKvk is/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@vmware.com header.s=s1024 header.b=gM+7zrFY; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id b9-20020a056a000a8900b0050567a6fe15si30676891pfl.365.2022.06.08.01.51.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 01:51:31 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@vmware.com header.s=s1024 header.b=gM+7zrFY; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=vmware.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 67CA03AB1F8; Wed, 8 Jun 2022 01:14:23 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233693AbiFHFlQ (ORCPT + 99 others); Wed, 8 Jun 2022 01:41:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236085AbiFHFky (ORCPT ); Wed, 8 Jun 2022 01:40:54 -0400 Received: from EX-PRD-EDGE01.vmware.com (ex-prd-edge01.vmware.com [208.91.3.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22C3940BA5B; Tue, 7 Jun 2022 20:24:19 -0700 (PDT) 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=q1Tg/wqCzr6O6IDRP6nkjppRtmGVU7CRSaKK5KQoZrA=; b=gM+7zrFYzjuT6XB249YrR14hDSE0pNgadBb5EYVQBxpkux77eDEerMCkNigeDr VX6ec/RkYldNjjdjNkC9dSCkhTJsL+27eDaJz+Wm+4N+T8AtGr7m9bVIq2C8d/ dhn6J1AQpqzipRJ7BPGBgUKzSKT2Ysbu1tdVppMyHslNiKc= Received: from sc9-mailhost1.vmware.com (10.113.161.71) by EX-PRD-EDGE01.vmware.com (10.188.245.6) with Microsoft SMTP Server id 15.1.2308.20; Tue, 7 Jun 2022 20:23:53 -0700 Received: from htb-1n-eng-dhcp122.eng.vmware.com (unknown [10.20.114.216]) by sc9-mailhost1.vmware.com (Postfix) with ESMTP id 9C6692346F; Tue, 7 Jun 2022 20:24:08 -0700 (PDT) Received: by htb-1n-eng-dhcp122.eng.vmware.com (Postfix, from userid 0) id 96D69AA454; Tue, 7 Jun 2022 20:24:08 -0700 (PDT) From: Ronak Doshi To: CC: Ronak Doshi , VMware PV-Drivers Reviewers , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , open list Subject: [PATCH v3 net-next 7/8] vmxnet3: use ext1 field to indicate encapsulated packet Date: Tue, 7 Jun 2022 20:23:52 -0700 Message-ID: <20220608032353.964-8-doshir@vmware.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20220608032353.964-1-doshir@vmware.com> References: <20220608032353.964-1-doshir@vmware.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: None (EX-PRD-EDGE01.vmware.com: doshir@vmware.com does not designate permitted sender hosts) X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Till vmxnet3 version 6, om field of transmit descriptor was used to indicate encapsulated offload packet and msscof was used to indirectly indicate TSO/CSO. From version 7 and later, ext1 field will be used to indicate whether packet is encapsulated or not and om fields will continue to indicate if the packet is TSO or CSO. Signed-off-by: Ronak Doshi Acked-by: Guolin Yang --- drivers/net/vmxnet3/vmxnet3_defs.h | 14 ++++++++------ drivers/net/vmxnet3/vmxnet3_drv.c | 18 +++++++++++++++--- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/drivers/net/vmxnet3/vmxnet3_defs.h b/drivers/net/vmxnet3/vmxnet3_defs.h index cb9dc72f2b3d..41d6767283a6 100644 --- a/drivers/net/vmxnet3/vmxnet3_defs.h +++ b/drivers/net/vmxnet3/vmxnet3_defs.h @@ -148,17 +148,17 @@ struct Vmxnet3_TxDesc { #ifdef __BIG_ENDIAN_BITFIELD u32 msscof:14; /* MSS, checksum offset, flags */ - u32 ext1:1; + u32 ext1:1; /* set to 1 to indicate inner csum/tso, vmxnet3 v7 */ u32 dtype:1; /* descriptor type */ - u32 oco:1; + u32 oco:1; /* Outer csum offload */ u32 gen:1; /* generation bit */ u32 len:14; #else u32 len:14; u32 gen:1; /* generation bit */ - u32 oco:1; + u32 oco:1; /* Outer csum offload */ u32 dtype:1; /* descriptor type */ - u32 ext1:1; + u32 ext1:1; /* set to 1 to indicate inner csum/tso, vmxnet3 v7 */ u32 msscof:14; /* MSS, checksum offset, flags */ #endif /* __BIG_ENDIAN_BITFIELD */ @@ -262,11 +262,13 @@ struct Vmxnet3_RxCompDesc { u32 rqID:10; /* rx queue/ring ID */ u32 sop:1; /* Start of Packet */ u32 eop:1; /* End of Packet */ - u32 ext1:2; + u32 ext1:2; /* bit 0: indicating v4/v6/.. is for inner header */ + /* bit 1: indicating rssType is based on inner header */ u32 rxdIdx:12; /* Index of the RxDesc */ #else u32 rxdIdx:12; /* Index of the RxDesc */ - u32 ext1:2; + u32 ext1:2; /* bit 0: indicating v4/v6/.. is for inner header */ + /* bit 1: indicating rssType is based on inner header */ u32 eop:1; /* End of Packet */ u32 sop:1; /* Start of Packet */ u32 rqID:10; /* rx queue/ring ID */ diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c index 2ee3a2e39f10..5c42b4a008e8 100644 --- a/drivers/net/vmxnet3/vmxnet3_drv.c +++ b/drivers/net/vmxnet3/vmxnet3_drv.c @@ -1161,7 +1161,12 @@ vmxnet3_tq_xmit(struct sk_buff *skb, struct vmxnet3_tx_queue *tq, if (ctx.mss) { if (VMXNET3_VERSION_GE_4(adapter) && skb->encapsulation) { gdesc->txd.hlen = ctx.l4_offset + ctx.l4_hdr_size; - gdesc->txd.om = VMXNET3_OM_ENCAP; + if (VMXNET3_VERSION_GE_7(adapter)) { + gdesc->txd.om = VMXNET3_OM_TSO; + gdesc->txd.ext1 = 1; + } else { + gdesc->txd.om = VMXNET3_OM_ENCAP; + } gdesc->txd.msscof = ctx.mss; if (skb_shinfo(skb)->gso_type & SKB_GSO_UDP_TUNNEL_CSUM) @@ -1178,8 +1183,15 @@ vmxnet3_tq_xmit(struct sk_buff *skb, struct vmxnet3_tx_queue *tq, skb->encapsulation) { gdesc->txd.hlen = ctx.l4_offset + ctx.l4_hdr_size; - gdesc->txd.om = VMXNET3_OM_ENCAP; - gdesc->txd.msscof = 0; /* Reserved */ + if (VMXNET3_VERSION_GE_7(adapter)) { + gdesc->txd.om = VMXNET3_OM_CSUM; + gdesc->txd.msscof = ctx.l4_offset + + skb->csum_offset; + gdesc->txd.ext1 = 1; + } else { + gdesc->txd.om = VMXNET3_OM_ENCAP; + gdesc->txd.msscof = 0; /* Reserved */ + } } else { gdesc->txd.hlen = ctx.l4_offset; gdesc->txd.om = VMXNET3_OM_CSUM; -- 2.11.0