From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 07326184101; Tue, 10 Sep 2024 09:49:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725961782; cv=none; b=l2HJwry8fe75O/zT3YlaRKlzTmryhEyks5s0pdguIJolxaaciua/VwoiUeMcRrwezsQ8YU7+bmfIPOWDSICuX42s7YEHV14jgCZVjzEakWTeRCl9d7RwT1WK1x02SC5PteG06zOTe1wKoHFUxSULB/tnhrktf9sfrHqlsOdgxG0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725961782; c=relaxed/simple; bh=Pv2ALsLcvvPeW14Q0aO2cq3HFVIuvd3Qdj5GLPJfZqs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VnN0eeLKFsXdii7hwX98RvsM0LzECRxGwyO8nN1f7WzqUoto+vSvT3JkjTrTWm7yoj5BLrn441Ihhbd3ZVOZqIKLuD7haPka3rZq2U0vCdEFeLMgyddjb3sJ5bpfgD5H40jTJkIZdMluNd4wCHJ38tQTC7HHHhMQA85pflgb5mA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=miKveZtP; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="miKveZtP" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 83D99C4CEC3; Tue, 10 Sep 2024 09:49:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1725961781; bh=Pv2ALsLcvvPeW14Q0aO2cq3HFVIuvd3Qdj5GLPJfZqs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=miKveZtPRQYUOPLi9UpzN5z52TJ4AZYrJejsyNbG0kkS+jVMMijpFDXkyEkOcULDs RNlsyzAY/Uwp+SXYGXyvMRh1Kz6Qfmy0FVG+NeuBk/sgBeuTLBe5nimCG5ze8VOPHv 9pp7Lc7iFOMfGtBtvttoC6yDx8fe8igBGI0mHz9s= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Wojciech Drewek , Jacob Keller , Chandan Kumar Rout , Maciej Fijalkowski , Larysa Zaremba , Tony Nguyen , Sasha Levin Subject: [PATCH 6.10 186/375] ice: do not bring the VSI up, if it was down before the XDP setup Date: Tue, 10 Sep 2024 11:29:43 +0200 Message-ID: <20240910092628.738633365@linuxfoundation.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240910092622.245959861@linuxfoundation.org> References: <20240910092622.245959861@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Larysa Zaremba [ Upstream commit 04c7e14e5b0b6227e7b00d7a96ca2f2426ab9171 ] 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: efc2214b6047 ("ice: Add support for XDP") Reviewed-by: Wojciech Drewek Reviewed-by: Jacob Keller Tested-by: Chandan Kumar Rout Acked-by: Maciej Fijalkowski Signed-off-by: Larysa Zaremba Signed-off-by: Tony Nguyen Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/ice/ice_main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c index 746cae5964fa..766f9a466bc3 100644 --- a/drivers/net/ethernet/intel/ice/ice_main.c +++ b/drivers/net/ethernet/intel/ice/ice_main.c @@ -3006,8 +3006,8 @@ ice_xdp_setup_prog(struct ice_vsi *vsi, struct bpf_prog *prog, struct netlink_ext_ack *extack) { unsigned int frame_size = vsi->netdev->mtu + ICE_ETH_PKT_HDR_PAD; - bool if_running = netif_running(vsi->netdev); int ret = 0, xdp_ring_err = 0; + bool if_running; if (prog && !prog->aux->xdp_has_frags) { if (frame_size > ice_max_xdp_frame_size(vsi)) { @@ -3024,8 +3024,11 @@ ice_xdp_setup_prog(struct ice_vsi *vsi, struct bpf_prog *prog, return 0; } + if_running = netif_running(vsi->netdev) && + !test_and_set_bit(ICE_VSI_DOWN, vsi->state); + /* need to stop netdev while setting up the program for Rx rings */ - if (if_running && !test_and_set_bit(ICE_VSI_DOWN, vsi->state)) { + if (if_running) { ret = ice_down(vsi); if (ret) { NL_SET_ERR_MSG_MOD(extack, "Preparing device for XDP attach failed"); -- 2.43.0