From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id AB4F2A0C41; Thu, 30 Sep 2021 10:14:54 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8F7F2410EA; Thu, 30 Sep 2021 10:14:54 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id C314E4067E for ; Thu, 30 Sep 2021 10:14:52 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10122"; a="310678246" X-IronPort-AV: E=Sophos;i="5.85,335,1624345200"; d="scan'208";a="310678246" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Sep 2021 01:14:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,335,1624345200"; d="scan'208";a="707788958" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by fmsmga006.fm.intel.com with ESMTP; 30 Sep 2021 01:14:44 -0700 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Thu, 30 Sep 2021 01:14:44 -0700 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx607.amr.corp.intel.com (10.18.126.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Thu, 30 Sep 2021 01:14:43 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Thu, 30 Sep 2021 01:14:43 -0700 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (104.47.73.168) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Thu, 30 Sep 2021 01:14:43 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Z9Uhu2olvbCJPqHosR060GEsFLovVUCbQ+r/RO1BMTWeqdm43YOJ40iA07oZdxCYW4ttdADyhxKOiI6sK2pcGAsCDGCaKFmsaLdvb1mcHL4lYWCQw69af+0eYdmZOKNJ1s/Cf5kMb6fEneMAk9jvtbxCr7aBgK9cGZ/S5RIbK8BCzTeFaMvzIC024M0VEirNfqR3qG6fTzNiECsGWP6urpkA2yr2oCO7k00DnW38yPFtM4Xqf2fCDDGuUGh5e3/bq0nq81XMYu9xWqH/JtXYqiyqempk8g8arH0heSYUxnUyy22nDkK4N6cnOhF2S41Y1hIQRV9PWXJDYImiovyLXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=GVpVhdz9vaeHQO3ueoNAcN77jOhDJv4aHxcsSXZwHrg=; b=lbhTptXDZ6Z8CRq1L7rnPxPzswcD8ph9OWxds9aaKCCVSkoKOcAdjOsBZ5N80JcGwjVZe4HGbEtZAGS3REWV3b2xlW11C+c35Pu5gr8TaLrVgm0KvisKfLcgyHur6VJxINCPS04zMoiNHxauxBLeLntu1dFePaddUPcNYLubjyoSmR1mL+2/wjMZlIldpKGlfpyTO+j6/C8FZBkQIDKL0JejQ2sr43yZAZNFN9wF8XXHKdmJW60hagc7Xrf2aVpTc5149tNwN/8I8YNifxQiBYlodv3AE2W5SW0zkq4fWUIqipkTII1LQCzl6c+vdcSM+o1ZPTEnkAkSc2bYKqIGYA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GVpVhdz9vaeHQO3ueoNAcN77jOhDJv4aHxcsSXZwHrg=; b=BGt0hgUfzvZspyNbtqGJXHKayhXKIU9TOqCfX2y2FmQD/BHN+Nyh5408iu/wG1TLbIUeYAuU3Vpp3lk/pUf7kRCEDcKGBLU/CkithHY7bV18zBM9yw9Bj/G1qyBWxwK71evXSMazyiGzbwJzofeayvWgUdfpjBadCMarlMx8Dss= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) by PH0PR11MB4903.namprd11.prod.outlook.com (2603:10b6:510:36::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.15; Thu, 30 Sep 2021 08:14:42 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::747b:3a08:d1ec:31fc]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::747b:3a08:d1ec:31fc%5]) with mapi id 15.20.4544.021; Thu, 30 Sep 2021 08:14:42 +0000 To: Tudor Cornea , CC: , , , , References: <1632483885-84732-1-git-send-email-tudor.cornea@gmail.com> <1632924497-60394-1-git-send-email-tudor.cornea@gmail.com> From: Ferruh Yigit X-User: ferruhy Message-ID: Date: Thu, 30 Sep 2021 09:14:35 +0100 In-Reply-To: <1632924497-60394-1-git-send-email-tudor.cornea@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-ClientProxiedBy: DU2PR04CA0293.eurprd04.prod.outlook.com (2603:10a6:10:28c::28) To PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) MIME-Version: 1.0 Received: from [192.168.0.206] (37.228.236.146) by DU2PR04CA0293.eurprd04.prod.outlook.com (2603:10a6:10:28c::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.14 via Frontend Transport; Thu, 30 Sep 2021 08:14:41 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5c1b6727-659a-42cf-5978-08d983ea5b3a X-MS-TrafficTypeDiagnostic: PH0PR11MB4903: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lyH3yCO/mE9LekclCSCuiZVk+K7h3hbazlL5De6gJ76Xe5P+UnEQJnT5CYaThZnQbrDhY+ezE6lQUzoP5xHBNOC3Sh0+tmVB5hE1xnL7Vx/mjxCRLFsQMuuXaqijbyuTDsaJYrZr35+MvhPlNGqJ7RW44sAnQmFPPi0+uN6XJh6Jkm2g/h9tg8jNwXDDmXTstJIiCtQIA4kqnBGZFh/mdwGztJC+tE9T/zSIXaUnk4bbYrihT1yjriBXGAg5oy+stKNHxFKi0ODdOce78etFjXtAkwX/DYSvUakzH5AjDTgD2s1mOOMr2/OI2crShcPbX74czZt6tRJ2jX1VwAmriY8O4EZ98FWk0zCzNfg421Z3f0pp2UsJiPuxs2sRkiNjoQBI7Hwm6lscUD5/jZxJdT9F2OCDmgH2GFfXmWmzgoA6O0q2cEZyh3k9piPbCCtLDPSDv7eNao4LTahDxEHyXkn/oq5/RwKx/IvN6lAGYvu9zRs547PHGdfgAQLrnPafplJ+lUzS5epvB0I42CgMetUYM17KjaJqKEa0cJ5dyi5/TrGn6M3675WBgz0nPMRLtS2T3TW2N5QUhcf2klNO6qxwsSKO5c9JfZMRS4Af6aNPABL+1KSivTJjuhfK3ZPIpJJbKC0wtoHHP360l9AHt+UjA/hARobVqipnnCm5C1iCxUGmXzqR3gX68T6l/Rop+JhaOKtnCsS8gcN0REEX054kPQ9+eN842NzpUXHBj2g0EmDZE9/Es0Kt7CIG82DJBZF7sYTSOefr1hOEhJjmKmbpxiG9C6zA/JyPKn1aymc= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5000.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(316002)(8936002)(16576012)(31686004)(36756003)(6486002)(8676002)(6666004)(83380400001)(508600001)(86362001)(53546011)(2906002)(44832011)(66946007)(66476007)(66556008)(31696002)(38100700002)(4326008)(966005)(5660300002)(186003)(2616005)(26005)(956004)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?NldhdVJSWXVGa3QwdmNsVXRtL3VRaGdOd0RQbEV3R2JUcVgzUGZYWFhOM050?= =?utf-8?B?amtFNTEreThEQ21mOXFVY2YzVSt5bElGZW5YbEFadENEWVNWMDEwQlBsS0l1?= =?utf-8?B?WVA5TGk1TjU4Wk5ZSHcydEVMU2FSL3lTSzVaM2VZSXhpOUllK0FkUXlSTnlx?= =?utf-8?B?a2hIb2JDMDhrWDEvUWMvajZldnVDL3hTeWx5K2V3cW9JZmFCbjhSVjRORC9p?= =?utf-8?B?clpRbGNPSU1qTXhTeDRhWkw3ZWVmcnRRa3EyWDRLSHY4VXJUVkVTRHlzbmJI?= =?utf-8?B?OHlDbWZWM3o2dStuMmpvMjh3VmR3SzgwMkVINXNxNmVScFZTbnFzdUZaQzBt?= =?utf-8?B?Sm1ST0YxZ2JVQXlhZ1RRcmNzUVpEcmM3cU1CNEdTeGRoRm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WZyalAxZUJEbnRlYW5QTHpKYmNOMkl6bHhn?= =?utf-8?B?enA4cER0eTQ0VTFUZXplNjRlWXVZRXh1OGJFK0tldm1hU3dibDVSb200cEVH?= =?utf-8?B?bkdKZWJVdHRGVjhDOCtPUzQzMCtOWXl3Mm0yaXJkaUtGUU9SVlNWalduSHgv?= =?utf-8?B?RDRtTDhqMG1mckplY2Z1UkhmRXRRVGdPMUduTVNxb0ltWENjTUhaYjlRTVAy?= =?utf-8?B?NXZkSGZKWDFIVWJFVEFkeW9EczMwWkN6UEg2U0hNdmpOamtXcWpVb2gvMGRl?= =?utf-8?B?UUpsSk5sR0NoYm5Mc0Q0N2I1RytFL096YXJpWk9nNWtKZEZUbVY5ZklOYmNx?= =?utf-8?B?aCtyOUJSZkg2OFRtazlMb01lMllMb2daNGlUKzhId3YybFYzVTVzN3FTb0Ew?= =?utf-8?B?WWduYjhNQ3k5UFdiMzF2TDZVZXI0VFRyK0UrYW9EWDVXcExoVlo4SnJLMVpn?= =?utf-8?Q?bk+GvJZtqp2iBxLRhL3GT/hX3eWSeBUyMigZ5Q+?= X-MS-Exchange-CrossTenant-Network-Message-Id: 5c1b6727-659a-42cf-5978-08d983ea5b3a X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2021 08:14:42.7405 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ccsRm3to1mTrRIGw3EbsFr2sHNRWVSpOQj+BY2cW575RAIAPS8tISQkC0hokr/wBAFUjOj4USd+0fr8zbOpTRQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB4903 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v4] net/af_packet: reinsert the stripped vlan tag X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 9/29/2021 3:08 PM, Tudor Cornea wrote: > The af_packet pmd driver binds to a raw socket and allows > sending and receiving of packets through the kernel. > > Since commit [1], the kernel strips the vlan tags early in > __netif_receive_skb_core(), so we receive untagged packets while > running with the af_packet pmd. > > Luckily for us, the skb vlan-related fields are still populated from the > stripped vlan tags, so we end up having all the information > that we need in the mbuf. > > Having the pmd driver support DEV_RX_OFFLOAD_VLAN_STRIP allows the > application to control the desired vlan stripping behavior, > until we have a way to describe offloads that can't be disabled by > pmd drivers. > > This patch will cause a change in the default way that the af_packet > pmd treats received vlan-tagged frames. While previously, the > application was required to check the PKT_RX_VLAN_STRIPPED flag, after > this patch, the pmd will re-insert the vlan tag transparently to the > user, unless the DEV_RX_OFFLOAD_VLAN_STRIP is enabled in > rxmode.offloads. > > I've attempted a preliminary benchmark to understand if the change could > cause a sizable performance hit. > > Setup: > Two virtual machines running on top of an ESXi hypervisor > > Tx: DPDK app (running on top of vmxnet3 PMD) > Rx: af_packet (running on top of a kernel vmxnet3 interface) > Packet size :68 (packet contains a vlan tag) > > Rates: > Tx - 1.419 Mpps > Rx (without vlan insertion) - 1227636 pps > Rx (with vlan insertion) - 1220081 pps > > At a first glance, we don't seem to have a large degradation in terms > of packet rate. > > [1] https://github.com/torvalds/linux/commit/bcc6d47903612c3861201cc3a866fb604f26b8b2 > > Signed-off-by: Tudor Cornea > > --- > v4: > * Updated the af_packet documentation > v3: > * Updated release note and documentation > * Updated commit with performance measurements > v2: > * Added DEV_RX_OFFLOAD_VLAN_STRIP to rxmode->offloads > --- > doc/guides/nics/af_packet.rst | 5 +++++ > doc/guides/rel_notes/release_21_11.rst | 4 ++++ > drivers/net/af_packet/rte_eth_af_packet.c | 12 ++++++++++++ > 3 files changed, 21 insertions(+) > > diff --git a/doc/guides/nics/af_packet.rst b/doc/guides/nics/af_packet.rst > index efd6f1c..c87310b 100644 > --- a/doc/guides/nics/af_packet.rst > +++ b/doc/guides/nics/af_packet.rst > @@ -65,3 +65,8 @@ framecnt=512): > .. code-block:: console > > --vdev=eth_af_packet0,iface=tap0,blocksz=4096,framesz=2048,framecnt=512,qpairs=1,qdisc_bypass=0 > + > +Features and Limitations of the af_packet PMD > +--------------------------------------------- > + > +Af_packet PMD now works with VLAN's on Linux Thanks Tudor. I see this is suggested by Stephen, but I think 'now' is confusing in the driver guide. Also driver was already working with VLAN, the change is VLAN is not force stripped anymore. I think following part from your previous version is better, what do you think something like following? " The PMD will re-insert the VLAN tag transparently to the packet if the kernel strips it, as long as the ``DEV_RX_OFFLOAD_VLAN_STRIP`` is not enabled by application. " > diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst > index ad7c1af..095fd5b 100644 > --- a/doc/guides/rel_notes/release_21_11.rst > +++ b/doc/guides/rel_notes/release_21_11.rst > @@ -66,6 +66,10 @@ New Features > > * Added rte_flow support for dual VLAN insert and strip actions. > > +* **Updated af_packet ethdev driver.** > + > + * Added DEV_RX_OFFLOAD_VLAN_STRIP capability. > + I think change in the default behavior is more important in the release notes, again what do you think to have your following update here: " Default VLAN strip behavior changed. If previously, the vlan tag was stripped, if the application now requires the same behavior, it will need to configure ``DEV_RX_OFFLOAD_VLAN_STRIP``. "