>-----Original Message-----
>From: Jan Kiszka <jan.kis...@siemens.com> 
>Sent: Thursday, August 5, 2021 1:01 PM
>To: Chen, Hongzhan <hongzhan.c...@intel.com>; xenomai@xenomai.org
>Subject: Re: [PATCH V2] testsuite/smokey: net: load rtnet module if it has not 
>been loaded
>
>On 05.08.21 05:13, Hongzhan Chen via Xenomai wrote:
>> Before checking net config, rtnet should be ready.
>> 
>> Signed-off-by: Hongzhan Chen <hongzhan.c...@intel.com>
>> 
>> diff --git a/testsuite/smokey/net_common/setup.c 
>> b/testsuite/smokey/net_common/setup.c
>> index 1badabdfb..a0512b00d 100644
>> --- a/testsuite/smokey/net_common/setup.c
>> +++ b/testsuite/smokey/net_common/setup.c
>> @@ -408,6 +408,10 @@ int smokey_net_setup(const char *driver, const char 
>> *intf, int tested_config,
>>      struct sockaddr_in *in_peer = vpeer;
>>      struct sockaddr *peer = vpeer;
>>  
>> +    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)
>> 
>
>Sorry, only realized now: The checks that come right after this should
>not be affected by rtnet being loaded or not yet. I think they check

No. Actually, it would be affected. If rtnet is not loaded and inited before 
cobalt_corectl is called, it would 
not call rtnet_corectl_register to cobalt_add_config_chain and 
config_notifier_list would
be empty.  And then cobalt_corectl ->do_conf_option would return -EINVAL 
because blocking_notifier_call_chain return NOTIFY_DONE.
In smokey_net_setup, it would return -ENOSYS because  cobalt_corectl return 
-EINVAL. 

Regards

Hongzhan Chen

>whether it is configured and could be loaded. If we try to load when it
>is not configured, the test case will fail rather than be skipped.
>Please check and reorder the modprobe accordingly.
>
>Jan
>
>-- 
>Siemens AG, T RDA IOT
>Corporate Competence Center Embedded Linux

Reply via email to