[ovs-dev] [PATCH RFC] netdev-dpdk: add af_xdp support.

Ilya Maximets i.maximets at samsung.com
Thu May 30 07:47:46 UTC 2019


On 29.05.2019 20:57, William Tu wrote:
> On Wed, May 29, 2019 at 10:51 AM William Tu <u9012063 at gmail.com> wrote:
>>
>> Hi Ilya,
>>
>> Thanks for your feedback.
>>
>> On Wed, May 29, 2019 at 6:15 AM Ilya Maximets <i.maximets at samsung.com> wrote:
>>>
>>> On 28.05.2019 23:12, William Tu wrote:
>>>> The patch adds support for using DPDK's AF_XDP PMD.
>>>> Base on DPDK 19.08-rc0:
>>>>   commit c6a53a6bcd0ae52afe0a6d58b059af577c9408b3
>>>>   Author: Thomas Monjalon <thomas at monjalon.net>
>>>>   Date:   Tue May 14 18:04:37 2019 +0200
>>>>
>>>>       version: 19.08-rc0
>>>>
>>>> An AF_XDP PMD can be created by:
>>>>
>>>>   $ ovs-vsctl add-port br0 afxdp-p0 -- set int afxdp-p0 type=dpdk \
>>>>        options:dpdk-devargs=net_af_xdp,iface=enp2s0,queue=0
>>>
>>> I'm confused. I didn't try, but I thought that this should work out-of-the-box
>>> without any changes to OVS. Basically, your rte_eal_hotplug_add() and rte_dev_probe()
>>> that we're using right now are the same function with different way of passing
>>> arguments. Have you tried to just use above command without this patch applied?
>>> What happens in this case?
> 
> So without my patch, if I do:
> ovs-vsctl add-port br0 afxdp-p0 -- set int afxdp-p0 type=dpdk \
>       options:dpdk-devargs=net_af_xdp,iface=enp2s0,queue=0
> 
> It also works:
> 2019-05-29T17:53:39.981Z|00044|netdev_dpdk|INFO|Device
> 'net_af_xdp,iface=enp2s0,queue=0' attached to DPDK
> 
> ovs-vsctl show
> Port "afxdp-p0"
>             Interface "afxdp-p0"
>                 type: dpdk
>                 options: {dpdk-devargs="net_af_xdp,iface=enp2s0,queue=0"}
> 
> And the only problem is when removing the device
> ovs-vsctl del-port afxdp-p0
> 2019-05-29T17:54:27.671Z|00055|dpdk|ERR|EAL: Driver cannot detach the
> device (net_af_xdp)
> 2019-05-29T17:54:27.671Z|00056|dpdk|ERR|EAL: Failed to detach device
> on primary process
> 2019-05-29T17:54:27.671Z|00057|netdev_dpdk|ERR|Device
> 'net_af_xdp,iface=enp2s0,queue=0' can not be detached
> 
> Thanks,
> William

Thanks for the logs. It looks like a bug in DPDK.
Does rte_eal_hotplug_remove() works without issues?
Unfortunately, I have no setup to test myself.

You may also use following patch to get more information about detaching
failure: https://mail.openvswitch.org/pipermail/ovs-dev/2019-May/359367.html

Another possible issue is that you're using driver base name (net_af_xdp)
as a name of DPDK device. Maybe this causes some issues.
Try following devargs: "vdev:net_af_xdp0,iface=enp2s0,queue=0".

Best regards, Ilya Maximets.

>>>
>>> Another option you may try is:
>>>
>>> ovs-vsctl add-port br0 afxdp-p0 -- set interface afxdp-p0 type=dpdk \
>>>           options:dpdk-devargs="vdev:net_af_xdp,iface=enp2s0,queue=0"
>>>
>> It actually works! When adding the device:
>> 2019-05-29T17:45:47.128Z|00044|netdev_dpdk|INFO|Device
>> 'vdev:net_af_xdp,iface=enp2s0,queue=0' attached to DPDK
>> 2019-05-29T17:45:47.128Z|00045|dpif_netdev|INFO|PMD thread on numa_id:
>> 0, core id: 11 created.
>> 2019-05-29T17:45:47.128Z|00046|dpif_netdev|INFO|There are 1 pmd
>> threads on numa node 0
>> 2019-05-29T17:45:47.128Z|00047|dpdk|INFO|Device with port_id=0 already stopped
>> 2019-05-29T17:45:47.208Z|00048|netdev_dpdk|WARN|Rx checksum offload is
>> not supported on port 0
>>
>> However , when removing the device, some errors show up.
>> ovs-vsctl del-port br0 afxdp-p0
>> 2019-05-29T17:47:00.318Z|00053|bridge|INFO|bridge br0: deleted
>> interface afxdp-p0 on port 1
>> 2019-05-29T17:47:00.318Z|00054|dpif_netdev|INFO|PMD thread on numa_id:
>> 0, core id: 11 destroyed.
>> 2019-05-29T17:47:00.651Z|00055|dpdk|ERR|EAL: Driver cannot detach the
>> device (net_af_xdp)
>> 2019-05-29T17:47:00.651Z|00056|dpdk|ERR|EAL: Failed to detach device
>> on primary process
>> 2019-05-29T17:47:00.651Z|00057|netdev_dpdk|ERR|Device
>> 'vdev:net_af_xdp,iface=enp2s0,queue=0' can not be detached
>>
>> I also measured the performance, it works fine and shows around 7Mpps.
>>
>>> so DPDK will not have to guess the bus type.
>>>
>>>>
>>>>   $ ovs-vsctl show
>>>>   Port "afxdp-p0"
>>>>     Interface "afxdp-p0"
>>>>       type: dpdk
>>>>       options: {dpdk-devargs="net_af_xdp,iface=enp2s0,queue=0"}
>>>>
>>>> The performance of physical device loopback shows around 7Mpps with 64B pkt.
>>>>
>>>>   $ ovs-ofctl add-flow br0 "in_port=afxdp-p0, \
>>>>        actions=set_field:14->in_port,set_field:a0:36:9f:33:b1:40->dl_src,afxdp-p0"
>>>>
>>>> Note: I have to set e_RTE_METER_GREEN to 0 to pass compile.
>>>
>>> You may use 'dpdk-latest' OVS branch. The proper fix exists there.
>>> In general, patches that intended to work only with latest DPDK that
>>> not yet supported on master should be made on top of 'dpdk-latest'
>>> branch and have [PATCH dpdk-latest] subject prefix.
>>
>> Got it, thank you.
>> William
>>
>>>
>>> Best regards, Ilya Maximets.
> 
> 


More information about the dev mailing list