All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] testsuite/smokey: net: load rtnet module if it has not been loaded
@ 2021-08-04  2:47 Hongzhan Chen
  2021-08-04  2:47 ` [PATCH 2/2] testsuite/smokey: net_client: skip late packet error in vm mode Hongzhan Chen
  2021-08-04 10:17 ` [PATCH 1/2] testsuite/smokey: net: load rtnet module if it has not been loaded Jan Kiszka
  0 siblings, 2 replies; 7+ messages in thread
From: Hongzhan Chen @ 2021-08-04  2:47 UTC (permalink / raw)
  To: xenomai

Before checking net config, rtnet should be ready.

Signed-off-by: Hongzhan Chen <hongzhan.chen@intel.com>

diff --git a/testsuite/smokey/net_common/setup.c b/testsuite/smokey/net_common/setup.c
index 1badabdfb..719d8175f 100644
--- a/testsuite/smokey/net_common/setup.c
+++ b/testsuite/smokey/net_common/setup.c
@@ -408,6 +408,14 @@ int smokey_net_setup(const char *driver, const char *intf, int tested_config,
 	struct sockaddr_in *in_peer = vpeer;
 	struct sockaddr *peer = vpeer;
 
+	err = access("/dev/rtnet", F_OK);
+	if (err) {
+		/* device does not exist and load rtnet*/
+		err = smokey_net_modprobe(MODID_RTNET);
+		if (err < 0)
+			return err;
+	}
+
 	err = cobalt_corectl(_CC_COBALT_GET_NET_CONFIG,
 			&net_config, sizeof(net_config));
 	if (err == -EINVAL)
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] testsuite/smokey: net_client: skip late packet error in vm mode
  2021-08-04  2:47 [PATCH 1/2] testsuite/smokey: net: load rtnet module if it has not been loaded Hongzhan Chen
@ 2021-08-04  2:47 ` Hongzhan Chen
  2021-08-04 10:20   ` Jan Kiszka
  2021-08-04 10:17 ` [PATCH 1/2] testsuite/smokey: net: load rtnet module if it has not been loaded Jan Kiszka
  1 sibling, 1 reply; 7+ messages in thread
From: Hongzhan Chen @ 2021-08-04  2:47 UTC (permalink / raw)
  To: xenomai

In vm mode, skip late packet error in functional test to avoid
test failure.

Signed-off-by: Hongzhan Chen <hongzhan.chen@intel.com>

diff --git a/testsuite/smokey/net_common/client.c b/testsuite/smokey/net_common/client.c
index d13d72918..752ea55ed 100644
--- a/testsuite/smokey/net_common/client.c
+++ b/testsuite/smokey/net_common/client.c
@@ -204,7 +204,7 @@ static int smokey_net_client_loop(struct smokey_net_client *client)
 		} while (err != -ETIMEDOUT);
 	}
 
-	if (glost || glate)
+	if (glost || (!smokey_on_vm && glate))
 		fprintf(stderr, "RTnet %s test failed", client->name);
 	if (glost) {
 		if (glost == limit)
@@ -214,11 +214,11 @@ static int smokey_net_client_loop(struct smokey_net_client *client)
 			fprintf(stderr, ", %Lu packets lost (%g %%)",
 				glost, 100.0 * glost / limit);
 	}
-	if (glate)
+	if (!smokey_on_vm && glate)
 		fprintf(stderr, ", %Lu overruns", glate);
 	if (glost || glate)
 		fputc('\n', stderr);
-	err = glost || glate ? -EPROTO : 0;
+	err = glost || (!smokey_on_vm && glate) ? -EPROTO : 0;
 
   err:
 	sock = smokey_check_errno(__RT(close(sock)));
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] testsuite/smokey: net: load rtnet module if it has not been loaded
  2021-08-04  2:47 [PATCH 1/2] testsuite/smokey: net: load rtnet module if it has not been loaded Hongzhan Chen
  2021-08-04  2:47 ` [PATCH 2/2] testsuite/smokey: net_client: skip late packet error in vm mode Hongzhan Chen
