On Mon, Apr 13, 2020 at 3:20 PM Ilya Maximets <[email protected]> wrote:
>
> On 3/25/20 10:44 PM, William Tu wrote:
> > The patch adds a new netdev class 'afxdp-nonpmd' to enable afxdp
> > interrupt mode. This is similar to 'type=afxdp', except that the
> > is_pmd field is set to false. As a result, the packet processing
> > is handled by main thread, not pmd thread. This avoids burning
> > the CPU to always 100% when there is no traffic.
> >
> > Tested-at:
> > https://travis-ci.org/github/williamtu/ovs-travis/builds/666980138
> > Signed-off-by: William Tu <[email protected]>
> > ---
> > v4:
> > - Previously crash and fix it with qid = qid % netdev_n_txq(netdev)
> > Now remove it because Ilya's fix:
> > "dpif-netdev: Force port reconfiguration to change dynamic_txqs."
>
> Thanks! This version looks mostly fine. One small comment inline.
>
> Best regards, Ilya Maximets.
>
> > ---
> > NEWS | 3 +++
> > lib/netdev-linux.c | 20 ++++++++++++++++++++
> > lib/netdev-provider.h | 1 +
> > lib/netdev.c | 1 +
> > tests/system-afxdp.at | 23 +++++++++++++++++++++++
> > 5 files changed, 48 insertions(+)
> >
> > diff --git a/NEWS b/NEWS
> > index 32ca2e0c6642..2ca8f6266145 100644
> > --- a/NEWS
> > +++ b/NEWS
> > @@ -10,6 +10,9 @@ Post-v2.13.0
> > * Deprecated DPDK ring ports (dpdkr) are no longer supported.
> > - Linux datapath:
> > * Support for kernel versions up to 5.5.x.
> > + - AF_XDP:
> > + * New netdev class 'afxdp-nonpmd' for netdev-afxdp to save CPU cycles
> > + by enabling interrupt mode.
> >
> >
> > v2.13.0 - 14 Feb 2020
> > diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
> > index c6e46f1885aa..bcc28869516e 100644
> > --- a/lib/netdev-linux.c
> > +++ b/lib/netdev-linux.c
> > @@ -3624,6 +3624,26 @@ const struct netdev_class netdev_afxdp_class = {
> > .rxq_destruct = netdev_afxdp_rxq_destruct,
> > .rxq_recv = netdev_afxdp_rxq_recv,
> > };
> > +
> > +const struct netdev_class netdev_afxdp_nonpmd_class = {
> > + NETDEV_LINUX_CLASS_COMMON,
> > + .type = "afxdp-nonpmd",
> > + .is_pmd = false,
> > + .init = netdev_afxdp_init,
> > + .construct = netdev_afxdp_construct,
> > + .destruct = netdev_afxdp_destruct,
> > + .get_stats = netdev_afxdp_get_stats,
> > + .get_custom_stats = netdev_afxdp_get_custom_stats,
> > + .get_status = netdev_linux_get_status,
> > + .set_config = netdev_afxdp_set_config,
> > + .get_config = netdev_afxdp_get_config,
> > + .reconfigure = netdev_afxdp_reconfigure,
> > + .get_numa_id = netdev_linux_get_numa_id,
> > + .send = netdev_afxdp_batch_send,
> > + .rxq_construct = netdev_afxdp_rxq_construct,
> > + .rxq_destruct = netdev_afxdp_rxq_destruct,
> > + .rxq_recv = netdev_afxdp_rxq_recv,
>
> Above looks like almost same as for "pmd" version. Could you, please,
> make a macro like NETDEV_AFXDP_CLASS_COMMON or something like that to
> avoid duplication?
>
OK! Thanks for the feedback.
William
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev