summaryrefslogtreecommitdiffstats
path: root/src/plugins/avf
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/avf')
-rw-r--r--src/plugins/avf/device.c34
-rw-r--r--src/plugins/avf/virtchnl.h19
2 files changed, 40 insertions, 13 deletions
diff --git a/src/plugins/avf/device.c b/src/plugins/avf/device.c
index 3427a69451c..c73cf1e1e68 100644
--- a/src/plugins/avf/device.c
+++ b/src/plugins/avf/device.c
@@ -478,18 +478,28 @@ clib_error_t *
avf_op_get_vf_resources (vlib_main_t * vm, avf_device_t * ad,
virtchnl_vf_resource_t * res)
{
- clib_error_t *err = 0;
- u32 bitmap = (VIRTCHNL_VF_OFFLOAD_L2 | VIRTCHNL_VF_OFFLOAD_RSS_AQ |
- VIRTCHNL_VF_OFFLOAD_RSS_REG | VIRTCHNL_VF_OFFLOAD_WB_ON_ITR |
- VIRTCHNL_VF_OFFLOAD_VLAN | VIRTCHNL_VF_OFFLOAD_RX_POLLING);
+ u32 bitmap = (VIRTCHNL_VF_OFFLOAD_L2 | VIRTCHNL_VF_OFFLOAD_RSS_PF |
+ VIRTCHNL_VF_OFFLOAD_WB_ON_ITR | VIRTCHNL_VF_OFFLOAD_VLAN |
+ VIRTCHNL_VF_OFFLOAD_RX_POLLING);
- err = avf_send_to_pf (vm, ad, VIRTCHNL_OP_GET_VF_RESOURCES, &bitmap,
- sizeof (u32), res, sizeof (virtchnl_vf_resource_t));
+ return avf_send_to_pf (vm, ad, VIRTCHNL_OP_GET_VF_RESOURCES, &bitmap,
+ sizeof (u32), res, sizeof (virtchnl_vf_resource_t));
+}
- if (err)
- return err;
+clib_error_t *
+avf_op_config_rss_lut (vlib_main_t * vm, avf_device_t * ad)
+{
+ int msg_len = sizeof (virtchnl_rss_lut_t) + ad->rss_lut_size - 1;
+ u8 msg[msg_len];
+ virtchnl_rss_lut_t *rl;
- return err;
+ memset (msg, 0, msg_len);
+ rl = (virtchnl_rss_lut_t *) msg;
+ rl->vsi_id = ad->vsi_id;
+ rl->lut_entries = ad->rss_lut_size;
+
+ return avf_send_to_pf (vm, ad, VIRTCHNL_OP_CONFIG_RSS_LUT, msg, msg_len, 0,
+ 0);
}
clib_error_t *
@@ -702,10 +712,8 @@ avf_device_init (vlib_main_t * vm, avf_device_t * ad)
if ((error = avf_config_promisc_mode (vm, ad)))
return error;
- if ((error = avf_cmd_rx_ctl_reg_write (vm, ad, 0xc400, 0)))
- return error;
-
- if ((error = avf_cmd_rx_ctl_reg_write (vm, ad, 0xc404, 0)))
+ if ((ad->feature_bitmap & VIRTCHNL_VF_OFFLOAD_RSS_PF) &&
+ (error = avf_op_config_rss_lut (vm, ad)))
return error;
/*
diff --git a/src/plugins/avf/virtchnl.h b/src/plugins/avf/virtchnl.h
index 671da959c2b..3b85b0ebd62 100644
--- a/src/plugins/avf/virtchnl.h
+++ b/src/plugins/avf/virtchnl.h
@@ -333,6 +333,25 @@ typedef struct
foreach_virtchnl_eth_stats
#undef _
} virtchnl_eth_stats_t;
+
+typedef struct
+{
+ u16 vsi_id;
+ u16 key_len;
+ u8 key[1];
+} virtchnl_rss_key_t;
+
+STATIC_ASSERT_SIZEOF (virtchnl_rss_key_t, 6);
+
+typedef struct
+{
+ u16 vsi_id;
+ u16 lut_entries;
+ u8 lut[1];
+} virtchnl_rss_lut_t;
+
+STATIC_ASSERT_SIZEOF (virtchnl_rss_lut_t, 6);
+
/*
* fd.io coding-style-patch-verification: ON
*