From patchwork Mon Jun 3 22:38:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacob Keller X-Patchwork-Id: 13684434 X-Patchwork-Delegate: kuba@kernel.org Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) (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 D1F0013DDB9 for ; Mon, 3 Jun 2024 22:38:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717454304; cv=none; b=XYqdyHSYbnNg9y1g7n1GJf6yZcnWdZk/JzNEKiSAtZf0A9Sx2z4CQfHIJIiinWX0wTugKl8GqmQm3quW3L1ioxF0kDQm26JxGb3lWOtNfyLWTsIgrPwNvywJAXvb4mO3bqjelxhr4ci58t1FYrKxqL+NPtRfvyiDaLnjrp6D46c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717454304; c=relaxed/simple; bh=pwd/MVtitZ8Ps76FwPkFB4/aX/Fn6oW06hDofOADNXc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=HW56WVZ/zmkk7G3m2y9BISbYSH4C3z2S0trhdfsm0TvpQ/UgJCLzsL57wtm5urPxGbjV0yDiDS6/XD8qUKQHSa8XgGolK/bM99v2pqpPyqcDlwGdTOiM9gmznmEHrR8gukVnVLuCr0I0EGGDGQDRGlpTtG/+sGCF1xUNTKKqlZ0= 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=lZqd1R7V; arc=none smtp.client-ip=192.198.163.19 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="lZqd1R7V" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717454303; x=1748990303; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=pwd/MVtitZ8Ps76FwPkFB4/aX/Fn6oW06hDofOADNXc=; b=lZqd1R7VI2btzMEBib4MCTavrDY9GWP7wISu4SjbERvUVI3dly2aggxn RakCwyo3xV34HjLf8H6Rf6nLyy5DJe1F55eVEEl01saMVzKWJqffPuf7I ONzdbz6w9/ySPeQEZAYbGg2Tv0JIMYGi9lMN9BE9i97As1/+cJ6kCGE8i UeFB5e5TtV5kP1wAk9lNY/JMq92/uBDzsPqIPYrbfstH3Y3feFbFxks8O d/RkYRO97+IMvnW6KmXVZOV9dP0TYM4ioX4N2UpQFHhAqxKqR4/Lv4HW3 gEfcw0kBnY3+yynBJoXx3XD1PWvpHN8MpwBXXuGwSrxmc0Nx0Zp3ud9h1 g==; X-CSE-ConnectionGUID: GWimqQjTRMWuhGP+PE8Z2A== X-CSE-MsgGUID: zbGNvZbfTASxtDa4NNHANQ== X-IronPort-AV: E=McAfee;i="6600,9927,11092"; a="13780104" X-IronPort-AV: E=Sophos;i="6.08,212,1712646000"; d="scan'208";a="13780104" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2024 15:38:21 -0700 X-CSE-ConnectionGUID: PpLPyvmNQK+zvbUn6O/eWw== X-CSE-MsgGUID: BME3+kkMSgO8ybvgp7hOQA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,212,1712646000"; d="scan'208";a="41471174" Received: from jekeller-desk.amr.corp.intel.com ([10.166.241.1]) by fmviesa005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2024 15:38:21 -0700 From: Jacob Keller Date: Mon, 03 Jun 2024 15:38:13 -0700 Subject: [PATCH 1/9] net: intel: Use *-y instead of *-objs in Makefile Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240603-next-2024-06-03-intel-next-batch-v1-1-e0523b28f325@intel.com> References: <20240603-next-2024-06-03-intel-next-batch-v1-0-e0523b28f325@intel.com> In-Reply-To: <20240603-next-2024-06-03-intel-next-batch-v1-0-e0523b28f325@intel.com> To: David Miller , netdev , Jakub Kicinski Cc: Jacob Keller , Andy Shevchenko , Aleksandr Loktionov , Alexander Lobakin , Pucha Himasekhar Reddy X-Mailer: b4 0.13.0 X-Patchwork-Delegate: kuba@kernel.org From: Andy Shevchenko *-objs suffix is reserved rather for (user-space) host programs while usually *-y suffix is used for kernel drivers (although *-objs works for that purpose for now). Let's correct the old usages of *-objs in Makefiles. Reviewed-by: Aleksandr Loktionov Reviewed-by: Alexander Lobakin Signed-off-by: Andy Shevchenko Reviewed-by: Jacob Keller Tested-by: Pucha Himasekhar Reddy Signed-off-by: Jacob Keller --- drivers/net/ethernet/intel/e1000/Makefile | 2 +- drivers/net/ethernet/intel/e1000e/Makefile | 7 +++---- drivers/net/ethernet/intel/i40e/Makefile | 2 +- drivers/net/ethernet/intel/iavf/Makefile | 5 ++--- drivers/net/ethernet/intel/igb/Makefile | 6 +++--- drivers/net/ethernet/intel/igbvf/Makefile | 6 +----- drivers/net/ethernet/intel/igc/Makefile | 6 +++--- drivers/net/ethernet/intel/ixgbe/Makefile | 8 ++++---- drivers/net/ethernet/intel/ixgbevf/Makefile | 6 +----- drivers/net/ethernet/intel/libeth/Makefile | 2 +- drivers/net/ethernet/intel/libie/Makefile | 2 +- 11 files changed, 21 insertions(+), 31 deletions(-) diff --git a/drivers/net/ethernet/intel/e1000/Makefile b/drivers/net/ethernet/intel/e1000/Makefile index 314c52d44b7c..79491dec47e1 100644 --- a/drivers/net/ethernet/intel/e1000/Makefile +++ b/drivers/net/ethernet/intel/e1000/Makefile @@ -7,4 +7,4 @@ obj-$(CONFIG_E1000) += e1000.o -e1000-objs := e1000_main.o e1000_hw.o e1000_ethtool.o e1000_param.o +e1000-y := e1000_main.o e1000_hw.o e1000_ethtool.o e1000_param.o diff --git a/drivers/net/ethernet/intel/e1000e/Makefile b/drivers/net/ethernet/intel/e1000e/Makefile index 0baa15503c38..18f22b6374d5 100644 --- a/drivers/net/ethernet/intel/e1000e/Makefile +++ b/drivers/net/ethernet/intel/e1000e/Makefile @@ -10,7 +10,6 @@ subdir-ccflags-y += -I$(src) obj-$(CONFIG_E1000E) += e1000e.o -e1000e-objs := 82571.o ich8lan.o 80003es2lan.o \ - mac.o manage.o nvm.o phy.o \ - param.o ethtool.o netdev.o ptp.o - +e1000e-y := 82571.o ich8lan.o 80003es2lan.o \ + mac.o manage.o nvm.o phy.o \ + param.o ethtool.o netdev.o ptp.o diff --git a/drivers/net/ethernet/intel/i40e/Makefile b/drivers/net/ethernet/intel/i40e/Makefile index cad93f323bd5..9faa4339a76c 100644 --- a/drivers/net/ethernet/intel/i40e/Makefile +++ b/drivers/net/ethernet/intel/i40e/Makefile @@ -10,7 +10,7 @@ subdir-ccflags-y += -I$(src) obj-$(CONFIG_I40E) += i40e.o -i40e-objs := i40e_main.o \ +i40e-y := i40e_main.o \ i40e_ethtool.o \ i40e_adminq.o \ i40e_common.o \ diff --git a/drivers/net/ethernet/intel/iavf/Makefile b/drivers/net/ethernet/intel/iavf/Makefile index 2d154a4e2fd7..356ac9faa5bf 100644 --- a/drivers/net/ethernet/intel/iavf/Makefile +++ b/drivers/net/ethernet/intel/iavf/Makefile @@ -11,6 +11,5 @@ subdir-ccflags-y += -I$(src) obj-$(CONFIG_IAVF) += iavf.o -iavf-objs := iavf_main.o iavf_ethtool.o iavf_virtchnl.o iavf_fdir.o \ - iavf_adv_rss.o \ - iavf_txrx.o iavf_common.o iavf_adminq.o +iavf-y := iavf_main.o iavf_ethtool.o iavf_virtchnl.o iavf_fdir.o \ + iavf_adv_rss.o iavf_txrx.o iavf_common.o iavf_adminq.o diff --git a/drivers/net/ethernet/intel/igb/Makefile b/drivers/net/ethernet/intel/igb/Makefile index 394c1e0656b9..463c0d26b9d4 100644 --- a/drivers/net/ethernet/intel/igb/Makefile +++ b/drivers/net/ethernet/intel/igb/Makefile @@ -6,6 +6,6 @@ obj-$(CONFIG_IGB) += igb.o -igb-objs := igb_main.o igb_ethtool.o e1000_82575.o \ - e1000_mac.o e1000_nvm.o e1000_phy.o e1000_mbx.o \ - e1000_i210.o igb_ptp.o igb_hwmon.o +igb-y := igb_main.o igb_ethtool.o e1000_82575.o \ + e1000_mac.o e1000_nvm.o e1000_phy.o e1000_mbx.o \ + e1000_i210.o igb_ptp.o igb_hwmon.o diff --git a/drivers/net/ethernet/intel/igbvf/Makefile b/drivers/net/ethernet/intel/igbvf/Makefile index afd3e36eae75..902711d5e691 100644 --- a/drivers/net/ethernet/intel/igbvf/Makefile +++ b/drivers/net/ethernet/intel/igbvf/Makefile @@ -6,8 +6,4 @@ obj-$(CONFIG_IGBVF) += igbvf.o -igbvf-objs := vf.o \ - mbx.o \ - ethtool.o \ - netdev.o - +igbvf-y := vf.o mbx.o ethtool.o netdev.o diff --git a/drivers/net/ethernet/intel/igc/Makefile b/drivers/net/ethernet/intel/igc/Makefile index ebffd3054285..efc5e7983dad 100644 --- a/drivers/net/ethernet/intel/igc/Makefile +++ b/drivers/net/ethernet/intel/igc/Makefile @@ -6,7 +6,7 @@ # obj-$(CONFIG_IGC) += igc.o -igc-$(CONFIG_IGC_LEDS) += igc_leds.o -igc-objs := igc_main.o igc_mac.o igc_i225.o igc_base.o igc_nvm.o igc_phy.o \ -igc_diag.o igc_ethtool.o igc_ptp.o igc_dump.o igc_tsn.o igc_xdp.o +igc-y := igc_main.o igc_mac.o igc_i225.o igc_base.o igc_nvm.o igc_phy.o \ + igc_diag.o igc_ethtool.o igc_ptp.o igc_dump.o igc_tsn.o igc_xdp.o +igc-$(CONFIG_IGC_LEDS) += igc_leds.o diff --git a/drivers/net/ethernet/intel/ixgbe/Makefile b/drivers/net/ethernet/intel/ixgbe/Makefile index 4fb0d9e3f2da..965e5ce1b326 100644 --- a/drivers/net/ethernet/intel/ixgbe/Makefile +++ b/drivers/net/ethernet/intel/ixgbe/Makefile @@ -6,10 +6,10 @@ obj-$(CONFIG_IXGBE) += ixgbe.o -ixgbe-objs := ixgbe_main.o ixgbe_common.o ixgbe_ethtool.o \ - ixgbe_82599.o ixgbe_82598.o ixgbe_phy.o ixgbe_sriov.o \ - ixgbe_mbx.o ixgbe_x540.o ixgbe_x550.o ixgbe_lib.o ixgbe_ptp.o \ - ixgbe_xsk.o +ixgbe-y := ixgbe_main.o ixgbe_common.o ixgbe_ethtool.o \ + ixgbe_82599.o ixgbe_82598.o ixgbe_phy.o ixgbe_sriov.o \ + ixgbe_mbx.o ixgbe_x540.o ixgbe_x550.o ixgbe_lib.o ixgbe_ptp.o \ + ixgbe_xsk.o ixgbe-$(CONFIG_IXGBE_DCB) += ixgbe_dcb.o ixgbe_dcb_82598.o \ ixgbe_dcb_82599.o ixgbe_dcb_nl.o diff --git a/drivers/net/ethernet/intel/ixgbevf/Makefile b/drivers/net/ethernet/intel/ixgbevf/Makefile index 186a4bb24fde..01d3e892f3fa 100644 --- a/drivers/net/ethernet/intel/ixgbevf/Makefile +++ b/drivers/net/ethernet/intel/ixgbevf/Makefile @@ -6,9 +6,5 @@ obj-$(CONFIG_IXGBEVF) += ixgbevf.o -ixgbevf-objs := vf.o \ - mbx.o \ - ethtool.o \ - ixgbevf_main.o +ixgbevf-y := vf.o mbx.o ethtool.o ixgbevf_main.o ixgbevf-$(CONFIG_IXGBEVF_IPSEC) += ipsec.o - diff --git a/drivers/net/ethernet/intel/libeth/Makefile b/drivers/net/ethernet/intel/libeth/Makefile index cb99203d1dd2..52492b081132 100644 --- a/drivers/net/ethernet/intel/libeth/Makefile +++ b/drivers/net/ethernet/intel/libeth/Makefile @@ -3,4 +3,4 @@ obj-$(CONFIG_LIBETH) += libeth.o -libeth-objs += rx.o +libeth-y := rx.o diff --git a/drivers/net/ethernet/intel/libie/Makefile b/drivers/net/ethernet/intel/libie/Makefile index bf42c5aeeedd..ffd27fab916a 100644 --- a/drivers/net/ethernet/intel/libie/Makefile +++ b/drivers/net/ethernet/intel/libie/Makefile @@ -3,4 +3,4 @@ obj-$(CONFIG_LIBIE) += libie.o -libie-objs += rx.o +libie-y := rx.o From patchwork Mon Jun 3 22:38:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacob Keller X-Patchwork-Id: 13684435 X-Patchwork-Delegate: kuba@kernel.org Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) (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 DC71513E03E for ; Mon, 3 Jun 2024 22:38:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717454305; cv=none; b=EXKl2Z4lA3/N9b/5XAjCTxluQ6v8Ehey9LekSuyBBy5JDBhdiHZOnjbKUrmBaxa6v+QcEy6K0HOTLv0s1wdD/4TIr0P+4PAzFVxV2cdSdUou2wEMO+ORG9xODDMTwV+RkhHPJupHweaFndNkMDuQlvJ2t8CrWmp/k+MCBJzELbg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717454305; c=relaxed/simple; bh=eaAmhLuouq2E/NfXqCshM6878WjbMqTcwMma2+5nw70=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=VJqSXCIugzVaK03sjdEGOaCF2c2zxb0JdDFRRTfUoGw0CSeMFnCL4CI030APra6djSSdRqmWYPi6Dc4rTLFzdIPIoCvxd4wWKtEJ39GyRWdQQPMFZQ3p8H8+UWSzX1jYK8IfzTPy2OCYgkGKrX4RYfmPYV8PHDSAjlmKTdBbQZY= 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=ghJ6udum; arc=none smtp.client-ip=192.198.163.19 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="ghJ6udum" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717454304; x=1748990304; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=eaAmhLuouq2E/NfXqCshM6878WjbMqTcwMma2+5nw70=; b=ghJ6udumyuDdpVIOsEy8XOYOys3gvJSjAvgI1k579WYoqrGsGqhNG4nc UsAvtqYfptWKIwsfviW886mqOPPThkDBKmdgZS3Ib6EqJk+h9uxxz9vqP QI1T5J7e4J1zkmfIeP3P9iIiVDwO8QwAoSDwPNMxvm68rmC4f4KtKWnh4 mUgaLmtBD3Pf0kvwbG0IScIF+73YVUcmRmruEn/neywtwmx/FEv++ZamY omLwPMExK1/Sv2BXXexenGgyQxXOc4TAhmLQaR18IvUmK9+8SZpelBpOc TucxL/Nv85teCcToS/PWBD4Y2ZBBq8dXv06dmkNMZUka6PBOFcf9LShoG w==; X-CSE-ConnectionGUID: C4PycqwlSd24phLnKiRPWQ== X-CSE-MsgGUID: mrD+6UbISACWm20nrck9pw== X-IronPort-AV: E=McAfee;i="6600,9927,11092"; a="13780107" X-IronPort-AV: E=Sophos;i="6.08,212,1712646000"; d="scan'208";a="13780107" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2024 15:38:21 -0700 X-CSE-ConnectionGUID: G/JpgBfuRBCYQpPyw/3ZiA== X-CSE-MsgGUID: X2lB2OicQH2DsUynn6K5BQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,212,1712646000"; d="scan'208";a="41471177" Received: from jekeller-desk.amr.corp.intel.com ([10.166.241.1]) by fmviesa005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2024 15:38:21 -0700 From: Jacob Keller Date: Mon, 03 Jun 2024 15:38:14 -0700 Subject: [PATCH 2/9] ice: store representor ID in bridge port Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240603-next-2024-06-03-intel-next-batch-v1-2-e0523b28f325@intel.com> References: <20240603-next-2024-06-03-intel-next-batch-v1-0-e0523b28f325@intel.com> In-Reply-To: <20240603-next-2024-06-03-intel-next-batch-v1-0-e0523b28f325@intel.com> To: David Miller , netdev , Jakub Kicinski Cc: Jacob Keller , Michal Swiatkowski , Wojciech Drewek , Sujai Buvaneswaran , Jiri Pirko X-Mailer: b4 0.13.0 X-Patchwork-Delegate: kuba@kernel.org From: Michal Swiatkowski It is used to get representor structure during cleaning. Reviewed-by: Wojciech Drewek Signed-off-by: Michal Swiatkowski Tested-by: Sujai Buvaneswaran Reviewed-by: Jiri Pirko Signed-off-by: Jacob Keller --- drivers/net/ethernet/intel/ice/ice_eswitch_br.c | 4 +++- drivers/net/ethernet/intel/ice/ice_eswitch_br.h | 1 + drivers/net/ethernet/intel/ice/ice_repr.c | 7 ++----- drivers/net/ethernet/intel/ice/ice_repr.h | 1 + 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_eswitch_br.c b/drivers/net/ethernet/intel/ice/ice_eswitch_br.c index ac5beecd028b..f5aceb32bf4d 100644 --- a/drivers/net/ethernet/intel/ice/ice_eswitch_br.c +++ b/drivers/net/ethernet/intel/ice/ice_eswitch_br.c @@ -896,7 +896,8 @@ ice_eswitch_br_port_deinit(struct ice_esw_br *bridge, if (br_port->type == ICE_ESWITCH_BR_UPLINK_PORT && vsi->back) { vsi->back->br_port = NULL; } else { - struct ice_repr *repr = ice_repr_get_by_vsi(vsi); + struct ice_repr *repr = + ice_repr_get(vsi->back, br_port->repr_id); if (repr) repr->br_port = NULL; @@ -937,6 +938,7 @@ ice_eswitch_br_vf_repr_port_init(struct ice_esw_br *bridge, br_port->vsi = repr->src_vsi; br_port->vsi_idx = br_port->vsi->idx; br_port->type = ICE_ESWITCH_BR_VF_REPR_PORT; + br_port->repr_id = repr->id; repr->br_port = br_port; err = xa_insert(&bridge->ports, br_port->vsi_idx, br_port, GFP_KERNEL); diff --git a/drivers/net/ethernet/intel/ice/ice_eswitch_br.h b/drivers/net/ethernet/intel/ice/ice_eswitch_br.h index 85a8fadb2928..c15c7344d7f8 100644 --- a/drivers/net/ethernet/intel/ice/ice_eswitch_br.h +++ b/drivers/net/ethernet/intel/ice/ice_eswitch_br.h @@ -46,6 +46,7 @@ struct ice_esw_br_port { enum ice_esw_br_port_type type; u16 vsi_idx; u16 pvid; + u32 repr_id; struct xarray vlans; }; diff --git a/drivers/net/ethernet/intel/ice/ice_repr.c b/drivers/net/ethernet/intel/ice/ice_repr.c index d367f4c66dcd..fe83f305cc7d 100644 --- a/drivers/net/ethernet/intel/ice/ice_repr.c +++ b/drivers/net/ethernet/intel/ice/ice_repr.c @@ -415,12 +415,9 @@ struct ice_repr *ice_repr_add_vf(struct ice_vf *vf) return ERR_PTR(err); } -struct ice_repr *ice_repr_get_by_vsi(struct ice_vsi *vsi) +struct ice_repr *ice_repr_get(struct ice_pf *pf, u32 id) { - if (!vsi->vf) - return NULL; - - return xa_load(&vsi->back->eswitch.reprs, vsi->vf->repr_id); + return xa_load(&pf->eswitch.reprs, id); } /** diff --git a/drivers/net/ethernet/intel/ice/ice_repr.h b/drivers/net/ethernet/intel/ice/ice_repr.h index cff730b15ca0..07842620d7a2 100644 --- a/drivers/net/ethernet/intel/ice/ice_repr.h +++ b/drivers/net/ethernet/intel/ice/ice_repr.h @@ -40,4 +40,5 @@ struct ice_repr *ice_repr_get_by_vsi(struct ice_vsi *vsi); void ice_repr_inc_tx_stats(struct ice_repr *repr, unsigned int len, int xmit_status); void ice_repr_inc_rx_stats(struct net_device *netdev, unsigned int len); +struct ice_repr *ice_repr_get(struct ice_pf *pf, u32 id); #endif From patchwork Mon Jun 3 22:38:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacob Keller X-Patchwork-Id: 13684436 X-Patchwork-Delegate: kuba@kernel.org Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) (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 C232213CF9A for ; Mon, 3 Jun 2024 22:38:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717454305; cv=none; b=TEl3HCDM84DchVSxQzoHH+FaJrhJyHqclV0vJrJL5PtVUzp80i1+RnhxAZft05xcToGcpnViIwnEph5gXHyGwCO1z3rAVNxF/qwT8rupRnkg+LKfveoavYxaVkxYXIIyLZ1bSi9uqEfGUeSM5xE77479tsmf0dOtm4t8TWiFJ0w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717454305; c=relaxed/simple; bh=HBNR2tu6ZMc3N1OCuLgchIQjBgvKbqa3ViBchqerzJw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BX8BHFMu0WQDUJ5wQX/Owax32/axi7w273IpLytxb4dx829ecKbPc2NtqZ51GoXaiW9V6R2EyJg5/Hw3MP7lI/AEg9SjS+fpUWt1Lq61UujTPSy840gc7+7dcf4X71zkzquWrjvommAf+ClpDKs/FuYYqV9gQ93Kpjgfixtb//0= 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=Om/QVC4p; arc=none smtp.client-ip=192.198.163.19 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="Om/QVC4p" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717454304; x=1748990304; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=HBNR2tu6ZMc3N1OCuLgchIQjBgvKbqa3ViBchqerzJw=; b=Om/QVC4pz1Cq6TmgzIsl6/AQ7KBP/PhRW8SpJCIY1WJ21NzKTNx8+Oeo PABB0aQys164U6gPwW4wwGYgQqDOHeiKqr/UqHrKYvpGE5WfJVL9W0k/G PrA/jIr8pxpOTtyu5kk1Oefzw58OtkiE4U3S/hCRuUkMp+dJl1tYHuPgb AvJm4ht4jd+xF3qmLQObF6ufU/PZLioPVc1yA4aa4+OVCfxcGxt4no8Cp 4KAz8+y5SNsOtjRVTi4g8LeFAMLovTJcEQGSFR7BtK/SpwyyIad4CdY09 ThC74AFtfuL3N8ICSp0GN0qWRcNTxPD6wFZ6ZXo0J/5dxHFkXFCT5nrXd g==; X-CSE-ConnectionGUID: Gu1UAgQBSVW/4bU3v+O11w== X-CSE-MsgGUID: bJRd9algST2rDnwtUkse4g== X-IronPort-AV: E=McAfee;i="6600,9927,11092"; a="13780111" X-IronPort-AV: E=Sophos;i="6.08,212,1712646000"; d="scan'208";a="13780111" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2024 15:38:22 -0700 X-CSE-ConnectionGUID: rUf9yxKzTYyCYq3wiGmLjA== X-CSE-MsgGUID: HZNwCzG6TYuFN5b+mNDGPA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,212,1712646000"; d="scan'208";a="41471181" Received: from jekeller-desk.amr.corp.intel.com ([10.166.241.1]) by fmviesa005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2024 15:38:21 -0700 From: Jacob Keller Date: Mon, 03 Jun 2024 15:38:15 -0700 Subject: [PATCH 3/9] ice: move devlink locking outside the port creation Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240603-next-2024-06-03-intel-next-batch-v1-3-e0523b28f325@intel.com> References: <20240603-next-2024-06-03-intel-next-batch-v1-0-e0523b28f325@intel.com> In-Reply-To: <20240603-next-2024-06-03-intel-next-batch-v1-0-e0523b28f325@intel.com> To: David Miller , netdev , Jakub Kicinski Cc: Jacob Keller , Michal Swiatkowski , Sujai Buvaneswaran , Jiri Pirko X-Mailer: b4 0.13.0 X-Patchwork-Delegate: kuba@kernel.org From: Michal Swiatkowski In case of subfunction lock will be taken for whole port creation. Do the same in VF case. Signed-off-by: Michal Swiatkowski Tested-by: Sujai Buvaneswaran Reviewed-by: Jiri Pirko Signed-off-by: Jacob Keller --- drivers/net/ethernet/intel/ice/devlink/devlink.c | 2 -- drivers/net/ethernet/intel/ice/devlink/devlink_port.c | 4 ++-- drivers/net/ethernet/intel/ice/ice_eswitch.c | 9 +++++++-- drivers/net/ethernet/intel/ice/ice_repr.c | 2 -- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/devlink/devlink.c b/drivers/net/ethernet/intel/ice/devlink/devlink.c index 704e9ad5144e..f774781ab514 100644 --- a/drivers/net/ethernet/intel/ice/devlink/devlink.c +++ b/drivers/net/ethernet/intel/ice/devlink/devlink.c @@ -794,10 +794,8 @@ int ice_devlink_rate_init_tx_topology(struct devlink *devlink, struct ice_vsi *v tc_node = pi->root->children[0]; mutex_lock(&pi->sched_lock); - devl_lock(devlink); for (i = 0; i < tc_node->num_children; i++) ice_traverse_tx_tree(devlink, tc_node->children[i], tc_node, pf); - devl_unlock(devlink); mutex_unlock(&pi->sched_lock); return 0; diff --git a/drivers/net/ethernet/intel/ice/devlink/devlink_port.c b/drivers/net/ethernet/intel/ice/devlink/devlink_port.c index 13e6790d3cae..c9fbeebf7fb9 100644 --- a/drivers/net/ethernet/intel/ice/devlink/devlink_port.c +++ b/drivers/net/ethernet/intel/ice/devlink/devlink_port.c @@ -407,7 +407,7 @@ int ice_devlink_create_vf_port(struct ice_vf *vf) devlink_port_attrs_set(devlink_port, &attrs); devlink = priv_to_devlink(pf); - err = devlink_port_register(devlink, devlink_port, vsi->idx); + err = devl_port_register(devlink, devlink_port, vsi->idx); if (err) { dev_err(dev, "Failed to create devlink port for VF %d, error %d\n", vf->vf_id, err); @@ -426,5 +426,5 @@ int ice_devlink_create_vf_port(struct ice_vf *vf) void ice_devlink_destroy_vf_port(struct ice_vf *vf) { devl_rate_leaf_destroy(&vf->devlink_port); - devlink_port_unregister(&vf->devlink_port); + devl_port_unregister(&vf->devlink_port); } diff --git a/drivers/net/ethernet/intel/ice/ice_eswitch.c b/drivers/net/ethernet/intel/ice/ice_eswitch.c index b102db8b829a..7b57a6561a5a 100644 --- a/drivers/net/ethernet/intel/ice/ice_eswitch.c +++ b/drivers/net/ethernet/intel/ice/ice_eswitch.c @@ -423,6 +423,7 @@ static void ice_eswitch_start_reprs(struct ice_pf *pf) int ice_eswitch_attach(struct ice_pf *pf, struct ice_vf *vf) { + struct devlink *devlink = priv_to_devlink(pf); struct ice_repr *repr; int err; @@ -437,7 +438,9 @@ ice_eswitch_attach(struct ice_pf *pf, struct ice_vf *vf) ice_eswitch_stop_reprs(pf); + devl_lock(devlink); repr = ice_repr_add_vf(vf); + devl_unlock(devlink); if (IS_ERR(repr)) { err = PTR_ERR(repr); goto err_create_repr; @@ -460,7 +463,9 @@ ice_eswitch_attach(struct ice_pf *pf, struct ice_vf *vf) err_xa_alloc: ice_eswitch_release_repr(pf, repr); err_setup_repr: + devl_lock(devlink); ice_repr_rem_vf(repr); + devl_unlock(devlink); err_create_repr: if (xa_empty(&pf->eswitch.reprs)) ice_eswitch_disable_switchdev(pf); @@ -484,6 +489,7 @@ void ice_eswitch_detach(struct ice_pf *pf, struct ice_vf *vf) ice_eswitch_disable_switchdev(pf); ice_eswitch_release_repr(pf, repr); + devl_lock(devlink); ice_repr_rem_vf(repr); if (xa_empty(&pf->eswitch.reprs)) { @@ -491,12 +497,11 @@ void ice_eswitch_detach(struct ice_pf *pf, struct ice_vf *vf) * no point in keeping the nodes */ ice_devlink_rate_clear_tx_topology(ice_get_main_vsi(pf)); - devl_lock(devlink); devl_rate_nodes_destroy(devlink); - devl_unlock(devlink); } else { ice_eswitch_start_reprs(pf); } + devl_unlock(devlink); } /** diff --git a/drivers/net/ethernet/intel/ice/ice_repr.c b/drivers/net/ethernet/intel/ice/ice_repr.c index fe83f305cc7d..35a6ac8c0466 100644 --- a/drivers/net/ethernet/intel/ice/ice_repr.c +++ b/drivers/net/ethernet/intel/ice/ice_repr.c @@ -285,9 +285,7 @@ ice_repr_reg_netdev(struct net_device *netdev) static void ice_repr_remove_node(struct devlink_port *devlink_port) { - devl_lock(devlink_port->devlink); devl_rate_leaf_destroy(devlink_port); - devl_unlock(devlink_port->devlink); } /** From patchwork Mon Jun 3 22:38:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacob Keller X-Patchwork-Id: 13684439 X-Patchwork-Delegate: kuba@kernel.org Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) (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 ADF5613FD6D for ; Mon, 3 Jun 2024 22:38:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717454307; cv=none; b=T5NSTqlLWo9G5Y5ctL72yxT3dw/8n0HEhxT5wznBCZVIX+NHMQEHtkY9epbeArL+EvSV+zL65Ou4yJFR46jgGUBE/M8Oae3/KXZgcucIX70dW0IG2AEkYubiweHQCiqxVV306uGCTvIUVAvQP0ZyYcqGTpb6TEIQxcYCy33l/cw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717454307; c=relaxed/simple; bh=VYsk72x/Nd4uuR65GzdJOXFPPRAZ3Rq29nRvCNngo7E=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dS7d7w5wpca78GX24YIf1SLSprbrIwcmCl7duCMHqQhVsrWUtU+izuyI76CxfbQnM17Uj9dmn16zPpmmfZn7qU0RvjZzhqs+AnZOWO5aO1qafE5R6+PPPj0bJ8x9ZhQs+53s23nxOn+f8r5ZfmMkgRtSVvcFa/47YxpoWUZ2htk= 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=JRcJXYJF; arc=none smtp.client-ip=192.198.163.19 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="JRcJXYJF" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717454306; x=1748990306; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=VYsk72x/Nd4uuR65GzdJOXFPPRAZ3Rq29nRvCNngo7E=; b=JRcJXYJF9hzd0eNyieB4mEy64QTYN1dZVQU3iCZZ4v22M53AoyjIwSgL ZVbYp1vMX58yJyQIDZKriK70PBZ+0f59RH6vRn6k4cdC/7eEYYHetSrdj YAHQcBw+VKriJNMxlfkC0dSbUsYGbwJ+5vev6YLWx1J3UTMexvsbFpS39 3138P7BAUAH/UC630bJMmA6U1pOTz5m82oIPcc7F+uMgiE1jpacUnoPdO RGaFDaKsfGvm2l+qjGNU3wG8w1wKFvz5v1H9cX+7q46YG/JZRNSoadLVB F7ZpJBSZtoYIBorO7eR95n2/IGs0m69YLerqf9l1zYWneizkeBdm2Kl6l w==; X-CSE-ConnectionGUID: a7FOzs/mT72ZjZuRVVqklA== X-CSE-MsgGUID: z6CgPzyIQQOSckLUSy41NA== X-IronPort-AV: E=McAfee;i="6600,9927,11092"; a="13780115" X-IronPort-AV: E=Sophos;i="6.08,212,1712646000"; d="scan'208";a="13780115" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2024 15:38:22 -0700 X-CSE-ConnectionGUID: D2OWzlUNSumkscDP3Go+6w== X-CSE-MsgGUID: gzi6sWieT+a5Ja0kRHZWfQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,212,1712646000"; d="scan'208";a="41471184" Received: from jekeller-desk.amr.corp.intel.com ([10.166.241.1]) by fmviesa005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2024 15:38:21 -0700 From: Jacob Keller Date: Mon, 03 Jun 2024 15:38:16 -0700 Subject: [PATCH 4/9] ice: move VSI configuration outside repr setup Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240603-next-2024-06-03-intel-next-batch-v1-4-e0523b28f325@intel.com> References: <20240603-next-2024-06-03-intel-next-batch-v1-0-e0523b28f325@intel.com> In-Reply-To: <20240603-next-2024-06-03-intel-next-batch-v1-0-e0523b28f325@intel.com> To: David Miller , netdev , Jakub Kicinski Cc: Jacob Keller , Michal Swiatkowski , Sujai Buvaneswaran , Jiri Pirko X-Mailer: b4 0.13.0 X-Patchwork-Delegate: kuba@kernel.org From: Michal Swiatkowski It is needed because subfunction port representor shouldn't configure the source VSI during representor creation. Move the code to separate function and call it only in case the VF port representor is being created. Signed-off-by: Michal Swiatkowski Tested-by: Sujai Buvaneswaran Reviewed-by: Jiri Pirko Signed-off-by: Jacob Keller --- drivers/net/ethernet/intel/ice/ice_eswitch.c | 55 ++++++++++++++++++++-------- drivers/net/ethernet/intel/ice/ice_eswitch.h | 10 +++++ drivers/net/ethernet/intel/ice/ice_repr.c | 7 ++++ 3 files changed, 57 insertions(+), 15 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_eswitch.c b/drivers/net/ethernet/intel/ice/ice_eswitch.c index 7b57a6561a5a..3f73f46111fc 100644 --- a/drivers/net/ethernet/intel/ice/ice_eswitch.c +++ b/drivers/net/ethernet/intel/ice/ice_eswitch.c @@ -117,17 +117,10 @@ static int ice_eswitch_setup_repr(struct ice_pf *pf, struct ice_repr *repr) struct ice_vsi *vsi = repr->src_vsi; struct metadata_dst *dst; - ice_remove_vsi_fltr(&pf->hw, vsi->idx); repr->dst = metadata_dst_alloc(0, METADATA_HW_PORT_MUX, GFP_KERNEL); if (!repr->dst) - goto err_add_mac_fltr; - - if (ice_vsi_update_security(vsi, ice_vsi_ctx_clear_antispoof)) - goto err_dst_free; - - if (ice_vsi_add_vlan_zero(vsi)) - goto err_update_security; + return -ENOMEM; netif_keep_dst(uplink_vsi->netdev); @@ -136,16 +129,48 @@ static int ice_eswitch_setup_repr(struct ice_pf *pf, struct ice_repr *repr) dst->u.port_info.lower_dev = uplink_vsi->netdev; return 0; +} -err_update_security: +/** + * ice_eswitch_cfg_vsi - configure VSI to work in slow-path + * @vsi: VSI structure of representee + * @mac: representee MAC + * + * Return: 0 on success, non-zero on error. + */ +int ice_eswitch_cfg_vsi(struct ice_vsi *vsi, const u8 *mac) +{ + int err; + + ice_remove_vsi_fltr(&vsi->back->hw, vsi->idx); + + err = ice_vsi_update_security(vsi, ice_vsi_ctx_clear_antispoof); + if (err) + goto err_update_security; + + err = ice_vsi_add_vlan_zero(vsi); + if (err) + goto err_vlan_zero; + + return 0; + +err_vlan_zero: ice_vsi_update_security(vsi, ice_vsi_ctx_set_antispoof); -err_dst_free: - metadata_dst_free(repr->dst); - repr->dst = NULL; -err_add_mac_fltr: - ice_fltr_add_mac_and_broadcast(vsi, repr->parent_mac, ICE_FWD_TO_VSI); +err_update_security: + ice_fltr_add_mac_and_broadcast(vsi, mac, ICE_FWD_TO_VSI); - return -ENODEV; + return err; +} + +/** + * ice_eswitch_decfg_vsi - unroll changes done to VSI for switchdev + * @vsi: VSI structure of representee + * @mac: representee MAC + */ +void ice_eswitch_decfg_vsi(struct ice_vsi *vsi, const u8 *mac) +{ + ice_vsi_update_security(vsi, ice_vsi_ctx_set_antispoof); + ice_fltr_add_mac_and_broadcast(vsi, mac, ICE_FWD_TO_VSI); } /** diff --git a/drivers/net/ethernet/intel/ice/ice_eswitch.h b/drivers/net/ethernet/intel/ice/ice_eswitch.h index e2e5c0c75e7d..9a25606e9740 100644 --- a/drivers/net/ethernet/intel/ice/ice_eswitch.h +++ b/drivers/net/ethernet/intel/ice/ice_eswitch.h @@ -28,6 +28,9 @@ netdev_tx_t ice_eswitch_port_start_xmit(struct sk_buff *skb, struct net_device *netdev); struct net_device *ice_eswitch_get_target(struct ice_rx_ring *rx_ring, union ice_32b_rx_flex_desc *rx_desc); + +int ice_eswitch_cfg_vsi(struct ice_vsi *vsi, const u8 *mac); +void ice_eswitch_decfg_vsi(struct ice_vsi *vsi, const u8 *mac); #else /* CONFIG_ICE_SWITCHDEV */ static inline void ice_eswitch_detach(struct ice_pf *pf, struct ice_vf *vf) { } @@ -85,5 +88,12 @@ ice_eswitch_get_target(struct ice_rx_ring *rx_ring, { return rx_ring->netdev; } + +static inline int ice_eswitch_cfg_vsi(struct ice_vsi *vsi, const u8 *mac) +{ + return -EOPNOTSUPP; +} + +static inline void ice_eswitch_decfg_vsi(struct ice_vsi *vsi, const u8 *mac) { } #endif /* CONFIG_ICE_SWITCHDEV */ #endif /* _ICE_ESWITCH_H_ */ diff --git a/drivers/net/ethernet/intel/ice/ice_repr.c b/drivers/net/ethernet/intel/ice/ice_repr.c index 35a6ac8c0466..bdda3401e343 100644 --- a/drivers/net/ethernet/intel/ice/ice_repr.c +++ b/drivers/net/ethernet/intel/ice/ice_repr.c @@ -306,6 +306,7 @@ static void ice_repr_rem(struct ice_repr *repr) void ice_repr_rem_vf(struct ice_repr *repr) { ice_repr_remove_node(&repr->vf->devlink_port); + ice_eswitch_decfg_vsi(repr->src_vsi, repr->parent_mac); unregister_netdev(repr->netdev); ice_devlink_destroy_vf_port(repr->vf); ice_virtchnl_set_dflt_ops(repr->vf); @@ -401,11 +402,17 @@ struct ice_repr *ice_repr_add_vf(struct ice_vf *vf) if (err) goto err_netdev; + err = ice_eswitch_cfg_vsi(repr->src_vsi, repr->parent_mac); + if (err) + goto err_cfg_vsi; + ice_virtchnl_set_repr_ops(vf); ice_repr_set_tx_topology(vf->pf); return repr; +err_cfg_vsi: + unregister_netdev(repr->netdev); err_netdev: ice_repr_rem(repr); err_repr_add: From patchwork Mon Jun 3 22:38:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacob Keller X-Patchwork-Id: 13684438 X-Patchwork-Delegate: kuba@kernel.org Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) (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 BA72D13FD82 for ; Mon, 3 Jun 2024 22:38:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717454307; cv=none; b=Ytzcnc1SDvFfIeL90PVzZ0WK1Ed67ARED0wGnrp9hi6nrHVaZjShLdMjd8Ahghh8oOAzMzscCWaP4zrXOurNzLJAglvBFQfVEyx0FRhkQj2oVehU2tZODUquie4Rrm7TxZsFu0OXuKvFIExQfqdno2Ew0o5UEoR+MxUA0urMmqM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717454307; c=relaxed/simple; bh=ftoqpp2fmR6aU4PVMSgZDWfBw87I/MVDZ12Atu0W/ds=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Bq3uO3HbO3jjnhKyeyFwx1iP5eWVBtVqDu/jY35u5Kjlku3JegZ61NIoCvDAtr9ba79iGmG4YcXC/9oB1tdNqB6gAIRL6tvIxAir7U0mIvaPbzz7pC7rnSBaUbBgshF3mCd198wLTCUATkYZIV8m/ovOrOHN2NTsqnCEO3Wdvdo= 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=SiwMWXky; arc=none smtp.client-ip=192.198.163.19 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="SiwMWXky" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717454306; x=1748990306; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=ftoqpp2fmR6aU4PVMSgZDWfBw87I/MVDZ12Atu0W/ds=; b=SiwMWXky9PvHN/6cyhCTusRokAZvUxK6EIB2fqNWoDSWYMqVU2IEdwaY zq/3/YNmL6pldxTiqmEM3EjTxm5X0Gl7dIeuybqPmD6Of87LlStvr/Up6 yyg/K7XLVXUy0X1pca+VOO8rwJYdeJoyvkGnR9IYsgdoFDtvF4d2MaFYP E9RfKhsfUU4ME0quQ1hKgqH/Mmqo1TP+fgGDkziJYMjSA2Cuf7akZDCTD J8aepPQSd3KhpsHXjPaWNkh0a0RGYxQ+8pbE3sU5HQQ0I1xtjYz9F28sC 3vhkH3B8HJDlDBm59G1fZV+bPCEmTCvjjkyFBKRztmdcaNQunkFgwZG8e Q==; X-CSE-ConnectionGUID: l611acIkT2G/pUtyvezX0g== X-CSE-MsgGUID: V/jYc6rnTwW+OKAok2fN/A== X-IronPort-AV: E=McAfee;i="6600,9927,11092"; a="13780119" X-IronPort-AV: E=Sophos;i="6.08,212,1712646000"; d="scan'208";a="13780119" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2024 15:38:22 -0700 X-CSE-ConnectionGUID: rscZBsu0TYmG70tAaAyuow== X-CSE-MsgGUID: E+2GnvSRQyqaxRSeDm+3Fg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,212,1712646000"; d="scan'208";a="41471188" Received: from jekeller-desk.amr.corp.intel.com ([10.166.241.1]) by fmviesa005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2024 15:38:21 -0700 From: Jacob Keller Date: Mon, 03 Jun 2024 15:38:17 -0700 Subject: [PATCH 5/9] ice: update representor when VSI is ready Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240603-next-2024-06-03-intel-next-batch-v1-5-e0523b28f325@intel.com> References: <20240603-next-2024-06-03-intel-next-batch-v1-0-e0523b28f325@intel.com> In-Reply-To: <20240603-next-2024-06-03-intel-next-batch-v1-0-e0523b28f325@intel.com> To: David Miller , netdev , Jakub Kicinski Cc: Jacob Keller , Michal Swiatkowski , Sujai Buvaneswaran , Jiri Pirko X-Mailer: b4 0.13.0 X-Patchwork-Delegate: kuba@kernel.org From: Michal Swiatkowski In case of reset of VF VSI can be reallocated. To handle this case it should be properly updated. Reload representor as vsi->vsi_num can be different than the one stored when representor was created. Instead of only changing antispoof do whole VSI configuration for eswitch. Signed-off-by: Michal Swiatkowski Tested-by: Sujai Buvaneswaran Reviewed-by: Jiri Pirko Signed-off-by: Jacob Keller --- drivers/net/ethernet/intel/ice/ice_eswitch.c | 21 ++++++++++++++------- drivers/net/ethernet/intel/ice/ice_eswitch.h | 4 ++-- drivers/net/ethernet/intel/ice/ice_vf_lib.c | 2 +- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_eswitch.c b/drivers/net/ethernet/intel/ice/ice_eswitch.c index 3f73f46111fc..4f539b1c7781 100644 --- a/drivers/net/ethernet/intel/ice/ice_eswitch.c +++ b/drivers/net/ethernet/intel/ice/ice_eswitch.c @@ -178,16 +178,16 @@ void ice_eswitch_decfg_vsi(struct ice_vsi *vsi, const u8 *mac) * @repr_id: representor ID * @vsi: VSI for which port representor is configured */ -void ice_eswitch_update_repr(unsigned long repr_id, struct ice_vsi *vsi) +void ice_eswitch_update_repr(unsigned long *repr_id, struct ice_vsi *vsi) { struct ice_pf *pf = vsi->back; struct ice_repr *repr; - int ret; + int err; if (!ice_is_switchdev_running(pf)) return; - repr = xa_load(&pf->eswitch.reprs, repr_id); + repr = xa_load(&pf->eswitch.reprs, *repr_id); if (!repr) return; @@ -197,12 +197,19 @@ void ice_eswitch_update_repr(unsigned long repr_id, struct ice_vsi *vsi) if (repr->br_port) repr->br_port->vsi = vsi; - ret = ice_vsi_update_security(vsi, ice_vsi_ctx_clear_antispoof); - if (ret) { - ice_fltr_add_mac_and_broadcast(vsi, repr->parent_mac, - ICE_FWD_TO_VSI); + err = ice_eswitch_cfg_vsi(vsi, repr->parent_mac); + if (err) dev_err(ice_pf_to_dev(pf), "Failed to update VSI of port representor %d", repr->id); + + /* The VSI number is different, reload the PR with new id */ + if (repr->id != vsi->vsi_num) { + xa_erase(&pf->eswitch.reprs, repr->id); + repr->id = vsi->vsi_num; + if (xa_insert(&pf->eswitch.reprs, repr->id, repr, GFP_KERNEL)) + dev_err(ice_pf_to_dev(pf), "Failed to reload port representor %d", + repr->id); + *repr_id = repr->id; } } diff --git a/drivers/net/ethernet/intel/ice/ice_eswitch.h b/drivers/net/ethernet/intel/ice/ice_eswitch.h index 9a25606e9740..09194d514f9b 100644 --- a/drivers/net/ethernet/intel/ice/ice_eswitch.h +++ b/drivers/net/ethernet/intel/ice/ice_eswitch.h @@ -18,7 +18,7 @@ ice_eswitch_mode_set(struct devlink *devlink, u16 mode, struct netlink_ext_ack *extack); bool ice_is_eswitch_mode_switchdev(struct ice_pf *pf); -void ice_eswitch_update_repr(unsigned long repr_id, struct ice_vsi *vsi); +void ice_eswitch_update_repr(unsigned long *repr_id, struct ice_vsi *vsi); void ice_eswitch_stop_all_tx_queues(struct ice_pf *pf); @@ -47,7 +47,7 @@ ice_eswitch_set_target_vsi(struct sk_buff *skb, struct ice_tx_offload_params *off) { } static inline void -ice_eswitch_update_repr(unsigned long repr_id, struct ice_vsi *vsi) { } +ice_eswitch_update_repr(unsigned long *repr_id, struct ice_vsi *vsi) { } static inline int ice_eswitch_configure(struct ice_pf *pf) { diff --git a/drivers/net/ethernet/intel/ice/ice_vf_lib.c b/drivers/net/ethernet/intel/ice/ice_vf_lib.c index 48a8d462d76a..5635e9da2212 100644 --- a/drivers/net/ethernet/intel/ice/ice_vf_lib.c +++ b/drivers/net/ethernet/intel/ice/ice_vf_lib.c @@ -948,7 +948,7 @@ int ice_reset_vf(struct ice_vf *vf, u32 flags) goto out_unlock; } - ice_eswitch_update_repr(vf->repr_id, vsi); + ice_eswitch_update_repr(&vf->repr_id, vsi); /* if the VF has been reset allow it to come up again */ ice_mbx_clear_malvf(&vf->mbx_info); From patchwork Mon Jun 3 22:38:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacob Keller X-Patchwork-Id: 13684437 X-Patchwork-Delegate: kuba@kernel.org Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) (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 C328313F011 for ; Mon, 3 Jun 2024 22:38:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717454306; cv=none; b=tmCboKkIpo3PszSRbxJK17UYUxgAmIeGvSjAUjM+HRJ83/XQsv7t68sL6edwftwOkyPf392b5wl03QjnVNkycFLGgJLZGi0YYYXAZ3I3ZQJ/SgCq/fIq3a/ppYHOC0M3evHHT64db6vR4ZP6fZyBXgAJAOMMcAf0HC1PviCpH0o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717454306; c=relaxed/simple; bh=nxV7DfHtVDVRR6GAnUgGY7qp4mmKPq9ffl0JokpKRTM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Esf+09Y6hbS3wiUFYA1g4y02ObzEUVW+zk3v1P+dkLqi4LQLY8Aei0CvWiiYGTQEujEL4uEfyyGDTu71BgLR/sy+7uxGbUGvPMBD/756sPmMaav6bEaxYjTNfR7b3nuzRkqGTm4btYylBUEz7T3HeLW+CvjOnrXoKFc0EfihIpQ= 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=ApL8qPcc; arc=none smtp.client-ip=192.198.163.19 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="ApL8qPcc" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717454305; x=1748990305; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=nxV7DfHtVDVRR6GAnUgGY7qp4mmKPq9ffl0JokpKRTM=; b=ApL8qPccBj/blXzP+GWgmGvEdOTz5WalqTsw95FbDX/ohwJXMdco1XFA BedQHUHqXnu38smxQRhEhtT3B2kwyTw9cu//LSbABb155C4nEmGDn/2aE hNOiwkIA06T2ZtWo0p8zWPXrX02nfCQVTKuj7NPq125+1ZuUrh5VJFym1 tLi365eCyqFEPqibZevOKCRHNXeTDAPsvTHSirak29HI/CoyHbWHQVb4e yqP5apADBEL4RbF/FD/0pYFI764WXpipX71usDk3WMlhN8QYawWoPFC+p 5wS879s0JklOl5F/O1uJu9QyH/bK8WAR7iRc8LeKWnd5z4fgVln0u1X0T g==; X-CSE-ConnectionGUID: 0yRH4LGVRXCkw5iKPpadfw== X-CSE-MsgGUID: 4OJ4IPLUSE63MLRgyMrkkw== X-IronPort-AV: E=McAfee;i="6600,9927,11092"; a="13780123" X-IronPort-AV: E=Sophos;i="6.08,212,1712646000"; d="scan'208";a="13780123" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2024 15:38:22 -0700 X-CSE-ConnectionGUID: 1kGUKK9sRA2hCfL+GZEQdw== X-CSE-MsgGUID: FbbTdLgeQYu+y4A6R4vcPg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,212,1712646000"; d="scan'208";a="41471194" Received: from jekeller-desk.amr.corp.intel.com ([10.166.241.1]) by fmviesa005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2024 15:38:21 -0700 From: Jacob Keller Date: Mon, 03 Jun 2024 15:38:18 -0700 Subject: [PATCH 6/9] ice: add and use roundup_u64 instead of open coding equivalent Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240603-next-2024-06-03-intel-next-batch-v1-6-e0523b28f325@intel.com> References: <20240603-next-2024-06-03-intel-next-batch-v1-0-e0523b28f325@intel.com> In-Reply-To: <20240603-next-2024-06-03-intel-next-batch-v1-0-e0523b28f325@intel.com> To: David Miller , netdev , Jakub Kicinski Cc: Jacob Keller , Pucha Himasekhar Reddy X-Mailer: b4 0.13.0 X-Patchwork-Delegate: kuba@kernel.org In ice_ptp_cfg_clkout(), the ice driver needs to calculate the nearest next second of a current time value specified in nanoseconds. It implements this using div64_u64, because the time value is a u64. It could use div_u64 since NSEC_PER_SEC is smaller than 32-bits. Ideally this would be implemented directly with roundup(), but that can't work on all platforms due to a division which requires using the specific macros and functions due to platform restrictions, and to ensure that the most appropriate and fast instructions are used. The kernel doesn't currently provide any 64-bit equivalents for doing roundup. Attempting to use roundup() on a 32-bit platform will result in a link failure due to not having a direct 64-bit division. The closest equivalent for this is DIV64_U64_ROUND_UP, which does a division always rounding up. However, this only computes the division, and forces use of the div64_u64 in cases where the divisor is a 32bit value and could make use of div_u64. Introduce DIV_U64_ROUND_UP based on div_u64, and then use it to implement roundup_u64 which takes a u64 input value and a u32 rounding value. The name roundup_u64 matches the naming scheme of div_u64, and future patches could implement roundup64_u64 if they need to round by a multiple that is greater than 32-bits. Replace the logic in ice_ptp.c which does this equivalent with the newly added roundup_u64. Tested-by: Pucha Himasekhar Reddy Signed-off-by: Jacob Keller --- drivers/net/ethernet/intel/ice/ice_ptp.c | 3 +-- include/linux/math64.h | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c b/drivers/net/ethernet/intel/ice/ice_ptp.c index adbb9cffe20c..b7ab6fdf710d 100644 --- a/drivers/net/ethernet/intel/ice/ice_ptp.c +++ b/drivers/net/ethernet/intel/ice/ice_ptp.c @@ -1773,8 +1773,7 @@ static int ice_ptp_cfg_clkout(struct ice_pf *pf, unsigned int chan, * maintaining phase */ if (start_time < current_time) - start_time = div64_u64(current_time + NSEC_PER_SEC - 1, - NSEC_PER_SEC) * NSEC_PER_SEC + phase; + start_time = roundup_u64(current_time, NSEC_PER_SEC) + phase; if (ice_is_e810(hw)) start_time -= E810_OUT_PROP_DELAY_NS; diff --git a/include/linux/math64.h b/include/linux/math64.h index d34def7f9a8c..6aaccc1626ab 100644 --- a/include/linux/math64.h +++ b/include/linux/math64.h @@ -297,6 +297,19 @@ u64 mul_u64_u64_div_u64(u64 a, u64 mul, u64 div); #define DIV64_U64_ROUND_UP(ll, d) \ ({ u64 _tmp = (d); div64_u64((ll) + _tmp - 1, _tmp); }) +/** + * DIV_U64_ROUND_UP - unsigned 64bit divide with 32bit divisor rounded up + * @ll: unsigned 64bit dividend + * @d: unsigned 32bit divisor + * + * Divide unsigned 64bit dividend by unsigned 32bit divisor + * and round up. + * + * Return: dividend / divisor rounded up + */ +#define DIV_U64_ROUND_UP(ll, d) \ + ({ u32 _tmp = (d); div_u64((ll) + _tmp - 1, _tmp); }) + /** * DIV64_U64_ROUND_CLOSEST - unsigned 64bit divide with 64bit divisor rounded to nearest integer * @dividend: unsigned 64bit dividend @@ -342,4 +355,19 @@ u64 mul_u64_u64_div_u64(u64 a, u64 mul, u64 div); div_s64((__x - (__d / 2)), __d); \ } \ ) + +/** + * roundup_u64 - Round up a 64bit value to the next specified 32bit multiple + * @x: the value to up + * @y: 32bit multiple to round up to + * + * Rounds @x to the next multiple of @y. For 32bit @x values, see roundup and + * the faster round_up() for powers of 2. + * + * Return: rounded up value. + */ +static inline u64 roundup_u64(u64 x, u32 y) +{ + return DIV_U64_ROUND_UP(x, y) * y; +} #endif /* _LINUX_MATH64_H */ From patchwork Mon Jun 3 22:38:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacob Keller X-Patchwork-Id: 13684441 X-Patchwork-Delegate: kuba@kernel.org Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) (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 C9A281411C1 for ; Mon, 3 Jun 2024 22:38:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717454309; cv=none; b=osw8YzCSkF6jHAqWOGDgVqEg+kVa4QOJ57QRD938h9HvgburkPjVQsinGfNR+0hVpQ7IhWEbIKBp8MrANTHv0oQjZIGqJcHD7kjcOawFHlyzaArZ1h6F8QkNoFY3KkIx/S1fOIyW9Fsx2LbUgSl7oaW/L5u4b9LZ/vdm52d+6Fg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717454309; c=relaxed/simple; bh=EdspLI47a6CE1Xn4Ii0/m2F/9uaHZygxyEKNw3RB6HE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=mQFGcFbsXRBxUAuF8aiXPWswzT5EsIa/3ww8Wqif6E/9pJ5SqkASyxWglsrL0jSJE437YSXQ+XrGpoO2Luwk6qEVv8Vcpury833Vy2hU3aHaZ0qytevvnKVRj1VIhdtydeHPl0THNmkuiVAlBbO+3qM8UJEqRc8MiHqp84W1Kg4= 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=U/Dtqyvo; arc=none smtp.client-ip=192.198.163.19 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="U/Dtqyvo" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717454308; x=1748990308; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=EdspLI47a6CE1Xn4Ii0/m2F/9uaHZygxyEKNw3RB6HE=; b=U/DtqyvoaseMmfEm6SvB3ETTCXJERLK43Ter8CDt0aAfTSoP+w4OLBeP 2qs7p8YTWGhDmCspgvPyYCTGqCNRgZu2qIep2UVc1ZHmaYxoZNjApyMbC d/vWiwUCLl5Y/v3joh0BWE/xkWsGPaesgWzqjy/fIzASuNfb4YqjTCWtq U8yYLDbWtR2gpvLslFF3b+N0KLw1qi14vyyoQn3UlfHx01CVsrQNqcLNa V0k9Pu3febALnVYZhmdh4ScFHJS19/bh94mslGB59J1fMjKmP5MkVcoUS p6uE0mEG93wYr8aYGDvs83iUlksBfK1CLD06rSx603YTPbXUYAP1tyWvu A==; X-CSE-ConnectionGUID: tO8btnTCTk67KX7NApcUNA== X-CSE-MsgGUID: s4mwhm0USLutrXKYEJsWQw== X-IronPort-AV: E=McAfee;i="6600,9927,11092"; a="13780126" X-IronPort-AV: E=Sophos;i="6.08,212,1712646000"; d="scan'208";a="13780126" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2024 15:38:22 -0700 X-CSE-ConnectionGUID: YgQPV1SwRZ+GHhKpp1S2sA== X-CSE-MsgGUID: 6Py0WW6fQYCT5XfFx/eflg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,212,1712646000"; d="scan'208";a="41471200" Received: from jekeller-desk.amr.corp.intel.com ([10.166.241.1]) by fmviesa005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2024 15:38:22 -0700 From: Jacob Keller Date: Mon, 03 Jun 2024 15:38:19 -0700 Subject: [PATCH 7/9] 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: <20240603-next-2024-06-03-intel-next-batch-v1-7-e0523b28f325@intel.com> References: <20240603-next-2024-06-03-intel-next-batch-v1-0-e0523b28f325@intel.com> In-Reply-To: <20240603-next-2024-06-03-intel-next-batch-v1-0-e0523b28f325@intel.com> To: David Miller , netdev , Jakub Kicinski 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 5371e91f6bbb..0f8b622db2b5 100644 --- a/drivers/net/ethernet/intel/ice/ice_lib.c +++ b/drivers/net/ethernet/intel/ice/ice_lib.c @@ -2587,8 +2587,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 f60c022f7960..a5d369b8fed5 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; From patchwork Mon Jun 3 22:38:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacob Keller X-Patchwork-Id: 13684440 X-Patchwork-Delegate: kuba@kernel.org Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) (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 CD05114039A for ; Mon, 3 Jun 2024 22:38:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717454308; cv=none; b=MuJ4xlLXU7WQLo5eNdPjyKfw0YTVXaeX6m4hnrGY5UskXj3g1gGkk6AE2yc+MFVpHuiIeYbtMOX8PCBCpCdNK6UUiL/MZgCBmzld7oPEEBKQxmWFjHgWPD/kt0oRJDoXQgyXmgGTPF/KcPW0SlmW5sFuQQhB0tK1p7rZ5jhQcgA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717454308; c=relaxed/simple; bh=KsJ8yunZ/jIyjGmyqxaEFGPcWKJlerq3zOg0T3tCmJE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=awalpGtrBvTx1M4MX/btEsi3nmwAaq00K31Ye6S/MbgI6spFLiGYjfixJc7Hx/QBTGFw9pHKDab3XjmKmG3JB+Xr2RtZp3NdRMUfFCmTlhyCmgNX/Sj+N6m78ZWj5o81O+gGjqQCRdjLrHhcR6nRoEmoq/p4n1p7aXZvLV65XXI= 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=W89SXTqb; arc=none smtp.client-ip=192.198.163.19 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="W89SXTqb" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717454307; x=1748990307; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=KsJ8yunZ/jIyjGmyqxaEFGPcWKJlerq3zOg0T3tCmJE=; b=W89SXTqbupTlROuLOtczv6g8/HDXPGyvM9THKzcjBno77E9FNmCkA3au GSFZM/18sTcqqXAiWnBX++fVDegWr48w4gbkkt33gQifBU6NGGQzvrqeH ekhR5VS3TaBpEPiIvPIvj4UYkDlhAg4b4kuszAwFejy8rHzIoE42csDid bW9KFP71m74pOkFiw9H7HnuerBCqgD7VHnJL7JNPi+zuNAX9KY7gusD19 2Qgh7FnUdjEEm9YNEhy5IfacQ1VnLmbcOLqKpDNLR1gHvCE78C3iPzryL Ci0RSiwqsgHqjnkcO4m330HnQtCnSv0Hr7WytOVDLNAdPEJW3afInzFTZ Q==; X-CSE-ConnectionGUID: dtByh64tQbefu+ZLRdc/hA== X-CSE-MsgGUID: QfH7vB2CRw+YKxrXMSlN/g== X-IronPort-AV: E=McAfee;i="6600,9927,11092"; a="13780131" X-IronPort-AV: E=Sophos;i="6.08,212,1712646000"; d="scan'208";a="13780131" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2024 15:38:22 -0700 X-CSE-ConnectionGUID: SXQqb+gRSVCYRln5MLPbRA== X-CSE-MsgGUID: 7iLbRlvQSWSf8VGW+aN5SQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,212,1712646000"; d="scan'208";a="41471204" Received: from jekeller-desk.amr.corp.intel.com ([10.166.241.1]) by fmviesa005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2024 15:38:22 -0700 From: Jacob Keller Date: Mon, 03 Jun 2024 15:38:20 -0700 Subject: [PATCH 8/9] ice: Check all ice_vsi_rebuild() errors in function Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240603-next-2024-06-03-intel-next-batch-v1-8-e0523b28f325@intel.com> References: <20240603-next-2024-06-03-intel-next-batch-v1-0-e0523b28f325@intel.com> In-Reply-To: <20240603-next-2024-06-03-intel-next-batch-v1-0-e0523b28f325@intel.com> To: David Miller , netdev , Jakub Kicinski Cc: Jacob Keller , Eric Joyner , Michal Swiatkowski , Przemek Kitszel , Karen Ostrowska , Pucha Himasekhar Reddy X-Mailer: b4 0.13.0 X-Patchwork-Delegate: kuba@kernel.org From: Eric Joyner Check the return value from ice_vsi_rebuild() and prevent the usage of incorrectly configured VSI. Reviewed-by: Michal Swiatkowski Reviewed-by: Przemek Kitszel Signed-off-by: Eric Joyner Signed-off-by: Karen Ostrowska Tested-by: Pucha Himasekhar Reddy Signed-off-by: Jacob Keller --- drivers/net/ethernet/intel/ice/ice_main.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c index a5d369b8fed5..74a4b3cb3094 100644 --- a/drivers/net/ethernet/intel/ice/ice_main.c +++ b/drivers/net/ethernet/intel/ice/ice_main.c @@ -4135,15 +4135,24 @@ int ice_vsi_recfg_qs(struct ice_vsi *vsi, int new_rx, int new_tx, bool locked) /* set for the next time the netdev is started */ if (!netif_running(vsi->netdev)) { - ice_vsi_rebuild(vsi, ICE_VSI_FLAG_NO_INIT); + err = ice_vsi_rebuild(vsi, ICE_VSI_FLAG_NO_INIT); + if (err) + goto rebuild_err; dev_dbg(ice_pf_to_dev(pf), "Link is down, queue count change happens when link is brought up\n"); goto done; } ice_vsi_close(vsi); - ice_vsi_rebuild(vsi, ICE_VSI_FLAG_NO_INIT); + err = ice_vsi_rebuild(vsi, ICE_VSI_FLAG_NO_INIT); + if (err) + goto rebuild_err; + ice_pf_dcb_recfg(pf, locked); ice_vsi_open(vsi); + +rebuild_err: + dev_err(ice_pf_to_dev(pf), "Error during VSI rebuild: %d. Unload and reload the driver.\n", + err); done: clear_bit(ICE_CFG_BUSY, pf->state); return err; From patchwork Mon Jun 3 22:38:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacob Keller X-Patchwork-Id: 13684442 X-Patchwork-Delegate: kuba@kernel.org Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) (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 E33FC1411C8 for ; Mon, 3 Jun 2024 22:38:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717454309; cv=none; b=D2oN0hogoWV4YVX6pEzIYdVEmAbgC8TDkr38yTcDtB1L2JVK3pdTj//iD+LBxKAnI0chPzfVoB7w2ebbd37yjSpTI7xFmaFmYQ5oxH0acBos8JcvGGyrkF2gQRE+4ZP95XiyIwRUb5BUJnzLEf7PedtmccgiBl3S6MT9JWY40ag= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717454309; c=relaxed/simple; bh=2kjzUB8na2cN4OBQvNPcjvOEQpeAh1YQfpxhoGDNjck=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=QuKIBlCP9VAKyDhg3WkjTus8klx0apbA4DtbQaHE9skGyRokzAtOPdqJCvouBwsn3CIMsRa0efcwc4S0HwK9XPzPlrWCU0hAX6L8lBpQnOY4PxBBnFT8sDRlOOj5AJbkn7Lo+1+hzsQs/rBAFJr8JcMG7p/AgqDsljzMzn4ZF+k= 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=UEx6ptZt; arc=none smtp.client-ip=192.198.163.19 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="UEx6ptZt" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717454308; x=1748990308; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=2kjzUB8na2cN4OBQvNPcjvOEQpeAh1YQfpxhoGDNjck=; b=UEx6ptZtZFtP/ahoqo9pkxj9HT1GRyh14NcfFl9VJUn4Q0g6b5C77A51 LrKq/iwZ4L5CVSJvoRmiN5YYGZzYk+l9FOg/eLaF+hCIo1i01HhHADyZ4 H5+MwQOj4+8xp+eLV9guE4nxaTEzPpwnt+p1+ZNKSJEf5WwXTkjsmJtc1 O9g/mEyTULDQXzQmXhDUN3yvHIx2NHskv+rr6dEX9UaToF5zc+7eT+MzJ HbdxRvShGL0G9TN1xRmmr3Ad/NNC9CZqTe6ere+LIw1wsr68erZoPfynP a4VRWWWSQXIsTE+JJN2lK7Sx/s1AWNVbAqaYGsfDa2obi1CnLtQDE7FjG A==; X-CSE-ConnectionGUID: Q5QfyT0QTwCvuXHeOZ0suQ== X-CSE-MsgGUID: F15ntv/RQHGxruY86iJHbg== X-IronPort-AV: E=McAfee;i="6600,9927,11092"; a="13780134" X-IronPort-AV: E=Sophos;i="6.08,212,1712646000"; d="scan'208";a="13780134" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2024 15:38:23 -0700 X-CSE-ConnectionGUID: lqLXdgxlQCyd49Q8qWZl6g== X-CSE-MsgGUID: ww1Y1VBORQmkmDhNE2N4CA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,212,1712646000"; d="scan'208";a="41471208" Received: from jekeller-desk.amr.corp.intel.com ([10.166.241.1]) by fmviesa005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2024 15:38:22 -0700 From: Jacob Keller Date: Mon, 03 Jun 2024 15:38:21 -0700 Subject: [PATCH 9/9] igc: add support for ethtool.set_phys_id Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240603-next-2024-06-03-intel-next-batch-v1-9-e0523b28f325@intel.com> References: <20240603-next-2024-06-03-intel-next-batch-v1-0-e0523b28f325@intel.com> In-Reply-To: <20240603-next-2024-06-03-intel-next-batch-v1-0-e0523b28f325@intel.com> To: David Miller , netdev , Jakub Kicinski Cc: Jacob Keller , Vitaly Lifshits , Menachem Fogel , Naama Meir X-Mailer: b4 0.13.0 X-Patchwork-Delegate: kuba@kernel.org From: Vitaly Lifshits Add support for ethtool.set_phys_id callback to initiate LED blinking and stopping them by the ethtool interface. This is done by storing the initial LEDCTL register value and restoring it when LED blinking is terminated. In addition, moved IGC_LEDCTL related defines from igc_leds.c to igc_defines.h where they can be included by all of the igc module files. Co-developed-by: Menachem Fogel Signed-off-by: Menachem Fogel Signed-off-by: Vitaly Lifshits Tested-by: Naama Meir Signed-off-by: Jacob Keller --- drivers/net/ethernet/intel/igc/igc_defines.h | 22 +++++++++++++++++++ drivers/net/ethernet/intel/igc/igc_ethtool.c | 32 ++++++++++++++++++++++++++++ drivers/net/ethernet/intel/igc/igc_hw.h | 2 ++ drivers/net/ethernet/intel/igc/igc_leds.c | 21 +----------------- drivers/net/ethernet/intel/igc/igc_main.c | 2 ++ 5 files changed, 59 insertions(+), 20 deletions(-) diff --git a/drivers/net/ethernet/intel/igc/igc_defines.h b/drivers/net/ethernet/intel/igc/igc_defines.h index 5f92b3c7c3d4..664d49f10427 100644 --- a/drivers/net/ethernet/intel/igc/igc_defines.h +++ b/drivers/net/ethernet/intel/igc/igc_defines.h @@ -686,4 +686,26 @@ #define IGC_LTRMAXV_LSNP_REQ 0x00008000 /* LTR Snoop Requirement */ #define IGC_LTRMAXV_SCALE_SHIFT 10 +/* LED ctrl defines */ +#define IGC_NUM_LEDS 3 + +#define IGC_LEDCTL_GLOBAL_BLINK_MODE BIT(5) +#define IGC_LEDCTL_LED0_MODE_SHIFT 0 +#define IGC_LEDCTL_LED0_MODE_MASK GENMASK(3, 0) +#define IGC_LEDCTL_LED0_BLINK BIT(7) +#define IGC_LEDCTL_LED1_MODE_SHIFT 8 +#define IGC_LEDCTL_LED1_MODE_MASK GENMASK(11, 8) +#define IGC_LEDCTL_LED1_BLINK BIT(15) +#define IGC_LEDCTL_LED2_MODE_SHIFT 16 +#define IGC_LEDCTL_LED2_MODE_MASK GENMASK(19, 16) +#define IGC_LEDCTL_LED2_BLINK BIT(23) + +#define IGC_LEDCTL_MODE_ON 0x00 +#define IGC_LEDCTL_MODE_OFF 0x01 +#define IGC_LEDCTL_MODE_LINK_10 0x05 +#define IGC_LEDCTL_MODE_LINK_100 0x06 +#define IGC_LEDCTL_MODE_LINK_1000 0x07 +#define IGC_LEDCTL_MODE_LINK_2500 0x08 +#define IGC_LEDCTL_MODE_ACTIVITY 0x0b + #endif /* _IGC_DEFINES_H_ */ diff --git a/drivers/net/ethernet/intel/igc/igc_ethtool.c b/drivers/net/ethernet/intel/igc/igc_ethtool.c index f2c4f1966bb0..82ece5f95f1e 100644 --- a/drivers/net/ethernet/intel/igc/igc_ethtool.c +++ b/drivers/net/ethernet/intel/igc/igc_ethtool.c @@ -1975,6 +1975,37 @@ static void igc_ethtool_diag_test(struct net_device *netdev, msleep_interruptible(4 * 1000); } +static int igc_ethtool_set_phys_id(struct net_device *netdev, + enum ethtool_phys_id_state state) +{ + struct igc_adapter *adapter = netdev_priv(netdev); + struct igc_hw *hw = &adapter->hw; + u32 ledctl; + + switch (state) { + case ETHTOOL_ID_ACTIVE: + ledctl = rd32(IGC_LEDCTL); + + /* initiate LED1 blinking */ + ledctl &= ~(IGC_LEDCTL_GLOBAL_BLINK_MODE | + IGC_LEDCTL_LED1_MODE_MASK | + IGC_LEDCTL_LED2_MODE_MASK); + ledctl |= IGC_LEDCTL_LED1_BLINK; + wr32(IGC_LEDCTL, ledctl); + break; + + case ETHTOOL_ID_INACTIVE: + /* restore LEDCTL default value */ + wr32(IGC_LEDCTL, hw->mac.ledctl_default); + break; + + default: + break; + } + + return 0; +} + static const struct ethtool_ops igc_ethtool_ops = { .supported_coalesce_params = ETHTOOL_COALESCE_USECS, .get_drvinfo = igc_ethtool_get_drvinfo, @@ -2013,6 +2044,7 @@ static const struct ethtool_ops igc_ethtool_ops = { .get_link_ksettings = igc_ethtool_get_link_ksettings, .set_link_ksettings = igc_ethtool_set_link_ksettings, .self_test = igc_ethtool_diag_test, + .set_phys_id = igc_ethtool_set_phys_id, }; void igc_ethtool_set_ops(struct net_device *netdev) diff --git a/drivers/net/ethernet/intel/igc/igc_hw.h b/drivers/net/ethernet/intel/igc/igc_hw.h index e1c572e0d4ef..45b68695bdb7 100644 --- a/drivers/net/ethernet/intel/igc/igc_hw.h +++ b/drivers/net/ethernet/intel/igc/igc_hw.h @@ -95,6 +95,8 @@ struct igc_mac_info { bool autoneg; bool autoneg_failed; bool get_link_status; + + u32 ledctl_default; }; struct igc_nvm_operations { diff --git a/drivers/net/ethernet/intel/igc/igc_leds.c b/drivers/net/ethernet/intel/igc/igc_leds.c index 3929b25b6ae6..e5eeef240802 100644 --- a/drivers/net/ethernet/intel/igc/igc_leds.c +++ b/drivers/net/ethernet/intel/igc/igc_leds.c @@ -8,26 +8,7 @@ #include #include "igc.h" - -#define IGC_NUM_LEDS 3 - -#define IGC_LEDCTL_LED0_MODE_SHIFT 0 -#define IGC_LEDCTL_LED0_MODE_MASK GENMASK(3, 0) -#define IGC_LEDCTL_LED0_BLINK BIT(7) -#define IGC_LEDCTL_LED1_MODE_SHIFT 8 -#define IGC_LEDCTL_LED1_MODE_MASK GENMASK(11, 8) -#define IGC_LEDCTL_LED1_BLINK BIT(15) -#define IGC_LEDCTL_LED2_MODE_SHIFT 16 -#define IGC_LEDCTL_LED2_MODE_MASK GENMASK(19, 16) -#define IGC_LEDCTL_LED2_BLINK BIT(23) - -#define IGC_LEDCTL_MODE_ON 0x00 -#define IGC_LEDCTL_MODE_OFF 0x01 -#define IGC_LEDCTL_MODE_LINK_10 0x05 -#define IGC_LEDCTL_MODE_LINK_100 0x06 -#define IGC_LEDCTL_MODE_LINK_1000 0x07 -#define IGC_LEDCTL_MODE_LINK_2500 0x08 -#define IGC_LEDCTL_MODE_ACTIVITY 0x0b +#include "igc_defines.h" #define IGC_SUPPORTED_MODES \ (BIT(TRIGGER_NETDEV_LINK_2500) | BIT(TRIGGER_NETDEV_LINK_1000) | \ diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c index 12f004f46082..d0db302aa3eb 100644 --- a/drivers/net/ethernet/intel/igc/igc_main.c +++ b/drivers/net/ethernet/intel/igc/igc_main.c @@ -7070,6 +7070,8 @@ static int igc_probe(struct pci_dev *pdev, goto err_register; } + hw->mac.ledctl_default = rd32(IGC_LEDCTL); + return 0; err_register: