From patchwork Tue Dec 3 06:58:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Swiatkowski X-Patchwork-Id: 13891776 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 BEA36185B76 for ; Tue, 3 Dec 2024 06:58:49 +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=1733209131; cv=none; b=LwXob0VWIVyCL13o+JhqG4pd5umrXiS/QIJUZdrAVINhk9fbFFyNfIUW2IncuugeHYzjxMS4Ljhf4GA42jwiHa3ecWblZl+LMYVyATcj4oWsSrMyqlTXZ7D0aYAEX7AWBI+LsIYiogSt3tux2R3TF4kP02MfP+LQZbJtRkPMXbc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733209131; c=relaxed/simple; bh=dcsC+RtCSD5Uo+HcViZYTI3F4FsTqUB53i8NpeKAX0A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=n1T18JBG6TSguFz01Vcq0pW/ldiYppLajFwq9D/m6YzDM4NEUOFcebrk+c5Kq72HMYhgLelH9JdGYk297V+Zr+piXwA9Q7TZn17G6QFx0gBqDgEW88yT4XLfTnR4yEh4VNmoQzvkGdb2AX4xvMz/uen92ykjRuwfjvbT15LMJJQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=EkBbcnP9; arc=none smtp.client-ip=192.198.163.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="EkBbcnP9" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1733209130; x=1764745130; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=dcsC+RtCSD5Uo+HcViZYTI3F4FsTqUB53i8NpeKAX0A=; b=EkBbcnP9RjyUhp7qw3HcPvnDfz6nTHJEjQSAuya3cXOMpTErfHMYUMuj lGH2c6wrG1T5COG8FiY8vue7rFriTC4VTOyP4EdHnixq6hLiYX8iCWrS2 392ZkcV+WMoZo0bWW9CTK5mwGgKgfP/riaOPyjeI9L4Slv21lh4y2qHK1 X7h0/OvQTDMMp67/rSXIetP0uJW+KpBrfWL0jP8+tmCFGQOiEiMTciRCi lB/IUr5EQ5lARa0ZPAsqkEAmAc5CkhGFiKgH4BL9YVeAnbKa7Ms+J2Yg1 m1Q1skZ1dEoscacFiC6JOaZX5zc08N2jVxFT7nX4EJrHDxxZPshIqpcyE w==; X-CSE-ConnectionGUID: 5iyXIM26Tn++Uc1vq/H9ww== X-CSE-MsgGUID: ZPpCqusITgGDc1sQXeJnMA== X-IronPort-AV: E=McAfee;i="6700,10204,11274"; a="33330554" X-IronPort-AV: E=Sophos;i="6.12,204,1728975600"; d="scan'208";a="33330554" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Dec 2024 22:58:49 -0800 X-CSE-ConnectionGUID: 2EB3Ea1JTi66WMwy6ZLvpA== X-CSE-MsgGUID: 1g7tmOoHT3S/P5LYvRk67A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,204,1728975600"; d="scan'208";a="93673742" Received: from gk3153-dr2-r750-36946.igk.intel.com ([10.102.20.192]) by fmviesa010.fm.intel.com with ESMTP; 02 Dec 2024 22:58:46 -0800 From: Michal Swiatkowski To: intel-wired-lan@lists.osuosl.org Cc: netdev@vger.kernel.org, pawel.chmielewski@intel.com, sridhar.samudrala@intel.com, jacob.e.keller@intel.com, pio.raczynski@gmail.com, konrad.knitter@intel.com, marcin.szycik@intel.com, wojciech.drewek@intel.com, nex.sw.ncis.nat.hpm.dev@intel.com, przemyslaw.kitszel@intel.com, jiri@resnulli.us, horms@kernel.org, David.Laight@ACULAB.COM, pmenzel@molgen.mpg.de, mschmidt@redhat.com, himasekharx.reddy.pucha@intel.com, rafal.romanowski@intel.com Subject: [iwl-next v9 7/9] ice: enable_rdma devlink param Date: Tue, 3 Dec 2024 07:58:15 +0100 Message-ID: <20241203065817.13475-8-michal.swiatkowski@linux.intel.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20241203065817.13475-1-michal.swiatkowski@linux.intel.com> References: <20241203065817.13475-1-michal.swiatkowski@linux.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 Implement enable_rdma devlink parameter to allow user to turn RDMA feature on and off. It is useful when there is no enough interrupts and user doesn't need RDMA feature. Reviewed-by: Jacob Keller Reviewed-by: Jan Sokolowski Reviewed-by: Przemek Kitszel Signed-off-by: Michal Swiatkowski --- .../net/ethernet/intel/ice/devlink/devlink.c | 21 +++++++++++++++++++ drivers/net/ethernet/intel/ice/ice_lib.c | 8 ++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/ice/devlink/devlink.c b/drivers/net/ethernet/intel/ice/devlink/devlink.c index c53baecf8a90..725136c975e1 100644 --- a/drivers/net/ethernet/intel/ice/devlink/devlink.c +++ b/drivers/net/ethernet/intel/ice/devlink/devlink.c @@ -1583,6 +1583,19 @@ ice_devlink_msix_min_pf_validate(struct devlink *devlink, u32 id, return 0; } +static int ice_devlink_enable_rdma_validate(struct devlink *devlink, u32 id, + union devlink_param_value val, + struct netlink_ext_ack *extack) +{ + struct ice_pf *pf = devlink_priv(devlink); + bool new_state = val.vbool; + + if (new_state && !test_bit(ICE_FLAG_RDMA_ENA, pf->flags)) + return -EOPNOTSUPP; + + return 0; +} + enum ice_param_id { ICE_DEVLINK_PARAM_ID_BASE = DEVLINK_PARAM_GENERIC_ID_MAX, ICE_DEVLINK_PARAM_ID_TX_SCHED_LAYERS, @@ -1598,6 +1611,8 @@ static const struct devlink_param ice_dvl_rdma_params[] = { ice_devlink_enable_iw_get, ice_devlink_enable_iw_set, ice_devlink_enable_iw_validate), + DEVLINK_PARAM_GENERIC(ENABLE_RDMA, BIT(DEVLINK_PARAM_CMODE_DRIVERINIT), + NULL, NULL, ice_devlink_enable_rdma_validate), }; static const struct devlink_param ice_dvl_msix_params[] = { @@ -1738,6 +1753,12 @@ int ice_devlink_register_params(struct ice_pf *pf) devl_param_driverinit_value_set(devlink, DEVLINK_PARAM_GENERIC_ID_MSIX_VEC_PER_PF_MIN, value); + + value.vbool = test_bit(ICE_FLAG_RDMA_ENA, pf->flags); + devl_param_driverinit_value_set(devlink, + DEVLINK_PARAM_GENERIC_ID_ENABLE_RDMA, + value); + return 0; unregister_msix_params: diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c index 01afa5f84af9..29a3e055b7c6 100644 --- a/drivers/net/ethernet/intel/ice/ice_lib.c +++ b/drivers/net/ethernet/intel/ice/ice_lib.c @@ -833,7 +833,13 @@ bool ice_is_safe_mode(struct ice_pf *pf) */ bool ice_is_rdma_ena(struct ice_pf *pf) { - return test_bit(ICE_FLAG_RDMA_ENA, pf->flags); + union devlink_param_value value; + int err; + + err = devl_param_driverinit_value_get(priv_to_devlink(pf), + DEVLINK_PARAM_GENERIC_ID_ENABLE_RDMA, + &value); + return err ? test_bit(ICE_FLAG_RDMA_ENA, pf->flags) : value.vbool; } /**