From patchwork Tue May 7 11:45:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Swiatkowski X-Patchwork-Id: 13656709 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) (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 656D314F11A for ; Tue, 7 May 2024 11:40:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715082014; cv=none; b=qR5LedXOWVJNUXtS6KBWwlntTzQ06BG8hALVkfsR8Bm+VNEvJJ/KArRTrwjGns9c4IcBIOBVMpeIW2S5kYaBVDcab02vkb95kDEFMhBO9xylf9XzhiE8qk4qcrXGJvrgNLfP3WU3tY4vguv5GYaEiTzt7yNrSGEBSUoBi9KVEFI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715082014; c=relaxed/simple; bh=dadqmm5nJ6qRblS2ceDFRB5Fc7tJ5Y397ZiFyduG+gI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=h1Q0B9AUkchEt5hH3TtNfr6NGQDYo9qt7un8l/5q1+e5jUF6LLBCfBPZEOTjX2/Szbq0JX45NttTElzByrCNUzPjoapupFwBz17SahTrx2kBuCb1wnEVs69QdM5Bl1nyUnK0i6MGkJYrj1HkGPDLwyt1A2qC9EtFyfAT5jtC+Pw= 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=oHs3+CaO; arc=none smtp.client-ip=198.175.65.13 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="oHs3+CaO" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1715082013; x=1746618013; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=dadqmm5nJ6qRblS2ceDFRB5Fc7tJ5Y397ZiFyduG+gI=; b=oHs3+CaO3pCBttdurCMbkQbtaV5DQ1MIBdChGjWawDEn1Vrp3v2Dygjc F+nYjqByHrgeHQEvOGkxGGoPjvFA5G6quwsrkosnB08UFrQM57cCqgaS9 G9t4WM4DwNMFQEBDx3SI12e650PdP3Bpwi1PtlFTryvipMv1M4yYQcagD OgTYDJ+UCNyEq1n4o1ypUePQ3FmuBJsu9DxiYYZapuo4x6zTM9uJG/QUO 1cmxit8n37xFINws6JxjFj5MzPqbxiUAuWzrOmhVFEVr2vepjPw5lI13n 8NThBxl+sGsrYxzgfD2ixtigUaT2Fk8/rxpurcXRe6KgYHRHFFmFEXTiD g==; X-CSE-ConnectionGUID: qmOWWeqzQDOzyRuOXykksg== X-CSE-MsgGUID: mYnUU0AeSA2ripYrFaJasQ== X-IronPort-AV: E=McAfee;i="6600,9927,11065"; a="22029085" X-IronPort-AV: E=Sophos;i="6.08,261,1712646000"; d="scan'208";a="22029085" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 May 2024 04:40:12 -0700 X-CSE-ConnectionGUID: cuGvTFjPS+mLeO8irPYZ4Q== X-CSE-MsgGUID: jKilp82mRuCkzcoNKI2IWQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,261,1712646000"; d="scan'208";a="28576663" Received: from wasp.igk.intel.com (HELO GK3153-DR2-R750-36946.localdomain.com) ([10.102.20.192]) by orviesa009.jf.intel.com with ESMTP; 07 May 2024 04:40:09 -0700 From: Michal Swiatkowski To: intel-wired-lan@lists.osuosl.org Cc: netdev@vger.kernel.org, jacob.e.keller@intel.com, michal.kubiak@intel.com, maciej.fijalkowski@intel.com, sridhar.samudrala@intel.com, przemyslaw.kitszel@intel.com, wojciech.drewek@intel.com, pio.raczynski@gmail.com, jiri@nvidia.com, mateusz.polchlopek@intel.com, shayd@nvidia.com Subject: [iwl-next v1 00/14] ice: support devlink subfunction Date: Tue, 7 May 2024 13:45:01 +0200 Message-ID: <20240507114516.9765-1-michal.swiatkowski@linux.intel.com> X-Mailer: git-send-email 2.42.0 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Hi, Currently ice driver does not allow creating more than one networking device per physical function. The only way to have more hardware backed netdev is to use SR-IOV. Following patchset adds support for devlink port API. For each new pcisf type port, driver allocates new VSI, configures all resources needed, including dynamically MSIX vectors, program rules and registers new netdev. This series supports only one Tx/Rx queue pair per subfunction. Example commands: devlink port add pci/0000:31:00.1 flavour pcisf pfnum 1 sfnum 1000 devlink port function set pci/0000:31:00.1/1 hw_addr 00:00:00:00:03:14 devlink port function set pci/0000:31:00.1/1 state active devlink port function del pci/0000:31:00.1/1 Make the port representor and eswitch code generic to support subfunction representor type. VSI configuration is slightly different between VF and SF. It needs to be reflected in the code. Most recent previous patchset (not containing port representor for SF support). [1] [1] https://lore.kernel.org/netdev/20240417142028.2171-1-michal.swiatkowski@linux.intel.com/ Michal Swiatkowski (7): ice: treat subfunction VSI the same as PF VSI ice: create port representor for SF ice: don't set target VSI for subfunction ice: check if SF is ready in ethtool ops ice: netdevice ops for SF representor ice: support subfunction devlink Tx topology ice: basic support for VLAN in subfunctions Piotr Raczynski (7): ice: add new VSI type for subfunctions ice: export ice ndo_ops functions ice: add basic devlink subfunctions support ice: allocate devlink for subfunction ice: base subfunction aux driver ice: implement netdev for subfunction ice: allow to activate and deactivate subfunction drivers/net/ethernet/intel/ice/Makefile | 2 + .../net/ethernet/intel/ice/devlink/devlink.c | 48 ++ .../net/ethernet/intel/ice/devlink/devlink.h | 1 + .../ethernet/intel/ice/devlink/devlink_port.c | 516 ++++++++++++++++++ .../ethernet/intel/ice/devlink/devlink_port.h | 43 ++ drivers/net/ethernet/intel/ice/ice.h | 19 +- drivers/net/ethernet/intel/ice/ice_base.c | 5 +- drivers/net/ethernet/intel/ice/ice_dcb_lib.c | 1 + drivers/net/ethernet/intel/ice/ice_eswitch.c | 85 ++- drivers/net/ethernet/intel/ice/ice_eswitch.h | 22 +- drivers/net/ethernet/intel/ice/ice_ethtool.c | 7 +- drivers/net/ethernet/intel/ice/ice_lib.c | 52 +- drivers/net/ethernet/intel/ice/ice_lib.h | 3 + drivers/net/ethernet/intel/ice/ice_main.c | 66 ++- drivers/net/ethernet/intel/ice/ice_repr.c | 195 +++++-- drivers/net/ethernet/intel/ice/ice_repr.h | 22 +- drivers/net/ethernet/intel/ice/ice_sf_eth.c | 329 +++++++++++ drivers/net/ethernet/intel/ice/ice_sf_eth.h | 33 ++ .../ethernet/intel/ice/ice_sf_vsi_vlan_ops.c | 21 + .../ethernet/intel/ice/ice_sf_vsi_vlan_ops.h | 13 + drivers/net/ethernet/intel/ice/ice_sriov.c | 4 +- drivers/net/ethernet/intel/ice/ice_txrx.c | 2 +- drivers/net/ethernet/intel/ice/ice_type.h | 1 + drivers/net/ethernet/intel/ice/ice_vf_lib.c | 4 +- .../net/ethernet/intel/ice/ice_vsi_vlan_ops.c | 4 + drivers/net/ethernet/intel/ice/ice_xsk.c | 2 +- 26 files changed, 1362 insertions(+), 138 deletions(-) create mode 100644 drivers/net/ethernet/intel/ice/ice_sf_eth.c create mode 100644 drivers/net/ethernet/intel/ice/ice_sf_eth.h create mode 100644 drivers/net/ethernet/intel/ice/ice_sf_vsi_vlan_ops.c create mode 100644 drivers/net/ethernet/intel/ice/ice_sf_vsi_vlan_ops.h