Commit 346bf250 authored by Qi Zhang's avatar Qi Zhang Committed by Tony Nguyen

ice: Add new actions support for VF FDIR

Add two new actions support for VF FDIR:

A passthrough action does not specify the destination queue, but
just allow the packet go to next pipeline stage, a typical use
cases is combined with a software mark (FDID) action.

Allow specify a 2^n continuous queues as the destination of a FDIR rule.
Packet distribution is based on current RSS configure.
Signed-off-by: default avatarYahui Cao <yahui.cao@intel.com>
Signed-off-by: default avatarQi Zhang <qi.z.zhang@intel.com>
Tested-by: default avatarChen Bo <BoX.C.Chen@intel.com>
Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
parent 0ce332fd
...@@ -374,7 +374,14 @@ ice_fdir_get_prgm_desc(struct ice_hw *hw, struct ice_fdir_fltr *input, ...@@ -374,7 +374,14 @@ ice_fdir_get_prgm_desc(struct ice_hw *hw, struct ice_fdir_fltr *input,
if (input->dest_ctl == ICE_FLTR_PRGM_DESC_DEST_DROP_PKT) { if (input->dest_ctl == ICE_FLTR_PRGM_DESC_DEST_DROP_PKT) {
fdir_fltr_ctx.drop = ICE_FXD_FLTR_QW0_DROP_YES; fdir_fltr_ctx.drop = ICE_FXD_FLTR_QW0_DROP_YES;
fdir_fltr_ctx.qindex = 0; fdir_fltr_ctx.qindex = 0;
} else if (input->dest_ctl ==
ICE_FLTR_PRGM_DESC_DEST_DIRECT_PKT_OTHER) {
fdir_fltr_ctx.drop = ICE_FXD_FLTR_QW0_DROP_NO;
fdir_fltr_ctx.qindex = 0;
} else { } else {
if (input->dest_ctl ==
ICE_FLTR_PRGM_DESC_DEST_DIRECT_PKT_QGROUP)
fdir_fltr_ctx.toq = input->q_region;
fdir_fltr_ctx.drop = ICE_FXD_FLTR_QW0_DROP_NO; fdir_fltr_ctx.drop = ICE_FXD_FLTR_QW0_DROP_NO;
fdir_fltr_ctx.qindex = input->q_index; fdir_fltr_ctx.qindex = input->q_index;
} }
...@@ -382,6 +389,9 @@ ice_fdir_get_prgm_desc(struct ice_hw *hw, struct ice_fdir_fltr *input, ...@@ -382,6 +389,9 @@ ice_fdir_get_prgm_desc(struct ice_hw *hw, struct ice_fdir_fltr *input,
fdir_fltr_ctx.cnt_index = input->cnt_index; fdir_fltr_ctx.cnt_index = input->cnt_index;
fdir_fltr_ctx.fd_vsi = ice_get_hw_vsi_num(hw, input->dest_vsi); fdir_fltr_ctx.fd_vsi = ice_get_hw_vsi_num(hw, input->dest_vsi);
fdir_fltr_ctx.evict_ena = ICE_FXD_FLTR_QW0_EVICT_ENA_FALSE; fdir_fltr_ctx.evict_ena = ICE_FXD_FLTR_QW0_EVICT_ENA_FALSE;
if (input->dest_ctl == ICE_FLTR_PRGM_DESC_DEST_DIRECT_PKT_OTHER)
fdir_fltr_ctx.toq_prio = 0;
else
fdir_fltr_ctx.toq_prio = 3; fdir_fltr_ctx.toq_prio = 3;
fdir_fltr_ctx.pcmd = add ? ICE_FXD_FLTR_QW1_PCMD_ADD : fdir_fltr_ctx.pcmd = add ? ICE_FXD_FLTR_QW1_PCMD_ADD :
ICE_FXD_FLTR_QW1_PCMD_REMOVE; ICE_FXD_FLTR_QW1_PCMD_REMOVE;
......
...@@ -42,6 +42,8 @@ ...@@ -42,6 +42,8 @@
enum ice_fltr_prgm_desc_dest { enum ice_fltr_prgm_desc_dest {
ICE_FLTR_PRGM_DESC_DEST_DROP_PKT, ICE_FLTR_PRGM_DESC_DEST_DROP_PKT,
ICE_FLTR_PRGM_DESC_DEST_DIRECT_PKT_QINDEX, ICE_FLTR_PRGM_DESC_DEST_DIRECT_PKT_QINDEX,
ICE_FLTR_PRGM_DESC_DEST_DIRECT_PKT_QGROUP,
ICE_FLTR_PRGM_DESC_DEST_DIRECT_PKT_OTHER,
}; };
enum ice_fltr_prgm_desc_fd_status { enum ice_fltr_prgm_desc_fd_status {
...@@ -133,6 +135,8 @@ struct ice_fdir_fltr { ...@@ -133,6 +135,8 @@ struct ice_fdir_fltr {
/* flex byte filter data */ /* flex byte filter data */
__be16 flex_word; __be16 flex_word;
/* queue region size (=2^q_region) */
u8 q_region;
u16 flex_offset; u16 flex_offset;
u16 flex_fltr; u16 flex_fltr;
......
...@@ -897,6 +897,10 @@ ice_vc_fdir_parse_action(struct ice_vf *vf, struct virtchnl_fdir_add *fltr, ...@@ -897,6 +897,10 @@ ice_vc_fdir_parse_action(struct ice_vf *vf, struct virtchnl_fdir_add *fltr,
struct virtchnl_filter_action *action = &as->actions[i]; struct virtchnl_filter_action *action = &as->actions[i];
switch (action->type) { switch (action->type) {
case VIRTCHNL_ACTION_PASSTHRU:
dest_num++;
input->dest_ctl = ICE_FLTR_PRGM_DESC_DEST_DIRECT_PKT_OTHER;
break;
case VIRTCHNL_ACTION_DROP: case VIRTCHNL_ACTION_DROP:
dest_num++; dest_num++;
input->dest_ctl = ICE_FLTR_PRGM_DESC_DEST_DROP_PKT; input->dest_ctl = ICE_FLTR_PRGM_DESC_DEST_DROP_PKT;
...@@ -906,6 +910,12 @@ ice_vc_fdir_parse_action(struct ice_vf *vf, struct virtchnl_fdir_add *fltr, ...@@ -906,6 +910,12 @@ ice_vc_fdir_parse_action(struct ice_vf *vf, struct virtchnl_fdir_add *fltr,
input->dest_ctl = ICE_FLTR_PRGM_DESC_DEST_DIRECT_PKT_QINDEX; input->dest_ctl = ICE_FLTR_PRGM_DESC_DEST_DIRECT_PKT_QINDEX;
input->q_index = action->act_conf.queue.index; input->q_index = action->act_conf.queue.index;
break; break;
case VIRTCHNL_ACTION_Q_REGION:
dest_num++;
input->dest_ctl = ICE_FLTR_PRGM_DESC_DEST_DIRECT_PKT_QGROUP;
input->q_index = action->act_conf.queue.index;
input->q_region = action->act_conf.queue.region;
break;
case VIRTCHNL_ACTION_MARK: case VIRTCHNL_ACTION_MARK:
mark_num++; mark_num++;
input->fltr_id = action->act_conf.mark_id; input->fltr_id = action->act_conf.mark_id;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment