Re: [dpdk-dev] [PATCH] bus/vmbus: fix race in sub channel creation
On Fri, 2018-11-30 at 12:24 -0800, Stephen Hemminger wrote: > When using multiple queues, there was a race with the kernel > in setting up the second channel. This is do due to a kernel change > whiche does not allow accessing sysfs files for Hyper-V > channels that are not opened. > > The fix is simple, just move the logic to detect not ready > sub channels earlier in the existing loop. > > Fixes: 831dba47bd36 ("bus/vmbus: add Hyper-V virtual bus support") > Reported-by:Mohammed Gamal > Signed-off-by: Stephen Hemminger > --- > drivers/bus/vmbus/linux/vmbus_uio.c | 12 ++-- > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/drivers/bus/vmbus/linux/vmbus_uio.c > b/drivers/bus/vmbus/linux/vmbus_uio.c > index 12e97e3a420a..38df4d724ed5 100644 > --- a/drivers/bus/vmbus/linux/vmbus_uio.c > +++ b/drivers/bus/vmbus/linux/vmbus_uio.c > @@ -357,6 +357,12 @@ int vmbus_uio_get_subchan(struct vmbus_channel > *primary, > continue; > } > > + if (!vmbus_isnew_subchannel(primary, relid)) > + continue; /* Already know about you > */ > + > + if (!vmbus_uio_ring_present(dev, relid)) > + continue; /* Ring may not be ready > yet */ > + > snprintf(subchan_path, sizeof(subchan_path), > "%s/%lu", > chan_path, relid); > err = vmbus_uio_sysfs_read(subchan_path, > "subchannel_id", > @@ -370,12 +376,6 @@ int vmbus_uio_get_subchan(struct vmbus_channel > *primary, > if (subid == 0) > continue; /* skip primary channel */ > > - if (!vmbus_isnew_subchannel(primary, relid)) > - continue; > - > - if (!vmbus_uio_ring_present(dev, relid)) > - continue; /* Ring may not be ready > yet */ > - > err = vmbus_uio_sysfs_read(subchan_path, > "monitor_id", > &monid, UINT8_MAX); > if (err) { With this patch I am now getting the following error: [...] Configuring Port 0 (socket 0) hn_dev_configure(): >> hn_rndis_link_status(): link status 0x40020006 hn_subchan_configure(): open 1 subchannels hn_subchan_configure(): open subchannel failed: -2 hn_dev_configure(): subchannel configuration failed Port0 dev_configure = -2 hn_dev_rx_queue_release(): >> hn_dev_rx_queue_release(): >> hn_dev_tx_queue_release(): >> hn_dev_tx_queue_release(): >> Fail to configure port 0 EAL: Error - exiting with code: 1 Cause: Start ports failed Apparently, no subchannels were ready. Anything I may have missed or misconfigured? Regards, Mohammed
Re: [dpdk-dev] [PATCH] bus/vmbus: fix race in sub channel creation
On Mon, 2018-12-03 at 08:48 -0800, Stephen Hemminger wrote: > On Mon, 03 Dec 2018 07:02:55 +0100 > Mohammed Gamal wrote: > > > On Fri, 2018-11-30 at 12:24 -0800, Stephen Hemminger wrote: > > > When using multiple queues, there was a race with the kernel > > > in setting up the second channel. This is do due to a kernel > > > change > > > whiche does not allow accessing sysfs files for Hyper-V > > > channels that are not opened. > > > > > > The fix is simple, just move the logic to detect not ready > > > sub channels earlier in the existing loop. > > > > > > Fixes: 831dba47bd36 ("bus/vmbus: add Hyper-V virtual bus > > > support") > > > Reported-by:Mohammed Gamal > > > Signed-off-by: Stephen Hemminger > > > --- > > > drivers/bus/vmbus/linux/vmbus_uio.c | 12 ++-- > > > 1 file changed, 6 insertions(+), 6 deletions(-) > > > > > > diff --git a/drivers/bus/vmbus/linux/vmbus_uio.c > > > b/drivers/bus/vmbus/linux/vmbus_uio.c > > > index 12e97e3a420a..38df4d724ed5 100644 > > > --- a/drivers/bus/vmbus/linux/vmbus_uio.c > > > +++ b/drivers/bus/vmbus/linux/vmbus_uio.c > > > @@ -357,6 +357,12 @@ int vmbus_uio_get_subchan(struct > > > vmbus_channel > > > *primary, > > > continue; > > > } > > > > > > + if (!vmbus_isnew_subchannel(primary, relid)) > > > + continue; /* Already know about > > > you > > > */ > > > + > > > + if (!vmbus_uio_ring_present(dev, relid)) > > > + continue; /* Ring may not be > > > ready > > > yet */ > > > + > > > snprintf(subchan_path, sizeof(subchan_path), > > > "%s/%lu", > > > chan_path, relid); > > > err = vmbus_uio_sysfs_read(subchan_path, > > > "subchannel_id", > > > @@ -370,12 +376,6 @@ int vmbus_uio_get_subchan(struct > > > vmbus_channel > > > *primary, > > > if (subid == 0) > > > continue; /* skip primary channel > > > */ > > > > > > - if (!vmbus_isnew_subchannel(primary, relid)) > > > - continue; > > > - > > > - if (!vmbus_uio_ring_present(dev, relid)) > > > - continue; /* Ring may not be > > > ready > > > yet */ > > > - > > > err = vmbus_uio_sysfs_read(subchan_path, > > > "monitor_id", > > > &monid, UINT8_MAX); > > > if (err) { > > > > With this patch I am now getting the following error: > > [...] > > Configuring Port 0 (socket 0) > > hn_dev_configure(): >> > > hn_rndis_link_status(): link status 0x40020006 > > hn_subchan_configure(): open 1 subchannels > > hn_subchan_configure(): open subchannel failed: -2 > > hn_dev_configure(): subchannel configuration failed > > Port0 dev_configure = -2 > > hn_dev_rx_queue_release(): >> > > hn_dev_rx_queue_release(): >> > > hn_dev_tx_queue_release(): >> > > hn_dev_tx_queue_release(): >> > > Fail to configure port 0 > > EAL: Error - exiting with code: 1 > > Cause: Start ports failed > > > > Apparently, no subchannels were ready. Anything I may have missed > > or > > misconfigured? > > > > Regards, > > Mohammed > > Could you check the kernel log? > I did. No relevant messages seem to be there. > The way sub channel configuration works is that the userspace code in > DPDK > sends a message to the hypervisor that it would like N subchannels, > then > the response from the hypervisor is processed by the kernel causing > sysfs > files to be created. Meanwhile the userspace is polling waiting for > the > sysfs files to show up (for 10 seconds). You could increas the > timeout or > go looking in the sysfs directory to see what is present. Tried increasing that up to 100 seconds, still nothing. Could it be a problem on my host? The VM I am using is on a local hyper-v instance. > > There is no good way to handle errors here, the hypervisor doesn't > really > give much feedback.
Re: [dpdk-dev] Problems running netvsc multiq
On Tue, 2018-12-04 at 08:48 -0800, Stephen Hemminger wrote: > On Fri, 30 Nov 2018 14:06:52 -0500 (EST) > Mohammed Gamal wrote: > > > - Stephen Hemminger wrote: > > > On Fri, 30 Nov 2018 12:04:41 +0100 > > > Mohammed Gamal wrote: > > > > > > > Hi All, > > > > I am having the following errors when I run testpmd with the > > > > netvsc > > > > driver and --txq 2 and --rxq 2 options: > > > > > > > > testpmd: create a new mbuf pool : n=155456, > > > > size=2176, socket=0 > > > > testpmd: preferred mempool ops selected: ring_mp_mc > > > > Configuring Port 0 (socket 0) > > > > hn_dev_configure(): >> > > > > hn_rndis_link_status(): link status 0x40020006 > > > > hn_subchan_configure(): open 1 subchannels > > > > vmbus_uio_get_subchan(): invalid subchannel id 0 > > > > hn_subchan_configure(): open subchannel failed: -5 > > > > hn_dev_configure(): subchannel configuration failed > > > > Port0 dev_configure = -5 > > > > hn_dev_rx_queue_release(): >> > > > > hn_dev_rx_queue_release(): >> > > > > hn_dev_tx_queue_release(): >> > > > > hn_dev_tx_queue_release(): >> > > > > Fail to configure port 0 > > > > EAL: Error - exiting with code: 1 > > > > Cause: Start ports failed > > > > > > > > Multiq support was enabled and kernel module was loaded. The > > > > full > > > > command line was: > > > > ./testpmd -l 0-1 -n 2 --log-level=8 --log-level='pmd.*,8' -- > > > > log- > > > > level='bus.vmbus,8' -- --port-topology=chained --forward- > > > > mode=rxonly -- > > > > stats-period 1 --eth-peer=0,00:15:5d:1e:20:c0 --txq 2 --rxq 2 > > > > > > > > I am running latest upstream kernel from the Linus tree and > > > > latest DPDK > > > > upstream from git.dpdk.org. > > > > > > > > Could you also reproduce this? If not, what could I be > > > > misssing? > > > > > > > > Regards, > > > > Mohammed > > > > > > Investigating now. > > > Does single queue work for you? > > > > Yes it does. > > What version of Windows are you running on? Multi-queue requires > WS2016 or later. > The driver is missing a check of NDIS version, will add that. I am running WS2016
Re: [dpdk-dev] Problems running netvsc multiq
On Wed, 2018-12-05 at 14:32 -0800, Stephen Hemminger wrote: > The problem is a regression in 4.20 kernel. Bisecting now. I was bisecting the kernel and the change that seems to introduce this regression is this one: commit ae6935ed7d424ffa74d634da00767e7b03c98fd3 Author: Stephen Hemminger Date: Fri Sep 14 09:10:17 2018 -0700 vmbus: split ring buffer allocation from open The UIO driver needs the ring buffer to be persistent(reused) across open/close. Split the allocation and setup of ring buffer out of vmbus_open. For normal usage vmbus_open/vmbus_close there are no changes; only impacts uio_hv_generic which needs to keep ring buffer memory and reuse when application restarts. Signed-off-by: Stephen Hemminger Signed-off-by: Greg Kroah-Hartman > Failure with logging is: > > $ sudo ./testpmd -l 0-1 -n2 --log-level=8 --log-level='pmd.*,8' -- > log-level='bus.vmbus,8' -- --port-topology=chained --forward- > mode=rxonly --stats-period 1 --eth-peer=0,00:15:5d:1e:20:c0 --txq 2 > --rxq 2 > EAL: Detected 4 lcore(s) > EAL: Detected 1 NUMA nodes > EAL: Multi-process socket /var/run/dpdk/rte/mp_socket > vmbus_scan_one(): Adding vmbus device 2dd1ce17-079e-403c-b352- > a1921ee207ee > vmbus_scan_one(): Adding vmbus device 635a7ae3-091e-4410-ad59- > 667c4f8c04c3 > vmbus_scan_one(): Adding vmbus device 58f75a6d-d949-4320-99e1- > a2a2576d581c > vmbus_scan_one(): Adding vmbus device 242ff919-07db-4180-9c2e- > b86cb68c8c55 > vmbus_scan_one(): Adding vmbus device 7cb9f65d-684d-44dc-9d55- > 13d40dd60570 > vmbus_scan_one(): Adding vmbus device a6dcdcb3-c4da-445a-bc12- > 9050eb9cebfc > vmbus_scan_one(): Adding vmbus device 2450ee40-33bf-4fbd-892e- > 9fb06e9214cf > vmbus_scan_one(): Adding vmbus device 99221fa0-24ad-11e2-be98- > 001aa01bbf6e > vmbus_scan_one(): Adding vmbus device d34b2567-b9b6-42b9-8778- > 0a4ec0b955bf > vmbus_scan_one(): Adding vmbus device fd149e91-82e0-4a7d-afa6- > 2a4166cbd7c0 > vmbus_scan_one(): Adding vmbus device b6650ff7-33bc-4840-8048- > e0676786f393 > vmbus_scan_one(): Adding vmbus device 5620e0c7-8062-4dce-aeb7- > 520c7ef76171 > vmbus_scan_one(): Adding vmbus device 1eccfd72-4b41-45ef-b73a- > 4a6e44c12924 > vmbus_scan_one(): Adding vmbus device 4487b255-b88c-403f-bb51- > d1f69cf17f87 > vmbus_scan_one(): Adding vmbus device b5fa4c59-1916-4725-935f- > 5c8d09d596c5 > vmbus_scan_one(): Adding vmbus device b30ed368-1a6f-4921-8d2b- > 4160a0dfc667 > vmbus_scan_one(): Adding vmbus device f5bee29c-1741-4aad-a4c2- > 8fdedb46dcc2 > EAL: Probing VFIO support... > EAL: WARNING: cpu flags constant_tsc=yes nonstop_tsc=no -> using > unreliable clock cycles ! > EAL: PCI device 935f:00:02.0 on NUMA socket 0 > EAL: probe driver: 15b3:1014 net_mlx5 > net_mlx5: checking device "mlx5_0" > net_mlx5: PCI information matches for device "mlx5_0" > net_mlx5: no switch support detected > net_mlx5: MPW isn't supported > net_mlx5: SWP support: 0 > net_mlx5: tunnel offloading is supported > net_mlx5: MPLS over GRE/UDP tunnel offloading disabled due to old > OFED/rdma-core version or firmware configuration > net_mlx5: naming Ethernet device "935f:00:02.0" > net_mlx5: port is not active: "down" (1) > net_mlx5: checksum offloading is supported > net_mlx5: counters are not supported > net_mlx5: maximum Rx indirection table size is 512 > net_mlx5: VLAN stripping is supported > net_mlx5: FCS stripping configuration is supported > net_mlx5: hardware Rx end alignment padding is not supported > net_mlx5: MPS is disabled > net_mlx5: port 0 reserved UAR address space: 0x7f346659e000 > net_mlx5: port 0 MAC address is 00:15:5d:2a:16:66 > net_mlx5: port 0 MTU is 1500 > net_mlx5: port 0 forcing Ethernet interface up > net_mlx5: port 0 flow maximum priority: 5 > vmbus_probe_one_driver(): VMBUS device 635a7ae3-091e-4410-ad59- > 667c4f8c04c3 on NUMA socket 0 > vmbus_probe_one_driver(): probe driver: net_netvsc > eth_hn_probe(): >> > eth_hn_dev_init(): >> > hn_nvs_init(): NVS version 0x60001, NDIS version 6.30 > hn_nvs_conn_rxbuf(): connect rxbuff va=0x2200402000 gpad=0xe1e2d > hn_nvs_conn_rxbuf(): receive buffer size 1728 count 18811 > hn_nvs_conn_chim(): connect send buf va=0x2202302000 gpad=0xe1e2e > hn_nvs_conn_chim(): send buffer 16777216 section size:6144, > count:2730 > hn_nvs_handle_vfassoc(): VF serial 2 add to port 1 > hn_rndis_init(): RNDIS ver 1.0, aggpkt size 4026531839, aggpkt cnt 8, > aggpkt align 8 > hn_rndis_link_status(): link status 0x4001000b > hn_rndis_set_rxfilter(): set RX filter 0 done > hn_tx_pool_init(): create a TX send pool hn_txd_1 n=2730 size=32 > socket=0 > hn_rndis_get_eaddr(): MAC address 00:15:5d:2a:16:66 > eth_hn_dev_init(): VMBus max channels 64 > hn_rndis_query_rsscaps(): RX rings 64 indirect 128 caps 0x301 > eth_hn_dev_init(): Adding VF device > hn_vf_attach(): Attach VF device 0 > hn_nvs_set_datapath(): set datapath VF > vmbus_probe_one_driver(): VMBUS device 7cb9f65d-684d-44dc-9d55- > 13d40dd60570 on NUMA socket 0 > rte_vmbus_map_device(): Not managed by
Re: [dpdk-dev] Problems running netvsc multiq
On Fri, 2018-12-07 at 11:18 -0800, Stephen Hemminger wrote: > On Fri, 07 Dec 2018 13:15:43 +0200 > Mohammed Gamal wrote: > > > On Wed, 2018-12-05 at 14:32 -0800, Stephen Hemminger wrote: > > > The problem is a regression in 4.20 kernel. Bisecting now. > > > > I was bisecting the kernel and the change that seems to introduce > > this > > regression is this one: > > > > commit ae6935ed7d424ffa74d634da00767e7b03c98fd3 > > Author: Stephen Hemminger > > Date: Fri Sep 14 09:10:17 2018 -0700 > > > > vmbus: split ring buffer allocation from open > > > > The UIO driver needs the ring buffer to be persistent(reused) > > across open/close. Split the allocation and setup of ring > > buffer > > out of vmbus_open. For normal usage vmbus_open/vmbus_close > > there > > are no changes; only impacts uio_hv_generic which needs to keep > > ring buffer memory and reuse when application restarts. > > > > Signed-off-by: Stephen Hemminger > > Signed-off-by: Greg Kroah-Hartman > > > > Patch posted: > > From step...@networkplumber.org Fri Dec 7 10:58:47 2018 > From: Stephen Hemminger > Subject: [PATCH] vmbus: fix subchannel removal > > The changes to split ring allocation from open/close, broke > the cleanup of subchannels. This resulted in problems using > uio on network devices because the subchannel was left behind > when the network device was unbound. > > The cause was in the disconnect logic which used list splice > to move the subchannel list into a local variable. This won't > work because the subchannel list is needed later during the > process of the rescind messages (relid2channel). > > The fix is to just leave the subchannel list in place > which is what the original code did. The list is cleaned > up later when the host rescind is processed. > > Fixes: ae6935ed7d42 ("vmbus: split ring buffer allocation from open") > Signed-off-by: Stephen Hemminger > --- > drivers/hv/channel.c | 10 +- > 1 file changed, 1 insertion(+), 9 deletions(-) > > diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c > index fe00b12e4417..bea4c9850247 100644 > --- a/drivers/hv/channel.c > +++ b/drivers/hv/channel.c > @@ -701,20 +701,12 @@ static int vmbus_close_internal(struct > vmbus_channel *channel) > int vmbus_disconnect_ring(struct vmbus_channel *channel) > { > struct vmbus_channel *cur_channel, *tmp; > - unsigned long flags; > - LIST_HEAD(list); > int ret; > > if (channel->primary_channel != NULL) > return -EINVAL; > > - /* Snapshot the list of subchannels */ > - spin_lock_irqsave(&channel->lock, flags); > - list_splice_init(&channel->sc_list, &list); > - channel->num_sc = 0; > - spin_unlock_irqrestore(&channel->lock, flags); > - > - list_for_each_entry_safe(cur_channel, tmp, &list, sc_list) { > + list_for_each_entry_safe(cur_channel, tmp, &channel- > >sc_list, sc_list) { > if (cur_channel->rescind) > wait_for_completion(&cur_channel- > >rescind_event); > Hi Stephen, This works indeed for the first run. In any subsequent runs, I get this testpmd: create a new mbuf pool : n=155456, size=2176, socket=0 testpmd: preferred mempool ops selected: ring_mp_mc Configuring Port 0 (socket 0) hn_dev_configure(): >> hn_rndis_link_status(): link status 0x40020006 hn_subchan_configure(): open 1 subchannels vmbus_uio_get_subchan(): ring mmap not found (yet) for: 19 vmbus_uio_get_subchan(): ring mmap not found (yet) for: 19 vmbus_uio_get_subchan(): ring mmap not found (yet) for: 19 vmbus_uio_get_subchan(): ring mmap not found (yet) for: 19 vmbus_uio_get_subchan(): ring mmap not found (yet) for: 19 vmbus_uio_get_subchan(): ring mmap not found (yet) for: 19 vmbus_uio_get_subchan(): ring mmap not found (yet) for: 19 vmbus_uio_get_subchan(): ring mmap not found (yet) for: 19 vmbus_uio_get_subchan(): ring mmap not found (yet) for: 19 vmbus_uio_get_subchan(): ring mmap not found (yet) for: 19 vmbus_uio_get_subchan(): ring mmap not found (yet) for: 19 vmbus_uio_get_subchan(): ring mmap not found (yet) for: 19 vmbus_uio_get_subchan(): ring mmap not found (yet) for: 19 vmbus_uio_get_subchan(): ring mmap not found (yet) for: 19 vmbus_uio_get_subchan(): ring mmap not found (yet) for: 19 vmbus_uio_get_subchan(): ring mmap not found (yet) for: 19 vmbus_uio_get_subchan(): ring mmap not found (yet) for: 19 vmbus_uio_get_subchan(): ring mmap not found (yet) for: 19 vmbus_uio_get_subchan(): ring mmap not found (yet) for: 19 vmbus_uio_get_subchan(): ring mmap not found (yet) for: 19 vm
[dpdk-dev] [PATCH] kni: Fix build on RHEL 8
As RHEL8 beta has been released and is based on recent upstream kernels which don't use ndo_change_mtu_rh74 function. Fix the build so that it doesn't fail because the function is missing Signed-off-by: Mohammed Gamal --- kernel/linux/kni/compat.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/linux/kni/compat.h b/kernel/linux/kni/compat.h index 5aadebb..bc81d0c 100644 --- a/kernel/linux/kni/compat.h +++ b/kernel/linux/kni/compat.h @@ -103,7 +103,8 @@ #endif #if (defined(RHEL_RELEASE_CODE) && \ - (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7, 5))) + (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7, 5)) && \ + (RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(8, 0))) #define ndo_change_mtu ndo_change_mtu_rh74 #endif -- 1.8.3.1
Re: [dpdk-dev] [PATCH] kni: Fix build on RHEL 8
On Tue, 2018-11-27 at 10:55 +, Ferruh Yigit wrote: > On 11/26/2018 8:45 PM, Mohammed Gamal wrote: > > As RHEL8 beta has been released and is based on recent upstream > > kernels > > which don't use ndo_change_mtu_rh74 function. Fix the build so that > > it > > doesn't fail because the function is missing > > > > Signed-off-by: Mohammed Gamal > > --- > > kernel/linux/kni/compat.h | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/kernel/linux/kni/compat.h b/kernel/linux/kni/compat.h > > index 5aadebb..bc81d0c 100644 > > --- a/kernel/linux/kni/compat.h > > +++ b/kernel/linux/kni/compat.h > > @@ -103,7 +103,8 @@ > > #endif > > > > #if (defined(RHEL_RELEASE_CODE) && \ > > - (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7, 5))) > > + (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7, 5)) && \ > > + (RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(8, 0))) > > #define ndo_change_mtu ndo_change_mtu_rh74 > > What RHEL use, can you please confirm it turns back to > `ndo_change_mtu`, instead > of something like `ndo_change_mtu_rh8x`? There are no such functions in the RHEL8 kernel. You may check the kernel source code from the SRPM available here: http://ftp.redhat.com/redhat/rhel/rhel-8-beta/baseos/source/Packages/ke rnel-4.18.0-32.el8.src.rpm > > > #endif > > > > > >
[dpdk-dev] Problems running netvsc multiq
Hi All, I am having the following errors when I run testpmd with the netvsc driver and --txq 2 and --rxq 2 options: testpmd: create a new mbuf pool : n=155456, size=2176, socket=0 testpmd: preferred mempool ops selected: ring_mp_mc Configuring Port 0 (socket 0) hn_dev_configure(): >> hn_rndis_link_status(): link status 0x40020006 hn_subchan_configure(): open 1 subchannels vmbus_uio_get_subchan(): invalid subchannel id 0 hn_subchan_configure(): open subchannel failed: -5 hn_dev_configure(): subchannel configuration failed Port0 dev_configure = -5 hn_dev_rx_queue_release(): >> hn_dev_rx_queue_release(): >> hn_dev_tx_queue_release(): >> hn_dev_tx_queue_release(): >> Fail to configure port 0 EAL: Error - exiting with code: 1 Cause: Start ports failed Multiq support was enabled and kernel module was loaded. The full command line was: ./testpmd -l 0-1 -n 2 --log-level=8 --log-level='pmd.*,8' --log- level='bus.vmbus,8' -- --port-topology=chained --forward-mode=rxonly -- stats-period 1 --eth-peer=0,00:15:5d:1e:20:c0 --txq 2 --rxq 2 I am running latest upstream kernel from the Linus tree and latest DPDK upstream from git.dpdk.org. Could you also reproduce this? If not, what could I be misssing? Regards, Mohammed
Re: [dpdk-dev] Problems running netvsc multiq
- Stephen Hemminger wrote: > On Fri, 30 Nov 2018 12:04:41 +0100 > Mohammed Gamal wrote: > > > Hi All, > > I am having the following errors when I run testpmd with the netvsc > > driver and --txq 2 and --rxq 2 options: > > > > testpmd: create a new mbuf pool : n=155456, > > size=2176, socket=0 > > testpmd: preferred mempool ops selected: ring_mp_mc > > Configuring Port 0 (socket 0) > > hn_dev_configure(): >> > > hn_rndis_link_status(): link status 0x40020006 > > hn_subchan_configure(): open 1 subchannels > > vmbus_uio_get_subchan(): invalid subchannel id 0 > > hn_subchan_configure(): open subchannel failed: -5 > > hn_dev_configure(): subchannel configuration failed > > Port0 dev_configure = -5 > > hn_dev_rx_queue_release(): >> > > hn_dev_rx_queue_release(): >> > > hn_dev_tx_queue_release(): >> > > hn_dev_tx_queue_release(): >> > > Fail to configure port 0 > > EAL: Error - exiting with code: 1 > > Cause: Start ports failed > > > > Multiq support was enabled and kernel module was loaded. The full > > command line was: > > ./testpmd -l 0-1 -n 2 --log-level=8 --log-level='pmd.*,8' --log- > > level='bus.vmbus,8' -- --port-topology=chained --forward-mode=rxonly -- > > stats-period 1 --eth-peer=0,00:15:5d:1e:20:c0 --txq 2 --rxq 2 > > > > I am running latest upstream kernel from the Linus tree and latest DPDK > > upstream from git.dpdk.org. > > > > Could you also reproduce this? If not, what could I be misssing? > > > > Regards, > > Mohammed > > Investigating now. > Does single queue work for you? Yes it does.
[dpdk-dev] [PATCH] netvsc: update link info when getting device info
testpmd 'show summary' command always shows interface status as down with 0 Mbps speed regardless of the underlying VF's status. This happens as hn_dev_link_update() is never called, even on the initial RNDIS_STATUS_MEDIA_CONNECT message as LSC interrupts are not yet enabled at this point. Let's call it and update link info when calling hn_dev_info_get(). Signed-off-by: Mohammed Gamal --- drivers/net/netvsc/hn_ethdev.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c index c79f92437..1120fc688 100644 --- a/drivers/net/netvsc/hn_ethdev.c +++ b/drivers/net/netvsc/hn_ethdev.c @@ -265,6 +265,11 @@ static int hn_dev_info_get(struct rte_eth_dev *dev, if (rc != 0) return rc; + /* fill in link status and link speed */ + rc = hn_dev_link_update(dev, 0); + if (rc != 0) + return rc; + /* merges the offload and queues of vf */ return hn_vf_info_get(hv, dev_info); } -- 2.21.0
Re: [dpdk-dev] [RFT] net/netvsc: initialize link state
On Thu, 2020-02-06 at 16:10 -0800, Stephen Hemminger wrote: > If application is using link state interrupt, the correct link state > needs to be filled in when device is started. This is similar to > how virtio updates link information. > > Reported-by: Mohammed Gamal > Signed-off-by: Stephen Hemminger > --- > This version marked RFT because am in airport without access to a > machine to test it. > > drivers/net/netvsc/hn_ethdev.c | 4 > 1 file changed, 4 insertions(+) > > diff --git a/drivers/net/netvsc/hn_ethdev.c > b/drivers/net/netvsc/hn_ethdev.c > index c79f924379fe..564620748daf 100644 > --- a/drivers/net/netvsc/hn_ethdev.c > +++ b/drivers/net/netvsc/hn_ethdev.c > @@ -823,6 +823,10 @@ hn_dev_start(struct rte_eth_dev *dev) > if (error) > hn_rndis_set_rxfilter(hv, 0); > > + /* Initialize Link state */ > + if (error == 0) > + hn_dev_link_update(dev, 0); > + > return error; > } > I tested this and I always get the link status as UP, regardless of whether I start the interface on the guest in UP or DOWN state. Looking at hn_dev_link_update() code, I see that the link status depends on the NDIS status that the driver gets from the host if my understanding is correct. The question is whether if I use 'ip li set dev $IF_NAME down' on the guest affects the status the host sees, or would the host set the state to NDIS_MEDIA_STATE_CONNECTED of the device is physcially connected regardless of what the guest tries to do?
Re: [dpdk-dev] [RFT] net/netvsc: initialize link state
On Fri, 2020-02-07 at 08:12 -0800, Stephen Hemminger wrote: > On Fri, 07 Feb 2020 15:22:23 +0200 > Mohammed Gamal wrote: > > > On Thu, 2020-02-06 at 16:10 -0800, Stephen Hemminger wrote: > > > If application is using link state interrupt, the correct link > > > state > > > needs to be filled in when device is started. This is similar to > > > how virtio updates link information. > > > > > > Reported-by: Mohammed Gamal > > > Signed-off-by: Stephen Hemminger > > > --- > > > This version marked RFT because am in airport without access to a > > > machine to test it. > > > > > > drivers/net/netvsc/hn_ethdev.c | 4 > > > 1 file changed, 4 insertions(+) > > > > > > diff --git a/drivers/net/netvsc/hn_ethdev.c > > > b/drivers/net/netvsc/hn_ethdev.c > > > index c79f924379fe..564620748daf 100644 > > > --- a/drivers/net/netvsc/hn_ethdev.c > > > +++ b/drivers/net/netvsc/hn_ethdev.c > > > @@ -823,6 +823,10 @@ hn_dev_start(struct rte_eth_dev *dev) > > > if (error) > > > hn_rndis_set_rxfilter(hv, 0); > > > > > > + /* Initialize Link state */ > > > + if (error == 0) > > > + hn_dev_link_update(dev, 0); > > > + > > > return error; > > > } > > > > > > > I tested this and I always get the link status as UP, regardless of > > whether I start the interface on the guest in UP or DOWN state. > > Looking > > at hn_dev_link_update() code, I see that the link status depends on > > the > > NDIS status that the driver gets from the host if my understanding > > is > > correct. > > The question is whether if I use 'ip li set dev $IF_NAME down' on > > the > > guest affects the status the host sees, or would the host set the > > state > > to NDIS_MEDIA_STATE_CONNECTED of the device is physcially connected > > regardless of what the guest tries to do? > > > > Are you confused about admin state vs link state? Admin state is the > up/down state in software, and link state is the (virtual) hardware > link > status. In traditional Linux, admin state is controlled by ip link > set up/down; in DPDK the admin state is implied by whether the DPDK > device is started or stopped. The link state for hardware devices is > determined by whether the hardware link has synchronized with the > switch. > In virtual environments this is synchronized. In Linux link state > is reported as NOCARRIER (IFF_RUNNING). In DPDK it is reported in > via the link info get. > > The device visible to the kernel is the accelerated networking > (Mellanox) > device and is not related directly to the netvsc device. > > To test link up/down is not easy on Azure. You would have to use > Azure CLI > to disconnect the NIC from VM. On native Hyper-V you can test by > setting up a virtual switch with an external network device; then > unplug the network device. > > I see. Thanks for the explanation. In this case this does work as expected. Tested-by: Mohammed Gamal