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: 1932428 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=RdRTPt7d; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=patchwork.ozlabs.org) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (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 4VYbtX72s3z1xnS for ; Tue, 7 May 2024 21:40:20 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 90B6E401EA; Tue, 7 May 2024 11:40:16 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id KFLzpJL7XQxW; Tue, 7 May 2024 11:40:15 +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 smtp4.osuosl.org 22E86401F8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1715082015; bh=SMxC5Z2ccyZq0Q5DFC7PCZj2HxIuDtp8MboIf8aNtng=; h=From:To:Date:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:Cc:From; b=RdRTPt7dx/DyAbPRTugCtvSqbKvA2XNH64GMvDbjEYLXvL7h32pe5pDiOZCtsJekJ xWZxM3xlf4MDUw342KawQoiiKNpI0f0b3Z1cJB1/oqyjhFqh7wr6NLKKv/ZS3CEWxD pWDnymWVEtiqlD69qhTH+pawTCrZP+Orifyz/g6hUMWO7aIkGoHveiiU7dtt34NAZi TAgjajTUavCP9YVbk4zbsx07mxzxWs0Xulzp/jybjSJOSJ+oEyA7EXBdTZwj/aUsUJ QyyWrLYZQTthhPubaujVeuhkQ5HhAnMQZBUP1isq+cjDlci0hpiTm/SBXhXYl3+0CN 7Fg+lcoUZrwqg== Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 22E86401F8; Tue, 7 May 2024 11:40:15 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 0249C1BF5A0 for ; Tue, 7 May 2024 11:40:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id EF70340223 for ; Tue, 7 May 2024 11:40:13 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 8jjprK9Auana for ; Tue, 7 May 2024 11:40:13 +0000 (UTC) Received-SPF: None (mailfrom) identity=mailfrom; client-ip=198.175.65.13; helo=mgamail.intel.com; envelope-from=michal.swiatkowski@linux.intel.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp2.osuosl.org B8F2740154 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org B8F2740154 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) by smtp2.osuosl.org (Postfix) with ESMTPS id B8F2740154 for ; Tue, 7 May 2024 11:40:12 +0000 (UTC) X-CSE-ConnectionGUID: puDvH0r9S2Oov4gK95UosA== X-CSE-MsgGUID: Ool/R6YPTmOMIWpGn5aipQ== X-IronPort-AV: E=McAfee;i="6600,9927,11065"; a="22029086" X-IronPort-AV: E=Sophos;i="6.08,261,1712646000"; d="scan'208";a="22029086" 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 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 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=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-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dmarc=none (p=none dis=none) header.from=linux.intel.com X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=oHs3+CaO Subject: [Intel-wired-lan] [iwl-next v1 00/14] ice: support devlink subfunction 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: shayd@nvidia.com, maciej.fijalkowski@intel.com, sridhar.samudrala@intel.com, mateusz.polchlopek@intel.com, netdev@vger.kernel.org, jiri@nvidia.com, michal.kubiak@intel.com, pio.raczynski@gmail.com, przemyslaw.kitszel@intel.com, jacob.e.keller@intel.com, wojciech.drewek@intel.com Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" 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