Re: [PATCH] tools/testing: add kselftest shell helper library

2020-11-27 Thread Antonio Cardace
; - echo -e "$(basename $0): PASS=${num_pass} SKIP=${num_skip} > FAIL=${num_err}" > - > - if [[ $num_err -ne 0 ]]; then > - echo -e "$(basename $0): ${RED}FAIL${NC}" > - exit ${KSFT_FAIL} > - fi > - > - if [[ $num_skip -ne 0 ]]; then > - echo -e "$(basename $0): ${YELLOW}SKIP${NC}" > - exit ${KSFT_SKIP} > - fi > - > - echo -e "$(basename $0): ${GREEN}PASS${NC}" > - exit ${KSFT_PASS} > -} > +source "$(dirname $0)/../kselftest.sh" > > wake_children() { > local -r jobs="$(jobs -p)" > -- > 2.29.2.454.gaff20da3a2-goog > Reviewed-by: Antonio Cardace

[PATCH net-next v6 6/6] selftests: add ring and coalesce selftests

2020-11-18 Thread Antonio Cardace
Add scripts to test ring and coalesce settings of netdevsim. Signed-off-by: Antonio Cardace --- .../drivers/net/netdevsim/ethtool-coalesce.sh | 132 ++ .../drivers/net/netdevsim/ethtool-ring.sh | 85 +++ 2 files changed, 217 insertions(+) create mode 100755 tools

[PATCH net-next v6 3/6] netdevsim: support ethtool ring and coalesce settings

2020-11-18 Thread Antonio Cardace
Add ethtool ring and coalesce settings support for testing. Signed-off-by: Antonio Cardace Reviewed-by: Michal Kubecek --- drivers/net/netdevsim/ethtool.c | 66 +-- drivers/net/netdevsim/netdevsim.h | 3 ++ 2 files changed, 66 insertions(+), 3 deletions(-) diff

[PATCH net-next v6 4/6] selftests: extract common functions in ethtool-common.sh

2020-11-18 Thread Antonio Cardace
Factor out some useful functions so that they can be reused by other ethtool-netdevsim scripts. Signed-off-by: Antonio Cardace --- .../drivers/net/netdevsim/ethtool-common.sh | 69 +++ .../drivers/net/netdevsim/ethtool-pause.sh| 63 + 2 files changed, 71

[PATCH net-next v6 5/6] selftests: refactor get_netdev_name function

2020-11-18 Thread Antonio Cardace
As pointed out by Michal Kubecek, getting the name with the previous approach was racy, it's better and easier to get the name of the device with this patch's approach. Essentialy the function doesn't need to exist anymore as it's a simple 'ls' command.

[PATCH net-next v6 2/6] netdevsim: move ethtool pause params in separate struct

2020-11-18 Thread Antonio Cardace
This will help the refactoring in the next commit when coalesce and ring settings are added. Signed-off-by: Antonio Cardace Reviewed-by: Michal Kubecek --- drivers/net/netdevsim/ethtool.c | 16 drivers/net/netdevsim/netdevsim.h | 6 +- 2 files changed, 13 insertions

[PATCH net-next v6 0/6] netdevsim: add ethtool coalesce and ring settings

2020-11-18 Thread Antonio Cardace
Output of ethtool-ring.sh and ethtool-coalesce.sh selftests: # ./ethtool-ring.sh PASSED all 4 checks # ./ethtool-coalesce.sh PASSED all 22 checks # ./ethtool-pause.sh PASSED all 7 checks Changelog v5 -> v6 - moved some bits from patch 3, they were part of a refactoring made in patch 2 Anto

[PATCH net-next v6 1/6] ethtool: add ETHTOOL_COALESCE_ALL_PARAMS define

2020-11-18 Thread Antonio Cardace
This bitmask represents all existing coalesce parameters. Signed-off-by: Antonio Cardace Reviewed-by: Michal Kubecek --- include/linux/ethtool.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index 6408b446051f..e3da25b51ae4 100644 --- a

[PATCH net-next v5 6/6] selftests: add ring and coalesce selftests

2020-11-18 Thread Antonio Cardace
Add scripts to test ring and coalesce settings of netdevsim. Signed-off-by: Antonio Cardace --- .../drivers/net/netdevsim/ethtool-coalesce.sh | 132 ++ .../drivers/net/netdevsim/ethtool-ring.sh | 85 +++ 2 files changed, 217 insertions(+) create mode 100755 tools

[PATCH net-next v5 5/6] selftests: refactor get_netdev_name function

2020-11-18 Thread Antonio Cardace
As pointed out by Michal Kubecek, getting the name with the previous approach was racy, it's better and easier to get the name of the device with this patch's approach. Essentialy the function doesn't need to exist anymore as it's a simple 'ls' command. Signed-of

[PATCH net-next v5 2/6] netdevsim: move ethtool pause params in separate struct

2020-11-18 Thread Antonio Cardace
This will help the refactoring in the next commit when coalesce and ring settings are added. Signed-off-by: Antonio Cardace Reviewed-by: Michal Kubecek --- drivers/net/netdevsim/ethtool.c | 14 +++--- drivers/net/netdevsim/netdevsim.h | 6 +- 2 files changed, 12 insertions(+), 8

[PATCH net-next v5 1/6] ethtool: add ETHTOOL_COALESCE_ALL_PARAMS define

2020-11-18 Thread Antonio Cardace
This bitmask represents all existing coalesce parameters. Signed-off-by: Antonio Cardace Reviewed-by: Michal Kubecek --- include/linux/ethtool.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index 6408b446051f..e3da25b51ae4 100644 --- a

[PATCH net-next v5 4/6] selftests: extract common functions in ethtool-common.sh

2020-11-18 Thread Antonio Cardace
Factor out some useful functions so that they can be reused by other ethtool-netdevsim scripts. Signed-off-by: Antonio Cardace --- .../drivers/net/netdevsim/ethtool-common.sh | 69 +++ .../drivers/net/netdevsim/ethtool-pause.sh| 63 + 2 files changed, 71

[PATCH net-next v5 3/6] netdevsim: support ethtool ring and coalesce settings

2020-11-18 Thread Antonio Cardace
Add ethtool ring and coalesce settings support for testing. Signed-off-by: Antonio Cardace Reviewed-by: Michal Kubecek --- drivers/net/netdevsim/ethtool.c | 68 +-- drivers/net/netdevsim/netdevsim.h | 3 ++ 2 files changed, 67 insertions(+), 4 deletions(-) diff

[PATCH net-next v5 0/6] netdevsim: add ethtool coalesce and ring settings

2020-11-18 Thread Antonio Cardace
etdevsim${NSIM_ID}/net/)' to just 'ls /sys/bus/netdevsim/devices/netdevsim${NSIM_ID}/net/' Antonio Cardace (6): ethtool: add ETHTOOL_COALESCE_ALL_PARAMS define netdevsim: move ethtool pause params in separate struct netdevsim: support ethtool ring and coalesce settings se