@ 2021-08-04 10:17 ` Jan Kiszka
  1 sibling, 0 replies; 7+ messages in thread
From: Jan Kiszka @ 2021-08-04 10:17 UTC (permalink / raw)
  To: Hongzhan Chen, xenomai

On 04.08.21 04:47, Hongzhan Chen via Xenomai wrote:
> Before checking net config, rtnet should be ready.
> 
> Signed-off-by: Hongzhan Chen <hongzhan.chen@intel.com>
> 
> diff --git a/testsuite/smokey/net_common/setup.c b/testsuite/smokey/net_common/setup.c
> index 1badabdfb..719d8175f 100644
> --- a/testsuite/smokey/net_common/setup.c
> +++ b/testsuite/smokey/net_common/setup.c
> @@ -408,6 +408,14 @@ int smokey_net_setup(const char *driver, const char *intf, int tested_config,
>  	struct sockaddr_in *in_peer = vpeer;
>  	struct sockaddr *peer = vpeer;
>  
> +	err = access("/dev/rtnet", F_OK);

Not needed. smokey_net_modprobe() checks /proc/modules and loads only if
the module is missing.

> +	if (err) {
> +		/* device does not exist and load rtnet*/
> +		err = smokey_net_modprobe(MODID_RTNET);
> +		if (err < 0)
> +			return err;
> +	}
> +
>  	err = cobalt_corectl(_CC_COBALT_GET_NET_CONFIG,
>  			&net_config, sizeof(net_config));
>  	if (err == -EINVAL)
> 

Jan

-- 
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] testsuite/smokey: net_client: skip late packet error in vm mode
  2021-08-04  2:47 ` [PATCH 2/2] testsuite/smokey: net_client: skip late packet error in vm mode Hongzhan Chen
@ 2021-08-04 10:20   ` Jan Kiszka
  2021-08-05  0:39     ` Chen, Hongzhan
  0 siblings, 1 reply; 7+ messages in thread
From: Jan Kiszka @ 2021-08-04 10:20 UTC (permalink / raw)
  To: Hongzhan Chen, xenomai

On 04.08.21 04:47, Hongzhan Chen via Xenomai wrote:
> In vm mode, skip late packet error in functional test to avoid
> test failure.
> 
> Signed-off-by: Hongzhan Chen <hongzhan.chen@intel.com>
> 
> diff --git a/testsuite/smokey/net_common/client.c b/testsuite/smokey/net_common/client.c
> index d13d72918..752ea55ed 100644
> --- a/testsuite/smokey/net_common/client.c
> +++ b/testsuite/smokey/net_common/client.c
> @@ -204,7 +204,7 @@ static int smokey_net_client_loop(struct smokey_net_client *client)
>  		} while (err != -ETIMEDOUT);
>  	}
>  
> -	if (glost || glate)
> +	if (glost || (!smokey_on_vm && glate))
>  		fprintf(stderr, "RTnet %s test failed", client->name);
>  	if (glost) {
>  		if (glost == limit)
> @@ -214,11 +214,11 @@ static int smokey_net_client_loop(struct smokey_net_client *client)
>  			fprintf(stderr, ", %Lu packets lost (%g %%)",
>  				glost, 100.0 * glost / limit);
>  	}
> -	if (glate)
> +	if (!smokey_on_vm && glate)
>  		fprintf(stderr, ", %Lu overruns", glate);

I think we can keep this report, just not mark the test failed in case
of smokey_on_vm.

>  	if (glost || glate)
>  		fputc('\n', stderr);
> -	err = glost || glate ? -EPROTO : 0;
> +	err = glost || (!smokey_on_vm && glate) ? -EPROTO : 0;
>  
>    err:
>  	sock = smokey_check_errno(__RT(close(sock)));
> 

Jan

-- 
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux


