From patchwork Mon Sep 30 12:04:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Swiatkowski X-Patchwork-Id: 1990925 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=fNeS5Kx2; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org (client-ip=140.211.166.136; helo=smtp3.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=patchwork.ozlabs.org) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (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 4XHKWF3LZ4z1xsq for ; Mon, 30 Sep 2024 22:04:41 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 5B370606BD; Mon, 30 Sep 2024 12:04:30 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id PA6FS_ub241N; Mon, 30 Sep 2024 12:04:29 +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 smtp3.osuosl.org 8B4D96068F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1727697869; bh=eizZwucflGQGeVlYdkPUiOocATMdxPkJ19VpCZJWXks=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=fNeS5Kx2Mdq68I+5YOO6xJNodaJqTjFZ36rZjYNrIJs7TcjJvYpRf/46v+bIKbL1S CmhBHdw+TYrewvL9h3QOdiFbwFDdXnhXYlPGFNMNsloWbROknCl2nhaabdAWaBhDkz 6yL/jjIEBtW/aE+36CV6YmXlhzb1iR7bnGzVWPr7UrDHddFh4If7mN66yNflmFNaq0 7LoBzPw/L+iNCipLUz2e//LpiMgtixYhe0SoBfjOcXadF1GUuYr8dvzQHwVG7b0Y27 76vmMFcubiymgSw2FKGlfFTa42lvDnZOc4viXVee57YqzwPSnVry+Y+mIPeIze/1qq nyjY8ibRheB5Q== Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id 8B4D96068F; Mon, 30 Sep 2024 12:04:29 +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 B6A0B1BF31E for ; Mon, 30 Sep 2024 12:04:25 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id AE62380F35 for ; Mon, 30 Sep 2024 12:04:23 +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 lXPFulmYzkcM for ; Mon, 30 Sep 2024 12:04:23 +0000 (UTC) Received-SPF: None (mailfrom) identity=mailfrom; client-ip=192.198.163.13; helo=mgamail.intel.com; envelope-from=michal.swiatkowski@linux.intel.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org E435C80F0F DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org E435C80F0F Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) by smtp1.osuosl.org (Postfix) with ESMTPS id E435C80F0F for ; Mon, 30 Sep 2024 12:04:22 +0000 (UTC) X-CSE-ConnectionGUID: Div9YztfRKOYHbzFZQx3Yg== X-CSE-MsgGUID: U57koEq+QM+raJ3UB64ChQ== X-IronPort-AV: E=McAfee;i="6700,10204,11210"; a="29665577" X-IronPort-AV: E=Sophos;i="6.11,165,1725346800"; d="scan'208";a="29665577" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Sep 2024 05:04:23 -0700 X-CSE-ConnectionGUID: hbRpf7TySIm/wmqYzZdYrQ== X-CSE-MsgGUID: SKpHPQQSSoGeQVROt1L19Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,165,1725346800"; d="scan'208";a="77363528" Received: from gk3153-dr2-r750-36946.igk.intel.com ([10.102.20.192]) by fmviesa003.fm.intel.com with ESMTP; 30 Sep 2024 05:04:20 -0700 From: Michal Swiatkowski To: intel-wired-lan@lists.osuosl.org Date: Mon, 30 Sep 2024 14:04:00 +0200 Message-ID: <20240930120402.3468-7-michal.swiatkowski@linux.intel.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240930120402.3468-1-michal.swiatkowski@linux.intel.com> References: <20240930120402.3468-1-michal.swiatkowski@linux.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=1727697863; x=1759233863; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jUNfHA5UbzXJN6pEmK68qcgsFUz8UL3Epa3l8zpf55E=; b=GtSKunaLHSknSZqKZ1Wn0loZMX6z3Krxyy1kSWNomzQTMEYvd+u4jqWI baEVo/4qdwOjqQLtLtVGErdqPK2ZjDwM0d/ctE+UsksHbR3BCJKoiyaLa dBGXbmkG4MMQofa/G2VM3CX9jYS+QI73Tx59rui5DzQo0+BC81WTVZ/EI lbFS4hB6m81+qflk3cjxLO89FXVob125VI1ae194Vn7eJbgKOiubauRKd 7zlwq4ysGQniORaxCTbk0wEMwstrtCfQSB+oqdkEizF9Y70BQCaIfWSFN pS9eLF82JhrCal2sALDq4TItEk+zwxwpWtOhRCTuFmx9D2gtbPapcWSHc w==; X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dmarc=none (p=none dis=none) header.from=linux.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=GtSKunaL Subject: [Intel-wired-lan] [iwl-next v4 6/8] ice: enable_rdma devlink param 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@intel.com, marcin.szycik@intel.com, netdev@vger.kernel.org, konrad.knitter@intel.com, pawel.chmielewski@intel.com, nex.sw.ncis.nat.hpm.dev@intel.com, pio.raczynski@gmail.com, sridhar.samudrala@intel.com, jacob.e.keller@intel.com, jiri@resnulli.us, przemyslaw.kitszel@intel.com Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" 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: Jan Sokolowski Reviewed-by: Przemek Kitszel Signed-off-by: Michal Swiatkowski --- .../net/ethernet/intel/ice/devlink/devlink.c | 19 +++++++++++++++++++ drivers/net/ethernet/intel/ice/ice_lib.c | 8 +++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/ice/devlink/devlink.c b/drivers/net/ethernet/intel/ice/devlink/devlink.c index 55538cbcf0b0..ae1e2d705704 100644 --- a/drivers/net/ethernet/intel/ice/devlink/devlink.c +++ b/drivers/net/ethernet/intel/ice/devlink/devlink.c @@ -1544,6 +1544,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, @@ -1559,6 +1572,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[] = { @@ -1699,6 +1714,10 @@ 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; } diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c index 99af78daa5e2..2d0e44152480 100644 --- a/drivers/net/ethernet/intel/ice/ice_lib.c +++ b/drivers/net/ethernet/intel/ice/ice_lib.c @@ -834,7 +834,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; } /**