We've hit a problem using the DPDK HQOS API commands in VPP, where the commands
are actioned, but no response is received by the application. The simplest
repro (using the Python API) is as follows.
ubuntu@ip-10-0-0-100:~/$ python
Python 2.7.12 (default, Nov 19 2016, 06:48:10)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from vpp_papi import VPP
>>> v=VPP()
>>> v.connect("test")
>>> v.sw_interface_set_dpdk_hqos_pipe(sw_if_index=1,subport=0,pipe=269,profile=1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/dist-packages/vpp_papi.py", line 361, in <lambda>
f = lambda **kwargs: (self._call_vpp(i, msgdef, multipart, **kwargs))
File "/usr/lib/python2.7/dist-packages/vpp_papi.py", line 569, in _call_vpp
r = self.decode_incoming_msg(msg)
File "/usr/lib/python2.7/dist-packages/vpp_papi.py", line 505, in
decode_incoming_msg
r = self.decode(msgdef, msg)
File "/usr/lib/python2.7/dist-packages/vpp_papi.py", line 271, in decode
return self.__struct_type(False, msgdef, buf, 0, None)[1]
File "/usr/lib/python2.7/dist-packages/vpp_papi.py", line 213, in
__struct_type
return self.__struct_type_decode(msgdef, buf, offset)
File "/usr/lib/python2.7/dist-packages/vpp_papi.py", line 315, in
__struct_type_decode
res.append(v.unpack_from(buf, off)[0])
struct.error: unpack_from requires a buffer of at least 8 bytes
>>>
The problem is that the reply is sent with message ID set to 1. The API is
expect this ID to be a memclnt_create message so throws an exception when the
message is too short.
It looks like there are two bugs in the dpdk plugin that contribute to this,
specifically the file src/plugins/dpdk/device/init.c. The first is a missing
#define of REPLY_MSG_ID_BASE before the #include of
vlibapi/api_helper_macros.h, the second is a #include of
vlibmemory/vl_memory_api_h.h which should really be dpdk/api/dpdk_all_api_h.h.
We've tested that these changes fix the problem. Shall we go ahead and push
the fix?
Mike Evans
--
Mike Evans ([email protected])
Metaswitch
www.metaswitch.com<http://www.metaswitch.com/>
_______________________________________________
vpp-dev mailing list
[email protected]
https://lists.fd.io/mailman/listinfo/vpp-dev