Re: [PATCH net-next v4 5/6] selftests: refactor get_netdev_name function

2020-11-18 Thread Antonio Cardace
On Wed, Nov 18, 2020 at 08:56:10AM -0800, Jakub Kicinski wrote: > On Wed, 18 Nov 2020 10:03:20 +0100 Antonio Cardace wrote: > > Do I have to resend the whole serie as a new version or is there a > > quicker way to just resend a single patch? > > Just repost the series

Re: [PATCH net-next v4 5/6] selftests: refactor get_netdev_name function

2020-11-18 Thread Antonio Cardace
On Tue, Nov 17, 2020 at 06:35:20PM +0100, Michal Kubecek wrote: > On Tue, Nov 17, 2020 at 04:20:14PM +0100, Antonio Cardace wrote: > > As pointed out by Michal Kubecek, getting the name > > with the previous approach was racy, it's better > > and easier to get the na

[PATCH net-next v4 4/6] selftests: extract common functions in ethtool-common.sh

2020-11-17 Thread Antonio Cardace
Factor out some useful functions so that they can be reused by other ethtool-netdevsim scripts. Signed-off-by: Antonio Cardace --- .../drivers/net/netdevsim/ethtool-common.sh | 69 +++ .../drivers/net/netdevsim/ethtool-pause.sh| 63 + 2 files changed, 71

