[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191028.110556.665626038293022035.davem@davemloft.net>
Date: Mon, 28 Oct 2019 11:05:56 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: ecree@...arflare.com
Cc: cmclachlan@...arflare.com, brouer@...hat.com,
netdev@...r.kernel.org, linux-net-drivers@...arflare.com
Subject: Re: [PATCH net-next v2 2/6] sfc: perform XDP processing on
received packets
From: Edward Cree <ecree@...arflare.com>
Date: Mon, 28 Oct 2019 17:46:18 +0000
> 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?
I would seriously prefer a goto to this...
Powered by blists - more mailing lists