* [dpdk-dev] [PATCH] net/i40e: implement flag action for FDIR
@ 2017-05-27 2:46 Beilei Xing
2017-05-31 23:47 ` [dpdk-dev] [PATCH v2] net/i40e: update actions " Beilei Xing
0 siblings, 1 reply; 4+ messages in thread
From: Beilei Xing @ 2017-05-27 2:46 UTC (permalink / raw)
To: jingjing.wu; +Cc: dev
This commit adds flag action support for flow director.
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
---
drivers/net/i40e/i40e_flow.c | 26 +++++++++++++++-----------
1 file changed, 15 insertions(+), 11 deletions(-)
diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index 218ece1..2af88c6 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -2813,7 +2813,6 @@ i40e_flow_parse_fdir_action(struct rte_eth_dev *dev,
else
filter->action.behavior = RTE_ETH_FDIR_REJECT;
- filter->action.report_status = RTE_ETH_FDIR_REPORT_ID;
filter->action.rx_queue = act_q->index;
if (filter->action.rx_queue >= pf->dev_data->nb_rx_queues) {
@@ -2823,10 +2822,11 @@ i40e_flow_parse_fdir_action(struct rte_eth_dev *dev,
return -rte_errno;
}
- /* Check if the next non-void item is MARK or END. */
+ /* Check if the next non-void item is MARK or FLAG or END. */
index++;
NEXT_ITEM_OF_ACTION(act, actions, index);
if (act->type != RTE_FLOW_ACTION_TYPE_MARK &&
+ act->type != RTE_FLOW_ACTION_TYPE_FLAG &&
act->type != RTE_FLOW_ACTION_TYPE_END) {
rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION,
act, "Invalid action.");
@@ -2835,17 +2835,21 @@ i40e_flow_parse_fdir_action(struct rte_eth_dev *dev,
if (act->type == RTE_FLOW_ACTION_TYPE_MARK) {
mark_spec = (const struct rte_flow_action_mark *)act->conf;
+ filter->action.report_status = RTE_ETH_FDIR_REPORT_ID;
filter->soft_id = mark_spec->id;
+ } else if (act->type == RTE_FLOW_ACTION_TYPE_FLAG)
+ filter->action.report_status = RTE_ETH_FDIR_NO_REPORT_STATUS;
+ else if (act->type == RTE_FLOW_ACTION_TYPE_END)
+ return 0;
- /* Check if the next non-void item is END */
- index++;
- NEXT_ITEM_OF_ACTION(act, actions, index);
- if (act->type != RTE_FLOW_ACTION_TYPE_END) {
- rte_flow_error_set(error, EINVAL,
- RTE_FLOW_ERROR_TYPE_ACTION,
- act, "Invalid action.");
- return -rte_errno;
- }
+ /* Check if the next non-void item is END */
+ index++;
+ NEXT_ITEM_OF_ACTION(act, actions, index);
+ if (act->type != RTE_FLOW_ACTION_TYPE_END) {
+ rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ACTION,
+ act, "Invalid action.");
+ return -rte_errno;
}
return 0;
--
2.5.5
^ permalink raw reply [flat|nested] 4+ messages in thread
* [dpdk-dev] [PATCH v2] net/i40e: update actions for FDIR
2017-05-27 2:46 [dpdk-dev] [PATCH] net/i40e: implement flag action for FDIR Beilei Xing
@ 2017-05-31 23:47 ` Beilei Xing
2017-06-02 2:22 ` Wu, Jingjing
0 siblings, 1 reply; 4+ messages in thread
From: Beilei Xing @ 2017-05-31 23:47 UTC (permalink / raw)
To: jingjing.wu; +Cc: dev
This commit adds support of FLAG action and PASSTHRU
action for flow director.
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
---
v2 changes:
-Add support of PASSTHRU action.
-Refine code.
drivers/net/i40e/i40e_flow.c | 74 ++++++++++++++++++++++++--------------------
1 file changed, 40 insertions(+), 34 deletions(-)
diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index 218ece1..9fcf8bd 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -2797,55 +2797,61 @@ i40e_flow_parse_fdir_action(struct rte_eth_dev *dev,
const struct rte_flow_action_mark *mark_spec;
uint32_t index = 0;
- /* Check if the first non-void action is QUEUE or DROP. */
+ /* Check if the first non-void action is QUEUE or DROP or PASSTHRU. */
NEXT_ITEM_OF_ACTION(act, actions, index);
- if (act->type != RTE_FLOW_ACTION_TYPE_QUEUE &&
- act->type != RTE_FLOW_ACTION_TYPE_DROP) {
- rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION,
- act, "Invalid action.");
- return -rte_errno;
- }
-
- act_q = (const struct rte_flow_action_queue *)act->conf;
- filter->action.flex_off = 0;
- if (act->type == RTE_FLOW_ACTION_TYPE_QUEUE)
+ switch (act->type) {
+ case RTE_FLOW_ACTION_TYPE_QUEUE:
+ act_q = (const struct rte_flow_action_queue *)act->conf;
+ filter->action.rx_queue = act_q->index;
+ if (filter->action.rx_queue >= pf->dev_data->nb_rx_queues) {
+ rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ACTION, act,
+ "Invalid queue ID for FDIR.");
+ return -rte_errno;
+ }
filter->action.behavior = RTE_ETH_FDIR_ACCEPT;
- else
+ break;
+ case RTE_FLOW_ACTION_TYPE_DROP:
filter->action.behavior = RTE_ETH_FDIR_REJECT;
-
- filter->action.report_status = RTE_ETH_FDIR_REPORT_ID;
- filter->action.rx_queue = act_q->index;
-
- if (filter->action.rx_queue >= pf->dev_data->nb_rx_queues) {
+ break;
+ case RTE_FLOW_ACTION_TYPE_PASSTHRU:
+ filter->action.behavior = RTE_ETH_FDIR_PASSTHRU;
+ break;
+ default:
rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ACTION, act,
- "Invalid queue ID for FDIR.");
+ "Invalid action.");
return -rte_errno;
}
- /* Check if the next non-void item is MARK or END. */
+ /* Check if the next non-void item is MARK or FLAG or END. */
index++;
NEXT_ITEM_OF_ACTION(act, actions, index);
- if (act->type != RTE_FLOW_ACTION_TYPE_MARK &&
- act->type != RTE_FLOW_ACTION_TYPE_END) {
+ switch (act->type) {
+ case RTE_FLOW_ACTION_TYPE_MARK:
+ mark_spec = (const struct rte_flow_action_mark *)act->conf;
+ filter->action.report_status = RTE_ETH_FDIR_REPORT_ID;
+ filter->soft_id = mark_spec->id;
+ break;
+ case RTE_FLOW_ACTION_TYPE_FLAG:
+ filter->action.report_status = RTE_ETH_FDIR_NO_REPORT_STATUS;
+ break;
+ case RTE_FLOW_ACTION_TYPE_END:
+ return 0;
+ default:
rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION,
act, "Invalid action.");
return -rte_errno;
}
- if (act->type == RTE_FLOW_ACTION_TYPE_MARK) {
- mark_spec = (const struct rte_flow_action_mark *)act->conf;
- filter->soft_id = mark_spec->id;
-
- /* Check if the next non-void item is END */
- index++;
- NEXT_ITEM_OF_ACTION(act, actions, index);
- if (act->type != RTE_FLOW_ACTION_TYPE_END) {
- rte_flow_error_set(error, EINVAL,
- RTE_FLOW_ERROR_TYPE_ACTION,
- act, "Invalid action.");
- return -rte_errno;
- }
+ /* Check if the next non-void item is END */
+ index++;
+ NEXT_ITEM_OF_ACTION(act, actions, index);
+ if (act->type != RTE_FLOW_ACTION_TYPE_END) {
+ rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ACTION,
+ act, "Invalid action.");
+ return -rte_errno;
}
return 0;
--
2.5.5
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH v2] net/i40e: update actions for FDIR
2017-05-31 23:47 ` [dpdk-dev] [PATCH v2] net/i40e: update actions " Beilei Xing
@ 2017-06-02 2:22 ` Wu, Jingjing
2017-06-06 10:16 ` Ferruh Yigit
0 siblings, 1 reply; 4+ messages in thread
From: Wu, Jingjing @ 2017-06-02 2:22 UTC (permalink / raw)
To: Xing, Beilei; +Cc: dev
> -----Original Message-----
> From: Xing, Beilei
> Sent: Thursday, June 1, 2017 7:48 AM
> To: Wu, Jingjing <jingjing.wu@intel.com>
> Cc: dev@dpdk.org
> Subject: [PATCH v2] net/i40e: update actions for FDIR
>
> This commit adds support of FLAG action and PASSTHRU action for flow
> director.
>
> Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH v2] net/i40e: update actions for FDIR
2017-06-02 2:22 ` Wu, Jingjing
@ 2017-06-06 10:16 ` Ferruh Yigit
0 siblings, 0 replies; 4+ messages in thread
From: Ferruh Yigit @ 2017-06-06 10:16 UTC (permalink / raw)
To: Wu, Jingjing, Xing, Beilei; +Cc: dev
On 6/2/2017 3:22 AM, Wu, Jingjing wrote:
>
>
>> -----Original Message-----
>> From: Xing, Beilei
>> Sent: Thursday, June 1, 2017 7:48 AM
>> To: Wu, Jingjing <jingjing.wu@intel.com>
>> Cc: dev@dpdk.org
>> Subject: [PATCH v2] net/i40e: update actions for FDIR
>>
>> This commit adds support of FLAG action and PASSTHRU action for flow
>> director.
>>
>> Signed-off-by: Beilei Xing <beilei.xing@intel.com>
>
> Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Applied to dpdk-next-net/master, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-06-06 10:16 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-27 2:46 [dpdk-dev] [PATCH] net/i40e: implement flag action for FDIR Beilei Xing
2017-05-31 23:47 ` [dpdk-dev] [PATCH v2] net/i40e: update actions " Beilei Xing
2017-06-02 2:22 ` Wu, Jingjing
2017-06-06 10:16 ` Ferruh Yigit
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).