[PATCH net-next v4 3/6] netdevsim: support ethtool ring and coalesce settings

2020-11-17 Thread Antonio Cardace
Add ethtool ring and coalesce settings support for testing. Signed-off-by: Antonio Cardace Reviewed-by: Michal Kubecek --- v3 -> v4: - move supported_coalesce_params struct field as first field - extracted pauseparam refactoring in a different patch --- drivers/net/netdevsim/ethtool.c |

[PATCH net-next v4 2/6] netdevsim: move ethtool pause params in separate struct

2020-11-17 Thread Antonio Cardace
This will help the refactoring in the next commit when coalesce and ring settings are added. Signed-off-by: Antonio Cardace Reviewed-by: Michal Kubecek --- drivers/net/netdevsim/ethtool.c | 14 +++--- drivers/net/netdevsim/netdevsim.h | 6 +- 2 files changed, 12 insertions(+), 8

[PATCH net-next v4 6/6] selftests: add ring and coalesce selftests

2020-11-17 Thread Antonio Cardace
Add scripts to test ring and coalesce settings of netdevsim. Signed-off-by: Antonio Cardace --- .../drivers/net/netdevsim/ethtool-coalesce.sh | 132 ++ .../drivers/net/netdevsim/ethtool-ring.sh | 85 +++ 2 files changed, 217 insertions(+) create mode 100755 tools

[PATCH net-next v4 1/6] ethtool: add ETHTOOL_COALESCE_ALL_PARAMS define

2020-11-17 Thread Antonio Cardace
This bitmask represents all existing coalesce parameters. Signed-off-by: Antonio Cardace Reviewed-by: Michal Kubecek --- include/linux/ethtool.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index 6408b446051f..e3da25b51ae4 100644 --- a

[PATCH net-next v4 0/6] netdevsim: add ethtool coalesce and ring settings

2020-11-17 Thread Antonio Cardace
Output of ethtool-ring.sh and ethtool-coalesce.sh selftests: # ./ethtool-ring.sh PASSED all 4 checks # ./ethtool-coalesce.sh PASSED all 22 checks Antonio Cardace (6): ethtool: add ETHTOOL_COALESCE_ALL_PARAMS define netdevsim: move ethtool pause params in separate struct netdevsim: support

[PATCH net-next v4 5/6] selftests: refactor get_netdev_name function

2020-11-17 Thread Antonio Cardace
As pointed out by Michal Kubecek, getting the name with the previous approach was racy, it's better and easier to get the name of the device with this patch's approach. Essentialy the function doesn't need to exist anymore as it's a simple 'ls' command.

Re: [PATCH net-next v3 4/4] selftests: add ring and coalesce selftests

2020-11-17 Thread Antonio Cardace
On Mon, Nov 16, 2020 at 04:45:03PM -0800, Jakub Kicinski wrote: > On Sat, 14 Nov 2020 00:16:55 +0100 Antonio Cardace wrote: > > Add scripts to test ring and coalesce settings > > of netdevsim. > > > > Signed-off-by: Antonio Cardace > > > @@ -0,0 +1,68 @@

Re: [PATCH net-next v3 3/4] selftests: extract common functions in ethtool-common.sh

2020-11-16 Thread Antonio Cardace
On Mon, Nov 16, 2020 at 05:17:02PM +0100, Michal Kubecek wrote: > On Sat, Nov 14, 2020 at 12:16:54AM +0100, Antonio Cardace wrote: > > Factor out some useful functions so that they can be reused > > by other ethtool-netdevsim scripts. > > > > Signed-off-by: Antoni

[PATCH net-next v3 4/4] selftests: add ring and coalesce selftests

2020-11-13 Thread Antonio Cardace
Add scripts to test ring and coalesce settings of netdevsim. Signed-off-by: Antonio Cardace --- .../drivers/net/netdevsim/ethtool-coalesce.sh | 68 +++ .../drivers/net/netdevsim/ethtool-ring.sh | 53 +++ 2 files changed, 121 insertions(+) create mode 100755

