From patchwork Wed Jul 24 16:48:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Larysa Zaremba X-Patchwork-Id: 1964387 X-Patchwork-Delegate: anthony.l.nguyen@intel.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=osuosl.org header.i=@osuosl.org header.a=rsa-sha256 header.s=default header.b=7APGWIBT; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org (client-ip=2605:bc80:3010::133; helo=smtp2.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=patchwork.ozlabs.org) Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WTgG04pzkz1yZw for ; Thu, 25 Jul 2024 02:58:48 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 6C35740E1B; Wed, 24 Jul 2024 16:58:43 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id aAjdgwUjg8o9; Wed, 24 Jul 2024 16:58:42 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 895F640E14 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1721840322; bh=uuepI7iYQlJ3U+OAlD6L0VEXeJ1Y1qTXXsTzpDsFsYg=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=7APGWIBTEVf+vdQ78+/cLt0mZbMjtFlHBCER27APxPeIam5xPFd+zjwrg2sz7K3hA jPw8TKZT3QMXBgd2ANI4qx3PI46n6K0dR93OJ1qoE0UtW8fpcKkMz6oZczqr/ZDpUA Xs56xOaJ2GHMNYQ84jU+pTl58FUOokQ8HqPrmuGhqG8TqgIuDrw7c2dv0gQYoCe9xV ORBEK+A+8EKUemb8sJff9r65DIM5FQtTRnwoRyWc5X8FFZufypSENC69e6sSliFjig 4YP1x1yrHqAGFpBNVD+8TFDiNyA75OjZB6Ce0OmX9ZLYZiTeA5wUxKg7BG8JDdmF8X yuUjFW2jS/bTA== Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id 895F640E14; Wed, 24 Jul 2024 16:58:42 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id A515A1BF29C for ; Wed, 24 Jul 2024 16:58:40 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 93751814B6 for ; Wed, 24 Jul 2024 16:58:40 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id bbbKRMsUHOCQ for ; Wed, 24 Jul 2024 16:58:40 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=198.175.65.13; helo=mgamail.intel.com; envelope-from=larysa.zaremba@intel.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org D6F9D813ED DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org D6F9D813ED Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) by smtp1.osuosl.org (Postfix) with ESMTPS id D6F9D813ED for ; Wed, 24 Jul 2024 16:58:39 +0000 (UTC) X-CSE-ConnectionGUID: //KieBBISwOaJgwrds0q1g== X-CSE-MsgGUID: BcTPkXtNQwOGyx/Me42Hsw== X-IronPort-AV: E=McAfee;i="6700,10204,11143"; a="30679793" X-IronPort-AV: E=Sophos;i="6.09,233,1716274800"; d="scan'208";a="30679793" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jul 2024 09:58:40 -0700 X-CSE-ConnectionGUID: maqkn2tPQI+cyQwhL7cjiw== X-CSE-MsgGUID: nDssrBtuQcmLwkCfsXcdqw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,233,1716274800"; d="scan'208";a="56960634" Received: from irvmail002.ir.intel.com ([10.43.11.120]) by fmviesa005.fm.intel.com with ESMTP; 24 Jul 2024 09:58:36 -0700 Received: from lincoln.igk.intel.com (lincoln.igk.intel.com [10.102.21.235]) by irvmail002.ir.intel.com (Postfix) with ESMTP id 6C0582878E; Wed, 24 Jul 2024 17:58:34 +0100 (IST) From: Larysa Zaremba To: intel-wired-lan@lists.osuosl.org Date: Wed, 24 Jul 2024 18:48:36 +0200 Message-ID: <20240724164840.2536605-6-larysa.zaremba@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240724164840.2536605-1-larysa.zaremba@intel.com> References: <20240724164840.2536605-1-larysa.zaremba@intel.com> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1721840321; x=1753376321; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=BZD7fxo2009l6zfgoD9aO0y7LSTsVh4ZDQmghEWlGu8=; b=lH7GQ1SKt/tbrZ0AbChcf+Z0gMqqdYgFfq2jbcwA58eA/tAZHzpIgycN chwCIDNcGUBg3OKC5xIi9D5UyJRzJ5qvclnC8PZon4qqkv1YgFBE/DBDs hMIaSWJGtC8cl4cLZ7LTXmYHelqNGDsz7QnA+mJpb1ikecl2SWrjXqPXW 0HX9FmtGoI2Lsd3L+fqL7O82WrqXhs338OqSkX2+6F+F+j1O/x9q0nNsa rlXXzCpHDP1jS+XuCrz76iRiXU3CgxGlFMWJvJfbEc3zJOyTkaG1tz4Or +TAIGEJczJvlpOrNRxzFWWKsH2VBIGCEPELffdbSvX4chPpY/TX1T/KD9 Q==; X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dmarc=pass (p=none dis=none) header.from=intel.com X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=lH7GQ1SK Subject: [Intel-wired-lan] [PATCH iwl-net v2 5/6] ice: remove ICE_CFG_BUSY locking from AF_XDP code X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Wojciech Drewek , Maciej Fijalkowski , Jesper Dangaard Brouer , Daniel Borkmann , Larysa Zaremba , netdev@vger.kernel.org, John Fastabend , Alexei Starovoitov , linux-kernel@vger.kernel.org, Eric Dumazet , Michal Kubiak , Tony Nguyen , Amritha Nambiar , Jacob Keller , Jakub Kicinski , bpf@vger.kernel.org, Paolo Abeni , "David S. Miller" , magnus.karlsson@intel.com Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" Locking used in ice_qp_ena() and ice_qp_dis() does pretty much nothing, because ICE_CFG_BUSY is a state flag that is supposed to be set in a PF state, not VSI one. Therefore it does not protect the queue pair from e.g. reset. Despite being useless, it still can deadlock the unfortunate functions that have fell into the same ICE_CFG_BUSY-VSI trap. This happens if ice_qp_ena returns an error. Remove ICE_CFG_BUSY locking from ice_qp_dis() and ice_qp_ena(). Fixes: 2d4238f55697 ("ice: Add support for AF_XDP") Reviewed-by: Wojciech Drewek Signed-off-by: Larysa Zaremba Reviewed-by: Jacob Keller Reviewed-by: Jacob Keller Tested-by: Chandan Kumar Rout (A Contingent Worker at Intel) --- drivers/net/ethernet/intel/ice/ice_xsk.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_xsk.c b/drivers/net/ethernet/intel/ice/ice_xsk.c index 5dd50a2866cc..d23fd4ea9129 100644 --- a/drivers/net/ethernet/intel/ice/ice_xsk.c +++ b/drivers/net/ethernet/intel/ice/ice_xsk.c @@ -163,7 +163,6 @@ static int ice_qp_dis(struct ice_vsi *vsi, u16 q_idx) struct ice_q_vector *q_vector; struct ice_tx_ring *tx_ring; struct ice_rx_ring *rx_ring; - int timeout = 50; int err; if (q_idx >= vsi->num_rxq || q_idx >= vsi->num_txq) @@ -173,13 +172,6 @@ static int ice_qp_dis(struct ice_vsi *vsi, u16 q_idx) rx_ring = vsi->rx_rings[q_idx]; q_vector = rx_ring->q_vector; - while (test_and_set_bit(ICE_CFG_BUSY, vsi->state)) { - timeout--; - if (!timeout) - return -EBUSY; - usleep_range(1000, 2000); - } - ice_qvec_dis_irq(vsi, rx_ring, q_vector); ice_qvec_toggle_napi(vsi, q_vector, false); @@ -250,7 +242,6 @@ static int ice_qp_ena(struct ice_vsi *vsi, u16 q_idx) ice_qvec_ena_irq(vsi, q_vector); netif_tx_start_queue(netdev_get_tx_queue(vsi->netdev, q_idx)); - clear_bit(ICE_CFG_BUSY, vsi->state); return 0; }