From patchwork Fri Apr 12 06:30:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Swiatkowski X-Patchwork-Id: 1922857 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=Q6QwnuZ6; 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 4VG65h2Ytzz1yYM for ; Fri, 12 Apr 2024 16:26:15 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 00A0041EC6; Fri, 12 Apr 2024 06:26:13 +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 A0j0fUxwyISZ; Fri, 12 Apr 2024 06:26:12 +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 B47C041EC9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1712903172; bh=XDasYtv2F89G80iAlNlssqaNYJ1gtKLXyHsFHkKZL+k=; h=From:To:Date:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:Cc:From; b=Q6QwnuZ6VV4EhrTPs7DFiG01VgE9oCEnm3JmjeF1mBr3kSTVftP0iwu/96e3NjGVs Y81sgeju+GzQ12lXnJaqUrDpx3lr2y3jPBp9VJulgORmTRxt8XoMhBxKmUGeuVW8Vb rSqlyttDdOai9Db2A3alDOOXtZw4zWufDhxV0biMTjhqKNje1DrZvmW/+njm2Dg7Nz tzCIkAkJq9U76xd2mQflD6IcA9hpS78XT+cGQgf/nR8MAurYHZsjChiC6Oq7UdUN9A M/dBgkWoDF/zA+757+s4YA8m1/I+clzdOjPqc9KScM1wHiZdAvE88kntXgVTg/Dypp 8ITere23g3P9g== Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id B47C041EC9; Fri, 12 Apr 2024 06:26:12 +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 9A77B1BF997 for ; Fri, 12 Apr 2024 06:26:10 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 9344C40446 for ; Fri, 12 Apr 2024 06:26:10 +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 FzJgKqEDqN6S for ; Fri, 12 Apr 2024 06:26:09 +0000 (UTC) Received-SPF: None (mailfrom) identity=mailfrom; client-ip=192.198.163.11; helo=mgamail.intel.com; envelope-from=michal.swiatkowski@linux.intel.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp2.osuosl.org 5750540217 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 5750540217 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) by smtp2.osuosl.org (Postfix) with ESMTPS id 5750540217 for ; Fri, 12 Apr 2024 06:26:08 +0000 (UTC) X-CSE-ConnectionGUID: H+EhcQkYRw2Aoh3TNCtUGA== X-CSE-MsgGUID: uPjF+2VISk+iyptAnswkOw== X-IronPort-AV: E=McAfee;i="6600,9927,11041"; a="18952917" X-IronPort-AV: E=Sophos;i="6.07,195,1708416000"; d="scan'208";a="18952917" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Apr 2024 23:26:08 -0700 X-CSE-ConnectionGUID: 4WEmUjD/S7ye6lxehmcKJA== X-CSE-MsgGUID: l2RXEORcSDu96fzzPliawA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,195,1708416000"; d="scan'208";a="21105106" Received: from wasp.igk.intel.com (HELO GK3153-DR2-R750-36946.localdomain.com) ([10.102.20.192]) by orviesa009.jf.intel.com with ESMTP; 11 Apr 2024 23:26:06 -0700 From: Michal Swiatkowski To: intel-wired-lan@lists.osuosl.org Date: Fri, 12 Apr 2024 08:30:46 +0200 Message-ID: <20240412063053.339795-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=1712903169; x=1744439169; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=jRcj2oxklJwGFoMTbd917djM/PGT7350Dviv7MmY+gk=; b=SOiJcXx4zAFqX684jVr7SJ4AnW/0WLwgGPIYWC9EY/lMelgVcF5QhEd3 joMTbs3kdy0p2oVp1r5CrnQ7/lhVbaEd3pjyXZAy2btoE6UILfxr3iMLa ouRlB9k8Y1lGl/OAmPYAqVBj1ZqpImFFSaeO+Zil5pcpBTBk2riw5HfDi koQOKSgQDiS96vKySxNSONr8DZtG5L7BysUlcGeRQeidfXfXl/ABQWytJ /LwCK1FtuZEDFbiaR9d4IdYD8lSzwMoaxJ/zR+pOVHXKL3z+kXLNkVxRo e3MD9P7vw4XE6HV32K/vjhgkRjNvgNIhv+GV93e4l/BrZnp6zCmOmO3XL A==; 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=SOiJcXx4 Subject: [Intel-wired-lan] [iwl-next v3 0/7] 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: Michal Swiatkowski , maciej.fijalkowski@intel.com, mateusz.polchlopek@intel.com, sridhar.samudrala@intel.com, nex.sw.ncis.osdt.itp.upstreaming@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, This is second patchset split from subfunction patchset [1]. Important changes from previous version: * remove unnecessary checks for devlink port type * link correct devlink port to subfunction netdev Follow up patchset with subfunction port representor will be the last patchset for subfunction implementation in ice. It is a little unpleasant to split it like that, because devlink port should be linked with port representor netdev. In this patchset use devlink port without linking it. It will be done correctly in the follow up when subfunction port representor is available. 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 v2 --> v3: [3] * fix building issue between the patches; allocating devlink for subfunction need to include base subfunction header * fix kdoc issues v1 --> v2: [2] * use correct parameters in ice_devlink_alloc() thanks to Mateusz [1] https://lore.kernel.org/netdev/20240301115414.502097-1-michal.swiatkowski@linux.intel.com/ [2] https://lore.kernel.org/netdev/20240408103049.19445-1-michal.swiatkowski@linux.intel.com/ [3] https://lore.kernel.org/netdev/20240410050809.125043-1-michal.swiatkowski@linux.intel.com/ *** BLURB HERE *** 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 | 1 + .../net/ethernet/intel/ice/devlink/devlink.c | 50 +- .../net/ethernet/intel/ice/devlink/devlink.h | 1 + .../ethernet/intel/ice/devlink/devlink_port.c | 512 ++++++++++++++++++ .../ethernet/intel/ice/devlink/devlink_port.h | 38 ++ drivers/net/ethernet/intel/ice/ice.h | 12 + 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_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_sf_eth.c | 317 +++++++++++ drivers/net/ethernet/intel/ice/ice_sf_eth.h | 33 ++ drivers/net/ethernet/intel/ice/ice_type.h | 1 + drivers/net/ethernet/intel/ice/ice_xsk.c | 2 +- 15 files changed, 1047 insertions(+), 47 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