Now that the timer slack for the PMD threads is reduced we can also reduce the start/increment for PMD load based sleeping to match it.
This will further reduce initial sleep times making it more resilient to interfaces that might be sensitive to large sleep times. Signed-off-by: Kevin Traynor <ktray...@redhat.com> --- Documentation/topics/dpdk/pmd.rst | 15 ++++++--------- lib/dpif-netdev.c | 3 +-- tests/pmd.at | 6 +++--- vswitchd/vswitch.xml | 4 ---- 4 files changed, 10 insertions(+), 18 deletions(-) diff --git a/Documentation/topics/dpdk/pmd.rst b/Documentation/topics/dpdk/pmd.rst index 0c3bb717f..e70986d16 100644 --- a/Documentation/topics/dpdk/pmd.rst +++ b/Documentation/topics/dpdk/pmd.rst @@ -335,8 +335,5 @@ This can be enabled by setting the max requested sleep time (in microseconds) for a PMD thread:: - $ ovs-vsctl set open_vswitch . other_config:pmd-maxsleep=500 - -Non-zero values will be rounded up to the nearest 10 microseconds to avoid -requesting very small sleep times. + $ ovs-vsctl set open_vswitch . other_config:pmd-maxsleep=50 With a non-zero max value a PMD may request to sleep by an incrementing amount @@ -357,10 +354,10 @@ Sleep time statistics for 10 secs can be seen with:: && sleep 10 && ovs-appctl dpif-netdev/pmd-perf-show -Example output, showing that during the last 10 seconds, 76.8% of iterations -had a sleep of some length. The total amount of sleep time was 9.15 seconds and -the average sleep time per iteration was 46 microseconds:: +Example output, showing that during the last 10 seconds, 74.5% of iterations +had a sleep of some length. The total amount of sleep time was 9.06 seconds +and the average sleep time where a sleep was requested was 9 microseconds:: - - sleep iterations: 153994 ( 76.8 % of iterations) - Sleep time (us): 9159399 ( 59 us/iteration avg.) + - sleep iterations: 977037 ( 74.5 % of iterations) + Sleep time (us): 9068841 ( 9 us/iteration avg.) Any potential power saving from PMD load based sleeping is dependent on the diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index 4f06e3f4e..c9f7179c3 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -178,5 +178,5 @@ static struct odp_support dp_netdev_support = { #define PMD_SLEEP_THRESH (NETDEV_MAX_BURST / 2) /* Time in uS to increment a pmd thread sleep time. */ -#define PMD_SLEEP_INC_US 10 +#define PMD_SLEEP_INC_US 1 struct dpcls { @@ -4984,5 +4984,4 @@ dpif_netdev_set_config(struct dpif *dpif, const struct smap *other_config) pmd_max_sleep = smap_get_ullong(other_config, "pmd-maxsleep", 0); - pmd_max_sleep = ROUND_UP(pmd_max_sleep, 10); pmd_max_sleep = MIN(PMD_RCU_QUIESCE_INTERVAL, pmd_max_sleep); atomic_read_relaxed(&dp->pmd_max_sleep, &cur_pmd_max_sleep); diff --git a/tests/pmd.at b/tests/pmd.at index e0f58f7a6..c707f762c 100644 --- a/tests/pmd.at +++ b/tests/pmd.at @@ -1267,5 +1267,5 @@ dnl Check low value max sleep get_log_next_line_num AT_CHECK([ovs-vsctl set open_vswitch . other_config:pmd-maxsleep="1"]) -OVS_WAIT_UNTIL([tail -n +$LINENUM ovs-vswitchd.log | grep "PMD max sleep request is 10 usecs."]) +OVS_WAIT_UNTIL([tail -n +$LINENUM ovs-vswitchd.log | grep "PMD max sleep request is 1 usecs."]) OVS_WAIT_UNTIL([tail -n +$LINENUM ovs-vswitchd.log | grep "PMD load based sleeps are enabled."]) @@ -1295,6 +1295,6 @@ OVS_WAIT_UNTIL([tail -n +$LINENUM ovs-vswitchd.log | grep "PMD load based sleeps dnl Check rounding get_log_next_line_num -AT_CHECK([ovs-vsctl set open_vswitch . other_config:pmd-maxsleep="491"]) -OVS_WAIT_UNTIL([tail -n +$LINENUM ovs-vswitchd.log | grep "PMD max sleep request is 500 usecs."]) +AT_CHECK([ovs-vsctl set open_vswitch . other_config:pmd-maxsleep="499"]) +OVS_WAIT_UNTIL([tail -n +$LINENUM ovs-vswitchd.log | grep "PMD max sleep request is 499 usecs."]) OVS_WAIT_UNTIL([tail -n +$LINENUM ovs-vswitchd.log | grep "PMD load based sleeps are enabled."]) diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml index 8c4acfb18..2b57fc0e3 100644 --- a/vswitchd/vswitch.xml +++ b/vswitchd/vswitch.xml @@ -807,8 +807,4 @@ Rx queues that it polls. </p> - <p> - To avoid requesting very small sleeps (e.g. less than 10 us) the - value will be rounded up to the nearest 10 us. - </p> <p> The maximum value is <code>10000 microseconds</code>. -- 2.39.0 _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev