From patchwork Tue Jun 4 13:21:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maciej Fijalkowski X-Patchwork-Id: 13685305 X-Patchwork-Delegate: kuba@kernel.org Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) (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 41A15146D71 for ; Tue, 4 Jun 2024 13:22:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.10 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717507337; cv=none; b=RaSLx9eqTmKKEvX9Aqibg3LQTFqJK7341WAoqfT4AMP8vajpg74o5A+DwL0dxqDnQyWQi1UuG4cBXFGjT5tRO2ax0qtGMVapJFxIlqmpTXvWkpjTV1pcBmQDxOsCFU9olHm4JOawu9lhSdqWPNlBiIsseFk0M7TH1YpPdMVLKG0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717507337; c=relaxed/simple; bh=a1dhhNK9Bs1bRbEZVfp3DyLiMrScd+jIdCuvOFZqQN0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=DIA+JevQ5772QH4qem9U1LkMB420HX/0GqUlrdQLyu1oV1RvKzCpjeMDYl4QnEi9yKAhyWtrJfYBjaq3vINsMpANRAFGgmb1W6LTNYS/CUU185QlJCCyh0Un4N2arnozq5cb3r3EQ5BjJ7EuzbG/k9v314GxO7e6z1ANNzUtpKo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Wd5BWnpT; arc=none smtp.client-ip=198.175.65.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Wd5BWnpT" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717507336; x=1749043336; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=a1dhhNK9Bs1bRbEZVfp3DyLiMrScd+jIdCuvOFZqQN0=; b=Wd5BWnpTyhUJhTETx7freEcape/Fqnaj26yyRDgDkvJKC7TuNb9dHun6 DRWSmuaQCLetY7/Xcex6jYt+rk6TzDhqH6rZ7p7HS+/K3FKmnq2Aqkdsg 4oH8HiOOhQitwlULBJFkVxHPS/L3j8ldFU/KAIb6V3+NiaAz/jPFKqoZW lbxeNV+br869R4pjJF4tXxR0BhwLl3IUAWp+8rT96mA4uHxUFV/PPDUEV ApVkZsEjChP3aYpAFT66GNca+Zp++XeCq8ZNMExwMjJYwlv/EuE/9uKri Z7iruCbY7JcgwqiqzHuWqsztbCZizuuLFYYODI1XwWITnP3afgDNxVTmN Q==; X-CSE-ConnectionGUID: arzq6aRlRe2ooYHLtHDstQ== X-CSE-MsgGUID: FuvVrWDYSuysaLhAlZ3cWA== X-IronPort-AV: E=McAfee;i="6600,9927,11093"; a="31552864" X-IronPort-AV: E=Sophos;i="6.08,213,1712646000"; d="scan'208";a="31552864" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jun 2024 06:22:16 -0700 X-CSE-ConnectionGUID: NqvG7nAWTvetGvhaNnhL4w== X-CSE-MsgGUID: cb2jJ0zdTBSNVKL6hCNWbA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,213,1712646000"; d="scan'208";a="37350147" Received: from boxer.igk.intel.com ([10.102.20.173]) by fmviesa009.fm.intel.com with ESMTP; 04 Jun 2024 06:22:14 -0700 From: Maciej Fijalkowski To: intel-wired-lan@lists.osuosl.org Cc: netdev@vger.kernel.org, anthony.l.nguyen@intel.com, magnus.karlsson@intel.com, michal.kubiak@intel.com, larysa.zaremba@intel.com, jacob.e.keller@intel.com, Maciej Fijalkowski , Shannon Nelson , Chandan Kumar Rout Subject: [PATCH v3 iwl-net 3/8] ice: replace synchronize_rcu with synchronize_net Date: Tue, 4 Jun 2024 15:21:50 +0200 Message-Id: <20240604132155.3573752-4-maciej.fijalkowski@intel.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240604132155.3573752-1-maciej.fijalkowski@intel.com> References: <20240604132155.3573752-1-maciej.fijalkowski@intel.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Given that ice_qp_dis() is called under rtnl_lock, synchronize_net() can be called instead of synchronize_rcu() so that XDP rings can finish its job in a faster way. Also let us do this as earlier in XSK queue disable flow. Additionally, turn off regular Tx queue before disabling irqs and NAPI. Fixes: 2d4238f55697 ("ice: Add support for AF_XDP") Reviewed-by: Shannon Nelson Tested-by: Chandan Kumar Rout (A Contingent Worker at Intel) Signed-off-by: Maciej Fijalkowski --- drivers/net/ethernet/intel/ice/ice_xsk.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_xsk.c b/drivers/net/ethernet/intel/ice/ice_xsk.c index 4f606a1055b0..b6f4ddb744d4 100644 --- a/drivers/net/ethernet/intel/ice/ice_xsk.c +++ b/drivers/net/ethernet/intel/ice/ice_xsk.c @@ -52,10 +52,8 @@ static void ice_qp_reset_stats(struct ice_vsi *vsi, u16 q_idx) static void ice_qp_clean_rings(struct ice_vsi *vsi, u16 q_idx) { ice_clean_tx_ring(vsi->tx_rings[q_idx]); - if (ice_is_xdp_ena_vsi(vsi)) { - synchronize_rcu(); + if (ice_is_xdp_ena_vsi(vsi)) ice_clean_tx_ring(vsi->xdp_rings[q_idx]); - } ice_clean_rx_ring(vsi->rx_rings[q_idx]); } @@ -180,11 +178,12 @@ static int ice_qp_dis(struct ice_vsi *vsi, u16 q_idx) usleep_range(1000, 2000); } + synchronize_net(); + netif_tx_stop_queue(netdev_get_tx_queue(vsi->netdev, q_idx)); + ice_qvec_dis_irq(vsi, rx_ring, q_vector); ice_qvec_toggle_napi(vsi, q_vector, false); - netif_tx_stop_queue(netdev_get_tx_queue(vsi->netdev, q_idx)); - ice_fill_txq_meta(vsi, tx_ring, &txq_meta); err = ice_vsi_stop_tx_ring(vsi, ICE_NO_RESET, 0, tx_ring, &txq_meta); if (err)