diff options
author | Steven <sluong@cisco.com> | 2018-07-19 16:25:47 -0700 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2018-07-20 09:30:50 +0000 |
commit | c34b2e0f7cf891d8a5ecb91a6a2fb067cf33b3af (patch) | |
tree | 058d658fb5fed0ccb3b883d129c7110c4b64aac8 /src/plugins | |
parent | ed2fe93fd1ee7bfdad54f323946d76da91aa3398 (diff) |
avf: Support interrupt mode
DBGvpp# set interface rx-mode AVF0/4/2/0 interrupt
set interface rx-mode AVF0/4/2/0 interrupt
DBGvpp# sh int rx
sh int rx
Thread 0 (vpp_main):
node dpdk-input:
FortyGigabitEthernet6/0/0 queue 0 (polling)
node avf-input:
AVF0/4/2/0 queue 0 (interrupt)
DBGvpp# sh int addr
sh int addr
AVF0/4/2/0 (up):
L3 133.1.1.10/24
FortyGigabitEthernet6/0/0 (dn):
VirtualEthernet0/0/0 (up):
L3 192.168.42.1/24
DBGvpp# clear run
clear run
DBGvpp# clear interfaces
clear interfaces
DBGvpp# sh int rx
sh int rx
Thread 0 (vpp_main):
node dpdk-input:
FortyGigabitEthernet6/0/0 queue 0 (polling)
node avf-input:
AVF0/4/2/0 queue 0 (interrupt)
DBGvpp# ping 133.1.1.3 repeat 1
ping 133.1.1.3 repeat 1
64 bytes from 133.1.1.3: icmp_seq=1 ttl=64 time=.6237 ms
Statistics: 1 sent, 1 received, 0% packet loss
DBGvpp# sh int
sh int
Name Idx State MTU (L3/IP4/IP6/MPLS) Counter Count
AVF0/4/2/0 5 up 9000/0/0/0 rx packets 1
rx bytes 98
tx packets 1
tx bytes 98
drops 1
ip4 1
FortyGigabitEthernet6/0/0 1 down 9000/0/0/0
VirtualEthernet0/0/0 2 up 9000/0/0/0
local0 0 down 9000/0/0/0
DBGvpp# sh run
sh run
Time 41.9, average vectors/node 1.00, last 128 main loops 0.00 per node 0.00
vector rates in 2.3858e-2, out 2.3858e-2, drop 2.3858e-2, punt 0.0000e0
Name State Calls Vectors Suspends Clocks Vectors/Call
AVF0/4/2/0-output active 1 1 0 1.24e4 1.00
AVF0/4/2/0-tx active 1 1 0 4.28e4 1.00
api-rx-from-ring any wait 0 0 2 6.94e4 0.00
avf-input interrupt wa 1 1 0 1.09e4 1.00
avf-process any wait 0 0 47 1.01e4 0.00
...
DBGvpp#
DBGvpp# set interface rx-mode AVF0/4/2/0 polling
set interface rx-mode AVF0/4/2/0 polling
DBGvpp# sh int rx
sh int rx
Thread 0 (vpp_main):
node dpdk-input:
FortyGigabitEthernet6/0/0 queue 0 (polling)
node avf-input:
AVF0/4/2/0 queue 0 (polling)
DBGvpp# ping 133.1.1.3 repeat 1
ping 133.1.1.3 repeat 1
64 bytes from 133.1.1.3: icmp_seq=1 ttl=64 time=.2038 ms
Statistics: 1 sent, 1 received, 0% packet loss
DBGvpp#
Change-Id: Ib7d2b505ae4bb74a052263af766ca37d9df7bfe4
Signed-off-by: Steven <sluong@cisco.com>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/avf/README.md | 2 | ||||
-rw-r--r-- | src/plugins/avf/device.c | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/plugins/avf/README.md b/src/plugins/avf/README.md index 6a464a46b87..2ebc1372570 100644 --- a/src/plugins/avf/README.md +++ b/src/plugins/avf/README.md @@ -22,7 +22,7 @@ This driver is still in experimental phase, however it shows very good performance numbers. Following items are not implemented (yet). * Jumbo MTU support -* Interrupt and adaptive mode +* Adaptive mode * NUMA support ## Usage diff --git a/src/plugins/avf/device.c b/src/plugins/avf/device.c index 1d214e18ce7..b2283e44fe7 100644 --- a/src/plugins/avf/device.c +++ b/src/plugins/avf/device.c @@ -979,6 +979,7 @@ avf_irq_0_handler (vlib_pci_dev_handle_t h, u16 line) static void avf_irq_n_handler (vlib_pci_dev_handle_t h, u16 line) { + vnet_main_t *vnm = vnet_get_main (); vlib_main_t *vm = vlib_get_main (); avf_main_t *am = &avf_main; uword pd = vlib_pci_get_private_data (h); @@ -1004,6 +1005,7 @@ avf_irq_n_handler (vlib_pci_dev_handle_t h, u16 line) ed->line = line; } + vnet_device_input_set_interrupt_pending (vnm, ad->hw_if_index, 0); avf_irq_n_enable (ad, 0); } @@ -1172,6 +1174,8 @@ avf_create_if (vlib_main_t * vm, avf_create_if_args_t * args) vnet_sw_interface_t *sw = vnet_get_hw_sw_interface (vnm, ad->hw_if_index); ad->sw_if_index = sw->sw_if_index; + vnet_hw_interface_t *hw = vnet_get_hw_interface (vnm, ad->hw_if_index); + hw->flags |= VNET_HW_INTERFACE_FLAG_SUPPORTS_INT_MODE; vnet_hw_interface_set_input_node (vnm, ad->hw_if_index, avf_input_node.index); |