From patchwork Fri Jun 7 21:22:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacob Keller X-Patchwork-Id: 13690664 X-Patchwork-Delegate: kuba@kernel.org Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (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 2280315532B for ; Fri, 7 Jun 2024 21:22:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717795369; cv=none; b=AXQykqJN+JtlwO+3Ed8Pk3jS2GAAdpVE0LvYktHYpbc9ys3wjFG8vh0qt2HcwXNpD0WgLIGl/r+6E9NfQalm2dtq/WOXJ8yVZWQBEIOwsXnl1IvYKswrbTLrrLIJ3fcgbiQ6edgUCW3q35jcwiyxmAYgVt+e8m+yCkErfvwmaLg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717795369; c=relaxed/simple; bh=xeiAWV1KfVzKZo0IM2moDis3aN4One++SFlhpT5zKxU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=u31xav5uqPichHcP9mcFL6OZB9Uu0U23O7HWAHxMnrDU8jutbH+92XYgrp9q/y+/77HIElZXU0X4XjDjAPWmmG0PxwOF/sMzt+NR3xvOQVQkasjx40S/8brU2vxSVL6VBqEpdrPt/WFS0bvhLrA+KjnSkbLKEk4dS+RyQcrlWfY= 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=BBKZ6rwO; arc=none smtp.client-ip=192.198.163.17 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="BBKZ6rwO" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717795368; x=1749331368; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=xeiAWV1KfVzKZo0IM2moDis3aN4One++SFlhpT5zKxU=; b=BBKZ6rwOFoxtUaGJIej2CrBUk5pzA0jyK/NvKBEhyuC1nVkmveKtIomz QhiBq3G2Y4yyFawqv4fECM9E7a68bJO4GMKhtnwMSbKV3D2InEQOELf7M Mf86m18q386DCwAbwq0e7Bmo2coYGghPuZpkhOrp39RnLVbt2cuwMbrRK AOau+WCwKfiR7d3RggFAtfF/e+4yuqLcF0q69ZJks06Zb0gPXkEXN4Pgq sE6Ak+ml2STf6q/LN/gbFVDMs1dCzINOrluNrsU+hBYLJrOt8/xWc3hiK oihFx0EOL7wJxA6uguw1LT3SpLSXpJBgEIqec8vzIYhcWslki5d6irjon A==; X-CSE-ConnectionGUID: bobj4RjSSCSRCFI3fI6ijQ== X-CSE-MsgGUID: 5TyOO+PWRPCJ/Gb7g7q6dw== X-IronPort-AV: E=McAfee;i="6600,9927,11096"; a="14417711" X-IronPort-AV: E=Sophos;i="6.08,221,1712646000"; d="scan'208";a="14417711" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2024 14:22:45 -0700 X-CSE-ConnectionGUID: pb7qaA9ZRx6ewsi3lm2OIQ== X-CSE-MsgGUID: lBD2BZ6iROKF2tMVplLmdg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,221,1712646000"; d="scan'208";a="38571794" Received: from jekeller-desk.amr.corp.intel.com ([10.166.241.1]) by fmviesa009-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2024 14:22:44 -0700 From: Jacob Keller Date: Fri, 07 Jun 2024 14:22:34 -0700 Subject: [PATCH v3 3/3] ice: use irq_update_affinity_hint() Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240607-next-2024-06-03-intel-next-batch-v3-3-d1470cee3347@intel.com> References: <20240607-next-2024-06-03-intel-next-batch-v3-0-d1470cee3347@intel.com> In-Reply-To: <20240607-next-2024-06-03-intel-next-batch-v3-0-d1470cee3347@intel.com> To: Jakub Kicinski , David Miller , netdev Cc: Jacob Keller , Michal Schmidt , Sunil Goutham , Pucha Himasekhar Reddy X-Mailer: b4 0.13.0 X-Patchwork-Delegate: kuba@kernel.org From: Michal Schmidt irq_set_affinity_hint() is deprecated. Use irq_update_affinity_hint() instead. This removes the side-effect of actually applying the affinity. The driver does not really need to worry about spreading its IRQs across CPUs. The core code already takes care of that. On the contrary, when the driver applies affinities by itself, it breaks the users' expectations: 1. The user configures irqbalance with IRQBALANCE_BANNED_CPULIST in order to prevent IRQs from being moved to certain CPUs that run a real-time workload. 2. ice reconfigures VSIs at runtime due to a MIB change (ice_dcb_process_lldp_set_mib_change). Reopening a VSI resets the affinity in ice_vsi_req_irq_msix(). 3. ice has no idea about irqbalance's config, so it may move an IRQ to a banned CPU. The real-time workload suffers unacceptable latency. I am not sure if updating the affinity hints is at all useful, because irqbalance ignores them since 2016 ([1]), but at least it's harmless. This ice change is similar to i40e commit d34c54d1739c ("i40e: Use irq_update_affinity_hint()"). [1] https://github.com/Irqbalance/irqbalance/commit/dcc411e7bfdd Signed-off-by: Michal Schmidt Reviewed-by: Sunil Goutham Reviewed-by: Jacob Keller Tested-by: Pucha Himasekhar Reddy Signed-off-by: Jacob Keller --- drivers/net/ethernet/intel/ice/ice_lib.c | 4 ++-- drivers/net/ethernet/intel/ice/ice_main.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c index 7629b0190578..f559e60992fa 100644 --- a/drivers/net/ethernet/intel/ice/ice_lib.c +++ b/drivers/net/ethernet/intel/ice/ice_lib.c @@ -2580,8 +2580,8 @@ void ice_vsi_free_irq(struct ice_vsi *vsi) if (!IS_ENABLED(CONFIG_RFS_ACCEL)) irq_set_affinity_notifier(irq_num, NULL); - /* clear the affinity_mask in the IRQ descriptor */ - irq_set_affinity_hint(irq_num, NULL); + /* clear the affinity_hint in the IRQ descriptor */ + irq_update_affinity_hint(irq_num, NULL); synchronize_irq(irq_num); devm_free_irq(ice_pf_to_dev(pf), irq_num, vsi->q_vectors[i]); } diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c index 1b61ca3a6eb6..7d9a4e856f61 100644 --- a/drivers/net/ethernet/intel/ice/ice_main.c +++ b/drivers/net/ethernet/intel/ice/ice_main.c @@ -2607,7 +2607,7 @@ static int ice_vsi_req_irq_msix(struct ice_vsi *vsi, char *basename) } /* assign the mask for this irq */ - irq_set_affinity_hint(irq_num, &q_vector->affinity_mask); + irq_update_affinity_hint(irq_num, &q_vector->affinity_mask); } err = ice_set_cpu_rx_rmap(vsi); @@ -2625,7 +2625,7 @@ static int ice_vsi_req_irq_msix(struct ice_vsi *vsi, char *basename) irq_num = vsi->q_vectors[vector]->irq.virq; if (!IS_ENABLED(CONFIG_RFS_ACCEL)) irq_set_affinity_notifier(irq_num, NULL); - irq_set_affinity_hint(irq_num, NULL); + irq_update_affinity_hint(irq_num, NULL); devm_free_irq(dev, irq_num, &vsi->q_vectors[vector]); } return err;