From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 72B3FA057B; Thu, 2 Apr 2020 09:38:33 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D8712375B; Thu, 2 Apr 2020 09:38:32 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 7DB672C15 for ; Thu, 2 Apr 2020 09:38:29 +0200 (CEST) IronPort-SDR: ySs18Qipz+AdWMh1YnTxDl9ogyvcYrIIJs5//tdU2Lsk5KxbWJUnTqps139QklTMIsXy+SNeXP /byVWbKTzgBA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Apr 2020 00:38:29 -0700 IronPort-SDR: 6SeruiESjy441GK/Y3bsl1XfKUqi0ncA/Td3ryzE0bR4JGOJL49k3EcIV262HsWVYJrwGFrCBg YoORfVVslU2w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,334,1580803200"; d="scan'208";a="328731265" Received: from orsmsx102.amr.corp.intel.com ([10.22.225.129]) by orsmga001.jf.intel.com with ESMTP; 02 Apr 2020 00:38:28 -0700 Received: from orsmsx604.amr.corp.intel.com (10.22.229.17) by ORSMSX102.amr.corp.intel.com (10.22.225.129) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 2 Apr 2020 00:38:28 -0700 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) 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.1713.5; Thu, 2 Apr 2020 00:38:27 -0700 Received: from ORSEDG001.ED.cps.intel.com (10.7.248.4) by orsmsx603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Thu, 2 Apr 2020 00:38:27 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.172) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 2 Apr 2020 00:38:22 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dlKVOTqkEAdwo7rUNzGI7pP1KNfNYC8+Pzk8kOrJ0wg10YrcPf9v6fCBQUjdAXEenERHuX/YzZxWFtudsXBG8mKh/Ryn0RJ8TEuh6lbVJlFHjFK8tOT39LqMi7Ei8FHppGtIoUmxZEJBPGPOA/SzLSJxarSO7NIsjOfGBhXIOqAm2470nt3/RHRFSblIAseDiUdelEz4rP8rWSORSuGavht7+1jBvtCwDf7doRtndaFwvS/8sEJs/X3GpftuESMd/oViLhKuiuH+ShbuHKZpLcM1JJARlnSTzxawX2ii6K7wJeoomz//S0r6mZgudp72QJy/3KuAa7uQZTTlyj6V/w== 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=TNKhR3TBrFh6Jli3c6goxciAtOzSTpimlhfWQ1LgYDY=; b=gjQfcoiXbpIq8Qouy3G9NHeMimFhnd1Mx9wPGeh3NQrnR7g1xAn7xJMlPiWFWBtXYwwphbNjvy1eqAzyFQ3/sxPSJ+u7siLgzFsVxG4qvoVGe3TX+3fGsKZsO7JrpbMjyupWRlfjiBU3wuVoeI3yosCIpbUaYQAa9KLnqXKs36gRaSjc3Pg0qCgKZ5aLXHiKXTweTF4Z7cdOhzcbMYpE1oopTIGYU+jdA29Dtc3Lk/o46fv+f7vnWhDBscXPn+WThnLudBwP5PdER28fMqX9eGiZjMWj3Mq2z1+LzAF2osCl4f6NcI/U3xO5TCumQ/IDS5lJkXKeucxvL+H0BDZ4AA== 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=TNKhR3TBrFh6Jli3c6goxciAtOzSTpimlhfWQ1LgYDY=; b=UVAqFe0O2NF7moGpSSuuazLg7KU7VWdouJ9cmg2gV61yglE+WVlPujoYDZSsbiQnNN0Aqe/yPtBYf/D+ABytUkT9C9HktVMIbddNCymJOdJdhmta0SYj4Tbu1fUmG0Awcm03zv63Gjs+2A8nR+VqXJGfE6PonGGQQeRSfm6ACGM= Received: from BYAPR11MB3541.namprd11.prod.outlook.com (2603:10b6:a03:f5::16) by BYAPR11MB3831.namprd11.prod.outlook.com (2603:10b6:a03:b0::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.15; Thu, 2 Apr 2020 07:38:14 +0000 Received: from BYAPR11MB3541.namprd11.prod.outlook.com ([fe80::e8ad:5730:3ad0:87c6]) by BYAPR11MB3541.namprd11.prod.outlook.com ([fe80::e8ad:5730:3ad0:87c6%7]) with mapi id 15.20.2878.014; Thu, 2 Apr 2020 07:38:14 +0000 From: "Xing, Beilei" To: "Wang, Haiyue" , "Zhao1, Wei" , "dev@dpdk.org" CC: "Zhang, Qi Z" , "Peng, Yuan" , "Lu, Nannan" , "Fu, Qi" Thread-Topic: [PATCH v2 12/13] net/ice: enable flow redirect on switch Thread-Index: AQHWCL1+MViSDttl4US0GJogxheZsahlcNgAgAAA0sA= Date: Thu, 2 Apr 2020 07:38:14 +0000 Message-ID: References: <20200313020806.21654-1-wei.zhao1@intel.com> <20200402064620.47668-1-wei.zhao1@intel.com> <20200402064620.47668-13-wei.zhao1@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=beilei.xing@intel.com; x-originating-ip: [192.102.204.38] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 6a673574-9819-46de-00ed-08d7d6d8cd93 x-ms-traffictypediagnostic: BYAPR11MB3831: 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:2449; x-forefront-prvs: 0361212EA8 x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR11MB3541.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10019020)(396003)(346002)(39860400002)(366004)(376002)(136003)(81156014)(66556008)(86362001)(66446008)(76116006)(66946007)(64756008)(66476007)(478600001)(9686003)(71200400001)(5660300002)(54906003)(110136005)(55016002)(107886003)(52536014)(26005)(2906002)(186003)(81166006)(8676002)(316002)(53546011)(7696005)(33656002)(4326008)(8936002)(6506007); DIR:OUT; SFP:1102; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: dCSdoBAQPRZ2u5vZKkEdeOJl7wWBD76ujFcAB+xop95AggKR1ybV5AWNCIqHbKWQCjMWSNjRUISyrP5dMIzD+5dSaLxtQwENRGvQYNfgSeXtGke5UsX19XgxJHKvq7BJ/yugsif67RSRZSxSpNAauqgluHFQu/UXVSQJ3SvxK35NnB8QYas69go+KXZN8FywjhRkRZXZ7Ne4/OStvCnG5I39jVD2dIqCO9HYHLHMQGyEFmZApyRSOCX02T2dERJMy2AZ1mJE4LdV+cPfBS99OAj53YCgGnMkiwMvSl8wM/rbl2L6jo3vkHv3J6mqUo1nehdNZXMRPYaDf+5cv7UpOxKomevQaf3RaBtcNT0fZwbXdyRJJ0rg1ctPk32j01BVduhUgJTFvrYp3GgNeJR6IJ1GnMAue5pem0jlVSbNFsFx9gR5NEk+D+pTpitguRCv x-ms-exchange-antispam-messagedata: y2ECeyLkT+FyGftaBAJ5aRv9wTmsVVkJ1SZprV2TJwPAVmJ88MOKo6XbbeuBaet6H4TP31ftmDIwTXFdauFVb7m+WomBUjN2Hu1S+EQzhuiEsZxm49UWjoXiNkemQjB6fL0IiXyjTUZJGJMOfi2FPw== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 6a673574-9819-46de-00ed-08d7d6d8cd93 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Apr 2020 07:38:14.5578 (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: hBgcvVTl8EcCEf3QYew8SdNnJIkQ00Rsa9y7eMhsByzxAkhb0jq1ejSjsNc3nQFSIiyRorcjnKCbemvjwTWR4Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3831 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v2 12/13] net/ice: enable flow redirect on switch X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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: Wang, Haiyue > Sent: Thursday, April 2, 2020 3:35 PM > To: Zhao1, Wei ; dev@dpdk.org > Cc: Zhang, Qi Z ; Peng, Yuan ; > Lu, Nannan ; Fu, Qi ; Xing, Beilei > > Subject: RE: [PATCH v2 12/13] net/ice: enable flow redirect on switch >=20 > > -----Original Message----- > > From: Zhao1, Wei > > Sent: Thursday, April 2, 2020 14:46 > > To: dev@dpdk.org > > Cc: Zhang, Qi Z ; Peng, Yuan > > ; Lu, Nannan ; Fu, Qi > > ; Wang, Haiyue ; Xing, Beilei > > > > Subject: [PATCH v2 12/13] net/ice: enable flow redirect on switch > > > > Enable flow redirect on switch, currently only support VSI redirect. > > > > Signed-off-by: Beilei Xing > > --- > > drivers/net/ice/ice_switch_filter.c | 74 > > +++++++++++++++++++++++++++++ > > 1 file changed, 74 insertions(+) > > > > diff --git a/drivers/net/ice/ice_switch_filter.c > > b/drivers/net/ice/ice_switch_filter.c > > index 686f9c3e3..61adb518c 100644 > > --- a/drivers/net/ice/ice_switch_filter.c > > +++ b/drivers/net/ice/ice_switch_filter.c > > @@ -1420,6 +1420,79 @@ ice_switch_query(struct ice_adapter *ad > > __rte_unused, return -rte_errno; } > > > > +static int > > +ice_switch_redirect(struct ice_adapter *ad, > > + struct rte_flow *flow, > > + struct ice_flow_redirect *rd) > > +{ > > +struct ice_rule_query_data *rdata =3D flow->rule; struct > > +ice_adv_fltr_mgmt_list_entry *list_itr; struct ice_adv_lkup_elem > > +*lkups_dp =3D NULL; struct LIST_HEAD_TYPE *list_head; struct > > +ice_adv_rule_info rinfo; struct ice_hw *hw =3D &ad->hw; struct > > +ice_switch_info *sw; uint16_t lkups_cnt; int ret; > > + > > +sw =3D hw->switch_info; > > +if (!sw->recp_list[rdata->rid].recp_created) > > +return -EINVAL; > > + > > +if (rd->type !=3D ICE_FLOW_REDIRECT_VSI) return -ENOTSUP; > > + > > +list_head =3D &sw->recp_list[rdata->rid].filt_rules; > > +LIST_FOR_EACH_ENTRY(list_itr, list_head, ice_adv_fltr_mgmt_list_entry, > > + list_entry) { > > +rinfo =3D list_itr->rule_info; > > +if (rinfo.fltr_rule_id =3D=3D rdata->rule_id && > > + rinfo.sw_act.fltr_act =3D=3D ICE_FWD_TO_VSI && > > + rinfo.sw_act.vsi_handle =3D=3D rd->vsi_handle) { lkups_cnt =3D > > +list_itr->lkups_cnt; lkups_dp =3D (struct ice_adv_lkup_elem *) > > +ice_memdup(hw, list_itr->lkups, > > + sizeof(*list_itr->lkups) * > > + lkups_cnt, ICE_NONDMA_TO_NONDMA); > > +if (!lkups_dp) { > > +PMD_DRV_LOG(ERR, "Failed to allocate memory."); return -EINVAL; } > > + > > +break; > > +} > > +} > > + > > +if (!lkups_dp) > > +return 0; > > + > > +/* Remove the old rule */ > > +ret =3D ice_rem_adv_rule(hw, list_itr->lkups, > > + lkups_cnt, &rinfo); > > +if (ret) { > > +PMD_DRV_LOG(ERR, "Failed to delete the old rule %d", > > + rdata->rule_id); > > +ret =3D -EINVAL; > > +goto out; > > +} > > + > > +/* Update VSI context */ > > +hw->vsi_ctx[rd->vsi_handle]->vsi_num =3D rd->new_vsi_num; > > + > > +/* Replay the rule */ > > +ret =3D ice_add_adv_rule(hw, lkups_dp, lkups_cnt, > > + &rinfo, rdata); > > +if (ret) { > > +PMD_DRV_LOG(ERR, "Failed to replay the rule"); ret =3D -EINVAL; goto > > +out; >=20 > This 'goto out' can be removed. Yes, will remove in next version. Thanks. >=20 > > +} > > + > > +out: > > +ice_free(hw, lkups_dp); > > +return ret; > > +} > > + > > static int > > ice_switch_init(struct ice_adapter *ad) { @@ -1465,6 +1538,7 @@ > > ice_flow_engine ice_switch_engine =3D { .create =3D ice_switch_create, > > .destroy =3D ice_switch_destroy, .query_count =3D ice_switch_query, > > +.redirect =3D ice_switch_redirect, > > .free =3D ice_switch_filter_rule_free, > > .type =3D ICE_FLOW_ENGINE_SWITCH, > > }; > > -- > > 2.19.1 >=20