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 76416A0548; Mon, 26 Apr 2021 05:09:48 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3414941110; Mon, 26 Apr 2021 05:09:48 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id B7AC340A4B for ; Mon, 26 Apr 2021 05:09:46 +0200 (CEST) IronPort-SDR: QGIt1bzz/ehDpWlJcUDszA7XK/B1cMe/iKaT4mpJN2GXmxJvGrI+DRlRFvDBZ1kZi0Aj2FsjMz tK/fWyTN2fjw== X-IronPort-AV: E=McAfee;i="6200,9189,9965"; a="183756048" X-IronPort-AV: E=Sophos;i="5.82,251,1613462400"; d="scan'208";a="183756048" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Apr 2021 20:09:42 -0700 IronPort-SDR: vF9w0z5K+MM5TbCTcVwo5Zt9JS4AI6eNJfjz23pWkwqi0jBRbBnaVDYs5GOPswnf4hA2/lxmDf umEuuUzcWoNA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,251,1613462400"; d="scan'208";a="392567433" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by fmsmga007.fm.intel.com with ESMTP; 25 Apr 2021 20:09:42 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) 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.2106.2; Sun, 25 Apr 2021 20:09:42 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2 via Frontend Transport; Sun, 25 Apr 2021 20:09:42 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.102) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2106.2; Sun, 25 Apr 2021 20:09:42 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kl9qyTLdy7qQfxMqoK4WpuuETudC7M81DXnyZ38TGSH1QYGGzfESfyeOQlg0VLxsiNvMhE1IvM2AKJxAvvgedA42K67pLApUsWE4Ib8xc0fmuujUBpIAH7ZuV/pmvrOo7RgF8EDjSSAE08yTkChYsrz+ASCaJilbZwEPhNb/ead1vhvFQLxVJXs72IQYd+ingGZ3RNPwrqd9zljf8YOWJwZNVFaQDD3ejK+nul+edZVZEt35Obyj5FjYVER+BkMyL0CCZxtnYF7AKBmz/nQa0bM2mMH4eEEFJQgeLuasvPje8aBV34Oi8Gv/Ou8Jc9n2Orv/0na39JvikhMhSvSmMQ== 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=B8OtHoetoHJcls+u9jxDCp+RKkhsT382+VzKLYErRCs=; b=kBIi5ke8NpkwRw5wCR3/N5Z2LZpzDe3UjSxfPaEKx2pRgO9psyiio9OHmOvrbXxuH5E+UowR4/zxw67J52x+i4V51NRT152WIKD/MiCKuxNxDQkAK0OZS4gImU+j7MTvc8EhpOXB0exIOi6Nn5DsGScV8drqn35Jq7LbrkvfignFuHlicS1duu5gmVBDqE1lJGQYLWpUVj0VeQwzmEio6tNS1hz4VmEeh/s+oM2EuNp24aEjYmo46lZirrq9lhckFOuNF7PdP9SAfcNib6tgqkXSbfSb65rKP/zrx/96Yoqkbw4A9Yz2mqJ/pXn7MEUv8ZRuwpgVlRdhxqDADWz0YQ== 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=B8OtHoetoHJcls+u9jxDCp+RKkhsT382+VzKLYErRCs=; b=qaaCO97KWhx9od/mbyGY+ss9HROsXlOypg8Avwrvhrs8BF6Bcq8JoU7fToZPq+fYYEDfYIXhg8zuG8/hggafvxNOuqiXAhA8Znpm3Ogi11Mcqy7xzngWl6SUoOGWj1hCkRvGYFyNAco0jo5BvZDCm6S0TIsT6aLsH0U18s9R6UM= Received: from DM6PR11MB3516.namprd11.prod.outlook.com (2603:10b6:5:72::13) by DM5PR1101MB2108.namprd11.prod.outlook.com (2603:10b6:4:53::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.25; Mon, 26 Apr 2021 03:09:38 +0000 Received: from DM6PR11MB3516.namprd11.prod.outlook.com ([fe80::594a:341d:e402:b03d]) by DM6PR11MB3516.namprd11.prod.outlook.com ([fe80::594a:341d:e402:b03d%3]) with mapi id 15.20.4065.027; Mon, 26 Apr 2021 03:09:38 +0000 From: "Zhang, Yuying" To: "Zhang, Qi Z" , "dev@dpdk.org" , "Wang, Haiyue" CC: "Yan, Zhirun" , "Guo, Junfeng" Thread-Topic: [PATCH v3 2/2] net/ice: refactor input set fields for switch filter Thread-Index: AQHXOdiT4X3M9KRbLkmR57bvvuJncarGCKSAgAAVQEA= Date: Mon, 26 Apr 2021 03:09:38 +0000 Message-ID: References: <20210422100541.935478-1-yuying.zhang@intel.com> <20210425132906.976067-1-yuying.zhang@intel.com> <20210425132906.976067-2-yuying.zhang@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.198.147.202] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 3b7c05c0-51ee-4a5f-cd1e-08d90860ba1a x-ms-traffictypediagnostic: DM5PR1101MB2108: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7219; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: hr6nHIDu5Gz1jJIVdOUsFWkRcRuS5tF9/CfWsPJWTj82nW3YwbHZmYbuuxR2k95jtx9gj8BINJ6mTtUjZ6vD9CwwFGlRBnA0HAd7vHeYmWs5VIuna2tiZTgF8M9VPrQBRBjGrsBP7v2DRDpdBSwU3ojqRrycz2wlcLH6QNqj2fYqheZgpZ820xAsDHC7T9P/kdmTypgIelAeSFBacl8Oohn85m5pKrUDEIi1XR97nYHbCXZrIPWaOpbKUSIa5EYuwk8phbMHM/1cGU++6xg9WBdISACwGFRK80p/D61M8pwWEwiLbzb6ETioo/IW4QNt7M7W4tkMG6XvLbfe7x8RsqtDmiJeEbv2yc00fXZClSIv3HptkdrR8GKE9PdalqrfsFfWGwKQoavJyMBOBGxcLWAOvhshjg76Fh+Ly5x571QJsKbRxx+UBke/VnhlAE5A5iz8oUMUMuGkhzjS3pP6RWCLiJzp0cAX+usZ62pTNzpaidXPXVbP3Pz++120ZORo+Y2C4qziSrE2lmxV3CWosgjbaHsPgXpdnFXnnQIfeldM87msTkKtnjCjfFbcfYvT2cUQC+Rh+BV+2pZ+x2HyDMa+G/tPPTWSIbiEy+p3J88= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB3516.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(396003)(39860400002)(346002)(366004)(136003)(376002)(122000001)(38100700002)(8936002)(2906002)(55016002)(478600001)(83380400001)(186003)(26005)(316002)(33656002)(6506007)(107886003)(53546011)(86362001)(52536014)(7696005)(5660300002)(110136005)(66476007)(66946007)(66446008)(64756008)(66556008)(54906003)(76116006)(6636002)(9686003)(8676002)(71200400001)(4326008); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?rnYygF9MnG/fJ7iEBaxmsYz1jMVvo3JeLJtptEFbnXQ/QrvpUGu6h3JdoS8s?= =?us-ascii?Q?9ZSvT98l7mFaO3G/YJPzFPlZ1RREJ1AaqYDF5f9gpaHAuFyT9JbNt5N8j2a2?= =?us-ascii?Q?d4ZOtqUURexKrraWIXtUOpkzgg5h8cScecNPavZnOSAioFojmmNOWFZ7r5dA?= =?us-ascii?Q?25aY9S3zP6pKKTFEQB5HuEjRiu3PTfa2vA0zHt0yKAUrtDxZ6+vLR3n580tI?= =?us-ascii?Q?MZbJ7YMOFtzuaN/027AG/SLn/4rTXiKp2nzNamGllvirwRMJGOkkcFrZtn9V?= =?us-ascii?Q?Vv1/bSzfjdxp+fWb0D/OnCngFjuLO0eBx2zfwD6/r4C4hcsbbGD0ppGwX84L?= =?us-ascii?Q?CuK4DEIEEhOP2XteIRKbK2xCTHxE2ycfIuy6AQiy1/MqYZAvSmMBfRGgyhOL?= =?us-ascii?Q?5d/ofZbN1XtyDaphJ6MGNLohFGJc+r1lu859gX9ZvWBnYLr12ugX84xDq/uF?= =?us-ascii?Q?Se2Yk4Vr2V+ayoxjxiq329QoAgr8i2Fg4BIkTimjaQleF4zoBLsrCje/NYBM?= =?us-ascii?Q?nXs/bgj2AloNxIOr2r7GLMP6gTIsRsr75/O9mC/qML1dmIxEAGZ5d2p4c+Is?= =?us-ascii?Q?7jByu/Dv2q5UzQsiMDXJWUXFsWqCU3QsFGsiP7O4++PrIs9lksYrnDc18HbR?= =?us-ascii?Q?esKKLn3HSwq6sTql0pGwfRsncagHCErU4YaBRm+YCDmPJBpP0/fktAmZzzrB?= =?us-ascii?Q?zaDArPnqckWneI6rBYNBKZqOwbhct9kSR5UkiKE5ukN/elzUaSS9SHgUW7pZ?= =?us-ascii?Q?wGVGq/wpBq+FsX5k249Tp3pK+pd64vz4l3nnGlnpHxDL7iCjQppRDCvhTc9+?= =?us-ascii?Q?B/BGSw0YTnugN6pAwdLZMmYoPkUVor9UKBYrZVDdb3n+FN+RrivFRjsu+DV3?= =?us-ascii?Q?fSvVR3gLhuB+2SjljdUSebvTFKeP6N0ffUYR65+nhfF9ZcsI5RwCb2F/dE6n?= =?us-ascii?Q?lInRRYfZUTSLbSIHFJQdPD3Qqs+YR8RzR8sFrvAJSUxvtfNH5+GsNpoClYQp?= =?us-ascii?Q?tRR4YlmIOJmNmIkhSLviFGQAMmfm25ThLllBivdFSS1UpWNz5cQ1r+pc84bX?= =?us-ascii?Q?G0Y/K+U8VqptI/NZQiOWk+BSHehISbuizvY8PlvrZyG+Dvbmo7wJq7jRiAjr?= =?us-ascii?Q?TG1DyoWq2z2qkdgN8sbQWa2b56DNwnIq6dxXQnYB6EfB9ulY+s0ivmoCBUCe?= =?us-ascii?Q?pxLiKRQOrr5Xg7OLhGRPQZjJp2ssAtJz9EMGgEGEsVVATdRkB1gXzIGHldv2?= =?us-ascii?Q?bpbaJBGIV/GQRKr5k+wTumQFhcJhsztfw99cp0DGRsAlKrsxH+VQw58+BxAA?= =?us-ascii?Q?Fnb9QutnMFAviHQHCaFdeA1o?= 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: DM6PR11MB3516.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3b7c05c0-51ee-4a5f-cd1e-08d90860ba1a X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Apr 2021 03:09:38.0317 (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: mknjYfVEESBffIb4SX6tDforAqJLjYZVlmtXKvNDrFW6KBupxa62ZAMcYjUG/B1NaKQ12CPdJHu5fZy36yI3Dw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1101MB2108 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v3 2/2] net/ice: refactor input set fields for switch filter 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: Zhang, Qi Z > Sent: Monday, April 26, 2021 9:48 AM > To: Zhang, Yuying ; dev@dpdk.org; Wang, Haiyue > > Cc: Yan, Zhirun ; Guo, Junfeng > Subject: RE: [PATCH v3 2/2] net/ice: refactor input set fields for switch= filter >=20 >=20 >=20 > > -----Original Message----- > > From: Zhang, Yuying > > Sent: Sunday, April 25, 2021 9:29 PM > > To: dev@dpdk.org; Zhang, Qi Z ; Wang, Haiyue > > > > Cc: Yan, Zhirun ; Guo, Junfeng > > ; Zhang, Yuying > > Subject: [PATCH v3 2/2] net/ice: refactor input set fields for switch > > filter > > > > Input set has been divided into inner and outer part to distinguish > > different fields. However, the parse method of switch filter doesn't > > match this update. Refactor switch filter to distingush inner and > > outer input set in the same way as other filters. > > > > Signed-off-by: Yuying Zhang > > --- > > drivers/net/ice/ice_switch_filter.c | 746 > > ++++++++++++---------------- > > 1 file changed, 323 insertions(+), 423 deletions(-) > > > > >=20 > ...... > > > > -static uint64_t > > -ice_switch_inset_get(const struct rte_flow_item pattern[], > > +static bool > > +ice_switch_parse_pattern(const struct rte_flow_item pattern[], > > struct rte_flow_error *error, > > struct ice_adv_lkup_elem *list, > > uint16_t *lkups_num, > > -enum ice_sw_tunnel_type *tun_type) > > +enum ice_sw_tunnel_type *tun_type, > > +const struct ice_pattern_match_item pattern_match_item) >=20 > Better to parse const pointer, but not struct value >=20 > const struct ice_pattern_match_item *pattern_match_item >=20 > > { > > const struct rte_flow_item *item =3D pattern; enum rte_flow_item_type > > item_type; @@ -504,7 +456,9 @@ ice_switch_inset_get(const struct > > rte_flow_item pattern[], const struct rte_flow_item_pfcp *pfcp_spec, > > *pfcp_mask; const struct rte_flow_item_gtp *gtp_spec, *gtp_mask; > > const struct rte_flow_item_gtp_psc *gtp_psc_spec, *gtp_psc_mask; > > -uint64_t input_set =3D ICE_INSET_NONE; > > +uint64_t outer_input_set =3D ICE_INSET_NONE; uint64_t inner_input_set = =3D > > +ICE_INSET_NONE; uint64_t *input =3D NULL; >=20 > Why we need pointer here? >=20 > Can we: >=20 > if (tunnel_valid) { > ... > input_set =3D inner_input_set; > } else { > ... > input_set =3D outer_input_set; > } >=20 We need to change the value of inner_input_set and outer_input_set according to actual input set of the rule to be created. Pointer is used to distinguish which one need to be changed. > ....... > > > > -inputset =3D ice_switch_inset_get > > -(pattern, error, list, &lkups_num, &tun_type); -if ((!inputset && > > !ice_is_prof_rule(tun_type)) || -(inputset & > > ~pattern_match_item->input_set_mask_o)) { > > +if (ice_switch_parse_pattern(pattern, error, list, &lkups_num, > > + &tun_type, *pattern_match_item) =3D=3D false) { >=20 > No need "=3D=3Dfalse", use ! for Boolean. >=20 > > rte_flow_error_set(error, EINVAL, > > RTE_FLOW_ERROR_TYPE_ITEM_SPEC, > > pattern, > > -- > > 2.25.1 >=20