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 57AA9A0562; Mon, 30 Mar 2020 10:01:27 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BA59F1C032; Mon, 30 Mar 2020 10:01:26 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 928481C02A for ; Mon, 30 Mar 2020 10:01:24 +0200 (CEST) IronPort-SDR: +T6QV/+R4khZZABE2T8SfdVrJPtPsmUjAW4HegqD1XxJA77VMBQQY11nF+J3l6ffDvn9e2/Q+h Sc/CbiWqAwKA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Mar 2020 01:01:23 -0700 IronPort-SDR: YHlJfAIo8uC5hw/qUfXgbZlqFAXwJN2V1bAnX8lx0EPe+i0iY/a0yPhXG1Vwqf9d5CnOSqdua8 +gpE8/urpuhQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,323,1580803200"; d="scan'208";a="248625997" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga003.jf.intel.com with ESMTP; 30 Mar 2020 01:01:19 -0700 Received: from fmsmsx122.amr.corp.intel.com (10.18.125.37) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 30 Mar 2020 01:01:19 -0700 Received: from FMSEDG001.ED.cps.intel.com (10.1.192.133) by fmsmsx122.amr.corp.intel.com (10.18.125.37) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 30 Mar 2020 01:01:19 -0700 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (104.47.38.54) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 30 Mar 2020 01:01:18 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F1n17Kt6h136FRlqlHI++vNmJg3NZpaj+OxQKHJVoqA2900SdRbdEfLuo+VaaV/71+EdTvtMmgkHUBDmNkHUNmaSepmlZnB+EW0l/PlM/nGqsxzRU27zkj+KQg5th6l96XLpvCc9wgPidFbRwx3Bu/EAYZ3vDIdsrSig1fF7XgsHWzkPen6dTg4vXWm+u8W0ILKv7laa++Nor7XtKadicQ5u9kgwYd+c2dE28659+DBBJxBw7P74WmghkjmKRvPCLUTSlmZc2+ABWdNQmtdduZcdSeQWCcG+mVxQmzwWcZ0BHFYXHMKdT5gnKIL8Cqnh5utgJmUYohhWGLItoY3zlQ== 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=R4fLIC4HPDP77Hofkn5qibAKb3v9aXCbrO2dQr/jRqE=; b=UobR7XSGOiFs5XFphCZpcNQFrb2wLbRF25M+swusAiRS1o8BFXgA+j1+aFD9mPZrrz7Nswd0fIt8VNSkN6mxAX3sfCfpBLvteHrAnJ2rI0wBTHwIsqYUjDr4QCinuwmR91N89N2q2zqBgtKZrOuS3aVBR1B45U7ijxUoYFR7R7V3JDzA4WN6d0+lMwbXRnGqReajnyxE4q4k/rfbBWAHJBsyb1hmDZ4c5oSxzTypi4meXem9cicNofez0jFsua8eoS/sHpoMNtQid1gqns9zxXXzrFGymd77xkpwXcxGrNb8ik+F+CZu4S2hJMFtUwYaY9LfonFJPFLwuF8MQ9xOqw== 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=R4fLIC4HPDP77Hofkn5qibAKb3v9aXCbrO2dQr/jRqE=; b=z0beg8FWFTfPb0Q06O3hEcTiT6OEOXHZt5by2wwYLPIjpRar4qahP7T55z/+eFezSslhgNSe6g9wZJTCjpiMvSiroX+z9KpSIRta9V6SL+Q+9nhuRW4Kf/6iZJr6rluDXz2hXkQEHPUWdZGA04LZZCSHmOsL47/esrPcSWilR0A= Received: from MN2PR11MB3582.namprd11.prod.outlook.com (2603:10b6:208:ec::28) by MN2PR11MB4192.namprd11.prod.outlook.com (2603:10b6:208:13f::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Mon, 30 Mar 2020 08:01:17 +0000 Received: from MN2PR11MB3582.namprd11.prod.outlook.com ([fe80::f091:55f5:2e58:8b26]) by MN2PR11MB3582.namprd11.prod.outlook.com ([fe80::f091:55f5:2e58:8b26%6]) with mapi id 15.20.2856.019; Mon, 30 Mar 2020 08:01:17 +0000 From: "Yang, Qiming" To: "Xing, Beilei" , "dev@dpdk.org" , "Wang, Haiyue" , "Zhang, Qi Z" Thread-Topic: [PATCH] net/ice: support flow redirect function Thread-Index: AQHWBmbb+zyKJp3uAEmzQJbjYgcIoKhgxQPw Date: Mon, 30 Mar 2020 08:01:16 +0000 Message-ID: References: <1585586271-9296-1-git-send-email-beilei.xing@intel.com> In-Reply-To: <1585586271-9296-1-git-send-email-beilei.xing@intel.com> 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=qiming.yang@intel.com; x-originating-ip: [192.102.204.38] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e62a0943-1ffd-459f-a69f-08d7d480866b x-ms-traffictypediagnostic: MN2PR11MB4192: 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:5516; x-forefront-prvs: 0358535363 x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB3582.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10019020)(376002)(366004)(136003)(39860400002)(396003)(346002)(6506007)(9686003)(7696005)(5660300002)(53546011)(71200400001)(8676002)(33656002)(478600001)(110136005)(186003)(55016002)(26005)(64756008)(8936002)(66476007)(66556008)(316002)(6636002)(76116006)(52536014)(66446008)(86362001)(81166006)(2906002)(81156014)(66946007); DIR:OUT; SFP:1102; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: lQJP9b4UuZBD4pYzvgYx/Nh+HAc4rdQbOc2E72a1zMnGakV5OYfs8ukYUU+R+l+DvA0/fy1XMmQwrzKugf2YonZTNiS0LCjvJxTd4C/252YaV8RZUaiAiNRForNwhrky0DjTy+UBWY3rir5hexNtp5x1kH+Dhvpxs+ZVbMUMc9tkiQGaXoVVZSY0e11HGFxGOjuBP/cupa7F1cBLfpCdxb8kygHIOcfmUeQQjgYAxa3RLVV2O5+sa2ZO3mXpVaib2vBTWE2lQcZo9kRzbd5C4sBmVDd6K9dsaOKNjGI/l0kK5+ohUNgry0YhN9P65lQODqjzX2dbEvQzh/I7UY5WWkii7gWrXRC8cExE5oYPhIdnmWY+9CNO/zTLxha3jqHgTSz1UKJvAYgqtAhpublkxkPL6JUJYAnHghohTqJ9bVNneak6tJ40j044pK9gsYDy x-ms-exchange-antispam-messagedata: QecGeBi1E1jMwsy/SRYYq+Z2gGr8UaXy6hpdAfx/Ozs/Uwdu6iFVzIFHOCxtRiTIgwoB2q9dFnqSqvp92gAQziH3XQjWKD3l+45cxFHJVhCT8Dx1HI0cCKMjfDLF0rkdUWsBtxx2D/JG9/B6PJmTIA== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: e62a0943-1ffd-459f-a69f-08d7d480866b X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Mar 2020 08:01:17.0080 (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: 7xa/ICgxIPyZ4LuLiFYMDZtz4nRZJAbcbyD5cdZ2P6dOX7ya2eQd1PHInmTqzwp2c1snok5pA4XO3WLr3ogEdg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4192 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH] net/ice: support flow redirect function 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: Xing, Beilei > Sent: Tuesday, March 31, 2020 00:38 > To: dev@dpdk.org; Wang, Haiyue ; Yang, Qiming > ; Zhang, Qi Z > Subject: [PATCH] net/ice: support flow redirect function >=20 > Add a new ops "redirect" to flow engine, it's used to implement the funct= ion > that redirect a flow's destination. Currently only support VSI-Redirect w= hich > will be used by DCF for handling VSI mapping table change. > A new API "ice_flow_redirect" is exposed, current usage is: it could be c= alled > when VSI mapping table change happens. We can mention the case, like VF reset. The usage will be more clear. >=20 > Signed-off-by: Beilei Xing > Signed-off-by: Qi Zhang > --- > drivers/net/ice/ice_generic_flow.c | 22 ++++++++++++++++++++++ > drivers/net/ice/ice_generic_flow.h | 21 +++++++++++++++++++++ > 2 files changed, 43 insertions(+) >=20 > diff --git a/drivers/net/ice/ice_generic_flow.c > b/drivers/net/ice/ice_generic_flow.c > index a1648ee..823ff0e 100644 > --- a/drivers/net/ice/ice_generic_flow.c > +++ b/drivers/net/ice/ice_generic_flow.c > @@ -1961,3 +1961,25 @@ ice_flow_query(struct rte_eth_dev *dev, > } > return ret; > } > + > +int > +ice_flow_redirect(struct ice_adapter *ad, > + struct ice_flow_redirect *rd) > +{ > + struct ice_pf *pf =3D &ad->pf; > + struct rte_flow *p_flow; > + void *temp; > + int ret; > + > + TAILQ_FOREACH_SAFE(p_flow, &pf->flow_list, node, temp) { > + if (!p_flow->engine->redirect) > + continue; > + ret =3D p_flow->engine->redirect(ad, p_flow, rd); > + if (ret) { > + PMD_DRV_LOG(ERR, "Failed to redirect flows"); > + return ret; > + } > + } > + > + return 0; > +} > diff --git a/drivers/net/ice/ice_generic_flow.h > b/drivers/net/ice/ice_generic_flow.h > index adc30ee..ede6ec8 100644 > --- a/drivers/net/ice/ice_generic_flow.h > +++ b/drivers/net/ice/ice_generic_flow.h > @@ -417,6 +417,20 @@ struct ice_pattern_match_item { > void *meta; > }; >=20 > +enum ice_flow_redirect_type { > + ICE_FLOW_REDIRECT_VSI, > +}; > + > +struct ice_flow_redirect { > + enum ice_flow_redirect_type type; > + union { > + struct { > + uint16_t vsi_handle; > + uint16_t new_vsi_num; > + }; > + }; > +}; > + > typedef int (*engine_init_t)(struct ice_adapter *ad); typedef void > (*engine_uninit_t)(struct ice_adapter *ad); typedef int > (*engine_create_t)(struct ice_adapter *ad, @@ -430,6 +444,9 @@ typedef > int (*engine_query_t)(struct ice_adapter *ad, > struct rte_flow *flow, > struct rte_flow_query_count *count, > struct rte_flow_error *error); > +typedef int(*engine_redirect_t)(struct ice_adapter *ad, > + struct rte_flow *flow, > + struct ice_flow_redirect *redirect); > typedef void (*engine_free_t) (struct rte_flow *flow); typedef int > (*parse_pattern_action_t)(struct ice_adapter *ad, > struct ice_pattern_match_item *array, @@ -447,6 +464,7 > @@ struct ice_flow_engine { > engine_create_t create; > engine_destroy_t destroy; > engine_query_t query_count; > + engine_redirect_t redirect; > engine_free_t free; > enum ice_flow_engine_type type; > }; > @@ -485,4 +503,7 @@ ice_search_pattern_match_item(const struct > rte_flow_item pattern[], > struct ice_pattern_match_item *array, > uint32_t array_len, > struct rte_flow_error *error); > +int > +ice_flow_redirect(struct ice_adapter *ad, > + struct ice_flow_redirect *rd); > #endif > -- > 2.7.4 Acked-by: Qiming Yang