[ovs-dev] [PATCH] netdev-afxdp: Add interrupt mode using poll syscall.

Ilya Maximets i.maximets at ovn.org
Thu Feb 27 15:33:51 UTC 2020


On 2/26/20 10:18 PM, William Tu wrote:
> On Mon, Feb 24, 2020 at 5:31 PM William Tu <u9012063 at gmail.com> wrote:
>>
>> On Mon, Feb 24, 2020 at 2:47 AM Ilya Maximets <i.maximets at ovn.org> wrote:
>>>
>>> On 2/21/20 9:24 PM, William Tu wrote:
>>>> The patch adds a new option 'use-intr' to enable afxdp interrupt
>>>> mode.  At receive path, add a poll() syscall so that when there
>>>> is no packet arrived, the pmd thread will be blocked and this
>>>> saves some CPU time for other processes. This avoids burning the
>>>> CPU to always 100% when there is no traffic. Disabled by default.
>>>
>>> Sleeping inside the PMD thread is not a good idea in general.
>>> If one port doesn't have packets this doesn't mean that other
>>> ports are idle too.  With this patch, PMD thread will probably
>>> sleep for 1 second for each rxq without packets?  Am I right?
>>
>> Timeout will be 1 millisecond.
>>>
>>> Also, sleeping while not in a quiescent state will produce
>>> additional issues will too late rcu calls and stalls of other
>>> threads waiting on rcu synchronization.
>>>
>>> I also spotted that you're entering quiescent state at some
>>> point, but who will end this state?  PMD thread will continue
>>> working in a quiescent state and will probably crash while trying
>>> to use rcu-protected data structures like flow tables.
>>
>> Right, I should also end the quiescent state somewhere.
>>
>>>
>>> IMHO, for this case you just need to create a non-pmd version
>>> of netdev-afxdp with rxq_wait() implemented.  These ports
>>> will be handled by the main thread without consuming extra CPU
>>> resources.
>>>
>> Hi Ilya,
>>
>> Thanks for your feedback.
>> I will work on the idea of setting to non-pmd version.
>>
> 
> Hi Ilya,
> 
> I have two approaches to this non-pmd versions. I'm thinking about
> which directions to go.
> 
> 1) Dynamically setting .is_pmd to true/false.
> So users can use
> ovs-vsctl -- set int eth0 options:use-intr=true/false
> The datapath will have to reconfigure the pmd to queue assignment.
> Need to maintain per afxdp netdev's is_pmd value (some netdev might
> set to true, some might be false), now the is_pmd is per-netdev_class.
> I think this is pretty complicated changes.
> 
> 2) Another solution is to statically create another netdev_class, with
> .name = "afxdp-nonpmd",
> .is_pmd = false,
> I think this is much easier.
> 
> What do you think?

I'd prefer the second option if it doesn't require much code duplication.
First option looks a little bit like an overkill.

Best regards, Ilya Maximets.


More information about the dev mailing list