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 46C2EA0A0E; Thu, 4 Feb 2021 07:35:50 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BF8AF240565; Thu, 4 Feb 2021 07:35:49 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id E7FD2240563 for ; Thu, 4 Feb 2021 07:35:47 +0100 (CET) IronPort-SDR: 25E1Pyaze3ozmSdMzi+UhgRvnpIhvsqqltCI1NfwtfOIyLc9/5vKruK7a80dlXPGjSN56mKy++ VIwVkrk4nuVg== X-IronPort-AV: E=McAfee;i="6000,8403,9884"; a="200162273" X-IronPort-AV: E=Sophos;i="5.79,400,1602572400"; d="scan'208";a="200162273" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Feb 2021 22:35:46 -0800 IronPort-SDR: i+iHkDuJo1Hj6R7mdIQMNEfMkUXJDMrE+vR4X3e2p9fQ417ndeciseMo9fIX6M6bhIS6zv/K5N Iug/xZgmgXfQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.79,400,1602572400"; d="scan'208";a="372177615" Received: from orsmsx604.amr.corp.intel.com ([10.22.229.17]) by fmsmga008.fm.intel.com with ESMTP; 03 Feb 2021 22:35:46 -0800 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX604.amr.corp.intel.com (10.22.229.17) 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:35:45 -0800 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX609.amr.corp.intel.com (10.22.229.22) 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:35:45 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx607.amr.corp.intel.com (10.22.229.20) 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:35:45 -0800 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.100) 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:35:44 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nDRUZzO/rwn8llaKB2wLP7um/a/TbDZikVlRMuEebMJHLk2qTKSK1+Isn3a4FwWQxAdV/aIeZqEdOC505oJwDavDx/eUK8yfcQXwmr0ufePYSRUdiz9MG+Zf1euaWTe8ERuihEjdq369o+bWD+8ACPRolktvmzSTHT4QWmhSLr5vnrL3FAl2dLtzZGxGGsJhg+xm9zPdVgJGWEktchGbjZFjHuTXEPxXWJRAJ5TwUBSWqn0h2sAg36UWQsoQU4B1eoMmDGE8YSyEZ6nHaeOpO7UGymumBqvR3XF0k8pkk6cTSU0Y/7HdBNjtVSzvNz9ngPJakPs6Lv53pEUgPEjfCA== 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=qzHU3LuNL7rYGrvyE7AOWYHV7jQY7dlbMZcpZDyXs1U=; b=IUmW6k4C5No2ApeYY83M7nb46CFuKIk8sCSUxYC0xNqjQ2HfGunFAPi5zItCncuSfEAx9voqjWD0XzUsNfsYHwJRY3PlswJ+r1J8vcShoYap2qfdn4pLGY0sJVcP9+8Fr9+DCxwvbg3oToo+uW5tChT74sAaefK8fN0RLnEi3bc6+/EhhHlyNSbwWfOq4h93ksrsiFTa2upA1YmTcTP5J1Q/DTH+KJUp0V64tjW072UGrpJ2II/Vtf6y7iNcmXdlIYuGkCy0NzwWvbDpRaC1/rrI8B8ggS9NIGl6y1ajf1p0PSfDZTY/WhI2+jBzHDhT5Vd2BzBtojevGUUeqykILQ== 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=qzHU3LuNL7rYGrvyE7AOWYHV7jQY7dlbMZcpZDyXs1U=; b=OVsIOhW95foy02lXbaD9iAO8lnrD2saWIUMTpXPKNFjZe7F4BUnPYyUiisHm8Dd/D8ooozJwsMIq1QXMNhBJlzeeF5WitgFuaSszkNP5coYa6s/8ww2gRfvHAX5gN6Dv0Ai5XraBjiQqx3lMRcl1ihRzBuN70IgtPOtm4dFlT1Y= Received: from MN2PR11MB3807.namprd11.prod.outlook.com (2603:10b6:208:f0::24) by MN2PR11MB3631.namprd11.prod.outlook.com (2603:10b6:208:ef::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3805.16; Thu, 4 Feb 2021 06:35:43 +0000 Received: from MN2PR11MB3807.namprd11.prod.outlook.com ([fe80::b92d:3d89:1894:8f18]) by MN2PR11MB3807.namprd11.prod.outlook.com ([fe80::b92d:3d89:1894:8f18%6]) with mapi id 15.20.3805.029; Thu, 4 Feb 2021 06:35:43 +0000 From: "Xing, Beilei" To: "Li, Xiaoyun" , "Wu, Jingjing" , "dev@dpdk.org" Thread-Topic: [PATCH] net/iavf: fix VLAN insert issue Thread-Index: AQHW+qPRqlGuAFN9vkW7j4vtc4HhjqpHicRw Date: Thu, 4 Feb 2021 06:35:43 +0000 Message-ID: References: <20210204031118.603270-1-xiaoyun.li@intel.com> In-Reply-To: <20210204031118.603270-1-xiaoyun.li@intel.com> 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.36] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: af46264a-8ff8-4312-2cf1-08d8c8d71910 x-ms-traffictypediagnostic: MN2PR11MB3631: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2958; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: XHzzcjvUkWCYpKQ27+2YAw4l+hOWyztqqdpy4PIzjDg1qqQVxMZd/x48il4tAbS4qi1AmNsvwWn5BBFiE/W9evcGOj/xRaPfUQssRfh3KY9jZ75CoMPVouwgFQGnJphH4IFW70IBKecTWeVgKyg23/ENlnDjfGEVn4Q0GuWmmRiLRue4+tVe7f+YtoXLHYa1iQB0nNWZhZZOLkynT9tF6I428uTLhodx2Q7Jv9SIte/sSycQbjatPvOKir3uAHheT97XuUHvQF38s0t3pYdy7G4fuYu0Ypqr69XS6TSkzggNYLvCpRHO6gTVZd6v8IPA8rmz5SoY/mYyW2iNjKJ4fEcArg/6cTdNwIWJ57Dnmd9NqUzAcgNTQuHxowK+DLIpvJTgBB7BMfl8lUR6gS32VGdNulK2VspXIGuLtfjUEUJFZLa6uyO4zHiOBy4o8KjeFuV7bgjeFPFORCiAwjXmsnq3wFwwKg/XMYBFAHg0Hag85w9QUfDNYTZt+xEn/GNts9Ym9maa984RIZei0MYvrg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB3807.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(346002)(136003)(396003)(39860400002)(376002)(366004)(71200400001)(26005)(66476007)(83380400001)(316002)(5660300002)(64756008)(33656002)(76116006)(66446008)(110136005)(6506007)(52536014)(7696005)(9686003)(2906002)(86362001)(8936002)(66946007)(478600001)(8676002)(53546011)(55016002)(186003)(66556008); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?Q33m2CDhMNn1b0sOYZ8K7Nr+L797gdAX55kfBmPkaoydsLXfQ9tv+SOq6bUz?= =?us-ascii?Q?/AbzLjGFB2TJgxFsI0aUqwro2QUlBvpN5xIeIRSoXbzlqEOHlg8csJ9fFglr?= =?us-ascii?Q?OVDO8lXcxHbTxS0nZARWsdrBPR/Okj7LWE3A9mHDtEdHS8V9HtCxDy09tOsL?= =?us-ascii?Q?6K+cAc7nc29zIWhI5qFXa44F02dPaWxr78p1g9eCItCQ/Vh/1AQcnW7KyLDv?= =?us-ascii?Q?6Y2NoqoU/MhoIvobLSk004Da77RmRLEwHil3eKhnJEmf3pb9vx5/w5Pu4H/8?= =?us-ascii?Q?hvQTrmtWFcfJ9FbnNXHuUoiqTt1Ho/X4bGvZ//Rvo3AZMG3cYM3nlAne1fe5?= =?us-ascii?Q?UDJAtKhbbAHrih5ezSR+fJIkZNndfj2ofT1Alsoyxg4tXCumkBUY4c5DBIek?= =?us-ascii?Q?odd+myBLwyfJGTH5yEATfShX0s7iIWYYvZcjonhsXvoZFZxti3/TDBe2CSYQ?= =?us-ascii?Q?zEgfiihapMKXx2oz9JleCtFczdkTBPfbPhFkCzAUHgzF+h/CCMRSxABbJI1A?= =?us-ascii?Q?a6t/B8fZ0TwahD6mWXvpiPSfawOOUpBEbIHCYbK7xI5WNhGaq/Z9RcDdMT/t?= =?us-ascii?Q?ZyrOTsf/xkw6bO41LKplZCFaekm4z1XgATlGdwUDNSK93GxclyrFT24M27tY?= =?us-ascii?Q?jRNEFoH0yeTC+Sx9GTTfwoh0neyjN+h7CDTa0RRLNdK/xvjl3lACzesX1qqP?= =?us-ascii?Q?NMMnnyyCSUjoT1k5RrZWcZEPQAOdUasrig3ZenFVTm0B/ivN2Aiel2BLXPek?= =?us-ascii?Q?+qxHD0AxpLdVJ2+nSEYPT5WUn0YnCTuUsEQPb1yoHAVCZWF7ohw7tVyZDf1n?= =?us-ascii?Q?LWkC1WqACb3pWalJa0givuQZLC6+jHmZFSEB9Vf7AI+6Pw/CwpRkivmeZVpM?= =?us-ascii?Q?Dq5DSV9sFl7/0HRw3cIU0Luq4sr1NqScGicocz22ZPZPkyHn01nly5UXeZER?= =?us-ascii?Q?Z1hlXcNRWNjdfcnAdBE+e1VKN5Jomhh4LOCgj5FFWAw5tcaQKZWcn8VGwhfj?= =?us-ascii?Q?876GOcRPWpN/H8CgtiHlhO2yjjmcfcaOON/5Gp801wIFw/owA25Tbn1yMC42?= =?us-ascii?Q?XyjKEu7kTmh4K2Bkv7xATTSQXWcHS7xyM+okz35u97Sy2fuLQKsfmlqzBrmI?= =?us-ascii?Q?QUO9CPRAnIFKLuxjT23pZjxbjOykaI+yvBx9L24CXMfHcMQ0zbyv2+wHhen5?= =?us-ascii?Q?ZNx3B5mzptFOIhe1U5a4ImlGh7raj3+Qof/4hZ6JP0hX//ZS7u2ZqRUVTZyh?= =?us-ascii?Q?iY/qUqHojb6saqet47e8+fMZopvraYmaJcPDBSRxWREagL6ULlqETvXFmwB7?= =?us-ascii?Q?hYO6uHv7+QONTotWBrmBESg1?= 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: MN2PR11MB3807.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: af46264a-8ff8-4312-2cf1-08d8c8d71910 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Feb 2021 06:35:43.5420 (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: QA1WcAB8LNNKvgmhUkgCfZm0PYKL3Al6hSFqbBlvLRdw+39xMCFfWqTJ/x7B730sU41CgWEhvalCItOAQW3Eyw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3631 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: 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 >=20 > The new VIRTCHNL_VF_OFFLOAD_VLAN_V2 capability allows PF to set the > location of TX VLAN insertion. >=20 > So VF needs to insert VLAN tag according to the location flags. >=20 > Fixes: 1c301e8c3cff ("net/iavf: support new VLAN capabilities") >=20 > 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(-) >=20 > 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 >=20 > /* Check if the context descriptor is needed for TX offloading */ stati= c 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; How about merging if condition? 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