avf: Support interrupt mode 66/13566/2
authorSteven <sluong@cisco.com>
Thu, 19 Jul 2018 23:25:47 +0000 (16:25 -0700)
committerDamjan Marion <dmarion@me.com>
Fri, 20 Jul 2018 09:30:50 +0000 (09:30 +0000)
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>
src/plugins/avf/README.md
src/plugins/avf/device.c

index 6a464a4..2ebc137 100644 (file)
@@ -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
index 1d214e1..b2283e4 100644 (file)
@@ -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);