Netdev List
 help / color / mirror / Atom feed
From: Edward Cree <ecree@solarflare.com>
To: Charles McLachlan <cmclachlan@solarflare.com>,
	Jesper Dangaard Brouer <brouer@redhat.com>
Cc: <davem@davemloft.net>, <netdev@vger.kernel.org>,
	<linux-net-drivers@solarflare.com>
Subject: Re: [PATCH net-next v2 2/6] sfc: perform XDP processing on received packets
Date: Mon, 28 Oct 2019 17:46:18 +0000	[thread overview]
Message-ID: <f9de8c74-b567-ac57-b1d5-dff8ce6ff191@solarflare.com> (raw)
In-Reply-To: <094a9975-f1bb-7e44-10e4-64456f924ac9@solarflare.com>

On 28/10/2019 17:11, Charles McLachlan wrote:
>>> +		efx_free_rx_buffers(rx_queue, rx_buf, 1);
>>> +		break;
>> You can do a /* Fall through */ to case XDP_DROP.
> but not if I put the trace_xdp_exception in as well. I think we're always going 
> to need two efx_free_rx_buffers calls.

This will probably make people scream, but I have an evil hack to deal with
 situations like this:

	default:
		bpf_warn_invalid_xdp_action(xdp_act);
		if (0) /* Fall further */
			/* Fall through */
	case XDP_ABORTED:
		trace_xdp_exception(netdev, xdp_prog, xdp_act);
		/* Fall through */
	case XDP_DROP:
		efx_free_rx_buffers(rx_queue, rx_buf, 1);
		break;

I wonder if gcc's Wimplicit-fallthrough logic can comprehend that?  Or if
 it'll trigger -Wmisleading-indentation?

-Ed

  reply	other threads:[~2019-10-28 17:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-28 13:56 [PATCH net-next v2 0/6] sfc: Add XDP support Charles McLachlan
2019-10-28 13:59 ` [PATCH net-next v2 1/6] sfc: support encapsulation of xdp_frames in efx_tx_buffer Charles McLachlan
2019-10-28 13:59 ` [PATCH net-next v2 2/6] sfc: perform XDP processing on received packets Charles McLachlan
2019-10-28 16:33   ` Jesper Dangaard Brouer
2019-10-28 17:11     ` Charles McLachlan
2019-10-28 17:46       ` Edward Cree [this message]
2019-10-28 18:05         ` David Miller
2019-10-28 13:59 ` [PATCH net-next v2 3/6] sfc: Enable setting of xdp_prog Charles McLachlan
2019-10-28 13:59 ` [PATCH net-next v2 4/6] sfc: allocate channels for XDP tx queues Charles McLachlan
2019-10-28 14:00 ` [PATCH net-next v2 5/6] sfc: handle XDP_TX outcomes of XDP eBPF programs Charles McLachlan
2019-10-28 14:00 ` [PATCH net-next v2 6/6] sfc: add XDP counters to ethtool stats Charles McLachlan
2019-10-28 22:03 ` [PATCH net-next v2 0/6] sfc: Add XDP support David Ahern
2019-10-29  9:40   ` Charles McLachlan

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=f9de8c74-b567-ac57-b1d5-dff8ce6ff191@solarflare.com \
    --to=ecree@solarflare.com \
    --cc=brouer@redhat.com \
    --cc=cmclachlan@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=linux-net-drivers@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