* [dpdk-dev] [PATCH 0/2] net/enic: minor flow manager changes
@ 2020-07-03 2:23 Hyong Youb Kim
2020-07-03 2:23 ` [dpdk-dev] [PATCH 1/2] net/enic: support VLAN push and pop flow actions Hyong Youb Kim
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Hyong Youb Kim @ 2020-07-03 2:23 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: dev, Hyong Youb Kim
This series enables VLAN push/pop actions. The first patch adds code
to translate rte_flow push/pop actions to flow manager actions. The
second patch extends the debug-print function to print recently added
flow manager actions, including the ones used by the first patch.
Thanks.
-Hyong
Hyong Youb Kim (2):
net/enic: support VLAN push and pop flow actions
net/enic: add new flow manager actions to the dump function
doc/guides/rel_notes/release_20_08.rst | 3 ++
drivers/net/enic/enic_fm_flow.c | 68 ++++++++++++++++++++++++++
2 files changed, 71 insertions(+)
--
2.26.2
^ permalink raw reply [flat|nested] 4+ messages in thread
* [dpdk-dev] [PATCH 1/2] net/enic: support VLAN push and pop flow actions
2020-07-03 2:23 [dpdk-dev] [PATCH 0/2] net/enic: minor flow manager changes Hyong Youb Kim
@ 2020-07-03 2:23 ` Hyong Youb Kim
2020-07-03 2:23 ` [dpdk-dev] [PATCH 2/2] net/enic: add new flow manager actions to the dump function Hyong Youb Kim
2020-07-09 16:09 ` [dpdk-dev] [PATCH 0/2] net/enic: minor flow manager changes Ferruh Yigit
2 siblings, 0 replies; 4+ messages in thread
From: Hyong Youb Kim @ 2020-07-03 2:23 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: dev, Hyong Youb Kim, John Daley
Flow manager API includes push/pop actions, so support corresponding
DPDK flow actions.
Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
---
doc/guides/rel_notes/release_20_08.rst | 3 ++
drivers/net/enic/enic_fm_flow.c | 61 ++++++++++++++++++++++++++
2 files changed, 64 insertions(+)
diff --git a/doc/guides/rel_notes/release_20_08.rst b/doc/guides/rel_notes/release_20_08.rst
index ccda17fb6a..b394381961 100644
--- a/doc/guides/rel_notes/release_20_08.rst
+++ b/doc/guides/rel_notes/release_20_08.rst
@@ -91,6 +91,9 @@ New Features
which are used to access packet data in a safe manner. Currently JIT support
for these instructions is implemented for x86 only.
+* **Updated Cisco enic driver.**
+
+ * Added support for VLAN push and pop flow actions.
Removed Items
-------------
diff --git a/drivers/net/enic/enic_fm_flow.c b/drivers/net/enic/enic_fm_flow.c
index 6ee0224372..10e5bb3d29 100644
--- a/drivers/net/enic/enic_fm_flow.c
+++ b/drivers/net/enic/enic_fm_flow.c
@@ -193,6 +193,7 @@ static const enum rte_flow_action_type enic_fm_supported_ig_actions[] = {
RTE_FLOW_ACTION_TYPE_FLAG,
RTE_FLOW_ACTION_TYPE_JUMP,
RTE_FLOW_ACTION_TYPE_MARK,
+ RTE_FLOW_ACTION_TYPE_OF_POP_VLAN,
RTE_FLOW_ACTION_TYPE_PORT_ID,
RTE_FLOW_ACTION_TYPE_PASSTHRU,
RTE_FLOW_ACTION_TYPE_QUEUE,
@@ -208,6 +209,9 @@ static const enum rte_flow_action_type enic_fm_supported_eg_actions[] = {
RTE_FLOW_ACTION_TYPE_COUNT,
RTE_FLOW_ACTION_TYPE_DROP,
RTE_FLOW_ACTION_TYPE_JUMP,
+ RTE_FLOW_ACTION_TYPE_OF_PUSH_VLAN,
+ RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_PCP,
+ RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_VID,
RTE_FLOW_ACTION_TYPE_PASSTHRU,
RTE_FLOW_ACTION_TYPE_VOID,
RTE_FLOW_ACTION_TYPE_VXLAN_ENCAP,
@@ -1090,17 +1094,22 @@ enic_fm_copy_action(struct enic_flowman *fm,
PASSTHRU = 1 << 2,
COUNT = 1 << 3,
ENCAP = 1 << 4,
+ PUSH_VLAN = 1 << 5,
};
struct fm_tcam_match_entry *fmt;
struct fm_action_op fm_op;
+ bool need_ovlan_action;
struct enic *enic;
uint32_t overlap;
uint64_t vnic_h;
+ uint16_t ovlan;
bool first_rq;
int ret;
ENICPMD_FUNC_TRACE();
fmt = &fm->tcam_entry;
+ need_ovlan_action = false;
+ ovlan = 0;
first_rq = true;
enic = fm->enic;
overlap = 0;
@@ -1307,6 +1316,50 @@ enic_fm_copy_action(struct enic_flowman *fm,
return ret;
break;
}
+ case RTE_FLOW_ACTION_TYPE_OF_POP_VLAN: {
+ memset(&fm_op, 0, sizeof(fm_op));
+ fm_op.fa_op = FMOP_POP_VLAN;
+ ret = enic_fm_append_action_op(fm, &fm_op, error);
+ if (ret)
+ return ret;
+ break;
+ }
+ case RTE_FLOW_ACTION_TYPE_OF_PUSH_VLAN: {
+ const struct rte_flow_action_of_push_vlan *vlan;
+
+ if (overlap & PASSTHRU)
+ goto unsupported;
+ vlan = actions->conf;
+ if (vlan->ethertype != RTE_BE16(RTE_ETHER_TYPE_VLAN)) {
+ return rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ACTION,
+ NULL, "unexpected push_vlan ethertype");
+ }
+ overlap |= PUSH_VLAN;
+ need_ovlan_action = true;
+ break;
+ }
+ case RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_PCP: {
+ const struct rte_flow_action_of_set_vlan_pcp *pcp;
+
+ pcp = actions->conf;
+ if (pcp->vlan_pcp > 7) {
+ return rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ACTION,
+ NULL, "invalid vlan_pcp");
+ }
+ need_ovlan_action = true;
+ ovlan |= ((uint16_t)pcp->vlan_pcp) << 13;
+ break;
+ }
+ case RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_VID: {
+ const struct rte_flow_action_of_set_vlan_vid *vid;
+
+ vid = actions->conf;
+ need_ovlan_action = true;
+ ovlan |= rte_be_to_cpu_16(vid->vlan_vid);
+ break;
+ }
default:
goto unsupported;
}
@@ -1314,6 +1367,14 @@ enic_fm_copy_action(struct enic_flowman *fm,
if (!(overlap & (FATE | PASSTHRU | COUNT)))
goto unsupported;
+ if (need_ovlan_action) {
+ memset(&fm_op, 0, sizeof(fm_op));
+ fm_op.fa_op = FMOP_SET_OVLAN;
+ fm_op.ovlan.vlan = ovlan;
+ ret = enic_fm_append_action_op(fm, &fm_op, error);
+ if (ret)
+ return ret;
+ }
memset(&fm_op, 0, sizeof(fm_op));
fm_op.fa_op = FMOP_END;
ret = enic_fm_append_action_op(fm, &fm_op, error);
--
2.26.2
^ permalink raw reply [flat|nested] 4+ messages in thread
* [dpdk-dev] [PATCH 2/2] net/enic: add new flow manager actions to the dump function
2020-07-03 2:23 [dpdk-dev] [PATCH 0/2] net/enic: minor flow manager changes Hyong Youb Kim
2020-07-03 2:23 ` [dpdk-dev] [PATCH 1/2] net/enic: support VLAN push and pop flow actions Hyong Youb Kim
@ 2020-07-03 2:23 ` Hyong Youb Kim
2020-07-09 16:09 ` [dpdk-dev] [PATCH 0/2] net/enic: minor flow manager changes Ferruh Yigit
2 siblings, 0 replies; 4+ messages in thread
From: Hyong Youb Kim @ 2020-07-03 2:23 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: dev, Hyong Youb Kim, John Daley
The following commit introduced several new actions. Make the dump
function to print those actions.
commit 6faf81f1d2c3 ("net/enic: update flow manager API")
Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
---
drivers/net/enic/enic_fm_flow.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/net/enic/enic_fm_flow.c b/drivers/net/enic/enic_fm_flow.c
index 10e5bb3d29..cb08a9317f 100644
--- a/drivers/net/enic/enic_fm_flow.c
+++ b/drivers/net/enic/enic_fm_flow.c
@@ -1421,6 +1421,13 @@ enic_fm_dump_tcam_actions(const struct fm_action *fm_action)
[FMOP_ENCAP] = "encap",
[FMOP_SET_OVLAN] = "set_ovlan",
[FMOP_DECAP_NOSTRIP] = "decap_nostrip",
+ [FMOP_DECAP_STRIP] = "decap_strip",
+ [FMOP_POP_VLAN] = "pop_vlan",
+ [FMOP_SET_EGPORT] = "set_egport",
+ [FMOP_RQ_STEER_ONLY] = "rq_steer_only",
+ [FMOP_SET_ENCAP_VLAN] = "set_encap_vlan",
+ [FMOP_EMIT] = "emit",
+ [FMOP_MODIFY] = "modify",
};
const struct fm_action_op *op = &fm_action->fma_action_ops[0];
char buf[128], *bp = buf;
--
2.26.2
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH 0/2] net/enic: minor flow manager changes
2020-07-03 2:23 [dpdk-dev] [PATCH 0/2] net/enic: minor flow manager changes Hyong Youb Kim
2020-07-03 2:23 ` [dpdk-dev] [PATCH 1/2] net/enic: support VLAN push and pop flow actions Hyong Youb Kim
2020-07-03 2:23 ` [dpdk-dev] [PATCH 2/2] net/enic: add new flow manager actions to the dump function Hyong Youb Kim
@ 2020-07-09 16:09 ` Ferruh Yigit
2 siblings, 0 replies; 4+ messages in thread
From: Ferruh Yigit @ 2020-07-09 16:09 UTC (permalink / raw)
To: Hyong Youb Kim; +Cc: dev
On 7/3/2020 3:23 AM, Hyong Youb Kim wrote:
> This series enables VLAN push/pop actions. The first patch adds code
> to translate rte_flow push/pop actions to flow manager actions. The
> second patch extends the debug-print function to print recently added
> flow manager actions, including the ones used by the first patch.
>
> Thanks.
> -Hyong
>
> Hyong Youb Kim (2):
> net/enic: support VLAN push and pop flow actions
> net/enic: add new flow manager actions to the dump function
>
Series applied to dpdk-next-net/master, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-07-09 16:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-03 2:23 [dpdk-dev] [PATCH 0/2] net/enic: minor flow manager changes Hyong Youb Kim
2020-07-03 2:23 ` [dpdk-dev] [PATCH 1/2] net/enic: support VLAN push and pop flow actions Hyong Youb Kim
2020-07-03 2:23 ` [dpdk-dev] [PATCH 2/2] net/enic: add new flow manager actions to the dump function Hyong Youb Kim
2020-07-09 16:09 ` [dpdk-dev] [PATCH 0/2] net/enic: minor flow manager changes 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).