From patchwork Tue Jun 4 13:21:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maciej Fijalkowski X-Patchwork-Id: 13685306 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 D5F581474A6 for ; Tue, 4 Jun 2024 13:22:18 +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=1717507340; cv=none; b=cunH7I+ZrLw1lCQoNz7l2C9ojh8JSdbRoPhbfbVlrMUNAguQsR+3yuYIAidIE2OtGIViHe1+Qi4dHvvec73eC7mnKrbB0ENoC+za8tr2pw7qCyKmpE4k+bt5xNvdRZTedsYybD86mKh8ZpVjy/9OtVTPX2VwswHWVrHvskl2xJs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717507340; c=relaxed/simple; bh=OYsK15Mb/mDG2rT2wboMih8QycgdQA7XYEQQTqsfnx0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=okHz3CzQkD7tGCts1uZnkHtDlT0+1IHkW01VEv3ia+IvOJ0PPHLd6kHFy1JAeDpin5xgPPGhWwws0A6Ob/dReRbdmY6T2k2qQWVubT3j80E4E7LIq84ujSF+tD2oGOsyHx46erb7AAkX9z7mRYsGuWzJaNWrLfAuQSz7wqXXOVE= 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=WtUznnRv; 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="WtUznnRv" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717507338; x=1749043338; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=OYsK15Mb/mDG2rT2wboMih8QycgdQA7XYEQQTqsfnx0=; b=WtUznnRv57BKN6CwjNgl/5tIXCh1y0YwT6XUiyUWOviEbIDMdF2NEyZE HNaysdkNiBLWAJ84Q++Yjrc0mMgJTKfpWcHDRJcORC/FXlIqYr6PFg5aq 5GkmK/fVAvuvcMl7jiDbtS4Qs6gx7MoFtWC0AKNWlcb1hd8M2tuwnsBf5 OiVLHGIbV6Gh3Eyv70B73ykZOw3mHHLH0Ak6yFokZdAaFgHdP7BaqP6zd KF6OMu9e7kUnlNfmmTsxE8TcUGUUJylZj+w6t4yLLSSIJ+PJF50qGzFCm k1eFHrBLwIIp8AIJarMjjIx71kVZbbOBDOz1BZchRWnIXibhONqHWuwd1 Q==; X-CSE-ConnectionGUID: xPBES/tCT/6H62wAei5HQw== X-CSE-MsgGUID: MH00XHfAQjiWhrVxsRRgGw== X-IronPort-AV: E=McAfee;i="6600,9927,11093"; a="31552881" X-IronPort-AV: E=Sophos;i="6.08,213,1712646000"; d="scan'208";a="31552881" 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:18 -0700 X-CSE-ConnectionGUID: Sdwk3qzBRT2VfZr8ykQBeg== X-CSE-MsgGUID: hEoKu8dfRIuEHhTmbZK21Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,213,1712646000"; d="scan'208";a="37350169" Received: from boxer.igk.intel.com ([10.102.20.173]) by fmviesa009.fm.intel.com with ESMTP; 04 Jun 2024 06:22:16 -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 4/8] ice: modify error handling when setting XSK pool in ndo_bpf Date: Tue, 4 Jun 2024 15:21:51 +0200 Message-Id: <20240604132155.3573752-5-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 Don't bail out right when spotting an error within ice_qp_{dis,ena}() but rather track error and go through whole flow of disabling and enabling queue pair. 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 | 30 +++++++++++++----------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_xsk.c b/drivers/net/ethernet/intel/ice/ice_xsk.c index b6f4ddb744d4..8ca7ff1a7e7f 100644 --- a/drivers/net/ethernet/intel/ice/ice_xsk.c +++ b/drivers/net/ethernet/intel/ice/ice_xsk.c @@ -162,6 +162,7 @@ static int ice_qp_dis(struct ice_vsi *vsi, u16 q_idx) struct ice_tx_ring *tx_ring; struct ice_rx_ring *rx_ring; int timeout = 50; + int fail = 0; int err; if (q_idx >= vsi->num_rxq || q_idx >= vsi->num_txq) @@ -186,8 +187,8 @@ static int ice_qp_dis(struct ice_vsi *vsi, u16 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) - return err; + if (!fail) + fail = err; if (ice_is_xdp_ena_vsi(vsi)) { struct ice_tx_ring *xdp_ring = vsi->xdp_rings[q_idx]; @@ -195,15 +196,15 @@ static int ice_qp_dis(struct ice_vsi *vsi, u16 q_idx) ice_fill_txq_meta(vsi, xdp_ring, &txq_meta); err = ice_vsi_stop_tx_ring(vsi, ICE_NO_RESET, 0, xdp_ring, &txq_meta); - if (err) - return err; + if (!fail) + fail = err; } ice_vsi_ctrl_one_rx_ring(vsi, false, q_idx, false); ice_qp_clean_rings(vsi, q_idx); ice_qp_reset_stats(vsi, q_idx); - return 0; + return fail; } /** @@ -216,32 +217,33 @@ static int ice_qp_dis(struct ice_vsi *vsi, u16 q_idx) static int ice_qp_ena(struct ice_vsi *vsi, u16 q_idx) { struct ice_q_vector *q_vector; + int fail = 0; int err; err = ice_vsi_cfg_single_txq(vsi, vsi->tx_rings, q_idx); - if (err) - return err; + if (!fail) + fail = err; if (ice_is_xdp_ena_vsi(vsi)) { struct ice_tx_ring *xdp_ring = vsi->xdp_rings[q_idx]; err = ice_vsi_cfg_single_txq(vsi, vsi->xdp_rings, q_idx); - if (err) - return err; + if (!fail) + fail = err; ice_set_ring_xdp(xdp_ring); ice_tx_xsk_pool(vsi, q_idx); } err = ice_vsi_cfg_single_rxq(vsi, q_idx); - if (err) - return err; + if (!fail) + fail = err; q_vector = vsi->rx_rings[q_idx]->q_vector; ice_qvec_cfg_msix(vsi, q_vector); err = ice_vsi_ctrl_one_rx_ring(vsi, true, q_idx, true); - if (err) - return err; + if (!fail) + fail = err; ice_qvec_toggle_napi(vsi, q_vector, true); ice_qvec_ena_irq(vsi, q_vector); @@ -249,7 +251,7 @@ static int ice_qp_ena(struct ice_vsi *vsi, u16 q_idx) netif_tx_start_queue(netdev_get_tx_queue(vsi->netdev, q_idx)); clear_bit(ICE_CFG_BUSY, vsi->state); - return 0; + return fail; } /**