igb: XDP xmit back fix error code
authorSven Auhagen <sven.auhagen@voleatech.de>
Wed, 11 Nov 2020 17:04:48 +0000 (18:04 +0100)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Wed, 9 Dec 2020 23:26:57 +0000 (15:26 -0800)
The igb XDP xmit back function should only return
defined error codes.

Fixes: 9cbc948b5a20 ("igb: add XDP support")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Signed-off-by: Sven Auhagen <sven.auhagen@voleatech.de>
Tested-by: Sandeep Penigalapati <sandeep.penigalapati@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/igb/igb_main.c

index 5fc2c38..08cc6f5 100644 (file)
@@ -2910,7 +2910,7 @@ static int igb_xdp_xmit_back(struct igb_adapter *adapter, struct xdp_buff *xdp)
         */
        tx_ring = adapter->xdp_prog ? igb_xdp_tx_queue_mapping(adapter) : NULL;
        if (unlikely(!tx_ring))
-               return -ENXIO;
+               return IGB_XDP_CONSUMED;
 
        nq = txring_txq(tx_ring);
        __netif_tx_lock(nq, cpu);