On Fri, Feb 3, 2017 at 10:01 AM, Rybalchenko, Kirill <
kirill.rybalche...@intel.com> wrote:

> Hi Jon,
>
>
>
> Yes, I think it is somehow related.
>
> Here is more detailed info:
>
>
>
> VPP – current master branch (commit e0cb0ccee10f1ce0e29c94acb3b486
> 1f46c0879d)
>
> CSIT – not related.
>
>
>
> Just build fresh new master branch:
>
>
> csit@dut1:~/dev2/vpp_t$ sudo ./build-root/build-vpp-native/vpp/vpp_api_test
> json <<< sw_interface_dump
>
> vat#
>
> …
>
> (Paused here for about 1 sec, probably because of timeout)
>
> …
>
> sw_interface_dump error: Misc
>
> vat# csit@dut1:~/dev2/vpp_t$
>
>
>
> master branch cloned yesterday morning works fine
>
>
>
> Thanks,
>
> Kirill.
>

OK.

I can explain the "sw_interface_dump: Misc" error as it pertains to the
CONTROL_PING.
It's subtle, but I didn't really cause the underlying problem.  I exposed a
lingering issue, I believe.
Here is what the last "working" code (56c7b01e16) looked like at the tai
end of the api_sw_interface_dump() function:
  /* and IPSEC tunnel interfaces */
 M (SW_INTERFACE_DUMP, mp);
 mp->name_filter_valid = 1;
 strncpy ((char *) mp->name_filter, "ipsec", sizeof (mp->name_filter) - 1);
 S (mp);

 /* Use a control ping for synchronization */
 {
   vl_api_control_ping_t *mp;
   M (CONTROL_PING, mp);
   S (mp);
 }
 W (ret);
 return ret;

Pop quiz:  What ret value is actually returned here?

The (somewhat surprising) answer is: The value from IPSEC tunnel message.

When I removed the braces around the CONTROL_PING block, I caused W() to
wait for the PING message to complete, and to reap *its* return code.  Now
that is what is returned.

  /* and IPSEC tunnel interfaces */
  M (SW_INTERFACE_DUMP, mp);
  mp->name_filter_valid = 1;
  strncpy ((char *) mp->name_filter, "ipsec", sizeof (mp->name_filter) - 1);
  S (mp);

  /* Use a control ping for synchronization */
  M (CONTROL_PING, mp_ping);
  S (mp_ping);

  W (ret);
  return ret;

The return from the CONTROL_PING has always been -99 (Misc), but no one
ever knew that.

Question:  What is "wait" (W) supposed to do?  Wait for the last message
sent to clear the queue and return its result?
If so, that's what we have after my changes, but not before.

Any easy fix that ignores the error codes is simply to "return 0;" at the
end of the function.  I will submit that patch if that is believed to be
the right way to fix it.  But more likely, we should figure out why the
PING says -99.

HTH,
jdl
_______________________________________________
vpp-dev mailing list
vpp-dev@lists.fd.io
https://lists.fd.io/mailman/listinfo/vpp-dev

Reply via email to