[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180322125811.0dcc1b28@redhat.com>
Date: Thu, 22 Mar 2018 12:58:11 +0100
From: Jesper Dangaard Brouer <brouer@...hat.com>
To: Björn Töpel <bjorn.topel@...il.com>
Cc: brouer@...hat.com, jeffrey.t.kirsher@...el.com,
intel-wired-lan@...ts.osuosl.org,
Björn Töpel <bjorn.topel@...el.com>,
magnus.karlsson@...el.com, netdev@...r.kernel.org,
alexander.h.duyck@...el.com, alexander.duyck@...il.com
Subject: Re: [PATCH v2 2/2] i40e: add support for XDP_REDIRECT
On Thu, 22 Mar 2018 10:03:07 +0100 Björn Töpel <bjorn.topel@...il.com> wrote:
> +/**
> + * i40e_xdp_xmit - Implements ndo_xdp_xmit
> + * @dev: netdev
> + * @xdp: XDP buffer
> + *
> + * Returns Zero if sent, else an error code
> + **/
> +int i40e_xdp_xmit(struct net_device *dev, struct xdp_buff *xdp)
> +{
The return code is used by the XDP redirect tracepoint... this is the
only way we have to debug/troubleshoot runtime issues with XDP. Thus,
these need to be consistent across drives and distinguishable.
> + struct i40e_netdev_priv *np = netdev_priv(dev);
> + unsigned int queue_index = smp_processor_id();
> + struct i40e_vsi *vsi = np->vsi;
> + int err;
> +
> + if (test_bit(__I40E_VSI_DOWN, vsi->state))
> + return -EINVAL;
Should be: -ENETDOWN
> +
> + if (!i40e_enabled_xdp_vsi(vsi) || queue_index >= vsi->num_queue_pairs)
> + return -EINVAL;
Should be: -ENXIO
> + err = i40e_xmit_xdp_ring(xdp, vsi->xdp_rings[queue_index]);
> + if (err != I40E_XDP_TX)
> + return -ENOMEM;
Should be: -ENOSPC
The ENOSPC return code is important, as this can be used as a feedback
to a XDP_REDIRECT load-balancer facility.
--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Principal Kernel Engineer at Red Hat
LinkedIn: http://www.linkedin.com/in/brouer
Powered by blists - more mailing lists