Re: [vpp-dev] vl_api_sw_interface_dump problem

2018-09-11 Thread emma sdi
I Have another idea, if we do not call
vnet_hw_interface_set_flags(...,VNET_HW_INTERFACE_FLAG_LINK_UP)
in dpdk_interface_admin_up_down function, flags will update appropriately
in dpdk_update_link_state function.
My patch 

On Mon, Sep 10, 2018 at 4:35 PM emma sdi  wrote:

> I tested your patch, bug still exists.
>
> On Mon, Sep 10, 2018 at 4:22 PM Damjan Marion  wrote:
>
>> Can you please try this patch:
>>
>> https://paste.ubuntu.com/p/GtqHd2yWqK/
>>
>> --
>> Damjan
>>
>> On 10 Sep 2018, at 13:44, khers  wrote:
>>
>> Dear Damjan
>>
>> This is output  of 'show
>> event-logger' before the problem.
>> I set GigabitEthernet0/4/0 interface up, then call dump_sw_interface api
>> in a c program.
>> duplex an speed is not accurate.
>> Outout  of 'show event-loger'
>> after I saw the bug.
>>
>> footnote: output of 'git diff' 
>> Cheers
>>
>> On Sun, Sep 9, 2018 at 2:47 PM Damjan Marion  wrote:
>>
>>>
>>> Dear Emma, Chore,
>>>
>>> Patch 14647 is not valid solution to the problem.
>>> DPDK_DEVICE_FLAG_ADMIN_UP is not valid hw interface flag.
>>> From that code section, you can see that dpdk_update_link_state()
>>> function is called which is supposed to update link speed and duplex after
>>> link goes up.
>>>
>>> Can you change LINK_STATE_ELOGS  in src/plugins/dpdk/device/init.c to 1,
>>> recompile vpp and capture link state events with "show event-logger" after
>>> problem happens?
>>>
>>> --
>>> Damjan
>>>
>>> On 9 Sep 2018, at 08:50, emma sdi  wrote:
>>>
>>> Dear community
>>>
>>> I have the same problem, and commit this suggestion in
>>> https://gerrit.fd.io/r/#/c/14647/.
>>> Please someone review this code, it seems OK to me.
>>>
>>> Cheers,
>>> Khers
>>>
>>> On Mon, Sep 3, 2018 at 12:18 PM sadjad  wrote:
>>>
 Hi Dear VPP
 I tried to solve this problem. so i changed device.c in dpdk plugin as
 you can see below:

 On branch stable/1807
 Your branch is up-to-date with 'origin/stable/1807'.
 Changes not staged for commit:

 modified:   src/plugins/dpdk/device/device.c

 diff --git a/src/plugins/dpdk/device/device.c
 b/src/plugins/dpdk/device/device.c
 index d5ab2585..159a395e 100644
 --- a/src/plugins/dpdk/device/device.c
 +++ b/src/plugins/dpdk/device/device.c
 @@ -547,11 +547,12 @@ dpdk_interface_admin_up_down (vnet_main_t * vnm,
 u32 hw_if_index, u32 flags)

if (xd->flags & DPDK_DEVICE_FLAG_PMD_INIT_FAIL)
  return clib_error_return (0, "Interface not initialized");
 -
 +  u32 hw_flags = hif->flags;
if (is_up)
  {
 + hw_flags |= DPDK_DEVICE_FLAG_ADMIN_UP;
vnet_hw_interface_set_flags (vnm, xd->hw_if_index,
 -  VNET_HW_INTERFACE_FLAG_LINK_UP);
 +  hw_flags);
if ((xd->flags & DPDK_DEVICE_FLAG_ADMIN_UP) == 0)
 dpdk_device_start (xd);
xd->flags |= DPDK_DEVICE_FLAG_ADMIN_UP;
 @@ -561,7 +562,8 @@ dpdk_interface_admin_up_down (vnet_main_t * vnm,
 u32 hw_if_index, u32 flags)
  }
