bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arthur Fabre <afabre@cloudflare.com>
To: Edward Cree <ecree@solarflare.com>
Cc: Solarflare linux maintainers <linux-net-drivers@solarflare.com>,
	Charles McLachlan <cmclachlan@solarflare.com>,
	Martin Habets <mhabets@solarflare.com>,
	David Miller <davem@davemloft.net>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Jakub Kicinski <jakub.kicinski@netronome.com>,
	Jesper Dangaard Brouer <hawk@kernel.org>,
	John Fastabend <john.fastabend@gmail.com>,
	netdev <netdev@vger.kernel.org>, bpf <bpf@vger.kernel.org>,
	kernel-team <kernel-team@cloudflare.com>
Subject: Re: [PATCH net-next] sfc: trace_xdp_exception on XDP failure
Date: Mon, 11 Nov 2019 17:38:29 +0000	[thread overview]
Message-ID: <CAOn4ftvqib3y+Gfhq+dS4cUeWQVyGDM+rNeLnoVoYz9O_VLYLA@mail.gmail.com> (raw)
In-Reply-To: <f58a73a8-631c-a9a1-25e9-a5f0050df13c@solarflare.com>

On Mon, Nov 11, 2019 at 5:27 PM Edward Cree <ecree@solarflare.com> wrote:
>
> On 11/11/2019 10:51, Arthur Fabre wrote:
> > diff --git a/drivers/net/ethernet/sfc/rx.c b/drivers/net/ethernet/sfc/rx.c
> > index a7d9841105d8..5bfe1f6112a1 100644
> > --- a/drivers/net/ethernet/sfc/rx.c
> > +++ b/drivers/net/ethernet/sfc/rx.c
> > @@ -678,6 +678,7 @@ static bool efx_do_xdp(struct efx_nic *efx, struct efx_channel *channel,
> >                                 "XDP is not possible with multiple receive fragments (%d)\n",
> >                                 channel->rx_pkt_n_frags);
> >               channel->n_rx_xdp_bad_drops++;
> > +             trace_xdp_exception(efx->net_dev, xdp_prog, xdp_act);
> >               return false;
> >       }
> AIUI trace_xdp_exception() is improper here as we have not run
>  the XDP program (and xdp_act is thus uninitialised).
>
> The other three, below, appear to be correct.
> -Ed
>

Good point. Do you know under what conditions we'd end up with
"fragmented" packets? As far as I can tell this isn't IP
fragmentation?

On Mon, Nov 11, 2019 at 5:27 PM Edward Cree <ecree@solarflare.com> wrote:
>
> On 11/11/2019 10:51, Arthur Fabre wrote:
> > The sfc driver can drop packets processed with XDP, notably when running
> > out of buffer space on XDP_TX, or returning an unknown XDP action.
> > This increments the rx_xdp_bad_drops ethtool counter.
> >
> > Call trace_xdp_exception everywhere rx_xdp_bad_drops is incremented to
> > easily monitor this from userspace.
> >
> > This mirrors the behavior of other drivers.
> >
> > Signed-off-by: Arthur Fabre <afabre@cloudflare.com>
> > ---
> >  drivers/net/ethernet/sfc/rx.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/drivers/net/ethernet/sfc/rx.c b/drivers/net/ethernet/sfc/rx.c
> > index a7d9841105d8..5bfe1f6112a1 100644
> > --- a/drivers/net/ethernet/sfc/rx.c
> > +++ b/drivers/net/ethernet/sfc/rx.c
> > @@ -678,6 +678,7 @@ static bool efx_do_xdp(struct efx_nic *efx, struct efx_channel *channel,
> >                                 "XDP is not possible with multiple receive fragments (%d)\n",
> >                                 channel->rx_pkt_n_frags);
> >               channel->n_rx_xdp_bad_drops++;
> > +             trace_xdp_exception(efx->net_dev, xdp_prog, xdp_act);
> >               return false;
> >       }
> AIUI trace_xdp_exception() is improper here as we have not run
>  the XDP program (and xdp_act is thus uninitialised).
>
> The other three, below, appear to be correct.
> -Ed
>
> >
> > @@ -724,6 +725,7 @@ static bool efx_do_xdp(struct efx_nic *efx, struct efx_channel *channel,
> >                               netif_err(efx, rx_err, efx->net_dev,
> >                                         "XDP TX failed (%d)\n", err);
> >                       channel->n_rx_xdp_bad_drops++;
> > +                     trace_xdp_exception(efx->net_dev, xdp_prog, xdp_act);
> >               } else {
> >                       channel->n_rx_xdp_tx++;
> >               }
> > @@ -737,6 +739,7 @@ static bool efx_do_xdp(struct efx_nic *efx, struct efx_channel *channel,
> >                               netif_err(efx, rx_err, efx->net_dev,
> >                                         "XDP redirect failed (%d)\n", err);
> >                       channel->n_rx_xdp_bad_drops++;
> > +                     trace_xdp_exception(efx->net_dev, xdp_prog, xdp_act);
> >               } else {
> >                       channel->n_rx_xdp_redirect++;
> >               }
> > @@ -746,6 +749,7 @@ static bool efx_do_xdp(struct efx_nic *efx, struct efx_channel *channel,
> >               bpf_warn_invalid_xdp_action(xdp_act);
> >               efx_free_rx_buffers(rx_queue, rx_buf, 1);
> >               channel->n_rx_xdp_bad_drops++;
> > +             trace_xdp_exception(efx->net_dev, xdp_prog, xdp_act);
> >               break;
> >
> >       case XDP_ABORTED:
>

  reply	other threads:[~2019-11-11 17:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-11 10:51 [PATCH net-next] sfc: trace_xdp_exception on XDP failure Arthur Fabre
2019-11-11 17:27 ` Edward Cree
2019-11-11 17:38   ` Arthur Fabre [this message]
2019-11-11 18:01     ` Edward Cree
2019-11-12 14:52       ` Arthur Fabre
2019-11-12 19:37 ` kbuild test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAOn4ftvqib3y+Gfhq+dS4cUeWQVyGDM+rNeLnoVoYz9O_VLYLA@mail.gmail.com \
    --to=afabre@cloudflare.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=cmclachlan@solarflare.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=ecree@solarflare.com \
    --cc=hawk@kernel.org \
    --cc=jakub.kicinski@netronome.com \
    --cc=john.fastabend@gmail.com \
    --cc=kernel-team@cloudflare.com \
    --cc=linux-net-drivers@solarflare.com \
    --cc=mhabets@solarflare.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).