Skip to content

Commit 04c7e14

Browse files
walking-machineanguy11
authored andcommitted
ice: do not bring the VSI up, if it was down before the XDP setup
After XDP configuration is completed, we bring the interface up unconditionally, regardless of its state before the call to .ndo_bpf(). Preserve the information whether the interface had to be brought down and later bring it up only in such case. Fixes: efc2214 ("ice: Add support for XDP") Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com> Reviewed-by: Jacob Keller <jacob.e.keller@intel.com> Tested-by: Chandan Kumar Rout <chandanx.rout@intel.com> Acked-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com> Signed-off-by: Larysa Zaremba <larysa.zaremba@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
1 parent 7e3b407 commit 04c7e14

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

drivers/net/ethernet/intel/ice/ice_main.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3005,8 +3005,8 @@ ice_xdp_setup_prog(struct ice_vsi *vsi, struct bpf_prog *prog,
30053005
struct netlink_ext_ack *extack)
30063006
{
30073007
unsigned int frame_size = vsi->netdev->mtu + ICE_ETH_PKT_HDR_PAD;
3008-
bool if_running = netif_running(vsi->netdev);
30093008
int ret = 0, xdp_ring_err = 0;
3009+
bool if_running;
30103010

30113011
if (prog && !prog->aux->xdp_has_frags) {
30123012
if (frame_size > ice_max_xdp_frame_size(vsi)) {
@@ -3023,8 +3023,11 @@ ice_xdp_setup_prog(struct ice_vsi *vsi, struct bpf_prog *prog,
30233023
return 0;
30243024
}
30253025

3026+
if_running = netif_running(vsi->netdev) &&
3027+
!test_and_set_bit(ICE_VSI_DOWN, vsi->state);
3028+
30263029
/* need to stop netdev while setting up the program for Rx rings */
3027-
if (if_running && !test_and_set_bit(ICE_VSI_DOWN, vsi->state)) {
3030+
if (if_running) {
30283031
ret = ice_down(vsi);
30293032
if (ret) {
30303033
NL_SET_ERR_MSG_MOD(extack, "Preparing device for XDP attach failed");

0 commit comments

Comments
 (0)