Message ID | 1507042556-9839-2-git-send-email-matan@mellanox.com (mailing list archive) |
---|---|
State | Accepted, archived |
Delegated to: | Ferruh Yigit |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7EE961B3A9; Tue, 3 Oct 2017 16:56:16 +0200 (CEST) Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50063.outbound.protection.outlook.com [40.107.5.63]) by dpdk.org (Postfix) with ESMTP id C87961B3A7 for <dev@dpdk.org>; Tue, 3 Oct 2017 16:56:15 +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=JyI2Bh3sbEn8lTZRaxITWEsiFtBTX0AhXVftoAmPsR4=; b=Qe3T0kPXuH9cfEAVgSXYO3CQM1MXHqDhOBx9dGScQMVA3c43Iy4vAVgq5o+NoENPuX9X5bah5RaiRjiDoKkuUoiHLbkuMidD4+16cn9HAjM2064czg5nlN/lTH9di6QUD27POfb3fX+cyfymxJX49XdwD4TxWCnL6Nu/XSS+fBI= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=matan@mellanox.com; Received: from mellanox.com (37.142.13.130) by DB6PR0502MB3048.eurprd05.prod.outlook.com (2603:10a6:4:9f::8) 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 14:56:14 +0000 From: Matan Azrad <matan@mellanox.com> To: Pascal Mazon <pascal.mazon@6wind.com> Cc: dev@dpdk.org Date: Tue, 3 Oct 2017 14:55:56 +0000 Message-Id: <1507042556-9839-2-git-send-email-matan@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1507042556-9839-1-git-send-email-matan@mellanox.com> References: <1507042556-9839-1-git-send-email-matan@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: VI1PR0101CA0055.eurprd01.prod.exchangelabs.com (2603:10a6:800:1f::23) To DB6PR0502MB3048.eurprd05.prod.outlook.com (2603:10a6:4:9f::8) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fe2fd509-9c35-495e-842d-08d50a6ee4e9 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(48565401081)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:DB6PR0502MB3048; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0502MB3048; 3:fSqy3lrQiZwv/e8GJzzECi2MPZkYPBNUKBXrgMPp4I4ZFOh+2nYMda0k2E3JEcVpeXn/opv2exIMy/9civOQjED6GEYzE8kbRWpUkqnWW7WRWgJ/UXLdLB1u6n5Ute4G0OVP65+b8x+nhvaGfreDms/yDOqIADFFVYyRoFiyXbKwxdIDCb6EJcLGe/BqmXLcCJpqjIGCTFwdE1osTv+xzZy6J1xT0kOMjqHEn9K8Tww8m1fDgrvfx63mqhuXG8gB; 25:Ea7qYJWNFcJfozUCDOITpZlYlVKxNt+9EmHFSv/xcOHAs2RQzMWmOqGLRnDLB9K5zfYnYWbC5mWJEnPaeeza1JUHwcax/5VsGiVCeQAh0AbSPpJYDF4Y0elaNzY+bEIml7EJIyyvJbsK8sktJoUv1T5KLAAuw3xkH3gzacVdfdMgtK7s2G361rBwZ02XWy0XZYqyi/wR+Mklam2c8seRfoCHsOvgAdDkICZUJIaRZRFbyblK+NXontHneu6/3HndcbeaITsVDXIe4hGGEcVCmTw6Lkbe69WfvaJhnq2x5QmsWu97NhU57bEOQnjfbEWcxIqGZJjWTUjshE0OOm/kdg==; 31:IK6vq533GMjQulblLjf9U70WaKD2dLqtPAm3O9WPIaYzonzPMydCoCVbmhqxMXpw4MUpFgHFxH+v2jdV1Z+lDAqJjxc+BHoQGYo1QjlxMbXq8haYHIbZeVAqC1nzXq4NjMtCKfpe02gu+dynNag7AouxGv/kkbQfEyWTYgwi0SY6DoXX/zyixmfqauK5sHeoUoPm9BZw+idbkYBC26bNtBKKVghCzCPVkyVao1HotGg= X-MS-TrafficTypeDiagnostic: DB6PR0502MB3048: X-Microsoft-Exchange-Diagnostics: 1; DB6PR0502MB3048; 20:P2UgPUtPv7u/RGOGry5Cu9c/FkakpMc+gikv3/vGRrGXs13SjycLx3jIO6wdutHYqnL5kOITS4FJFKnPrv7sb1C5jlOVQ9f3W7gQ6GfF052XjI1tDBMnhnZqc2YHqcpufEUm/gMayay6/P17BBvIdNwd6ec8b0qiKObjSLdIvPORJZoxvRTdaf7UxwpaVqXnDSsvLRdwZtnHiqvHbGl/aptqfbCB9+coHEhRgEwe/zG0zdBp0NozkLJBQl1fx1dgZtzNRb3rQfW5l/EuEqnr4TgVVD2rkzszvLKDgLGhPBZkDPbesoFlncKEf4Fjfbz2JUnI35AFhBAKl1EX71YnHsj9du9ZcN/Bb9oAXzu845bIgLLVahZNEagGnpt4aZfeuW9fkYmb8M2/BUih1NZHEDZ9uuGU3aUp/UP7ChZc8zgkBZ3Oo6dDp17gbvsrqkiWGluP9SAayYCepaVw7NnRAyAlbrEaUuQD7ROsOx69yFuIuR3KmMjY3qL1bFtO10Cg; 4:xAuCiYf+MtFVzX7olI24Jq05cOq/rRF1crw27hfe1TkBbCcH2DXsCqc05EQ4gJ+Ixrit0yZLCsuxvLkjK8v9cLX7VdDRIV+y+Qp7ENdKZ+/4oP4nrpqC7rQgdTpwv4SeVqkDJKF8sFiQdVbeUrLNWYpdTvXU99fweaMSsYakGvvFNpXtENsQmpgn0H0qL9S/M/iEpiZp8MZrPpH7w/EKBz9fXmbXVaO7m0n1VpnQuBkat6y4xx2oaEZRvGZz573m X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: <DB6PR0502MB3048C20D9644B359C6ECCAE6D2720@DB6PR0502MB3048.eurprd05.prod.outlook.com> X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(3002001)(10201501046)(93006095)(93001095)(6055026)(6041248)(20161123564025)(20161123555025)(20161123558100)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DB6PR0502MB3048; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DB6PR0502MB3048; X-Forefront-PRVS: 044968D9E1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(39860400002)(376002)(346002)(199003)(55674003)(189002)(5003940100001)(4720700003)(316002)(6666003)(50986999)(66066001)(76176999)(3846002)(33646002)(7736002)(48376002)(16586007)(68736007)(16526017)(189998001)(8936002)(50466002)(81166006)(305945005)(86362001)(81156014)(8676002)(478600001)(4326008)(25786009)(2906002)(53936002)(55016002)(47776003)(33026002)(6116002)(69596002)(97736004)(21086003)(36756003)(6916009)(105586002)(5660300001)(106356001)(101416001)(2950100002)(50226002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0502MB3048; H:mellanox.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB6PR0502MB3048; 23:eJ9l1dosaznAHpH6jR0rzESWbWjIjJBMGMnZ3ht?= 8LnYe1rf/17AK5q4x40BxvfXJsqT/iv0yf4fgI3a1k45sIJHGxHo21EYWovvB9vwkMkT4c+KnRchGsSkrbZPRfxaR/b3rPlv0qBSeFKHnueDCewKIt+7IiQGP/0z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gkG5oSxM5DoBXtAO5lpmmwA+xlXKcwohnOXUg8spGjYOjKyAt8WPSS5FUH98pfkYCvxrqJ0YrJ622ZQ5UxSUySVYCrBiAHm9JV0jIs8dlYYMMVbn+75AY9b8eWHP8/HHFDyCVra7/Ahle7xP5B/rgZGxC8LhkEj9cim4mOzJSE92LFrwCGbxdrn8ivxpxOTspwtnz1xqjrx3knTdxWHxs0FWhHEQYBu6/7UR6dLvu+wYh/KgHukimICd8nB8wIIT7b+WGIRV+/PgRNZKUoxWXmgCjbO0u2AO/2p8cQIMloFw9eY8w==; 5:ZhRcEWu8t4vK+HSgxAiszxYU/FyZHnxHPU4gYvrf1F4N0/ztbLe+lc9xiAZRpK8/qAx9DrnhQxfy068PsTOW6gfiJGgvqzWGCs/Cjf60hbawLg/P7uzutXCoTDbjwxy14JnFFVnyMKcZekNnTr8rCw==; 24:G0LV6wL89mGSXORQM7+ZzWUxQBti9S7OB+3vXc/WeId/d2p5cFHl+tfwT4Bo8x0MVgBCYkNKQUHp+zJZ2Uj/F3zMfF5Qg3kwg09aD4evB6k=; 7:l28FIsoxm8elmKUpq3MQDnOzTX+llG/3TXI6EQkTj792fwpPM8j0f/TsACiHCEJxxvIOWPtLYyWKHf0rMTWo4yD+6fYjAfweh8vLPfsnxxJUc43I73+ILdI6jJ+QqE2oAFQ6rIEW7qiTwsqe2Ah+zaf7G4NhSwCVVPfhiS5jwdn934GudLzDOOlCgCoHFwoB24Mh4toxIK44bqqbIHkkeO/2mCX9YjLxqCkrQH4Cipo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2017 14:56:14.0044 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0502MB3048 Subject: [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 <dev.dpdk.org> List-Unsubscribe: <http://dpdk.org/ml/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://dpdk.org/ml/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <http://dpdk.org/ml/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Checks
Context | Check | Description |
---|---|---|
ci/checkpatch | success | coding style OK |
ci/Intel-compilation | success | Compilation OK |
Commit Message
Matan Azrad
Oct. 3, 2017, 2:55 p.m. UTC
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.
Fail-safe is very strict about making sure its current configuration is
properly applied to all slave devices, they get rejected otherwise in
order to maintain a consistent state.
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 proper 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.
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.
Signed-off-by: Matan Azrad <matan@mellanox.com>
---
drivers/net/tap/tap_flow.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
Comments
Hi, What you say stands to reason, I'm basically ok with your patch, except for one remark. The rest of the file has no line breaks anywhere, please remove the two you added. Best regards, Pascal On 03/10/2017 16:55, Matan Azrad wrote: > 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. > > Fail-safe is very strict about making sure its current configuration is > properly applied to all slave devices, they get rejected otherwise in > order to maintain a consistent state. > > 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 proper 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. > > 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. > > Signed-off-by: Matan Azrad <matan@mellanox.com> > --- > drivers/net/tap/tap_flow.c | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) > > diff --git a/drivers/net/tap/tap_flow.c b/drivers/net/tap/tap_flow.c > index 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 = > (const struct rte_flow_action_queue *) > actions->conf; > + > if (action) > goto exit_action_not_supported; > action = 1; > @@ -1097,6 +1098,20 @@ struct tap_flow_items { > goto exit_action_not_supported; > if (flow) > err = add_action_skbedit(flow, queue->index); > + } else if (actions->type == RTE_FLOW_ACTION_TYPE_RSS) { > + /* Fake RSS support. */ > + const struct rte_flow_action_rss *rss = > + (const struct rte_flow_action_rss *) > + actions->conf; > + > + if (action) > + goto exit_action_not_supported; > + action = 1; > + if (!rss || rss->num < 1 || > + (rss->queue[0] > pmd->dev->data->nb_rx_queues - 1)) > + goto exit_action_not_supported; > + if (flow) > + err = add_action_skbedit(flow, rss->queue[0]); > } else { > goto exit_action_not_supported; > }
Hi, I was a little too quick earlier. The line breaks are justified because they follow the list of variable declarations. So I ack the whole patch series. Acked-by: Pascal Mazon <pascal.mazon@6wind.com> On 04/10/2017 10:19, Pascal Mazon wrote: > Hi, > > What you say stands to reason, I'm basically ok with your patch, except > for one remark. > The rest of the file has no line breaks anywhere, please remove the two > you added. > > Best regards, > Pascal > > On 03/10/2017 16:55, Matan Azrad wrote: >> 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. >> >> Fail-safe is very strict about making sure its current configuration is >> properly applied to all slave devices, they get rejected otherwise in >> order to maintain a consistent state. >> >> 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 proper 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. >> >> 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. >> >> Signed-off-by: Matan Azrad <matan@mellanox.com> >> --- >> drivers/net/tap/tap_flow.c | 15 +++++++++++++++ >> 1 file changed, 15 insertions(+) >> >> diff --git a/drivers/net/tap/tap_flow.c b/drivers/net/tap/tap_flow.c >> index 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 = >> (const struct rte_flow_action_queue *) >> actions->conf; >> + >> if (action) >> goto exit_action_not_supported; >> action = 1; >> @@ -1097,6 +1098,20 @@ struct tap_flow_items { >> goto exit_action_not_supported; >> if (flow) >> err = add_action_skbedit(flow, queue->index); >> + } else if (actions->type == RTE_FLOW_ACTION_TYPE_RSS) { >> + /* Fake RSS support. */ >> + const struct rte_flow_action_rss *rss = >> + (const struct rte_flow_action_rss *) >> + actions->conf; >> + >> + if (action) >> + goto exit_action_not_supported; >> + action = 1; >> + if (!rss || rss->num < 1 || >> + (rss->queue[0] > pmd->dev->data->nb_rx_queues - 1)) >> + goto exit_action_not_supported; >> + if (flow) >> + err = add_action_skbedit(flow, rss->queue[0]); >> } else { >> goto exit_action_not_supported; >> }
<...> >> On 03/10/2017 16:55, Matan Azrad wrote: >>> 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. >>> >>> Fail-safe is very strict about making sure its current configuration is >>> properly applied to all slave devices, they get rejected otherwise in >>> order to maintain a consistent state. >>> >>> 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 proper 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. >>> >>> 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. >>> >>> Signed-off-by: Matan Azrad <matan@mellanox.com> > Acked-by: Pascal Mazon <pascal.mazon@6wind.com> Applied to dpdk-next-net/master, thanks.
diff --git a/drivers/net/tap/tap_flow.c b/drivers/net/tap/tap_flow.c index 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 = (const struct rte_flow_action_queue *) actions->conf; + if (action) goto exit_action_not_supported; action = 1; @@ -1097,6 +1098,20 @@ struct tap_flow_items { goto exit_action_not_supported; if (flow) err = add_action_skbedit(flow, queue->index); + } else if (actions->type == RTE_FLOW_ACTION_TYPE_RSS) { + /* Fake RSS support. */ + const struct rte_flow_action_rss *rss = + (const struct rte_flow_action_rss *) + actions->conf; + + if (action) + goto exit_action_not_supported; + action = 1; + if (!rss || rss->num < 1 || + (rss->queue[0] > pmd->dev->data->nb_rx_queues - 1)) + goto exit_action_not_supported; + if (flow) + err = add_action_skbedit(flow, rss->queue[0]); } else { goto exit_action_not_supported; }