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 5EBA7A0A0E; Thu, 4 Feb 2021 07:47:01 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DAE80240568; Thu, 4 Feb 2021 07:47:00 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 1FA7E240565 for ; Thu, 4 Feb 2021 07:46:58 +0100 (CET) IronPort-SDR: ri/arwi8oKgFk+JKn7hEC97l6qVBPWPnAEzjolnYQvccw+8fwsm11s3r8KwAq/KMHu2rmCInhP HB/ku7rPWqcw== X-IronPort-AV: E=McAfee;i="6000,8403,9884"; a="245255969" X-IronPort-AV: E=Sophos;i="5.79,400,1602572400"; d="scan'208";a="245255969" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Feb 2021 22:46:57 -0800 IronPort-SDR: BzYMBLdA/K3qiwUfytrcoLj3FcS3YpOqDaoCs3e8Edg9IlGi3iiYCsiD9W1dUN9JNLmWoOh0us A3wBgY/RaDeQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.79,400,1602572400"; d="scan'208";a="579776456" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga006.fm.intel.com with ESMTP; 03 Feb 2021 22:46:57 -0800 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Wed, 3 Feb 2021 22:46:57 -0800 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) by ORSMSX608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Wed, 3 Feb 2021 22:46:56 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2 via Frontend Transport; Wed, 3 Feb 2021 22:46:57 -0800 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.175) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Wed, 3 Feb 2021 22:46:56 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W3KwdlXRPZb1GJI/SN/IsG7q3m/X8gSbziCC/WzqVgBADytF9BBMVtLvLsq0fFb61vEYSTa0gWRR7cttDctzOxs+IB7rLsk1UwwcpzIRkhHMJdcdurk6QY+6w1Qb6VvXk73Qh41TP79V39gZ2tQpjCbhmwPA+ips3MQkhgR37ZhNBG4ryu5pxjY4Nyrz+Tc6gcZkOUReHfgTB5NGoyKjl/lPU+Qqe4j1GMpDdLShrrhQomMXqCKIf2zfA+tuBPAVex18I7AbCrnGlm1faF9uFJRcmQa/zViDN6yHH0QHNAMjmjoVwyqYVBSrMOOQ/U2bKsi68um2lRWr8P+mD615bA== 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:X-MS-Exchange-SenderADCheck; bh=/RwpSvjqXkTy+BFkimq0O7U160VzarHdcDVHm//7DxM=; b=cYDsvNumvEEZcA4NahduDDm8gFiorz1mvcPw/V8Be7pAEeyTcZJhpr6fzQaOdBLifSxARBEJbR1sSj+GOZuJF82EgPx4nvnT9q0ld2BRh2VtWNMpFd8FEHyyVMSh+YXb9qLUq+Edt/0TBOluRP+oThu0GU4+xqzYpgNdYH5pUvGg336t/cU3iMZy3z3jQ8DM8nLPlDtQ8j+2fvW6SghsBo4oBBjowYEA404hD/yvmYwRjHB+MPfJvIsvuHCizmMOqSIqSEezLFiXM1DYe4pH8F9PT4WEQGIQT1iqbKaN6HhluzR8D7aDLdjL9eile1M4pqL5zWGotlaadaBbchBmFA== 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=/RwpSvjqXkTy+BFkimq0O7U160VzarHdcDVHm//7DxM=; b=UoR4EqMO9/GXIr5GBJ7WR1bTfVr5+Onv4nvM7QHwXMVBnPjNMNSvybsfp6Y/R0IWsIT/Iu+X2YK2Mra1nEjHVGhwbsOws2isdj4Y7A5HBsUfORencWeJGygcbwWb5bxTCFRQtGCj14iQccXh+wACV3kOIwTLwh8arS6jDbCPZ1I= Received: from CY4PR11MB1750.namprd11.prod.outlook.com (2603:10b6:903:126::8) by CY4PR11MB1240.namprd11.prod.outlook.com (2603:10b6:903:23::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3805.24; Thu, 4 Feb 2021 06:46:55 +0000 Received: from CY4PR11MB1750.namprd11.prod.outlook.com ([fe80::8fd:c082:f2bc:f6ae]) by CY4PR11MB1750.namprd11.prod.outlook.com ([fe80::8fd:c082:f2bc:f6ae%12]) with mapi id 15.20.3825.021; Thu, 4 Feb 2021 06:46:55 +0000 From: "Li, Xiaoyun" To: "Xing, Beilei" , "Wu, Jingjing" , "dev@dpdk.org" Thread-Topic: [PATCH] net/iavf: fix VLAN insert issue Thread-Index: AQHW+qPRyD9sGrEI40O5fTsceYO3LapHiqSAgAABhMA= Date: Thu, 4 Feb 2021 06:46:54 +0000 Message-ID: References: <20210204031118.603270-1-xiaoyun.li@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.102.204.37] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f79d5a6d-bc45-4702-50b7-08d8c8d8a936 x-ms-traffictypediagnostic: CY4PR11MB1240: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3513; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: KPc+fwzWeZEmKaiA3hZO0M7Gynd8NoiztQFb53wE1mu0RIHgNuxUo5uudDj7ezzcXp+8aUoGkcRjBdEP115Gdwun/NM+FPUvUyR+Xf+DPuERtIXEssRv/EfQC5wuTEhsk/upNNIB9DtaAonvoh3IR8Pb5RtjCtXAfZIoLITlggjEPOiAyf85QJcGhl6MwX3XzDP9gt+E/l6jNfet9TqlWhI9rtBnnjYqaRfNxMMOfXIr0MwLczsE2qLP++GGMLI1U+XrMK1KW45h6x1DM6CZgU3uRvD+roRarXZeSdvpDxMpmMUXCVtyZOxGUqybJKzbDQsuEjY4ZJ46hXuDhXUE/1wjM3nrJECAbkt8NA7MkVaMuYaCLRNLe2IqOqSsZmRvhF9vc3WZTJwre1Up97S+ZH8YqZ/nXdQ66Xqohrz+oDK84SD/piJw7jcwuomoAtgH6XRjZ4HBwVrZa13xSnnBayB/UADi93QK1++a70btYsF84lcZ1+0i8IMuNtJMn1qLMlXOXkQRELqswUJTauw9tw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CY4PR11MB1750.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(396003)(136003)(366004)(346002)(39860400002)(376002)(71200400001)(478600001)(7696005)(66446008)(64756008)(9686003)(66476007)(55016002)(2906002)(66556008)(8676002)(110136005)(52536014)(5660300002)(83380400001)(86362001)(26005)(186003)(76116006)(8936002)(6506007)(53546011)(33656002)(66946007)(316002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?DrgDXq2Edq4xAAJDCAOFp7t2XslxfyYrJP8FFVBV5sxTOkBzUpQELRT5sy/5?= =?us-ascii?Q?wXPym7DNMsmhhN6hcpGLvVzqsKqOR7DMjSqGTfQ8/Cg/u+Jj1BUpGUYPBnRg?= =?us-ascii?Q?68QjUQoz2AXSbPaToFTXESSa26vPq21CG/jAWVxvgBnnDfYYnZ9LchdlCwJY?= =?us-ascii?Q?TkX467GCoWpnJodNqIlB/7OspWHvimJ91OJ1K4zHztjHDSv1sPdFre2z6oAa?= =?us-ascii?Q?ZYbXCvT9T/tRaG9QtUsi+SMNuvYNdDvU/BtKOKDkbCg6qf1Sj9Q16ugA+5ok?= =?us-ascii?Q?awvq6NiqeDiESbijy2QYUW1QbV+EU+RqA4v92Y9STeD+V8vg3WDoYhDTGHkD?= =?us-ascii?Q?ZcJapI0pa+rwTPyU9fyNPSa+Dit/+gwkksrP0dwK8kAz8bL4ooKG4wRDJWOT?= =?us-ascii?Q?gu4JebYG2MTZqHpj6IeaSmnLcuHVVPitWbBA85wh97hmJZPiDKaV0nJAOomT?= =?us-ascii?Q?UEGjOedCI78NUpmSBSWQqR+YiJI3K5oo2v1qRsXTANONhnlMJtsC/ITlC6SH?= =?us-ascii?Q?xZBuyCOaKIcz30ByyJr/NR/2vJm1ZdjIt2oNigLWbN/dVczNUd4ZLLC0cyf7?= =?us-ascii?Q?4ZOpkfAnoURLO9ZxPs7x9XR1Oo4ys39K01grTLnD2vmcxYX3+vAy5qa0jaeu?= =?us-ascii?Q?D5iLw3kbRtDNeznDsJkbaYrPJaKfT/H2BqLJ9NWGsAn1IOkhJ0crCFF/Y8GZ?= =?us-ascii?Q?+Tw5ldc9BxGbdn6ixqoF6rapPQ/vTvLdB88/mhpQL1Ry41L9xTjNU2X941o0?= =?us-ascii?Q?qJuQFAammHdMLJ5B0jvgHLHgq+78RKO6RfEQKL1pBjOtZrcjUVFYny3AxtvB?= =?us-ascii?Q?1C01hdoijizStcuKi91fOxkhJ9EWsu1aGw7sL0eaGbdg2+dF7Lhs9Ha+tOlr?= =?us-ascii?Q?bhFqVS9sFM8HnTOnaR8Q4XnAbj/pqCXS8iEHDLFPRaWj7SjUq2l/6lyxeTS1?= =?us-ascii?Q?U4/GqO+wz0jdF2+Ihmf8jWZSGFQ1TFUdWDiTwXMqDX666CcpP4USpzlbMKoP?= =?us-ascii?Q?fKTpiH6Ga8/0tMn75NG71ngNixpNjfSIsrYVe5lyV9xbvioM0QmeDr764jc+?= =?us-ascii?Q?MOT3Hf3iDRD9YPaKPpHGVHFO4Ls+7Le2r+AxJbvvWR/MLDwzHysn3nInzNFF?= =?us-ascii?Q?Sychp+wauQXwIu2PzKk5TpB3p1OsYoGmGaJSEDgDDdpRI304o0/9dZzuIALv?= =?us-ascii?Q?u3v2pQTZ9XUugUsSikRrXZHo1MblD1mIFo73hI+e8rT+YDv/cBKxG8Zev/5E?= =?us-ascii?Q?nz1+lE9Mx83keFy152zrvdPko1u4DL4Mh10Xizg2MwIV+oGUkW3o9/Q96bhi?= =?us-ascii?Q?k6q9gYHtFHa1BZgumCMWLIYZ?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CY4PR11MB1750.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f79d5a6d-bc45-4702-50b7-08d8c8d8a936 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Feb 2021 06:46:54.9465 (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: HgJhVU9OQMKBUG+uzqKj9y+gq54yTEeYqxWQKmeoXi+iW8uyHK0F9rTbMvuawFDZHnwGYo+wr2J5kDvi+/qcsQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR11MB1240 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH] net/iavf: fix VLAN insert issue 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" > -----Original Message----- > From: Xing, Beilei > Sent: Thursday, February 4, 2021 14:36 > To: Li, Xiaoyun ; Wu, Jingjing ; > dev@dpdk.org > Subject: RE: [PATCH] net/iavf: fix VLAN insert issue >=20 >=20 >=20 > > -----Original Message----- > > From: Li, Xiaoyun > > Sent: Thursday, February 4, 2021 11:11 AM > > To: Wu, Jingjing ; Xing, Beilei > > ; dev@dpdk.org > > Cc: Li, Xiaoyun > > Subject: [PATCH] net/iavf: fix VLAN insert issue > > > > The new VIRTCHNL_VF_OFFLOAD_VLAN_V2 capability allows PF to set the > > location of TX VLAN insertion. > > > > So VF needs to insert VLAN tag according to the location flags. > > > > Fixes: 1c301e8c3cff ("net/iavf: support new VLAN capabilities") > > > > Signed-off-by: Xiaoyun Li > > --- > > drivers/net/iavf/iavf_rxtx.c | 45 > > +++++++++++++++++++++++++++++++----- > > drivers/net/iavf/iavf_rxtx.h | 3 +++ > > 2 files changed, 42 insertions(+), 6 deletions(-) > > > > diff --git a/drivers/net/iavf/iavf_rxtx.c > > b/drivers/net/iavf/iavf_rxtx.c index 3d471d9acc..af5a28d84d 100644 > > --- a/drivers/net/iavf/iavf_rxtx.c > > +++ b/drivers/net/iavf/iavf_rxtx.c > > > > /* Check if the context descriptor is needed for TX offloading */ > > static inline uint16_t -iavf_calc_context_desc(uint64_t flags) > > +iavf_calc_context_desc(uint64_t flags, uint8_t vlan_flag) > > { > > - static uint64_t mask =3D PKT_TX_TCP_SEG; > > - > > - return (flags & mask) ? 1 : 0; > > + if (flags & PKT_TX_TCP_SEG) > > + return 1; > > + if (flags & PKT_TX_VLAN_PKT && > > + vlan_flag & IAVF_TX_FLAGS_VLAN_TAG_LOC_L2TAG2) > > + return 1; > > + return 0; >=20 > How about merging if condition? >=20 > if ((flags & PKT_TX_TCP_SEG) || > (flags & PKT_TX_VLAN_PKT && > vlan_flag & IAVF_TX_FLAGS_VLAN_TAG_LOC_L2TAG2)) > return 1; > else > return 0; >=20 Both are OK. In case there are new offloads in the future which needs conte= xt desc. The previous code looks more clear which offload takes effect? > > } > >