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 BBF54A0350; Wed, 1 Jul 2020 11:37:45 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 413901C2E8; Wed, 1 Jul 2020 11:37:45 +0200 (CEST) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2046.outbound.protection.outlook.com [40.107.20.46]) by dpdk.org (Postfix) with ESMTP id 756841C1E3 for ; Wed, 1 Jul 2020 11:37:44 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ANDfzGudN6rMPoYSEpybU6C/jA1xNo4XWS0zd6PwJ8xkNgmICg652YR64MvzQ8mz17hzDTf+eAzxXmAVRbiMMcSq8uDJeYX35WhS/VYl0eaIaEQP7TVKEsPW7+TCy7Rwl8ClLdglfQvMQeydF5VNkrqOQNxduZRjkYcIgJtGZfIjp+j8FCX5bkFhcfIhVb6902T0GYLmKx+tCGYmUt3xFNZL9MM0nNoRfNL0xb1x95E3sGiFV19gNk7PqjEeFZy0hilV0cBUaAASMjYbUe47dhfbbThmB8nu6xBIZtoMrWFie/7ffgRik8zSEAPbiQZoz8MlZswMAeXUAW675XarMw== 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=Es5IjMZqu9XjCtlDONNUGEiVKuPYUIv1fEUwTA+nwUw=; b=YkdKylU9X9U6fDjN/0EB+bLC1UlDygUYPjWgkEsYcd0n4biMCPvD1hOWHrrAC2FlpU1P0OyEBAnMoyMh7MWiS8jrA93T57XxfPgvNq10Y59lvOBjrA30nVUvRdKbh2d9EPKNfvub5BL/kfqqz681Bp49Q9TYsOTfrLom8xhg2gGLY8sYdt8edflpjS9w2os3XWErbcNVfz6Sn+0cFXPpKEqFzKII5/0BkAteLbcfT6XNyb6nU4FvWq1JHbjzfgtq+9OKOOCtiob9OHhwRCJID72o6g7ol4eR1gx3QGnawMb1j7TROLB2PEPyhinl6pAzzDBak7Ihv8OkvmipOjQNWQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Es5IjMZqu9XjCtlDONNUGEiVKuPYUIv1fEUwTA+nwUw=; b=PZ84/ffFatd9v3DMLNQCURGFL1XmENRylhz6EwcWF9G86NfJ25pFQFyHy82J4A8I3Vf8I1vpHMzMvLDuHIPacBjM3yqfSrir9MyUpi6+eD8EXpg2aM/i/s/QV0E/N5I+Vza8njUTpq4pA+tSLZzRCuAllXqVJ2E6zKWMu9ov9oA= Received: from AM6PR05MB5176.eurprd05.prod.outlook.com (2603:10a6:20b:63::30) by AM7PR05MB6741.eurprd05.prod.outlook.com (2603:10a6:20b:13e::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.21; Wed, 1 Jul 2020 09:37:42 +0000 Received: from AM6PR05MB5176.eurprd05.prod.outlook.com ([fe80::9024:accb:4d6b:805f]) by AM6PR05MB5176.eurprd05.prod.outlook.com ([fe80::9024:accb:4d6b:805f%3]) with mapi id 15.20.3131.030; Wed, 1 Jul 2020 09:37:42 +0000 From: Ori Kam To: "Jiawei(Jonny) Wang" , Slava Ovsiienko , Matan Azrad CC: "dev@dpdk.org" , Thomas Monjalon , Raslan Darawsheh , "ian.stokes@intel.com" , "fbl@redhat.com" , "Jiawei(Jonny) Wang" Thread-Topic: [PATCH 1/8] ethdev: introduce sample action for rte flow Thread-Index: AQHWSxDCyLojAHjlU0ugMUl3sJ+yrajyf5yg Date: Wed, 1 Jul 2020 09:37:42 +0000 Message-ID: References: <1593102379-400132-1-git-send-email-jiaweiw@mellanox.com> <1593102379-400132-2-git-send-email-jiaweiw@mellanox.com> In-Reply-To: <1593102379-400132-2-git-send-email-jiaweiw@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: mellanox.com; dkim=none (message not signed) header.d=none;mellanox.com; dmarc=none action=none header.from=mellanox.com; x-originating-ip: [147.236.152.129] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 08969a44-fcd8-4103-029e-08d81da2674d x-ms-traffictypediagnostic: AM7PR05MB6741: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtFwd,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-forefront-prvs: 04519BA941 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Xw0n6dVE7lavCrOos5/lcNPbgf6rEbig411sx+wngFCJmnzoW/nN2jP1tY6GeKjbLUWrRvafXFMgFrzNFDj66jB73z2dQcKXqCpOFyINLjC0BQv+4NbB33HF6UpgC1A5JO8czIY79pWaArsf8ZbFTQjOZFJtdnILKQjGU1HE2GKUJQhzuDuDCjFFFrVObbNj6X/GqVJAXV7i1Pg9sn3tvEtmL/i9NKHo5krGo6mJrYzqHB8+MS/B7xr195yV0mLbHCrOocBN27XozfSiuyiAII/0RONlFmLCwGOAQDCT0vOEtWVzfzanva/EN0WaBo/F x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR05MB5176.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(366004)(376002)(396003)(346002)(39860400002)(136003)(110136005)(2906002)(66946007)(66476007)(66556008)(76116006)(64756008)(66446008)(83380400001)(9686003)(33656002)(8936002)(8676002)(4326008)(55016002)(107886003)(186003)(26005)(316002)(478600001)(54906003)(5660300002)(52536014)(6636002)(86362001)(7696005)(71200400001)(53546011)(6506007); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: 6d0XTxLNPAIbU88Os7ppUncTp0q4zYmLkgCt/0j94WVrI2rC/N7ETEUHXTgUbLXyH654Yv7S32nSdk6JX9CwCm7J6qvx3zwjH0Q65Pn6pMW9YNdzBHHNOZgoIutrcv8SVOZGT4ktsDeW8T6VhvVwXeMY2VvdeTBsVDxzVpV80ULoIxF8emm8iUOA0WGBYCDvjen82hcPkZHuhv0xLhkX27c+avb//uSUUwGQLVfJ3xtGY0NgwlRuBKmvVqy0QQZVVJEdkMnYWyLNaUQhUByrga/NkBLvD/S07qNMXwOYp03zWio/WJmxVnZLxeMdJdXl6N8ZjWGAInfW7M5DCIzIs8FhS4OYkuC+f+3DSmPnLludvFae6xEwsTFJfouIryhCmRjN0JKQjlegVAVT9+QZcL4x9OE4RGhIiuNiKODHxZrbMpsy8+kn1g1M3eu49A2zA1IDYJIeNdk2ddqHYIiq6BMQEEUnWxflekuCGkThhrvtqLs/0YooFRc7knX+4N+n Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AM6PR05MB5176.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 08969a44-fcd8-4103-029e-08d81da2674d X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Jul 2020 09:37:42.6923 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: wrhazgRtbRcN0YKvwiAGWExEhJC4HGEQqtTk+6ApXcNEDFuk+DLmC9YJG0EFA7L7N0su4l+tpDyuCOo7hjGtIQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR05MB6741 Subject: Re: [dpdk-dev] [PATCH 1/8] ethdev: introduce sample action for rte flow 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" Hi Jiawei, Please note that you are missing the doc changes. Please update them. Best, Ori > -----Original Message----- > From: Jiawei Wang > Sent: Thursday, June 25, 2020 7:26 PM > To: Ori Kam ; Slava Ovsiienko > ; Matan Azrad > Cc: dev@dpdk.org; Thomas Monjalon ; Raslan > Darawsheh ; ian.stokes@intel.com; fbl@redhat.com; > Jiawei(Jonny) Wang > Subject: [PATCH 1/8] ethdev: introduce sample action for rte flow >=20 > When using full offload, all traffic will be handled by the HW, and > directed to the requested vf or wire, the control application loses > visibility on the traffic. > So there's a need for an action that will enable the control application > some visibility. >=20 > The solution is introduced a new action that will sample the incoming > traffic and send a duplicated traffic in some predefined ratio to the > application, while the original packet will continue to the target > destination. >=20 > The packets sampled equals is '1/ratio', if the ratio value be set to 1 > , means that the packets would be completely mirrored. The sample packet > can be assigned with different set of actions from the original packet. >=20 > In order to support the sample packet in rte_flow, new rte_flow action > definition RTE_FLOW_ACTION_TYPE_SAMPLE and structure > rte_flow_action_sample > will be introduced. >=20 > Signed-off-by: Jiawei Wang > --- > lib/librte_ethdev/rte_flow.c | 1 + > lib/librte_ethdev/rte_flow.h | 29 +++++++++++++++++++++++++++++ > 2 files changed, 30 insertions(+) >=20 > diff --git a/lib/librte_ethdev/rte_flow.c b/lib/librte_ethdev/rte_flow.c > index 1685be5..733871d 100644 > --- a/lib/librte_ethdev/rte_flow.c > +++ b/lib/librte_ethdev/rte_flow.c > @@ -173,6 +173,7 @@ struct rte_flow_desc_data { > MK_FLOW_ACTION(SET_IPV4_DSCP, sizeof(struct > rte_flow_action_set_dscp)), > MK_FLOW_ACTION(SET_IPV6_DSCP, sizeof(struct > rte_flow_action_set_dscp)), > MK_FLOW_ACTION(AGE, sizeof(struct rte_flow_action_age)), > + MK_FLOW_ACTION(SAMPLE, sizeof(struct rte_flow_action_sample)), > }; >=20 > int > diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h > index b0e4199..71dd82c 100644 > --- a/lib/librte_ethdev/rte_flow.h > +++ b/lib/librte_ethdev/rte_flow.h > @@ -2099,6 +2099,13 @@ enum rte_flow_action_type { > * see enum RTE_ETH_EVENT_FLOW_AGED > */ > RTE_FLOW_ACTION_TYPE_AGE, > + > + /** > + * Redirects specific ratio of packets to vport or queue. > + * > + * See struct rte_flow_action_sample. > + */ > + RTE_FLOW_ACTION_TYPE_SAMPLE, > }; >=20 > /** > @@ -2709,6 +2716,28 @@ struct rte_flow_action { > struct rte_flow; >=20 > /** > + * @warning > + * @b EXPERIMENTAL: this structure may change without prior notice > + * > + * RTE_FLOW_ACTION_TYPE_SAMPLE > + * > + * Adds a sample action to a matched flow. > + * > + * The matching packets will be duplicated to a special queue or vport > + * in the predefined probabiilty, All the packets continues processing > + * on the default flow path. > + * > + * When the sample ratio is set to 1 then the packets will be 100% mirro= red. > + * Additional action list be supported to add for sampled or mirrored pa= ckets. > + */ > +struct rte_flow_action_sample { > + /* packets sampled equals to '1/ratio' */ > + const uint32_t ratio; > + /* sub-action list specific for the sampling hit cases */ > + const struct rte_flow_action *actions; > +}; > + > +/** > * Verbose error types. > * > * Most of them provide the type of the object referenced by struct > -- > 1.8.3.1