From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id D18C2B3D6 for ; Tue, 2 Jun 2015 07:27:36 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP; 01 Jun 2015 22:27:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,537,1427785200"; d="scan'208";a="501353663" Received: from kmsmsx152.gar.corp.intel.com ([172.21.73.87]) by FMSMGA003.fm.intel.com with ESMTP; 01 Jun 2015 22:27:34 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by KMSMSX152.gar.corp.intel.com (172.21.73.87) with Microsoft SMTP Server (TLS) id 14.3.224.2; Tue, 2 Jun 2015 13:27:33 +0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.23]) by SHSMSX101.ccr.corp.intel.com ([10.239.4.153]) with mapi id 14.03.0224.002; Tue, 2 Jun 2015 13:27:32 +0800 From: "Liu, Yong" To: "Liang, Cunming" , "dev@dpdk.org" Thread-Topic: [PATCH v9 01/12] eal/linux: add interrupt vectors support in intr_handle Thread-Index: AQHQmevcWLonGNkABkih2NbLTIOkXZ2Ytabw Date: Tue, 2 Jun 2015 05:27:31 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E10E36F69@SHSMSX103.ccr.corp.intel.com> References: <1432198563-16334-1-git-send-email-cunming.liang@intel.com> <1432889125-20255-1-git-send-email-cunming.liang@intel.com> <1432889125-20255-2-git-send-email-cunming.liang@intel.com> In-Reply-To: <1432889125-20255-2-git-send-email-cunming.liang@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "shemming@brocade.com" , "Wang, Liang-min" Subject: Re: [dpdk-dev] [PATCH v9 01/12] eal/linux: add interrupt vectors support in intr_handle X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2015 05:27:37 -0000 Tested-by: Yong Liu - Tested Commit: 7c4c66bf666b8059ed0ad2f2478ef349b3272f51 - OS: Fedora20 3.15.5 - GCC: gcc version 4.8.3 20140911 - CPU: Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz - NIC: Intel Corporation 82599ES 10-Gigabit SFI/SFP+ [8086:10fb] - NIC: Intel Corporation I350 Gigabit Network Connection [8086:1521] - Default x86_64-native-linuxapp-gcc configuration - Prerequisites: vfio related case request vt-d enable in bios and IOMMU en= able in kernel=20 - Total 17 cases, 15 passed, 2 failed - Failed cases: pf_rxq_on_uiopcigeneric, pf_lsc_on_uiopcigeneric - Case: pf_lsc_igbuio_legacy Description: check when pf bound to igb_uio with legacy mode, link status= change interrupt can be normally handled Command / instruction: Insmod igb_uio driver with legacy interrupt mode insmod ./x86_64-native-linuxapp-gcc/kmod/igb_uio.ko intr_mode=3Dlegac= y Change port config to lsc enable and rxq disable in l3fwd-power/main.c Build l3fwd-power and start l3fwd-power with 2 ports =20 l3fwd-power -c 0x6 -n 3 -- -p 0x3 -P --config=3D"(0,0,1),(1,0,2)" Change tester port0 link down and verify link down detected on dut port= 0=20 Port 0: link down Change tester port0 link up and verify link up detected on dut port0 Port 0: link up Change tester port1 link down and verify link down detected on dut port= 1=20 Port 1: link down Change tester port1 link up and verify link up detected on dut port1 Port 1: link up =20 Change port config to lsc enable and rxq enable in l3fwd-power/main.c Build l3fwd-power and start l3fwd-power with 2 ports l3fwd-power -c 0x6 -n 3 -- -p 0x3 -P --config=3D"(0,0,1),(1,0,2)" Verify lsc disabled for can't enable lsc and rxq in the same time when = pf bound to igb_uio lsc won't enable because of no intr multiplex =20 - Case: pf_lsc_igbuio_msix Description: check when pf bound to igb_uio with msix mode, link status c= hange interrupt can be normally handled Command / instruction: Insmod igb_uio driver with msix interrupt mode insmod ./x86_64-native-linuxapp-gcc/kmod/igb_uio.ko intr_mode=3Dmsix Verify link status can be normally handled like previous case pf_lsc_ig= buio_legacy. - Case: pf_lsc_vfio_legacy Description: check when pf bound to vfio with legacy mode, link status ch= ange interrupt can be normally handled Command / instruction: Do prerequisites for vfio driver then bind device to vfio-driver modprobe vfio modprobe vfio-pci ./tools/dpdk_nic_bind.py --bind=3Dvfio-pci 08:00.0 08:00.1 Change port config to lsc enable and rxq disable in l3fwd-power/main.c Start l3fwd-power with vfio legacy mode l3fwd-power -c 0x6 -n 3 --vfio-intr=3Dlegacy -- -p 0x3 -P --config=3D= "(0,0,1),(1,0,2)" Check link status change interrupt can be normally handled like previou= s case. =09 Change port config to lsc enable and rxq enable in l3fwd-power/main.c Start l3fwd-power with vfio legacy mode l3fwd-power -c 0x6 -n 3 --vfio-intr=3Dlegacy -- -p 0x3 -P --config=3D= "(0,0,1),(1,0,2)" Verify lsc disabled for can't enable lsc and rxq in the same time with = legacy mode. =09 - Case: pf_lsc_vfio_msi Description: check when pf bound to vfio with msi mode, link status chang= e interrupt can be normally handled Command / instruction: Do prerequisites for vfio driver then bind device to vfio-driver modprobe vfio modprobe vfio-pci ./tools/dpdk_nic_bind.py --bind=3Dvfio-pci 08:00.0 08:00.1 Change port config to lsc enable and rxq disable in l3fwd-power/main.c Start l3fwd-power with vfio msi mode l3fwd-power -c 0x6 -n 3 --vfio-intr=3Dmsi -- -p 0x3 -P --config=3D"(0= ,0,1),(1,0,2)" Check link status change interrupt can be normally handled like previou= s case. =09 Change port config to lsc enable and rxq enable in l3fwd-power/main.c Start l3fwd-power with vfio msi mode l3fwd-power -c 0x6 -n 3 --vfio-intr=3Dmsi -- -p 0x3 -P --config=3D"(0= ,0,1),(1,0,2)" Verify lsc disabled for can't enable lsc and rxq in the same time with = legacy mode. - Case: pf_lsc_vfio_msix Description: check when pf bound to vfio with msix mode, link status chan= ge interrupt can be normally handled Command / instruction: Do prerequisites for vfio driver then bind device to vfio-driver modprobe vfio modprobe vfio-pci ./tools/dpdk_nic_bind.py --bind=3Dvfio-pci 08:00.0 08:00.1 Change port config to lsc enable and rxq disable in l3fwd-power/main.c Start l3fwd-power with vfio msix mode l3fwd-power -c 0x6 -n 3 --vfio-intr=3Dmsix -- -p 0x3 -P --config=3D"(= 0,0,1),(1,0,2)" Check link status change interrupt can be normally handled like previou= s case. =09 Change port config to lsc enable and rxq enable in l3fwd-power/main.c Start l3fwd-power with vfio msix mode l3fwd-power -c 0x6 -n 3 --vfio-intr=3Dmsix -- -p 0x3 -P --config=3D"(= 0,0,1),(1,0,2)" Check link status change interrupt can be normally handled like previou= s case. =09 - Case: pf_rxq_on_vfio_msix Description: check when pf bound to vfio with default msix mode, receive = packet interrupt can be normally handled Command / instruction: Do prerequisites for vfio driver then bind device to vfio-driver modprobe vfio modprobe vfio-pci ./tools/dpdk_nic_bind.py --bind=3Dvfio-pci 08:00.0 08:00.1 Start l3fwd-power with 2 ports and 2 cores. =20 l3fwd-power -c 0x6 -n 3 -- -p 0x3 -P --config=3D"(0,0,1),(1,0,2)" Send packet from tester port0 and verify dut core1 wakeup and then slee= p. lcore 1 is waked up from rx interrupt on port 0 queue 0 lcore 1 sleeps until interrupt triggers Send packet from tester port1 and verify dut core2 wakeup and then slee= p. lcore 2 is waked up from rx interrupt on port 1 queue 0 lcore 2 sleeps until interrupt triggers =20 - Case: pf_rxq_on_vfio_msi Description: check when pf bound to vfio with msi mode, receive packet in= terrupt can be normally handled Command / instruction: Do prerequisites for vfio driver then bind device to vfio-driver modprobe vfio modprobe vfio-pci ./tools/dpdk_nic_bind.py --bind=3Dvfio-pci 08:00.0 08:00.1 Start l3fwd-power with 2 ports and 2 cores. =20 l3fwd-power -c 0x6 -n 3 --vfio-intr=3Dmsi -- -p 0x3 -P --config=3D"(0= ,0,1),(1,0,2)" Verify packet interrupt can be normally handled like previous case pf_r= xq_on_vfio_msix. =20 - Case: pf_rxq_on_vfio_legacy Description: check when pf bound to vfio with legacy mode, receive packet= interrupt can be normally handled Command / instruction: Do prerequisites for vfio driver then bind device to vfio-driver modprobe vfio modprobe vfio-pci ./tools/dpdk_nic_bind.py --bind=3Dvfio-pci 08:00.0 08:00.1 Start l3fwd-power with 2 ports and 2 cores. =20 l3fwd-power -c 0x6 -n 3 --vfio-intr=3Dlegacy -- -p 0x3 -P --config=3D= "(0,0,1),(1,0,2)" Verify packet interrupt can be normally handled like previous case pf_r= xq_on_vfio_msix. - Case: pf_onecore_on_vfio Description: check when all pf devices bound to one core, receive packet = interrupt can be normally handled Command / instruction: Do prerequisites for vfio driver then bind device to vfio-driver modprobe vfio modprobe vfio-pci ./tools/dpdk_nic_bind.py --bind=3Dvfio-pci 08:00.0 08:00.1 Start l3fwd-power with 2 ports and 1 cores. =20 l3fwd-power -c 0x2 -n 3 -- -p 0x3 -P --config=3D"(0,0,1),(1,0,1)" Verify packet interrupt can be normally handled like previous case pf_r= xq_on_vfio_msix. =09 - Case: pf_multiqueue_on_vfio Description: check when pf device has mulit queues, receive packet interr= upt can be normally handled Command / instruction: Start l3fwd-power with 2 ports and 4 cores. l3fwd-power -c 0x100000e -n 3 -- -p 0x3 -P --config=3D"(0,0,1),(0,1,2= ),(1,0,3),(1,1,24)" Send enough packets with different destination ip address. sendp([Ether()/IP(dst=3D"127.0.0.X")/UDP()/Raw('0'*18)], iface=3D"p786p1= ") Verify all cores wakeup and then sleep as expected. - Case: pf_maxqueue_on_vfio Description: check when pf device has maximum queues, receive packet inte= rrupt can be normally handled Command / instruction: Start l3fwd-power with 2 ports and 32 cores [only for niantic], differe= nt nic has different maximum rx queues l3fwd-power -c 0x3fdfe3fdfe -n 3 -- -p 0x3 -P --config=3D"(0,0,1),(0,= 1,21),(0,2,2),(0,3,22),\ (0,4,3),(0,5,23),(0,6,24),(0,7,4),(0,8,25),(0,9,5),(0,10,26),(0,1= 1,6),(0,12,27),(0,13,7),\ (0,14,8),(0,15,28),(1,0,10),(1,1,30),(1,2,11),(1,3,31),(1,4,32),(= 1,5,12),(1,6,33),(1,7,13),\ (1,8,34),(1,9,14),(1,10,35),(1,11,15),(1,12,16),(1,13,36),(1,14,1= 7),(1,15,37)," Send enough packets with different destination ip address. sendp([Ether()/IP(dst=3D"127.0.0.X")/UDP()/Raw('0'*18)], iface=3D"p786p1= ") Verify all cores wakeup and then sleep as expected.=09 =09 - Case: pf_rxq_on_igbuio_legacy Description: check when pf bound to igb_uio with legacy mode, receive pac= ket interrupt can be normally handled Command / instruction: Insmod igb_uio driver with legacy interrupt mode insmod ./x86_64-native-linuxapp-gcc/kmod/igb_uio.ko intr_mode=3Dlegac= y ./tools/dpdk_nic_bind.py --bind=3Digb_uio 08:00.0 08:00.1 =20 Start l3fwd-power with 2 ports and 2 cores. =20 l3fwd-power -c 0x6 -n 3 -- -p 0x3 -P --config=3D"(0,0,1),(1,0,2)" Verify packet interrupt can be normally handled like previous case pf_r= xq_on_vfio_msix. =20 - Case: pf_rxq_on_igbuio_msix Description: check when pf bound to igb_uio with msix mode, receive packe= t interrupt can be normally handled Command / instruction: Insmod igb_uio driver with msix interrupt mode insmod ./x86_64-native-linuxapp-gcc/kmod/igb_uio.ko intr_mode=3Dmsix ./tools/dpdk_nic_bind.py --bind=3Digb_uio 08:00.0 08:00.1 =20 Start l3fwd-power with 2 ports and 2 cores. =20 l3fwd-power -c 0x6 -n 3 -- -p 0x3 -P --config=3D"(0,0,1),(1,0,2)" Verify packet interrupt can be normally handled like previous case pf_r= xq_on_vfio_msix. - Case: pf_rxq_on_uiopcigeneric Description: check when pf bound to uio_pci_generic, receive packet inter= rupt can be normally handled Command / instruction: Insmod uio_pci_generic driver and bind pf device on it. ./tools/dpdk_nic_bind.py --bind=3Duio_pci_generic 08:00.0 08:00.1 =20 Start l3fwd-power with 2 ports and 2 cores. =20 l3fwd-power -c 0x6 -n 3 -- -p 0x3 -P --config=3D"(0,0,1),(1,0,2)" Verify packet interrupt can be normally handled like previous case pf_r= xq_on_vfio_msix.=09 - Case: pf_lsc_on_uiopcigeneric Description: check when pf bound to uio_pci_generic, link status changed = interrupt can be normally handled Command / instruction: Insmod uio_pci_generic driver and bind pf device on it. ./tools/dpdk_nic_bind.py --bind=3Duio_pci_generic 08:00.0 08:00.1 =20 Start l3fwd-power with 2 ports and 2 cores. =20 l3fwd-power -c 0x6 -n 3 -- -p 0x3 -P --config=3D"(0,0,1),(1,0,2)" Change tester port0 link down and verify link down detected on dut port= 0=20 Port 0: link down Change tester port0 link up and verify link up detected on dut port0 Port 0: link up Change tester port1 link down and verify link down detected on dut port= 1=20 Port 1: link down Change tester port1 link up and verify link up detected on dut port1 Port 1: link up =20 Change port config to lsc enable and rxq enable in l3fwd-power/main.c Build l3fwd-power and start l3fwd-power with 2 ports l3fwd-power -c 0x6 -n 3 -- -p 0x3 -P --config=3D"(0,0,1),(1,0,2)" Verify lsc disabled for can't enable lsc and rxq in the same time when = pf bound to uio_pci_generic lsc won't enable because of no intr multiplex=09 =09 - Case: vf_in_vm_rxq Description: check when vf bound to igb_uio in virtual machine, receive p= acket interrupt can be normally handled Only support niantic by now. Command / instruction: Create vf devices and bound into virtual machine echo 1 > /sys/bus/pci/devices/0000\:08\:00.0/sriov_numvfs echo 1 > /sys/bus/pci/devices/0000\:08\:00.1/sriov_numvfs virsh virsh # nodedev-dettach pci_0000_08_10_0 virsh # nodedev-dettach pci_0000_08_10_1 Start virtual machine and bind vf devices to driver igb_uio. ./tools/dpdk_nic_bind.py --bind=3Digb_uio eth1 eth2 Change port config to lsc disable and rxq enable in l3fwd-power/main.c= =09 Start l3fwd-power with 2 ports and 2 cores. =20 l3fwd-power -c 0x6 -n 3 -- -p 0x3 -P --config=3D"(0,0,1),(1,0,2)" Send packet from tester port0 with promisc mac and verify vm core1 wake= up and then sleep. lcore 1 is waked up from rx interrupt on port 0 queue 0 lcore 1 sleeps until interrupt triggers Send packet from tester port1 with promisc mac and verify vm core2 wake= up and then sleep. lcore 2 is waked up from rx interrupt on port 1 queue 0 lcore 2 sleeps until interrupt triggers =20 - Case: vf_in_host_rxq Description: check when vf bound to vfio with msix mode, receive packet i= nterrupt can be normally handled Only support niantic by now. Command / instruction: Create vf devices and bound to vfio echo 1 > /sys/bus/pci/devices/0000\:08\:00.0/sriov_numvfs echo 1 > /sys/bus/pci/devices/0000\:08\:00.1/sriov_numvfs modprobe vfio modprobe vfio-pci ./tools/dpdk_nic_bind.py --bind=3Dvfio-pci 08:10.0 08:10.1 Start l3fwd-power with 2 ports and 2 cores. =20 l3fwd-power -c 0x6 -n 3 -- -p 0x3 -P --config=3D"(0,0,1),(1,0,2)" Send packet from tester port0 with promisc mac and verify dut core1 wak= eup and then sleep. lcore 1 is waked up from rx interrupt on port 0 queue 0 lcore 1 sleeps until interrupt triggers Send packet from tester port1 with promisc mac and verify dut core2 wak= eup and then sleep. lcore 2 is waked up from rx interrupt on port 1 queue 0 lcore 2 sleeps until interrupt triggers > -----Original Message----- > From: Liang, Cunming > Sent: Friday, May 29, 2015 4:45 PM > To: dev@dpdk.org > Cc: shemming@brocade.com; david.marchand@6wind.com; > thomas.monjalon@6wind.com; Zhou, Danny; Wang, Liang-min; Richardson, Bruc= e; > Liu, Yong; nhorman@tuxdriver.com; Liang, Cunming > Subject: [PATCH v9 01/12] eal/linux: add interrupt vectors support in > intr_handle >=20 > The patch adds interrupt vectors support in rte_intr_handle. > 'vec_en' is set when interrupt vectors are detected and associated event > fds are set. > Those event fds are stored in efds[]. > 'intr_vec' is reserved for device driver to initialize the vector mapping > table. > When the event fds add to a specified epoll instance, 'eptrs' will hold > the rte_epoll_event object pointer. >=20 > Signed-off-by: Danny Zhou > Signed-off-by: Cunming Liang > --- > v7 changes: > - add eptrs[], it's used to store the register rte_epoll_event instances= . > - add vec_en, to log the vector capability status. >=20 > v6 changes: > - add mapping table between irq vector number and queue id. >=20 > v5 changes: > - Create this new patch file for changed struct rte_intr_handle that > other patches depend on, to avoid breaking git bisect. >=20 > lib/librte_eal/linuxapp/eal/include/exec-env/rte_interrupts.h | 10 > ++++++++++ > 1 file changed, 10 insertions(+) >=20 > diff --git a/lib/librte_eal/linuxapp/eal/include/exec-env/rte_interrupts.= h > b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_interrupts.h > index bdeb3fc..9c86a15 100644 > --- a/lib/librte_eal/linuxapp/eal/include/exec-env/rte_interrupts.h > +++ b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_interrupts.h > @@ -38,6 +38,8 @@ > #ifndef _RTE_LINUXAPP_INTERRUPTS_H_ > #define _RTE_LINUXAPP_INTERRUPTS_H_ >=20 > +#define RTE_MAX_RXTX_INTR_VEC_ID 32 > + > enum rte_intr_handle_type { > RTE_INTR_HANDLE_UNKNOWN =3D 0, > RTE_INTR_HANDLE_UIO, /**< uio device handle */ > @@ -49,6 +51,8 @@ enum rte_intr_handle_type { > RTE_INTR_HANDLE_MAX > }; >=20 > +struct rte_epoll_event; > + > /** Handle for interrupts. */ > struct rte_intr_handle { > union { > @@ -58,6 +62,12 @@ struct rte_intr_handle { > }; > int fd; /**< interrupt event file descriptor */ > enum rte_intr_handle_type type; /**< handle type */ > + uint32_t max_intr; /**< max interrupt requested */ > + uint32_t nb_efd; /**< number of available efds */ > + int efds[RTE_MAX_RXTX_INTR_VEC_ID]; /**< intr vectors/efds mapping > */ > + struct rte_epoll_event *elist[RTE_MAX_RXTX_INTR_VEC_ID]; > + /**< intr vector epoll event ptr */ > + int *intr_vec; /**< intr vector number array */ > }; >=20 > #endif /* _RTE_LINUXAPP_INTERRUPTS_H_ */ > -- > 1.8.1.4