OSDN Git Service

i40e: drop redundant check when setting xdp prog
authorMaciej Fijalkowski <maciej.fijalkowski@intel.com>
Mon, 18 Jan 2021 15:13:08 +0000 (16:13 +0100)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Fri, 12 Feb 2021 17:49:32 +0000 (09:49 -0800)
Net core handles the case where netdev has no xdp prog attached and
current prog is NULL. Therefore, remove such check within
i40e_xdp_setup.

Reviewed-by: Björn Töpel <bjorn.topel@intel.com>
Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Tested-by: Kiran Bhandare <kiranx.bhandare@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/i40e/i40e_main.c

index 63e19d2..8bb8eb6 100644 (file)
@@ -12947,9 +12947,6 @@ static int i40e_xdp_setup(struct i40e_vsi *vsi, struct bpf_prog *prog,
                return -EINVAL;
        }
 
-       if (!i40e_enabled_xdp_vsi(vsi) && !prog)
-               return 0;
-
        /* When turning XDP on->off/off->on we reset and rebuild the rings. */
        need_reset = (i40e_enabled_xdp_vsi(vsi) != !!prog);