summaryrefslogtreecommitdiffstats
path: root/src/plugins/avf/device.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/avf/device.c')
-rw-r--r--src/plugins/avf/device.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/plugins/avf/device.c b/src/plugins/avf/device.c
index aec7efaee6f..e4305251b23 100644
--- a/src/plugins/avf/device.c
+++ b/src/plugins/avf/device.c
@@ -1176,6 +1176,20 @@ error:
vlib_log_err (avf_log.class, "%U", format_clib_error, ad->error);
}
+clib_error_t *
+avf_op_program_flow (vlib_main_t *vm, avf_device_t *ad, int is_create,
+ u8 *rule, u32 rule_len, u8 *program_status,
+ u32 status_len)
+{
+ avf_log_debug (ad, "avf_op_program_flow: vsi_id %u is_create %u", ad->vsi_id,
+ is_create);
+
+ return avf_send_to_pf (vm, ad,
+ is_create ? VIRTCHNL_OP_ADD_FDIR_FILTER :
+ VIRTCHNL_OP_DEL_FDIR_FILTER,
+ rule, rule_len, program_status, status_len);
+}
+
static void
avf_process_handle_request (vlib_main_t * vm, avf_process_req_t * req)
{
@@ -1186,6 +1200,10 @@ avf_process_handle_request (vlib_main_t * vm, avf_process_req_t * req)
req->is_add);
else if (req->type == AVF_PROCESS_REQ_CONFIG_PROMISC_MDDE)
req->error = avf_op_config_promisc_mode (vm, ad, req->is_enable);
+ else if (req->type == AVF_PROCESS_REQ_PROGRAM_FLOW)
+ req->error =
+ avf_op_program_flow (vm, ad, req->is_add, req->rule, req->rule_len,
+ req->program_status, req->status_len);
else
clib_panic ("BUG: unknown avf proceess request type");
@@ -1793,6 +1811,24 @@ avf_clear_hw_interface_counters (u32 instance)
&ad->eth_stats, sizeof (ad->eth_stats));
}
+clib_error_t *
+avf_program_flow (u32 dev_instance, int is_add, u8 *rule, u32 rule_len,
+ u8 *program_status, u32 status_len)
+{
+ vlib_main_t *vm = vlib_get_main ();
+ avf_process_req_t req;
+
+ req.dev_instance = dev_instance;
+ req.type = AVF_PROCESS_REQ_PROGRAM_FLOW;
+ req.is_add = is_add;
+ req.rule = rule;
+ req.rule_len = rule_len;
+ req.program_status = program_status;
+ req.status_len = status_len;
+
+ return avf_process_request (vm, &req);
+}
+
/* *INDENT-OFF* */
VNET_DEVICE_CLASS (avf_device_class,) =
{