^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH 2/2] testsuite/smokey: net_client: skip late packet error in vm mode
  2021-08-04 10:20   ` Jan Kiszka
@ 2021-08-05  0:39     ` Chen, Hongzhan
  2021-08-05  5:01       ` Jan Kiszka
  0 siblings, 1 reply; 7+ messages in thread
From: Chen, Hongzhan @ 2021-08-05  0:39 UTC (permalink / raw)
  To: Jan Kiszka, xenomai



>-----Original Message-----
>From: Jan Kiszka <jan.kiszka@siemens.com> 
>Sent: Wednesday, August 4, 2021 6:20 PM
>To: Chen, Hongzhan <hongzhan.chen@intel.com>; xenomai@xenomai.org
>Subject: Re: [PATCH 2/2] testsuite/smokey: net_client: skip late packet error in vm mode
>
>On 04.08.21 04:47, Hongzhan Chen via Xenomai wrote:
>> In vm mode, skip late packet error in functional test to avoid
>> test failure.
>> 
>> Signed-off-by: Hongzhan Chen <hongzhan.chen@intel.com>
>> 
>> diff --git a/testsuite/smokey/net_common/client.c b/testsuite/smokey/net_common/client.c
>> index d13d72918..752ea55ed 100644
>> --- a/testsuite/smokey/net_common/client.c
>> +++ b/testsuite/smokey/net_common/client.c
>> @@ -204,7 +204,7 @@ static int smokey_net_client_loop(struct smokey_net_client *client)
>>  		} while (err != -ETIMEDOUT);
>>  	}
>>  
>> -	if (glost || glate)
>> +	if (glost || (!smokey_on_vm && glate))
>>  		fprintf(stderr, "RTnet %s test failed", client->name);
>>  	if (glost) {
>>  		if (glost == limit)
>> @@ -214,11 +214,11 @@ static int smokey_net_client_loop(struct smokey_net_client *client)
>>  			fprintf(stderr, ", %Lu packets lost (%g %%)",
>>  				glost, 100.0 * glost / limit);
>>  	}
>> -	if (glate)
>> +	if (!smokey_on_vm && glate)
>>  		fprintf(stderr, ", %Lu overruns", glate);
>
>I think we can keep this report, just not mark the test failed in case
>of smokey_on_vm.

But this string printed out here looks like ugly  in case of smokey_on_vm., do we need to change something ?
How about :

if (!smokey_on_vm && glate)
          fprintf(stderr, "there is %Lu overruns", glate);
else if (glate)
         fprintf(stderr, ", %Lu overruns", glate);

>
>>  	if (glost || glate)
>>  		fputc('\n', stderr);
>> -	err = glost || glate ? -EPROTO : 0;
>> +	err = glost || (!smokey_on_vm && glate) ? -EPROTO : 0;
>>  
>>    err:
>>  	sock = smokey_check_errno(__RT(close(sock)));
>> 
>
>Jan
>
>-- 
>Siemens AG, T RDA IOT
>Corporate Competence Center Embedded Linux

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] testsuite/smokey: net_client: skip late packet error in vm mode
  2021-08-05  0:39     ` Chen, Hongzhan
@ 2021-08-05  5:01       ` Jan Kiszka
  2021-08-06  7:41         ` Jan Kiszka
  0 siblings, 1 reply; 7+ messages in thread
From: Jan Kiszka @ 2021-08-05  5:01 UTC (permalink / raw)
  To: Chen, Hongzhan, xenomai

On 05.08.21 02:39, Chen, Hongzhan wrote:
> 
> 
>> -----Original Message-----
>> From: Jan Kiszka <jan.kiszka@siemens.com> 
>> Sent: Wednesday, August 4, 2021 6:20 PM
>> To: Chen, Hongzhan <hongzhan.chen@intel.com>; xenomai@xenomai.org
>> Subject: Re: [PATCH 2/2] testsuite/smokey: net_client: skip late packet error in vm mode
>>
>> On 04.08.21 04:47, Hongzhan Chen via Xenomai wrote:
>>> In vm mode, skip late packet error in functional test to avoid
>>> test failure.
>>>
>>> Signed-off-by: Hongzhan Chen <hongzhan.chen@intel.com>
>>>
>>> diff --git a/testsuite/smokey/net_common/client.c b/testsuite/smokey/net_common/client.c
>>> index d13d72918..752ea55ed 100644
>>> --- a/testsuite/smokey/net_common/client.c
>>> +++ b/testsuite/smokey/net_common/client.c
>>> @@ -204,7 +204,7 @@ static int smokey_net_client_loop(struct smokey_net_client *client)
>>>  		} while (err != -ETIMEDOUT);
>>>  	}
>>>  
>>> -	if (glost || glate)
>>> +	if (glost || (!smokey_on_vm && glate))
>>>  		fprintf(stderr, "RTnet %s test failed", client->name);
>>>  	if (glost) {
>>>  		if (glost == limit)
>>> @@ -214,11 +214,11 @@ static int smokey_net_client_loop(struct smokey_net_client *client)
>>>  			fprintf(stderr, ", %Lu packets lost (%g %%)",
>>>  				glost, 100.0 * glost / limit);
>>>  	}
>>> -	if (glate)
>>> +	if (!smokey_on_vm && glate)
>>>  		fprintf(stderr, ", %Lu overruns", glate);
>>
>> I think we can keep this report, just not mark the test failed in case
>> of smokey_on_vm.
> 
> But this string printed out here looks like ugly  in case of smokey_on_vm., do we need to change something ?
> How about :
> 
> if (!smokey_on_vm && glate)
>           fprintf(stderr, "there is %Lu overruns", glate);
> else if (glate)
>          fprintf(stderr, ", %Lu overruns", glate);
> 