[PATCH net-next v3 2/4] netdevsim: support ethtool ring and coalesce settings

2020-11-13 Thread Antonio Cardace
Add ethtool ring and coalesce settings support for testing. Signed-off-by: Antonio Cardace --- drivers/net/netdevsim/ethtool.c | 82 ++- drivers/net/netdevsim/netdevsim.h | 9 +++- 2 files changed, 79 insertions(+), 12 deletions(-) diff --git a/drivers/net

[PATCH net-next v3 3/4] selftests: extract common functions in ethtool-common.sh

2020-11-13 Thread Antonio Cardace
Factor out some useful functions so that they can be reused by other ethtool-netdevsim scripts. Signed-off-by: Antonio Cardace --- .../drivers/net/netdevsim/ethtool-common.sh | 69 +++ .../drivers/net/netdevsim/ethtool-pause.sh| 63 + 2 files changed, 71

[PATCH net-next v3 1/4] ethtool: add ETHTOOL_COALESCE_ALL_PARAMS define

2020-11-13 Thread Antonio Cardace
This bitmask represents all existing coalesce parameters. Signed-off-by: Antonio Cardace --- include/linux/ethtool.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index 6408b446051f..e3da25b51ae4 100644 --- a/include/linux/ethtool.h +++ b

[PATCH net-next v2 4/4] selftests: add ring and coalesce selftests

2020-11-13 Thread Antonio Cardace
Add scripts to test ring and coalesce settings of netdevsim. Signed-off-by: Antonio Cardace --- .../drivers/net/netdevsim/ethtool-coalesce.sh | 68 +++ .../drivers/net/netdevsim/ethtool-ring.sh | 53 +++ 2 files changed, 121 insertions(+) create mode 100755

[PATCH net-next v2 2/4] netdevsim: support ethtool ring and coalesce settings

2020-11-13 Thread Antonio Cardace
Add ethtool ring and coalesce settings support for testing. Signed-off-by: Antonio Cardace --- drivers/net/netdevsim/ethtool.c | 78 ++- drivers/net/netdevsim/netdevsim.h | 9 +++- 2 files changed, 75 insertions(+), 12 deletions(-) diff --git a/drivers/net

[PATCH net-next v2 1/4] ethtool: add ETHTOOL_COALESCE_ALL_PARAMS define

2020-11-13 Thread Antonio Cardace
This bitmask represents all existing coalesce parameters. Signed-off-by: Antonio Cardace --- include/linux/ethtool.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index 6408b446051f..e3da25b51ae4 100644 --- a/include/linux/ethtool.h +++ b

[PATCH net-next v2 3/4] selftests: extract common functions in ethtool-common.sh

2020-11-13 Thread Antonio Cardace
Factor out some useful functions so that they can be reused by other ethtool-netdevsim scripts. Signed-off-by: Antonio Cardace --- .../drivers/net/netdevsim/ethtool-common.sh | 69 +++ .../drivers/net/netdevsim/ethtool-pause.sh| 63 + 2 files changed, 71

Re: [PATCH net-next 1/1] netdevsim: support ethtool ring and coalesce settings

2020-11-13 Thread Antonio Cardace
On Fri, Nov 13, 2020 at 12:45:22PM +0100, Michal Kubecek wrote: > On Thu, Nov 12, 2020 at 04:12:29PM +0100, Antonio Cardace wrote: > > Add ethtool ring and coalesce settings support for testing. > > > > Signed-off-by: Antonio Cardace > > --- > > drive

[PATCH net-next 1/1] netdevsim: support ethtool ring and coalesce settings

2020-11-12 Thread Antonio Cardace
Add ethtool ring and coalesce settings support for testing. Signed-off-by: Antonio Cardace --- drivers/net/netdevsim/ethtool.c | 65 +++ drivers/net/netdevsim/netdevsim.h | 9 - 2 files changed, 65 insertions(+), 9 deletions(-) diff --git a/drivers/net