aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/dev_iavf/iavf.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2023-11-06 00:05:57 +0000
committerDave Wallace <dwallacelf@gmail.com>2023-11-09 19:56:35 +0000
commit67f03ba71dd050c41c3b98896e9a2446c2e8c48c (patch)
tree2588019b5e3214481e9619a594f76a12f5f96ad0 /src/plugins/dev_iavf/iavf.c
parent14bfd3d8b81f91caacd572ad426638e5375d2eb3 (diff)
iavf: interrupt mode support
Type: improvement Change-Id: Ie5fcaa706ab0995e0021cf1ee74b95c5a3b30283 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/plugins/dev_iavf/iavf.c')
-rw-r--r--src/plugins/dev_iavf/iavf.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/plugins/dev_iavf/iavf.c b/src/plugins/dev_iavf/iavf.c
index a8b108c92b7..f45bea0e669 100644
--- a/src/plugins/dev_iavf/iavf.c
+++ b/src/plugins/dev_iavf/iavf.c
@@ -98,7 +98,7 @@ iavf_reset (vlib_main_t *vm, vnet_dev_t *dev)
return VNET_DEV_ERR_TIMEOUT;
vlib_process_suspend (vm, 0.02);
}
- while ((iavf_reg_read (ad, VFGEN_RSTAT) & 3) != 2);
+ while ((iavf_reg_read (ad, IAVF_VFGEN_RSTAT) & 3) != 2);
iavf_aq_init (vm, dev);
iavf_aq_poll_on (vm, dev);
@@ -118,6 +118,7 @@ iavf_init (vlib_main_t *vm, vnet_dev_t *dev)
iavf_device_t *ad = vnet_dev_get_data (dev);
virtchnl_version_info_t ver;
virtchnl_vf_resource_t res;
+ u32 n_threads = vlib_get_n_threads ();
vnet_dev_rv_t rv;
log_debug (dev, "init");
@@ -209,13 +210,20 @@ iavf_init (vlib_main_t *vm, vnet_dev_t *dev)
log_info (dev, "MAC address is %U", format_ethernet_address,
res.vsi_res[0].default_mac_addr);
- if (vlib_get_n_threads () <= vnet_dev_get_pci_n_msix_interrupts (dev) - 1)
- port_add_args.port.attr.caps.interrupt_mode = 1;
+ if (n_threads <= vnet_dev_get_pci_n_msix_interrupts (dev) - 1)
+ {
+ port_add_args.port.attr.caps.interrupt_mode = 1;
+ iavf_port.n_rx_vectors = n_threads;
+ }
else
- log_notice (dev,
- "number of threads (%u) bigger than number of interrupt lines "
- "(%u), interrupt mode disabled",
- vlib_get_n_threads (), res.max_vectors);
+ {
+ log_notice (
+ dev,
+ "number of threads (%u) bigger than number of interrupt lines "
+ "(%u), interrupt mode disabled",
+ vlib_get_n_threads (), res.max_vectors);
+ iavf_port.n_rx_vectors = 1;
+ }
if (res.vf_cap_flags & VIRTCHNL_VF_OFFLOAD_RSS_PF)
{