Thread (13 messages) 13 messages, 5 authors, 2019-10-29

Re: [PATCH net-next v2 2/6] sfc: perform XDP processing on received packets

From: Edward Cree <hidden>
Date: 2019-10-28 17:46:29

On 28/10/2019 17:11, Charles McLachlan wrote:
quoted
quoted
+		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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help