| b212c2fc | 28-Oct-2024 |
Maxime Coquelin <maxime.coquelin@redhat.com> |
uapi: import VDUSE header
Import VDUSE headers to be included in the Vhost library. Set header version to v6.10 Linux Kernel release.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com> Ack
uapi: import VDUSE header
Import VDUSE headers to be included in the Vhost library. Set header version to v6.10 Linux Kernel release.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com> Acked-by: Morten Brørup <mb@smartsharesystems.com> Reviewed-by: David Marchand <david.marchand@redhat.com>
show more ...
|
| b99bd4a0 | 08-Jun-2022 |
Ke Zhang <ke1x.zhang@intel.com> |
kni: use dedicated function to set MAC address
The warning info: warning: passing argument 1 of ‘memcpy’ discards ‘const’ qualifier from pointer target type
Variable dev_addr is done const intentio
kni: use dedicated function to set MAC address
The warning info: warning: passing argument 1 of ‘memcpy’ discards ‘const’ qualifier from pointer target type
Variable dev_addr is done const intentionally in v5.17 to prevent using it directly. See the following Linux kernel changeset for details:
commit adeef3e32146 ("net: constify netdev->dev_addr")
Used helper function was introduced earlier in v5.15.
Fixes: ea6b39b5b847 ("kni: remove ethtool support") Cc: stable@dpdk.org
Signed-off-by: Ke Zhang <ke1x.zhang@intel.com> Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru> Acked-by: Ferruh Yigit <ferruh.yigit@xilinx.com>
show more ...
|
| 2ee8c67e | 08-Jun-2022 |
Ke Zhang <ke1x.zhang@intel.com> |
kni: use dedicated function to set random MAC address
eth_hw_addr_random() sets address type correctly.
eth_hw_addr_random() is available since Linux v3.4, so no compat is required.
Also fix the w
kni: use dedicated function to set random MAC address
eth_hw_addr_random() sets address type correctly.
eth_hw_addr_random() is available since Linux v3.4, so no compat is required.
Also fix the warning: warning: passing argument 1 of ‘memcpy’ discards ‘const’ qualifier from pointer target type
Variable dev_addr is done const intentionally in Linux v5.17 to prevent using it directly.
Fixes: ea6b39b5b847 ("kni: remove ethtool support") Cc: stable@dpdk.org
Signed-off-by: Ke Zhang <ke1x.zhang@intel.com> Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru> Acked-by: Ferruh Yigit <ferruh.yigit@xilinx.com>
show more ...
|
| f1b2991c | 03-Dec-2021 |
Markus Theil <markus.theil@secunet.com> |
kni: fix ioctl signature
Fix kni's ioctl signature to correctly match the kernel's structs. This shaves off the (void*) casts and uses struct file* instead of struct inode*. With the correct signatu
kni: fix ioctl signature
Fix kni's ioctl signature to correctly match the kernel's structs. This shaves off the (void*) casts and uses struct file* instead of struct inode*. With the correct signature, control flow integrity checkers are no longer confused at this point.
Signed-off-by: Markus Theil <markus.theil@secunet.com> Tested-by: Michael Pfeiffer <michael.pfeiffer@tu-ilmenau.de> Acked-by: Stephen Hemminger <stephen@networkplumber.org>
show more ...
|
| 5569dd7d | 20-Jan-2022 |
Tudor Cornea <tudor.cornea@gmail.com> |
kni: allow configuring thread granularity
The Kni kthreads seem to be re-scheduled at a granularity of roughly 1 millisecond right now, which seems to be insufficient for performing tests involving
kni: allow configuring thread granularity
The Kni kthreads seem to be re-scheduled at a granularity of roughly 1 millisecond right now, which seems to be insufficient for performing tests involving a lot of control plane traffic.
Even if KNI_KTHREAD_RESCHEDULE_INTERVAL is set to 5 microseconds, it seems that the existing code cannot reschedule at the desired granularily, due to precision constraints of schedule_timeout_interruptible().
In our use case, we leverage the Linux Kernel for control plane, and it is not uncommon to have 60K - 100K pps for some signaling protocols.
Since we are not in atomic context, the usleep_range() function seems to be more appropriate for being able to introduce smaller controlled delays, in the range of 5-10 microseconds. Upon reading the existing code, it would seem that this was the original intent. Adding sub-millisecond delays, seems unfeasible with a call to schedule_timeout_interruptible().
KNI_KTHREAD_RESCHEDULE_INTERVAL 5 /* us */ schedule_timeout_interruptible( usecs_to_jiffies(KNI_KTHREAD_RESCHEDULE_INTERVAL));
Below, we attempted a brief comparison between the existing implementation, which uses schedule_timeout_interruptible() and usleep_range().
We attempt to measure the CPU usage, and RTT between two Kni interfaces, which are created on top of vmxnet3 adapters, connected by a vSwitch.
insmod rte_kni.ko kthread_mode=single carrier=on
schedule_timeout_interruptible(usecs_to_jiffies(5)) kni_single CPU Usage: 2-4 % [root@localhost ~]# ping 1.1.1.2 -I eth1 PING 1.1.1.2 (1.1.1.2) from 1.1.1.1 eth1: 56(84) bytes of data. 64 bytes from 1.1.1.2: icmp_seq=1 ttl=64 time=2.70 ms 64 bytes from 1.1.1.2: icmp_seq=2 ttl=64 time=1.00 ms 64 bytes from 1.1.1.2: icmp_seq=3 ttl=64 time=1.99 ms 64 bytes from 1.1.1.2: icmp_seq=4 ttl=64 time=0.985 ms 64 bytes from 1.1.1.2: icmp_seq=5 ttl=64 time=1.00 ms
usleep_range(5, 10) kni_single CPU usage: 50% 64 bytes from 1.1.1.2: icmp_seq=1 ttl=64 time=0.338 ms 64 bytes from 1.1.1.2: icmp_seq=2 ttl=64 time=0.150 ms 64 bytes from 1.1.1.2: icmp_seq=3 ttl=64 time=0.123 ms 64 bytes from 1.1.1.2: icmp_seq=4 ttl=64 time=0.139 ms 64 bytes from 1.1.1.2: icmp_seq=5 ttl=64 time=0.159 ms
usleep_range(20, 50) kni_single CPU usage: 24% 64 bytes from 1.1.1.2: icmp_seq=1 ttl=64 time=0.202 ms 64 bytes from 1.1.1.2: icmp_seq=2 ttl=64 time=0.170 ms 64 bytes from 1.1.1.2: icmp_seq=3 ttl=64 time=0.171 ms 64 bytes from 1.1.1.2: icmp_seq=4 ttl=64 time=0.248 ms 64 bytes from 1.1.1.2: icmp_seq=5 ttl=64 time=0.185 ms
usleep_range(50, 100) kni_single CPU usage: 13% 64 bytes from 1.1.1.2: icmp_seq=1 ttl=64 time=0.537 ms 64 bytes from 1.1.1.2: icmp_seq=2 ttl=64 time=0.257 ms 64 bytes from 1.1.1.2: icmp_seq=3 ttl=64 time=0.231 ms 64 bytes from 1.1.1.2: icmp_seq=4 ttl=64 time=0.143 ms 64 bytes from 1.1.1.2: icmp_seq=5 ttl=64 time=0.200 ms
usleep_range(100, 200) kni_single CPU usage: 7% 64 bytes from 1.1.1.2: icmp_seq=1 ttl=64 time=0.716 ms 64 bytes from 1.1.1.2: icmp_seq=2 ttl=64 time=0.167 ms 64 bytes from 1.1.1.2: icmp_seq=3 ttl=64 time=0.459 ms 64 bytes from 1.1.1.2: icmp_seq=4 ttl=64 time=0.455 ms 64 bytes from 1.1.1.2: icmp_seq=5 ttl=64 time=0.252 ms
usleep_range(1000, 1100) kni_single CPU usage: 2% 64 bytes from 1.1.1.2: icmp_seq=1 ttl=64 time=2.22 ms 64 bytes from 1.1.1.2: icmp_seq=2 ttl=64 time=1.17 ms 64 bytes from 1.1.1.2: icmp_seq=3 ttl=64 time=1.17 ms 64 bytes from 1.1.1.2: icmp_seq=4 ttl=64 time=1.17 ms 64 bytes from 1.1.1.2: icmp_seq=5 ttl=64 time=1.15 ms
Upon testing, usleep_range(1000, 1100) seems roughly equivalent in latency and cpu usage to the variant with schedule_timeout_interruptible(), while usleep_range(100, 200) seems to give a decent tradeoff between latency and cpu usage, while allowing users to tweak the limits for improved precision if they have such use cases.
Disabling RTE_KNI_PREEMPT_DEFAULT, interestingly seems to lead to a softlockup on my kernel.
Kernel panic - not syncing: softlockup: hung tasks CPU: 0 PID: 1226 Comm: kni_single Tainted: G W O 3.10 #1 <IRQ> [<ffffffff814f84de>] dump_stack+0x19/0x1b [<ffffffff814f7891>] panic+0xcd/0x1e0 [<ffffffff810993b0>] watchdog_timer_fn+0x160/0x160 [<ffffffff810644b2>] __run_hrtimer.isra.4+0x42/0xd0 [<ffffffff81064b57>] hrtimer_interrupt+0xe7/0x1f0 [<ffffffff8102cd57>] smp_apic_timer_interrupt+0x67/0xa0 [<ffffffff8150321d>] apic_timer_interrupt+0x6d/0x80
This patch also attempts to remove this option.
References: [1] https://www.kernel.org/doc/Documentation/timers/timers-howto.txt
Signed-off-by: Tudor Cornea <tudor.cornea@gmail.com> Acked-by: Padraig Connolly <Padraig.J.Connolly@intel.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
show more ...
|
| e16b972b | 24-Jan-2022 |
Bruce Richardson <bruce.richardson@intel.com> |
build: remove deprecated Meson functions
Starting in meson 0.56, the functions meson.source_root() and meson.build_root() are deprecated and to be replaced by the [more descriptive] functions: proje
build: remove deprecated Meson functions
Starting in meson 0.56, the functions meson.source_root() and meson.build_root() are deprecated and to be replaced by the [more descriptive] functions: project_source_root()/global_source_root() and project_build_root()/global_build_root(). Unfortunately, these new replacement functions were only added in 0.56 release too, so to use them we would need version checks for old/new functions to remove the deprecation warnings.
However, the functions "current_build_dir()" and "current_source_dir()" remain unaffected by all this, so we can bypass the versioning problem, by saving off these values to "dpdk_source_root" and "dpdk_build_root" in the top-level meson.build file
Bugzilla ID: 926 Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Tested-by: Jerin Jacob <jerinj@marvell.com>
show more ...
|