else
  {
 -  vnet_hw_interface_set_flags (vnm, xd->hw_if_index, 0);
 + hw_flags &= ~DPDK_DEVICE_FLAG_ADMIN_UP;
 +  vnet_hw_interface_set_flags (vnm, xd->hw_if_index, hw_flags);
if ((xd->flags & DPDK_DEVICE_FLAG_ADMIN_UP) != 0)
 dpdk_device_stop (xd);
xd->flags &= ~DPDK_DEVICE_FLAG_ADMIN_UP;

 and problem is fixed. what is your idea?

 Best Regards

 On Mon, Sep 3, 2018 at 5:54 AM chore  wrote:

> Hi Dear VPP
> I wrote a small api client like vpp_api_test that contains
> sw_interface_dump api. when i was trying to use this api client i faced a
> problem in "stable/1807".
> At first i disconnected one of my links and my api client printed
> below output:
>
> GigabitEthernet0/9/0 duplex half speed 0
> admin: down
> link: down
>
> Then i connected the link and got this:
>
> GigabitEthernet0/9/0 duplex full speed 1000
> admin: down
> link: down
>
> At the end i changed admin status of link and saw below output:
>
> GigabitEthernet0/9/0 duplex bogus speed 0
> admin: up
> link: up
>
> and show hardware-interface GigabitEthernet0/9/0:
>   NameIdx   Link  Hardware
> GigabitEthernet0/9/0   2 up   GigabitEthernet0/9/0
>   Ethernet address 08:00:27:94:50:ba
>   Intel 82540EM (e1000)
> carrier up full duplex speed 1000 mtu 9202
> flags: admin-up pmd maybe-multiseg tx-offload intel-phdr-cksum
> rx queues 1, rx desc 1024, tx queues 1, tx desc 1024
> cpu socket 0
>
> based on last results, it seems to be a problem in

Re: [vpp-dev] vl_api_sw_interface_dump problem

2018-09-10 Thread emma sdi
I tested your patch, bug still exists.

On Mon, Sep 10, 2018 at 4:22 PM Damjan Marion  wrote:

> Can you please try this patch:
>
> https://paste.ubuntu.com/p/GtqHd2yWqK/
>
> --
> Damjan
>
> On 10 Sep 2018, at 13:44, khers  wrote:
>
> Dear Damjan
>
> This is output  of 'show
> event-logger' before the problem.
> I set GigabitEthernet0/4/0 interface up, then call dump_sw_interface api
> in a c program.
> duplex an speed is not accurate.
> Outout  of 'show event-loger'
> after I saw the bug.
>
> footnote: output of 'git diff' 
> Cheers
>
> On Sun, Sep 9, 2018 at 2:47 PM Damjan Marion  wrote:
>
>>
>> Dear Emma, Chore,
>>
>> Patch 14647 is not valid solution to the problem.
>> DPDK_DEVICE_FLAG_ADMIN_UP is not valid hw interface flag.
>> From that code section, you can see that dpdk_update_link_state()
>> function is called which is supposed to update link speed and duplex after
>> link goes up.
>>
>> Can you change LINK_STATE_ELOGS  in src/plugins/dpdk/device/init.c to 1,
>> recompile vpp and capture link state events with "show event-logger" after
>> problem happens?
>>
>> --
>> Damjan
>>
>> On 9 Sep 2018, at 08:50, emma sdi  wrote:
>>
>> Dear community
>>
>> I have the same problem, and commit this suggestion in
>> https://gerrit.fd.io/r/#/c/14647/.
>> Please someone review this code, it seems OK to me.
>>
>> Cheers,
>> Khers
>>
>> On Mon, Sep 3, 2018 at 12:18 PM sadjad  wrote:
>>
>>> Hi Dear VPP
>>> I tried to solve this problem. so i changed device.c in dpdk plugin as
>>> you can see below:
>>>
>>> On branch stable/1807
>>> Your branch is up-to-date with 'origin/stable/1807'.
>>> Changes not staged for commit:
>>>
>>> modified:   src/plugins/dpdk/device/device.c
>>>
>>> diff --git a/src/plugins/dpdk/device/device.c
>>> b/src/plugins/dpdk/device/device.c
>>> index d5ab2585..159a395e 100644
>>> --- a/src/plugins/dpdk/device/device.c
>>> +++ b/src/plugins/dpdk/device/device.c
>>> @@ -547,11 +547,12 @@ dpdk_interface_admin_up_down (vnet_main_t * vnm,
>>> u32 hw_if_index, u32 flags)
>>>
>>>if (xd->flags & DPDK_DEVICE_FLAG_PMD_INIT_FAIL)
>>>  return clib_error_return (0, "Interface not initialized");
>>> -
>>> +  u32 hw_flags = hif->flags;
>>>if (is_up)
>>>  {
>>> + hw_flags |= DPDK_DEVICE_FLAG_ADMIN_UP;
>>>vnet_hw_interface_set_flags (vnm, xd->hw_if_index,
>>> -  VNET_HW_INTERFACE_FLAG_LINK_UP);
>>> +  hw_flags);
>>>if ((xd->flags & DPDK_DEVICE_FLAG_ADMIN_UP) == 0)
>>> dpdk_device_start (xd);
>>>xd->flags |= DPDK_DEVICE_FLAG_ADMIN_UP;
>>> @@ -561,7 +562,8 @@ dpdk_interface_admin_up_down (vnet_main_t * vnm, u32
>>> hw_if_index, u32 flags)
>>>  }
>>>else
>>>  {
>>> -  vnet_hw_interface_set_flags (vnm, xd->hw_if_index, 0);
>>> + hw_flags &= ~DPDK_DEVICE_FLAG_ADMIN_UP;
>>> +  vnet_hw_interface_set_flags (vnm, xd->hw_if_index, hw_flags);
>>>if ((xd->flags & DPDK_DEVICE_FLAG_ADMIN_UP) != 0)
>>> dpdk_device_stop (xd);
>>>xd->flags &= ~DPDK_DEVICE_FLAG_ADMIN_UP;
>>>
>>> and problem is fixed. what is your idea?
>>>
>>> Best Regards
>>>
>>> On Mon, Sep 3, 2018 at 5:54 AM chore  wrote:
>>>
 Hi Dear VPP
 I wrote a small api client like vpp_api_test that contains
 sw_interface_dump api. when i was trying to use this api client i faced a
 problem in "stable/1807".
 At first i disconnected one of my links and my api client printed below
 output:

 GigabitEthernet0/9/0 duplex half speed 0
 admin: down
 link: down

 Then i connected the link and got this:

 GigabitEthernet0/9/0 duplex full speed 1000
 admin: down
 link: down

 At the end i changed admin status of link and saw below output:

 GigabitEthernet0/9/0 duplex bogus speed 0
 admin: up
 link: up

 and show hardware-interface GigabitEthernet0/9/0:
   NameIdx   Link  Hardware
 GigabitEthernet0/9/0   2 up   GigabitEthernet0/9/0
   Ethernet address 08:00:27:94:50:ba
   Intel 82540EM (e1000)
 carrier up full duplex speed 1000 mtu 9202
 flags: admin-up pmd maybe-multiseg tx-offload intel-phdr-cksum
 rx queues 1, rx desc 1024, tx queues 1, tx desc 1024
 cpu socket 0

 based on last results, it seems to be a problem in
 vl_api_sw_interface_dump.
 If I want to describe this problem more, I have to say that 'duplex'
 and 'speed' api returned values are wrong. however you can see correct
 values in  "show hardware-interface" cli output.

 In addition, GDB output shows that both 'speed' and 'duplex' are zero
 in replied mp.

 Breakpoint 1, vl_api_sw_interface_details_t_handler (mp=0x3005eabc) at
 interface-api.c:24
 24  int 

Re: [vpp-dev] vl_api_sw_interface_dump problem

2018-09-10 Thread Damjan Marion via Lists.Fd.Io
Can you please try this patch:

https://paste.ubuntu.com/p/GtqHd2yWqK/

-- 
Damjan

> On 10 Sep 2018, at 13:44, khers  wrote:
> 
> Dear Damjan
> 
> This is output  of 'show 
> event-logger' before the problem.
> I set GigabitEthernet0/4/0 interface up, then call dump_sw_interface api in a 
> c program. 
> duplex an speed is not accurate.
> Outout  of 'show event-loger' after I 
> saw the bug.
> 
> footnote: output of 'git diff' 
> Cheers
> 
> On Sun, Sep 9, 2018 at 2:47 PM Damjan Marion  > wrote:
> 
> Dear Emma, Chore,
> 
> Patch 14647 is not valid solution to the problem. DPDK_DEVICE_FLAG_ADMIN_UP 
> is not valid hw interface flag.
> From that code section, you can see that dpdk_update_link_state() function is 
> called which is supposed to update link speed and duplex after link goes up.
> 
> Can you change LINK_STATE_ELOGS  in src/plugins/dpdk/device/init.c to 1, 
> recompile vpp and capture link state events with "show event-logger" after 
> problem happens?
> 
> -- 
> Damjan
> 
>> On 9 Sep 2018, at 08:50, emma sdi > > wrote:
>> 
>> Dear community
>> 
>> I have the same problem, and commit this suggestion in 
>> https://gerrit.fd.io/r/#/c/14647/ .
>> Please someone review this code, it seems OK to me.
>> 
>> Cheers,
>> Khers
>> 
>> On Mon, Sep 3, 2018 at 12:18 PM sadjad > > wrote:
>> Hi Dear VPP
>> I tried to solve this problem. so i changed device.c in dpdk plugin as you 
>> can see below:
>> 
>> On branch stable/1807
>> Your branch is up-to-date with 'origin/stable/1807'.
>> Changes not staged for commit:
>> 
>> modified:   src/plugins/dpdk/device/device.c
>> 
>> diff --git a/src/plugins/dpdk/device/device.c 
>> b/src/plugins/dpdk/device/device.c
>> index d5ab2585..159a395e 100644
>> --- a/src/plugins/dpdk/device/device.c
>> +++ b/src/plugins/dpdk/device/device.c
>> @@ -547,11 +547,12 @@ dpdk_interface_admin_up_down (vnet_main_t * vnm, u32 
>> hw_if_index, u32 flags)
>>  
>>if (xd->flags & DPDK_DEVICE_FLAG_PMD_INIT_FAIL)
>>  return clib_error_return (0, "Interface not initialized");
>> -
>> +  u32 hw_flags = hif->flags;
>>if (is_up)
>>  {
>> + hw_flags |= DPDK_DEVICE_FLAG_ADMIN_UP;
>>vnet_hw_interface_set_flags (vnm, xd->hw_if_index,
>> -  VNET_HW_INTERFACE_FLAG_LINK_UP);
>> +  hw_flags);
>>if ((xd->flags & DPDK_DEVICE_FLAG_ADMIN_UP) == 0)
>> dpdk_device_start (xd);
>>xd->flags |= DPDK_DEVICE_FLAG_ADMIN_UP;
>> @@ -561,7 +562,8 @@ dpdk_interface_admin_up_down (vnet_main_t * vnm, u32 
>> hw_if_index, u32 flags)
>>  }
>>else
>>  {
>> -  vnet_hw_interface_set_flags (vnm, xd->hw_if_index, 0);
>> + hw_flags &= ~DPDK_DEVICE_FLAG_ADMIN_UP;
>> +  vnet_hw_interface_set_flags (vnm, xd->hw_if_index, hw_flags);
>>if ((xd->flags & DPDK_DEVICE_FLAG_ADMIN_UP) != 0)
>> dpdk_device_stop (xd);
>>xd->flags &= ~DPDK_DEVICE_FLAG_ADMIN_UP;
>> 
>> and problem is fixed. what is your idea?
>> 
>> Best Regards
>> 
>> On Mon, Sep 3, 2018 at 5:54 AM chore > > wrote:
>> Hi Dear VPP
>> I wrote a small api client like vpp_api_test that contains sw_interface_dump 
>> api. when i was trying to use this api client i faced a problem in 
>> "stable/1807".
>> At first i disconnected one of my links and my api client printed below 
>> output:
>>  
>> GigabitEthernet0/9/0 duplex half speed 0
>> admin: down
>> link: down
>> 
>> Then i connected the link and got this:
>> 
>> GigabitEthernet0/9/0 duplex full speed 1000
>> admin: down
>> link: down
>> 
>> At the end i changed admin status of link and saw below output: 
>> 
>> GigabitEthernet0/9/0 duplex bogus speed 0
>> admin: up
>> link: up
>> 
>> and show hardware-interface GigabitEthernet0/9/0:
>>   NameIdx   Link  Hardware
>> GigabitEthernet0/9/0   2 up   GigabitEthernet0/9/0
>>   Ethernet address 08:00:27:94:50:ba
>>   Intel 82540EM (e1000)
>> carrier up full duplex speed 1000 mtu 9202
>> flags: admin-up pmd maybe-multiseg tx-offload intel-phdr-cksum
>> rx queues 1, rx desc 1024, tx queues 1, tx desc 1024
>> cpu socket 0
>> 
>> based on last results, it seems to be a problem in vl_api_sw_interface_dump.
>> If I want to describe this problem more, I have to say that 'duplex' and 
>> 'speed' api returned values are wrong. however you can see correct values in 
>>  "show hardware-interface" cli output.
>> 
>> In addition, GDB output shows that both 'speed' and 'duplex' are zero in 
>> replied mp.
>> 
>> Breakpoint 1, vl_api_sw_interface_details_t_handler (mp=0x3005eabc) at 
>> interface-api.c:24
>> 24  int speed = 0;
>> (gdb) p *mp
>> $2 = {_vl_msg_id = 21504, 

Re: [vpp-dev] vl_api_sw_interface_dump problem

2018-09-10 Thread emma sdi
Dear Damjan

This is output  of 'show
event-logger' before the problem.
I set GigabitEthernet0/4/0 interface up, then call dump_sw_interface api in
a c program.
duplex an speed is not accurate.
Outout  of 'show event-loger' after
I saw the bug.

footnote: output of 'git diff' 
Cheers

On Sun, Sep 9, 2018 at 2:47 PM Damjan Marion  wrote:

>
> Dear Emma, Chore,
>
> Patch 14647 is not valid solution to the problem.
> DPDK_DEVICE_FLAG_ADMIN_UP is not valid hw interface flag.
> From that code section, you can see that dpdk_update_link_state() function
> is called which is supposed to update link speed and duplex after link goes
> up.
>
> Can you change LINK_STATE_ELOGS  in src/plugins/dpdk/device/init.c to 1,
> recompile vpp and capture link state events with "show event-logger" after
> problem happens?
>
> --
> Damjan
>
> On 9 Sep 2018, at 08:50, emma sdi  wrote:
>
> Dear community
>
> I have the same problem, and commit this suggestion in
> https://gerrit.fd.io/r/#/c/14647/.
> Please someone review this code, it seems OK to me.
>
> Cheers,
> Khers
>
> On Mon, Sep 3, 2018 at 12:18 PM sadjad  wrote:
>
>> Hi Dear VPP
>> I tried to solve this problem. so i changed device.c in dpdk plugin as
>> you can see below:
>>
>> On branch stable/1807
>> Your branch is up-to-date with 'origin/stable/1807'.
>> Changes not staged for commit:
>>
>> modified:   src/plugins/dpdk/device/device.c
>>
>> diff --git a/src/plugins/dpdk/device/device.c
>> b/src/plugins/dpdk/device/device.c
>> index d5ab2585..159a395e 100644
>> --- a/src/plugins/dpdk/device/device.c
>> +++ b/src/plugins/dpdk/device/device.c
>> @@ -547,11 +547,12 @@ dpdk_interface_admin_up_down (vnet_main_t * vnm,
>> u32 hw_if_index, u32 flags)
>>
>>if (xd->flags & DPDK_DEVICE_FLAG_PMD_INIT_FAIL)
>>  return clib_error_return (0, "Interface not initialized");
>> -
>> +  u32 hw_flags = hif->flags;
>>if (is_up)
>>  {
>> + hw_flags |= DPDK_DEVICE_FLAG_ADMIN_UP;
>>vnet_hw_interface_set_flags (vnm, xd->hw_if_index,
>> -  VNET_HW_INTERFACE_FLAG_LINK_UP);
>> +  hw_flags);
>>if ((xd->flags & DPDK_DEVICE_FLAG_ADMIN_UP) == 0)
>> dpdk_device_start (xd);
>>xd->flags |= DPDK_DEVICE_FLAG_ADMIN_UP;
>> @@ -561,7 +562,8 @@ dpdk_interface_admin_up_down (vnet_main_t * vnm, u32
>> hw_if_index, u32 flags)
>>  }
>>else
>>  {
>> -  vnet_hw_interface_set_flags (vnm, xd->hw_if_index, 0);
>> + hw_flags &= ~DPDK_DEVICE_FLAG_ADMIN_UP;
>> +  vnet_hw_interface_set_flags (vnm, xd->hw_if_index, hw_flags);
>>if ((xd->flags & DPDK_DEVICE_FLAG_ADMIN_UP) != 0)
>> dpdk_device_stop (xd);
>>xd->flags &= ~DPDK_DEVICE_FLAG_ADMIN_UP;
>>
>> and problem is fixed. what is your idea?
>>
>> Best Regards
>>
>> On Mon, Sep 3, 2018 at 5:54 AM chore  wrote:
>>
>>> Hi Dear VPP
>>> I wrote a small api client like vpp_api_test that contains
>>> sw_interface_dump api. when i was trying to use this api client i faced a
>>> problem in "stable/1807".
>>> At first i disconnected one of my links and my api client printed below
>>> output:
>>>
>>> GigabitEthernet0/9/0 duplex half speed 0
>>> admin: down
>>> link: down
>>>
>>> Then i connected the link and got this:
>>>
>>> GigabitEthernet0/9/0 duplex full speed 1000
>>> admin: down
>>> link: down
>>>
>>> At the end i changed admin status of link and saw below output:
>>>
>>> GigabitEthernet0/9/0 duplex bogus speed 0
>>> admin: up
>>> link: up
>>>
>>> and show hardware-interface GigabitEthernet0/9/0:
>>>   NameIdx   Link  Hardware
>>> GigabitEthernet0/9/0   2 up   GigabitEthernet0/9/0
>>>   Ethernet address 08:00:27:94:50:ba
>>>   Intel 82540EM (e1000)
>>> carrier up full duplex speed 1000 mtu 9202
>>> flags: admin-up pmd maybe-multiseg tx-offload intel-phdr-cksum
>>> rx queues 1, rx desc 1024, tx queues 1, tx desc 1024
>>> cpu socket 0
>>>
>>> based on last results, it seems to be a problem in
>>> vl_api_sw_interface_dump.
>>> If I want to describe this problem more, I have to say that 'duplex' and
>>> 'speed' api returned values are wrong. however you can see correct values
>>> in  "show hardware-interface" cli output.
>>>
>>> In addition, GDB output shows that both 'speed' and 'duplex' are zero in
>>> replied mp.
>>>
>>> Breakpoint 1, vl_api_sw_interface_details_t_handler (mp=0x3005eabc) at
>>> interface-api.c:24
>>> 24  int speed = 0;
>>> (gdb) p *mp
>>> $2 = {_vl_msg_id = 21504, context = 0, sw_if_index = 33554432,
>>> sup_sw_if_index = 33554432, l2_address_length = 100663296, l2_address =
>>> "\b\000'\224P\272\000",
>>>   interface_name = "GigabitEthernet0/9/0", '\000' ,
>>> admin_up_down = 1 '\001', link_up_down = 1 '\001', link_duplex = 0 '\000',
>>>   link_speed = 0 '\000', link_mtu = 61987, 

Re: [vpp-dev] vl_api_sw_interface_dump problem

2018-09-09 Thread Damjan Marion via Lists.Fd.Io

Dear Emma, Chore,

Patch 14647 is not valid solution to the problem. DPDK_DEVICE_FLAG_ADMIN_UP is 
not valid hw interface flag.
From that code section, you can see that dpdk_update_link_state() function is 
called which is supposed to update link speed and duplex after link goes up.

Can you change LINK_STATE_ELOGS  in src/plugins/dpdk/device/init.c to 1, 
recompile vpp and capture link state events with "show event-logger" after 
problem happens?

-- 
Damjan

> On 9 Sep 2018, at 08:50, emma sdi  wrote:
> 
> Dear community
> 
> I have the same problem, and commit this suggestion in 
> https://gerrit.fd.io/r/#/c/14647/ .
> Please someone review this code, it seems OK to me.
> 
> Cheers,
> Khers
> 
> On Mon, Sep 3, 2018 at 12:18 PM sadjad  > wrote:
> Hi Dear VPP
> I tried to solve this problem. so i changed device.c in dpdk plugin as you 
> can see below:
> 
> On branch stable/1807
> Your branch is up-to-date with 'origin/stable/1807'.
> Changes not staged for commit:
> 
> modified:   src/plugins/dpdk/device/device.c
> 
> diff --git a/src/plugins/dpdk/device/device.c 
> b/src/plugins/dpdk/device/device.c
> index d5ab2585..159a395e 100644
> --- a/src/plugins/dpdk/device/device.c
> +++ b/src/plugins/dpdk/device/device.c
> @@ -547,11 +547,12 @@ dpdk_interface_admin_up_down (vnet_main_t * vnm, u32 
> hw_if_index, u32 flags)
>  
>if (xd->flags & DPDK_DEVICE_FLAG_PMD_INIT_FAIL)
>  return clib_error_return (0, "Interface not initialized");
> -
> +  u32 hw_flags = hif->flags;
>if (is_up)
>  {
> + hw_flags |= DPDK_DEVICE_FLAG_ADMIN_UP;
>vnet_hw_interface_set_flags (vnm, xd->hw_if_index,
> -  VNET_HW_INTERFACE_FLAG_LINK_UP);
> +  hw_flags);
>if ((xd->flags & DPDK_DEVICE_FLAG_ADMIN_UP) == 0)
> dpdk_device_start (xd);
>xd->flags |= DPDK_DEVICE_FLAG_ADMIN_UP;
> @@ -561,7 +562,8 @@ dpdk_interface_admin_up_down (vnet_main_t * vnm, u32 
> hw_if_index, u32 flags)
>  }
>else
>  {
> -  vnet_hw_interface_set_flags (vnm, xd->hw_if_index, 0);
> + hw_flags &= ~DPDK_DEVICE_FLAG_ADMIN_UP;
> +  vnet_hw_interface_set_flags (vnm, xd->hw_if_index, hw_flags);
>if ((xd->flags & DPDK_DEVICE_FLAG_ADMIN_UP) != 0)
> dpdk_device_stop (xd);
>xd->flags &= ~DPDK_DEVICE_FLAG_ADMIN_UP;
> 
> and problem is fixed. what is your idea?
> 
> Best Regards
> 
> On Mon, Sep 3, 2018 at 5:54 AM chore  > wrote:
> Hi Dear VPP
> I wrote a small api client like vpp_api_test that contains sw_interface_dump 
> api. when i was trying to use this api client i faced a problem in 
> "stable/1807".
> At first i disconnected one of my links and my api client printed below 
> output:
>  
> GigabitEthernet0/9/0 duplex half speed 0
> admin: down
> link: down
> 
> Then i connected the link and got this:
> 
> GigabitEthernet0/9/0 duplex full speed 1000
> admin: down
> link: down
> 
> At the end i changed admin status of link and saw below output: 
> 
> GigabitEthernet0/9/0 duplex bogus speed 0
> admin: up
> link: up
> 
> and show hardware-interface GigabitEthernet0/9/0:
>   NameIdx   Link  Hardware
> GigabitEthernet0/9/0   2 up   GigabitEthernet0/9/0
>   Ethernet address 08:00:27:94:50:ba
>   Intel 82540EM (e1000)
> carrier up full duplex speed 1000 mtu 9202
> flags: admin-up pmd maybe-multiseg tx-offload intel-phdr-cksum
> rx queues 1, rx desc 1024, tx queues 1, tx desc 1024
> cpu socket 0
> 
> based on last results, it seems to be a problem in vl_api_sw_interface_dump.
> If I want to describe this problem more, I have to say that 'duplex' and 
> 'speed' api returned values are wrong. however you can see correct values in  
> "show hardware-interface" cli output.
> 
> In addition, GDB output shows that both 'speed' and 'duplex' are zero in 
> replied mp.
> 
> Breakpoint 1, vl_api_sw_interface_details_t_handler (mp=0x3005eabc) at 
> interface-api.c:24
> 24  int speed = 0;
> (gdb) p *mp
> $2 = {_vl_msg_id = 21504, context = 0, sw_if_index = 33554432, 
> sup_sw_if_index = 33554432, l2_address_length = 100663296, l2_address = 
> "\b\000'\224P\272\000", 
>   interface_name = "GigabitEthernet0/9/0", '\000' , 
> admin_up_down = 1 '\001', link_up_down = 1 '\001', link_duplex = 0 '\000', 
>   link_speed = 0 '\000', link_mtu = 61987, mtu = {673382400, 0, 0, 0}, sub_id 
> = 0, sub_dot1ad = 0 '\000', sub_dot1ah = 0 '\000', sub_number_of_tags = 0 
> '\000', 
>   sub_outer_vlan_id = 0, sub_inner_vlan_id = 0, sub_exact_match = 0 '\000', 
> sub_default = 0 '\000', sub_outer_vlan_id_any = 0 '\000', 
>   sub_inner_vlan_id_any = 0 '\000', vtr_op = 0, vtr_push_dot1q = 0, vtr_tag1 
> = 0, vtr_tag2 = 0, tag = '\000' , outer_tag = 0, 
>   b_dmac = "\000\000\000\000\000", b_smac = "\000\000\000\000\000", b_vlanid 
> = 0, i_sid = 0}
> 
> 
> 

Re: [vpp-dev] vl_api_sw_interface_dump problem

2018-09-09 Thread emma sdi
Dear community

I have the same problem, and commit this suggestion in
https://gerrit.fd.io/r/#/c/14647/.
Please someone review this code, it seems OK to me.

Cheers,
Khers

On Mon, Sep 3, 2018 at 12:18 PM sadjad  wrote:

> Hi Dear VPP
> I tried to solve this problem. so i changed device.c in dpdk plugin as you
> can see below:
>
> On branch stable/1807
> Your branch is up-to-date with 'origin/stable/1807'.
> Changes not staged for commit:
>
> modified:   src/plugins/dpdk/device/device.c
>
> diff --git a/src/plugins/dpdk/device/device.c
> b/src/plugins/dpdk/device/device.c
> index d5ab2585..159a395e 100644
> --- a/src/plugins/dpdk/device/device.c
> +++ b/src/plugins/dpdk/device/device.c
> @@ -547,11 +547,12 @@ dpdk_interface_admin_up_down (vnet_main_t * vnm, u32
> hw_if_index, u32 flags)
>
>if (xd->flags & DPDK_DEVICE_FLAG_PMD_INIT_FAIL)
>  return clib_error_return (0, "Interface not initialized");
> -
> +  u32 hw_flags = hif->flags;
>if (is_up)
>  {
> + hw_flags |= DPDK_DEVICE_FLAG_ADMIN_UP;
>vnet_hw_interface_set_flags (vnm, xd->hw_if_index,
> -  VNET_HW_INTERFACE_FLAG_LINK_UP);
> +  hw_flags);
>if ((xd->flags & DPDK_DEVICE_FLAG_ADMIN_UP) == 0)
> dpdk_device_start (xd);
>xd->flags |= DPDK_DEVICE_FLAG_ADMIN_UP;
> @@ -561,7 +562,8 @@ dpdk_interface_admin_up_down (vnet_main_t * vnm, u32
> hw_if_index, u32 flags)
>  }
>else
>  {
> -  vnet_hw_interface_set_flags (vnm, xd->hw_if_index, 0);
> + hw_flags &= ~DPDK_DEVICE_FLAG_ADMIN_UP;
> +  vnet_hw_interface_set_flags (vnm, xd->hw_if_index, hw_flags);
>if ((xd->flags & DPDK_DEVICE_FLAG_ADMIN_UP) != 0)
> dpdk_device_stop (xd);
>xd->flags &= ~DPDK_DEVICE_FLAG_ADMIN_UP;
>
> and problem is fixed. what is your idea?
>
> Best Regards
>
> On Mon, Sep 3, 2018 at 5:54 AM chore  wrote:
>
>> Hi Dear VPP
>> I wrote a small api client like vpp_api_test that contains
>> sw_interface_dump api. when i was trying to use this api client i faced a
>> problem in "stable/1807".
>> At first i disconnected one of my links and my api client printed below
>> output:
>>
>> GigabitEthernet0/9/0 duplex half speed 0
>> admin: down
>> link: down
>>
>> Then i connected the link and got this:
>>
>> GigabitEthernet0/9/0 duplex full speed 1000
>> admin: down
>> link: down
>>
>> At the end i changed admin status of link and saw below output:
>>
>> GigabitEthernet0/9/0 duplex bogus speed 0
>> admin: up
>> link: up
>>
>> and show hardware-interface GigabitEthernet0/9/0:
>>   NameIdx   Link  Hardware
>> GigabitEthernet0/9/0   2 up   GigabitEthernet0/9/0
>>   Ethernet address 08:00:27:94:50:ba
>>   Intel 82540EM (e1000)
>> carrier up full duplex speed 1000 mtu 9202
>> flags: admin-up pmd maybe-multiseg tx-offload intel-phdr-cksum
>> rx queues 1, rx desc 1024, tx queues 1, tx desc 1024
>> cpu socket 0
>>
>> based on last results, it seems to be a problem in
>> vl_api_sw_interface_dump.
>> If I want to describe this problem more, I have to say that 'duplex' and
>> 'speed' api returned values are wrong. however you can see correct values
>> in  "show hardware-interface" cli output.
>>
>> In addition, GDB output shows that both 'speed' and 'duplex' are zero in
>> replied mp.
>>
>> Breakpoint 1, vl_api_sw_interface_details_t_handler (mp=0x3005eabc) at
>> interface-api.c:24
>> 24  int speed = 0;
>> (gdb) p *mp
>> $2 = {_vl_msg_id = 21504, context = 0, sw_if_index = 33554432,
>> sup_sw_if_index = 33554432, l2_address_length = 100663296, l2_address =
>> "\b\000'\224P\272\000",
>>   interface_name = "GigabitEthernet0/9/0", '\000' ,
>> admin_up_down = 1 '\001', link_up_down = 1 '\001', link_duplex = 0 '\000',
>>   link_speed = 0 '\000', link_mtu = 61987, mtu = {673382400, 0, 0, 0},
>> sub_id = 0, sub_dot1ad = 0 '\000', sub_dot1ah = 0 '\000',
>> sub_number_of_tags = 0 '\000',
>>   sub_outer_vlan_id = 0, sub_inner_vlan_id = 0, sub_exact_match = 0
>> '\000', sub_default = 0 '\000', sub_outer_vlan_id_any = 0 '\000',
>>   sub_inner_vlan_id_any = 0 '\000', vtr_op = 0, vtr_push_dot1q = 0,
>> vtr_tag1 = 0, vtr_tag2 = 0, tag = '\000' , outer_tag = 0,
>>   b_dmac = "\000\000\000\000\000", b_smac = "\000\000\000\000\000",
>> b_vlanid = 0, i_sid = 0}
>>
>>
>> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
>
> View/Reply Online (#10342): https://lists.fd.io/g/vpp-dev/message/10342
> Mute This Topic: https://lists.fd.io/mt/25162112/675776
> Group Owner: vpp-dev+ow...@lists.fd.io
> Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [s3m2e1.6s...@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#10446): https://lists.fd.io/g/vpp-dev/message/10446
Mute This Topic: https://lists.fd.io/mt/25162112/21656
Group Owner: vpp-dev+ow...@lists.fd.io

Re: [vpp-dev] vl_api_sw_interface_dump problem

2018-09-03 Thread sadjad
Hi Dear VPP
I tried to solve this problem. so i changed device.c in dpdk plugin as you
can see below:

On branch stable/1807
Your branch is up-to-date with 'origin/stable/1807'.
Changes not staged for commit:

modified:   src/plugins/dpdk/device/device.c

diff --git a/src/plugins/dpdk/device/device.c
b/src/plugins/dpdk/device/device.c
index d5ab2585..159a395e 100644
--- a/src/plugins/dpdk/device/device.c
+++ b/src/plugins/dpdk/device/device.c
@@ -547,11 +547,12 @@ dpdk_interface_admin_up_down (vnet_main_t * vnm, u32
hw_if_index, u32 flags)

   if (xd->flags & DPDK_DEVICE_FLAG_PMD_INIT_FAIL)
 return clib_error_return (0, "Interface not initialized");
-
+  u32 hw_flags = hif->flags;
   if (is_up)
 {
+ hw_flags |= DPDK_DEVICE_FLAG_ADMIN_UP;
   vnet_hw_interface_set_flags (vnm, xd->hw_if_index,
-  VNET_HW_INTERFACE_FLAG_LINK_UP);
+  hw_flags);
   if ((xd->flags & DPDK_DEVICE_FLAG_ADMIN_UP) == 0)
dpdk_device_start (xd);
   xd->flags |= DPDK_DEVICE_FLAG_ADMIN_UP;
@@ -561,7 +562,8 @@ dpdk_interface_admin_up_down (vnet_main_t * vnm, u32
hw_if_index, u32 flags)
 }
   else
 {
-  vnet_hw_interface_set_flags (vnm, xd->hw_if_index, 0);
+ hw_flags &= ~DPDK_DEVICE_FLAG_ADMIN_UP;
+  vnet_hw_interface_set_flags (vnm, xd->hw_if_index, hw_flags);
   if ((xd->flags & DPDK_DEVICE_FLAG_ADMIN_UP) != 0)
dpdk_device_stop (xd);
   xd->flags &= ~DPDK_DEVICE_FLAG_ADMIN_UP;

and problem is fixed. what is your idea?

Best Regards

On Mon, Sep 3, 2018 at 5:54 AM chore  wrote:

> Hi Dear VPP
> I wrote a small api client like vpp_api_test that contains
> sw_interface_dump api. when i was trying to use this api client i faced a
> problem in "stable/1807".
> At first i disconnected one of my links and my api client printed below
> output:
>
> GigabitEthernet0/9/0 duplex half speed 0
> admin: down
> link: down
>
> Then i connected the link and got this:
>
> GigabitEthernet0/9/0 duplex full speed 1000
> admin: down
> link: down
>
> At the end i changed admin status of link and saw below output:
>
> GigabitEthernet0/9/0 duplex bogus speed 0
> admin: up
> link: up
>
> and show hardware-interface GigabitEthernet0/9/0:
>   NameIdx   Link  Hardware
> GigabitEthernet0/9/0   2 up   GigabitEthernet0/9/0
>   Ethernet address 08:00:27:94:50:ba
>   Intel 82540EM (e1000)
> carrier up full duplex speed 1000 mtu 9202
> flags: admin-up pmd maybe-multiseg tx-offload intel-phdr-cksum
> rx queues 1, rx desc 1024, tx queues 1, tx desc 1024
> cpu socket 0
>
> based on last results, it seems to be a problem in
> vl_api_sw_interface_dump.
> If I want to describe this problem more, I have to say that 'duplex' and
> 'speed' api returned values are wrong. however you can see correct values
> in  "show hardware-interface" cli output.
>
> In addition, GDB output shows that both 'speed' and 'duplex' are zero in
> replied mp.
>
> Breakpoint 1, vl_api_sw_interface_details_t_handler (mp=0x3005eabc) at
> interface-api.c:24
> 24  int speed = 0;
> (gdb) p *mp
> $2 = {_vl_msg_id = 21504, context = 0, sw_if_index = 33554432,
> sup_sw_if_index = 33554432, l2_address_length = 100663296, l2_address =
> "\b\000'\224P\272\000",
>   interface_name = "GigabitEthernet0/9/0", '\000' ,
> admin_up_down = 1 '\001', link_up_down = 1 '\001', link_duplex = 0 '\000',
>   link_speed = 0 '\000', link_mtu = 61987, mtu = {673382400, 0, 0, 0},
> sub_id = 0, sub_dot1ad = 0 '\000', sub_dot1ah = 0 '\000',
> sub_number_of_tags = 0 '\000',
>   sub_outer_vlan_id = 0, sub_inner_vlan_id = 0, sub_exact_match = 0
> '\000', sub_default = 0 '\000', sub_outer_vlan_id_any = 0 '\000',
>   sub_inner_vlan_id_any = 0 '\000', vtr_op = 0, vtr_push_dot1q = 0,
> vtr_tag1 = 0, vtr_tag2 = 0, tag = '\000' , outer_tag = 0,
>   b_dmac = "\000\000\000\000\000", b_smac = "\000\000\000\000\000",
> b_vlanid = 0, i_sid = 0}
>
>
>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#10342): https://lists.fd.io/g/vpp-dev/message/10342
Mute This Topic: https://lists.fd.io/mt/25162112/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


[vpp-dev] vl_api_sw_interface_dump problem

2018-09-02 Thread sadjad
Hi Dear VPP
I wrote a small api client like vpp_api_test that contains
sw_interface_dump api. when i was trying to use this api client i faced a
problem in "stable/1807".
At first i disconnected one of my links and my api client printed below
output:

GigabitEthernet0/9/0 duplex half speed 0
admin: down
link: down

Then i connected the link and got this:

GigabitEthernet0/9/0 duplex full speed 1000
admin: down
link: down

At the end i changed admin status of link and saw below output:

GigabitEthernet0/9/0 duplex bogus speed 0
admin: up
link: up

and show hardware-interface GigabitEthernet0/9/0:
  NameIdx   Link  Hardware
GigabitEthernet0/9/0   2 up   GigabitEthernet0/9/0
  Ethernet address 08:00:27:94:50:ba
  Intel 82540EM (e1000)
carrier up full duplex speed 1000 mtu 9202
flags: admin-up pmd maybe-multiseg tx-offload intel-phdr-cksum
rx queues 1, rx desc 1024, tx queues 1, tx desc 1024
cpu socket 0

based on last results, it seems to be a problem in vl_api_sw_interface_dump.
If I want to describe this problem more, I have to say that 'duplex' and
'speed' api returned values are wrong. however you can see correct values
in  "show hardware-interface" cli output.

In addition, GDB output shows that both 'speed' and 'duplex' are zero in
replied mp.

Breakpoint 1, vl_api_sw_interface_details_t_handler (mp=0x3005eabc) at
interface-api.c:24
24  int speed = 0;
(gdb) p *mp
$2 = {_vl_msg_id = 21504, context = 0, sw_if_index = 33554432,
sup_sw_if_index = 33554432, l2_address_length = 100663296, l2_address =
"\b\000'\224P\272\000",
  interface_name = "GigabitEthernet0/9/0", '\000' ,
admin_up_down = 1 '\001', link_up_down = 1 '\001', link_duplex = 0 '\000',
  link_speed = 0 '\000', link_mtu = 61987, mtu = {673382400, 0, 0, 0},
sub_id = 0, sub_dot1ad = 0 '\000', sub_dot1ah = 0 '\000',
sub_number_of_tags = 0 '\000',
  sub_outer_vlan_id = 0, sub_inner_vlan_id = 0, sub_exact_match = 0 '\000',
sub_default = 0 '\000', sub_outer_vlan_id_any = 0 '\000',
  sub_inner_vlan_id_any = 0 '\000', vtr_op = 0, vtr_push_dot1q = 0,
vtr_tag1 = 0, vtr_tag2 = 0, tag = '\000' , outer_tag = 0,
  b_dmac = "\000\000\000\000\000", b_smac = "\000\000\000\000\000",
b_vlanid = 0, i_sid = 0}
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#10341): https://lists.fd.io/g/vpp-dev/message/10341
Mute This Topic: https://lists.fd.io/mt/25162112/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-