Jesper Dangaard Brouer c0124f327e xdp/qede: setup xdp_rxq_info and intro xdp_rxq_info_is_reg
The driver code qede_free_fp_array() depend on kfree() can be called
with a NULL pointer. This stems from the qede_alloc_fp_array()
function which either (kz)alloc memory for fp->txq or fp->rxq.
This also simplifies error handling code in case of memory allocation
failures, but xdp_rxq_info_unreg need to know the difference.

Introduce xdp_rxq_info_is_reg() to handle if a memory allocation fails
and detect this is the failure path by seeing that xdp_rxq_info was
not registred yet, which first happens after successful alloaction in
qede_init_fp().

Driver hook points for xdp_rxq_info:
 * reg  : qede_init_fp
 * unreg: qede_free_fp_array

Tested on actual hardware with samples/bpf program.

V2: Driver have no proper error path for failed XDP RX-queue info reg, as
qede_init_fp() is a void function.

Cc: everest-linux-l2@cavium.com
Cc: Ariel Elior <Ariel.Elior@cavium.com>
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2018-01-05 15:21:21 -08:00
..
2017-07-11 06:08:58 -04:00
2017-11-15 13:46:33 -08:00
2017-04-05 10:15:20 +02:00
2016-07-08 12:20:57 +02:00
2016-04-25 16:44:27 -04:00
2016-04-25 16:44:27 -04:00
2017-08-31 14:42:19 -07:00
2017-11-30 09:54:27 -05:00
2017-10-11 09:49:34 +02:00
2017-11-16 10:49:00 +09:00
2017-12-11 14:10:06 -05:00
2016-04-27 22:48:25 -04:00
2017-12-15 12:34:00 -05:00
2017-09-29 06:19:32 +01:00
2016-08-17 19:36:23 -04:00
2016-10-03 02:00:22 -04:00
2016-07-08 12:20:57 +02:00
2017-11-08 16:12:33 +09:00
2016-03-23 22:09:58 -04:00
2017-12-27 13:34:42 -05:00
2017-12-05 14:37:13 -05:00
2017-12-04 11:32:53 -05:00