Skip to content

Commit

Permalink
net/cpfl: support represented port action
Browse files Browse the repository at this point in the history
Support RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT action for forwarding
packet to APF/CPF/VF representors.

Signed-off-by: Yuying Zhang <[email protected]>
Acked-by: Qi Zhang <[email protected]>
  • Loading branch information
Yuying2intel authored and qzhan16 committed Oct 12, 2023
1 parent 4955a89 commit 441e777
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions drivers/net/cpfl/cpfl_flow_engine_fxp.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ cpfl_fxp_parse_action(struct cpfl_itf *itf,
int queue_id = -1;
bool fwd_vsi = false;
bool fwd_q = false;
bool is_vsi;
uint32_t i;
struct cpfl_rule_info *rinfo = &rim->rules[index];
union cpfl_action_set *act_set = (void *)rinfo->act_bytes;
Expand All @@ -276,6 +277,7 @@ cpfl_fxp_parse_action(struct cpfl_itf *itf,
action_type = action->type;
switch (action_type) {
case RTE_FLOW_ACTION_TYPE_PORT_REPRESENTOR:
case RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT:
if (!fwd_vsi)
fwd_vsi = true;
else
Expand All @@ -294,12 +296,20 @@ cpfl_fxp_parse_action(struct cpfl_itf *itf,
queue_id = CPFL_INVALID_QUEUE_ID;
}

dev_id = cpfl_get_vsi_id(dst_itf);
is_vsi = (action_type == RTE_FLOW_ACTION_TYPE_PORT_REPRESENTOR ||
dst_itf->type == CPFL_ITF_TYPE_REPRESENTOR);
if (is_vsi)
dev_id = cpfl_get_vsi_id(dst_itf);
else
dev_id = cpfl_get_port_id(dst_itf);

if (dev_id == CPFL_INVALID_HW_ID)
goto err;

*act_set = cpfl_act_fwd_vsi(0, priority, 0, dev_id);
if (is_vsi)
*act_set = cpfl_act_fwd_vsi(0, priority, 0, dev_id);
else
*act_set = cpfl_act_fwd_port(0, priority, 0, dev_id);
act_set++;
rinfo->act_byte_len += sizeof(union cpfl_action_set);
break;
Expand Down

0 comments on commit 441e777

Please sign in to comment.