Hmm, what is the difference?

Jan

-- 
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] testsuite/smokey: net_client: skip late packet error in vm mode
  2021-08-05  5:01       ` Jan Kiszka
@ 2021-08-06  7:41         ` Jan Kiszka
  0 siblings, 0 replies; 7+ messages in thread
From: Jan Kiszka @ 2021-08-06  7:41 UTC (permalink / raw)
  To: Chen, Hongzhan, xenomai

On 05.08.21 07:01, Jan Kiszka via Xenomai wrote:
> On 05.08.21 02:39, Chen, Hongzhan wrote:
>>
>>
>>> -----Original Message-----
>>> From: Jan Kiszka <jan.kiszka@siemens.com> 
>>> Sent: Wednesday, August 4, 2021 6:20 PM
>>> To: Chen, Hongzhan <hongzhan.chen@intel.com>; xenomai@xenomai.org
>>> Subject: Re: [PATCH 2/2] testsuite/smokey: net_client: skip late packet error in vm mode
>>>
>>> On 04.08.21 04:47, Hongzhan Chen via Xenomai wrote:
>>>> In vm mode, skip late packet error in functional test to avoid
>>>> test failure.
>>>>
>>>> Signed-off-by: Hongzhan Chen <hongzhan.chen@intel.com>
>>>>
>>>> diff --git a/testsuite/smokey/net_common/client.c b/testsuite/smokey/net_common/client.c
>>>> index d13d72918..752ea55ed 100644
>>>> --- a/testsuite/smokey/net_common/client.c
>>>> +++ b/testsuite/smokey/net_common/client.c
>>>> @@ -204,7 +204,7 @@ static int smokey_net_client_loop(struct smokey_net_client *client)
>>>>  		} while (err != -ETIMEDOUT);
>>>>  	}
>>>>  
>>>> -	if (glost || glate)
>>>> +	if (glost || (!smokey_on_vm && glate))
>>>>  		fprintf(stderr, "RTnet %s test failed", client->name);
>>>>  	if (glost) {
>>>>  		if (glost == limit)
>>>> @@ -214,11 +214,11 @@ static int smokey_net_client_loop(struct smokey_net_client *client)
>>>>  			fprintf(stderr, ", %Lu packets lost (%g %%)",
>>>>  				glost, 100.0 * glost / limit);
>>>>  	}
>>>> -	if (glate)
>>>> +	if (!smokey_on_vm && glate)
>>>>  		fprintf(stderr, ", %Lu overruns", glate);
>>>
>>> I think we can keep this report, just not mark the test failed in case
>>> of smokey_on_vm.
>>
>> But this string printed out here looks like ugly  in case of smokey_on_vm., do we need to change something ?
>> How about :
>>
>> if (!smokey_on_vm && glate)
>>           fprintf(stderr, "there is %Lu overruns", glate);
>> else if (glate)
>>          fprintf(stderr, ", %Lu overruns", glate);
>>
> 
> Hmm, what is the difference?
> 

OK, sorry, now I see the relevance. Applied this one.

Thanks,
Jan

-- 
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-08-06  7:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-04  2:47 [PATCH 1/2] testsuite/smokey: net: load rtnet module if it has not been loaded Hongzhan Chen
2021-08-04  2:47 ` [PATCH 2/2] testsuite/smokey: net_client: skip late packet error in vm mode Hongzhan Chen
2021-08-04 10:20   ` Jan Kiszka
2021-08-05  0:39     ` Chen, Hongzhan
2021-08-05  5:01       ` Jan Kiszka
2021-08-06  7:41         ` Jan Kiszka
2021-08-04 10:17 ` [PATCH 1/2] testsuite/smokey: net: load rtnet module if it has not been loaded Jan Kiszka

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.