From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40071.outbound.protection.outlook.com [40.107.4.71]) by dpdk.org (Postfix) with ESMTP id BB9331B3B0 for ; Tue, 3 Oct 2017 17:07:38 +0200 (CEST) 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; bh=u9Eu6NEGdrsML+7IJU8I/ePDuC/5o/DkPNp1w79HBLQ=; b=qHLd8zSYbUqiz96Xwo30mLY01QeTUqlrYLs2yw9d6b+gpZ5gXPD9pY1h68OXnnEuELffl82ElGrEFhenYb7Re9k0AU9g1Fyfc/U9081qU/2NjvxNu/FZg9dHdNdgI4tFnZy+ywhHo65WGuBMuFEVRoODDoPjbMBcZRX4eEyttMQ= Received: from DB6PR0502MB3048.eurprd05.prod.outlook.com (10.172.250.136) by DB6PR0502MB3046.eurprd05.prod.outlook.com (10.172.247.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Tue, 3 Oct 2017 15:07:37 +0000 Received: from DB6PR0502MB3048.eurprd05.prod.outlook.com ([fe80::119e:aa7d:96e5:33a3]) by DB6PR0502MB3048.eurprd05.prod.outlook.com ([fe80::119e:aa7d:96e5:33a3%18]) with mapi id 15.20.0077.018; Tue, 3 Oct 2017 15:07:37 +0000 From: Matan Azrad To: root , Pascal Mazon CC: "dev@dpdk.org" Thread-Topic: [PATCH 2/2] net/tap: allow RSS flow action Thread-Index: AQHTPFdAbxO/fm5Ij0K8mMjRPp3SLqLSOf8g Date: Tue, 3 Oct 2017 15:07:37 +0000 Message-ID: References: <1507042327-9501-1-git-send-email-root@pegasus12.mtr.labs.mlnx> <1507042327-9501-2-git-send-email-root@pegasus12.mtr.labs.mlnx> In-Reply-To: <1507042327-9501-2-git-send-email-root@pegasus12.mtr.labs.mlnx> Accept-Language: en-US, he-IL Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=matan@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB6PR0502MB3046; 6:R+BOTVtkJy50s1hwcnMyIG/kZfMizVDX5J+d8ahsVDo+qs8FBWK1sNtcwfpZ4DK6CmD0eTFYKuZq417fjmem+BySmF5Y9RGniSZCptqz7fJRWzY/51TY+ySzzRuxBGZS2broI00DJRyyU7lTCOhPnqYhUxQN3kej8IZUx/7VnNMC66VlHElF+EiKCt7YJF4NmxGpPxqx/B9zF8kZMLi+8AiOjLsfKTAf6MsUX2MIRrI1ozdCg8BZbq0cdaHA/Vnq/0r8+WH9gpCOgGvfcDG3wPH5YHpRuM6UjB5N0IHLk5ojxUeaGbjiMctm7Oni25i53pmVNf1+hoKepGdU7s5F2Q==; 5:u5lMN7Ymcn+7PstkxbGqm7sFTisFlZmHaqJds33/BJYOvYUSAd1Gqdt5b+t2z0C1Schh27YAzMhLkPbs53KI1yAOIZdWckykOQWudiehaSgZ05/afFbGlTGB2pSqjyutyNS7xnRVp7iwQwt7uJjuFQ==; 24:DNDAb5Diwj/qIlTyyZQ1vvrIdF5Iz8M/KkRl0BhqidYUMW9I92oxac5AtYLfKxaqdwpk8xIHPnoTwh0wwcXpyM/c+e3mfR2ttyXsGHbPowU=; 7:CZRDt9nXE/zIcOM4KzZcz7CyqVzjiiU0fZ5b4kj1EB9VHfn4ObUUpqXF+mr5Cc5C9jnIrbeNhkU1MaVWgDs4xwbWZ9eivehg7FMdhgUV9lGbS+PdcwgayQlW/5U/U1fzR0MvMPO/LblxFdVjxshCNByvzS/kABsRRaYc1sEJq2I/i2pTTjK1uXm/+x2ypQmV2RAeG3FQR5AR7T/LKUA96YNqzYQGHQQCSv0XmIDS1nc= x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: 08727251-fe94-4026-a18e-08d50a707bd8 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(48565401081)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:DB6PR0502MB3046; x-ms-traffictypediagnostic: DB6PR0502MB3046: x-exchange-antispam-report-test: UriScan:; x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(100000703101)(100105400095)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123562025)(20161123558100)(20161123555025)(20161123564025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DB6PR0502MB3046; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DB6PR0502MB3046; x-forefront-prvs: 044968D9E1 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(376002)(39860400002)(346002)(13464003)(189002)(199003)(377454003)(74316002)(6116002)(66066001)(68736007)(102836003)(9686003)(3280700002)(305945005)(53546010)(3660700001)(3846002)(7736002)(478600001)(86362001)(106356001)(54356999)(105586002)(50986999)(76176999)(189998001)(2906002)(101416001)(53936002)(7696004)(2950100002)(5660300001)(229853002)(97736004)(316002)(110136005)(33656002)(5250100002)(6436002)(6506006)(8676002)(2900100001)(25786009)(8936002)(6246003)(81166006)(14454004)(4326008)(99286003)(81156014)(55016002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0502MB3046; H:DB6PR0502MB3048.eurprd05.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Oct 2017 15:07:37.1640 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0502MB3046 Subject: Re: [dpdk-dev] [PATCH 2/2] net/tap: allow RSS flow action 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: , X-List-Received-Date: Tue, 03 Oct 2017 15:07:38 -0000 I sent it from root user by mistake, sorry! I Sent it again with my user. > -----Original Message----- > From: root [mailto:root@pegasus12.mtr.labs.mlnx] > Sent: Tuesday, October 3, 2017 5:52 PM > To: Pascal Mazon > Cc: dev@dpdk.org; Matan Azrad > Subject: [PATCH 2/2] net/tap: allow RSS flow action >=20 > From: Matan Azrad >=20 > One of the main identified use cases for the tap PMD is to be used in > combination with the fail-safe PMD as a fallback for a physical device. >=20 > Fail-safe is very strict about making sure its current configuration is p= roperly > applied to all slave devices, they get rejected otherwise in order to mai= ntain > a consistent state. >=20 > The problem is that tap's RSS support is currently limited to the default= (non- > Toeplitz) balancing performed by the kernel on all Rx queues. While prope= r > RSS support emulation in the tap PMD is a work in progress, the lack of > rte_flow counterpart prevents validation of the above use case in the > meantime. >=20 > Given that unlike most PMDs, tap is more about convenience than > performance, support for the RSS action can be temporarily faked with a > minimum amount of code and mostly correct behavior by treating it like a > QUEUE action. Traffic is directed to the first queue of the set. >=20 > Signed-off-by: Matan Azrad > --- > drivers/net/tap/tap_flow.c | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) >=20 > diff --git a/drivers/net/tap/tap_flow.c b/drivers/net/tap/tap_flow.c inde= x > aa33960..28d793f 100644 > --- a/drivers/net/tap/tap_flow.c > +++ b/drivers/net/tap/tap_flow.c > @@ -1089,6 +1089,7 @@ struct tap_flow_items { > const struct rte_flow_action_queue *queue =3D > (const struct rte_flow_action_queue *) > actions->conf; > + > if (action) > goto exit_action_not_supported; > action =3D 1; > @@ -1097,6 +1098,20 @@ struct tap_flow_items { > goto exit_action_not_supported; > if (flow) > err =3D add_action_skbedit(flow, queue- > >index); > + } else if (actions->type =3D=3D RTE_FLOW_ACTION_TYPE_RSS) { > + /* Fake RSS support. */ > + const struct rte_flow_action_rss *rss =3D > + (const struct rte_flow_action_rss *) > + actions->conf; > + > + if (action) > + goto exit_action_not_supported; > + action =3D 1; > + if (!rss || rss->num < 1 || > + (rss->queue[0] > pmd->dev->data->nb_rx_queues > - 1)) > + goto exit_action_not_supported; > + if (flow) > + err =3D add_action_skbedit(flow, rss- > >queue[0]); > } else { > goto exit_action_not_supported; > } > -- > 1.8.3.1