From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E21A5C04E69 for ; Wed, 16 Aug 2023 14:59:01 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 55FCB41888; Wed, 16 Aug 2023 14:59:01 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 55FCB41888 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1692197941; bh=bh/kd6jsTrO8lAftCBiIZgT2fd4dk7hglXfOMfi7b84=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=fQCGgDgXpQf6XUoIwGVgfGdZapbABfSMkDfuQG4VddvwkaZPdjy7kLuQBbGIrBCFZ UmHlCUa7jcgCqQcvrG1YCbZdEQof+q4QkOKafZa7x+5Fc2eQn99BUUb1ebUb5KqTKu NIRk5LTyyqWBxY5/vVVLjECA/EN3oFKVKUDqblp1ZvJ5M2xUQ7PYqrYKucB5IFWXTC beZDTgW4JT0AzslJuDsRT4I0hecQCRWGhUn7qrj6c8iOzJVwWf9rfVEz9HYdaPIk3m tB8pPH8hKvnuwPvkWY2O7fzT+loN/GENFKWQhAWs7p1fdbT79E6qZseT160yEGMPBj ByUD5BRvBk7/Q== X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id q0A_TzjgbFMB; Wed, 16 Aug 2023 14:59:00 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id D854C41E32; Wed, 16 Aug 2023 14:58:59 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org D854C41E32 Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id B03E51BF4DA for ; Wed, 16 Aug 2023 03:29:32 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 9526F611B2 for ; Wed, 16 Aug 2023 03:29:32 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 9526F611B2 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4i6GcGaT0ITU for ; Wed, 16 Aug 2023 03:29:31 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.115]) by smtp3.osuosl.org (Postfix) with ESMTPS id 1285B60B12 for ; Wed, 16 Aug 2023 03:29:31 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 1285B60B12 X-IronPort-AV: E=McAfee;i="6600,9927,10803"; a="372427749" X-IronPort-AV: E=Sophos;i="6.01,175,1684825200"; d="scan'208";a="372427749" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Aug 2023 20:29:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10803"; a="710958631" X-IronPort-AV: E=Sophos;i="6.01,175,1684825200"; d="scan'208";a="710958631" Received: from dpdk-wuwenjun-icelake-ii.sh.intel.com ([10.67.110.152]) by orsmga006.jf.intel.com with ESMTP; 15 Aug 2023 20:29:27 -0700 From: Wenjun Wu To: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org Date: Wed, 16 Aug 2023 11:33:48 +0800 Message-Id: <20230816033353.94565-1-wenjun1.wu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230727021021.961119-1-wenjun1.wu@intel.com> References: <20230727021021.961119-1-wenjun1.wu@intel.com> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 16 Aug 2023 14:58:57 +0000 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=1692156571; x=1723692571; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=sCtw3BOwGca6RJBPjVd4Ax5JBZdOqFGXijzSHjesFh8=; b=W6oDepjNOlvau9XVUNwxUc8Se9ZBpKXu2TE+afXHsdzZ8A6zAF5NZNDC VPZwF2qg8ZTiOQAH14AVR7BEWFvHJMR9qZ/vABLvqdh3yyFnoK730LhE/ NomGu2E5Ry5zCJMw7F7q7cMjMYxaQIhICgsPjvRQmEdd8Oiqpb8aTqEBu tJPFI5FBLYgLj1Hz3m2OXGZ76Wm5m3CZ3xwkndH5llFXD+exyJ6s8+n9d l2wFRzCECktqVSBerpt974X0vxmvA9CDwdh7bg9q412hYfhe97CVHwUJI GtAQIKw2HhuyF0gRgadMjJtrXi1PpHJ6T1ocKdHGE1/otNEWVe3KGE9aA w==; X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=W6oDepjN Subject: [Intel-wired-lan] [PATCH iwl-next v3 0/5] iavf: Add devlink and devlink rate support 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: anthony.l.nguyen@intel.com, Wenjun Wu , qi.z.zhang@intel.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" To allow user to configure queue bandwidth, devlink port support is added to support devlink port rate API. [1] Add devlink framework registration/unregistration on iavf driver initialization and remove, and devlink port of DEVLINK_PORT_FLAVOUR_VIRTUAL is created to be associated iavf netdevice. iavf rate tree with root node, queue nodes, and leaf node is created and registered with devlink rate when iavf adapter is configured, and if PF indicates support of VIRTCHNL_VF_OFFLOAD_QOS through VF Resource / Capability Exchange. [root@localhost ~]# devlink port function rate show pci/0000:af:01.0/txq_15: type node parent iavf_root pci/0000:af:01.0/txq_14: type node parent iavf_root pci/0000:af:01.0/txq_13: type node parent iavf_root pci/0000:af:01.0/txq_12: type node parent iavf_root pci/0000:af:01.0/txq_11: type node parent iavf_root pci/0000:af:01.0/txq_10: type node parent iavf_root pci/0000:af:01.0/txq_9: type node parent iavf_root pci/0000:af:01.0/txq_8: type node parent iavf_root pci/0000:af:01.0/txq_7: type node parent iavf_root pci/0000:af:01.0/txq_6: type node parent iavf_root pci/0000:af:01.0/txq_5: type node parent iavf_root pci/0000:af:01.0/txq_4: type node parent iavf_root pci/0000:af:01.0/txq_3: type node parent iavf_root pci/0000:af:01.0/txq_2: type node parent iavf_root pci/0000:af:01.0/txq_1: type node parent iavf_root pci/0000:af:01.0/txq_0: type node parent iavf_root pci/0000:af:01.0/iavf_root: type node +---------+ | root | +----+----+ | |-----------------|-----------------| +----v----+ +----v----+ +----v----+ | txq_0 | | txq_1 | | txq_x | +----+----+ +----+----+ +----+----+ User can configure the tx_max and tx_share of each queue. Once any one of the queues are fully configured, VIRTCHNL opcodes of VIRTCHNL_OP_CONFIG_QUEUE_BW and VIRTCHNL_OP_CONFIG_QUANTA will be sent to PF to configure queues allocated to VF Example: 1.To Set the queue tx_share: devlink port function rate set pci/0000:af:01.0 txq_0 tx_share 100 MBps 2.To Set the queue tx_max: devlink port function rate set pci/0000:af:01.0 txq_0 tx_max 200 MBps 3.To Show Current devlink port rate info: devlink port function rate function show [root@localhost ~]# devlink port function rate show pci/0000:af:01.0/txq_15: type node parent iavf_root pci/0000:af:01.0/txq_14: type node parent iavf_root pci/0000:af:01.0/txq_13: type node parent iavf_root pci/0000:af:01.0/txq_12: type node parent iavf_root pci/0000:af:01.0/txq_11: type node parent iavf_root pci/0000:af:01.0/txq_10: type node parent iavf_root pci/0000:af:01.0/txq_9: type node parent iavf_root pci/0000:af:01.0/txq_8: type node parent iavf_root pci/0000:af:01.0/txq_7: type node parent iavf_root pci/0000:af:01.0/txq_6: type node parent iavf_root pci/0000:af:01.0/txq_5: type node parent iavf_root pci/0000:af:01.0/txq_4: type node parent iavf_root pci/0000:af:01.0/txq_3: type node parent iavf_root pci/0000:af:01.0/txq_2: type node parent iavf_root pci/0000:af:01.0/txq_1: type node parent iavf_root pci/0000:af:01.0/txq_0: type node tx_share 800Mbit tx_max 1600Mbit parent iavf_root pci/0000:af:01.0/iavf_root: type node [1]https://lore.kernel.org/netdev/20221115104825.172668-1-michal.wilczynski@intel.com/ Change log: v3: - Rebase the code - Changed rate node max/share set function description - Put variable in local scope v2: - Change static array to flex array - Use struct_size helper - Align all the error code types in the function - Move the register field definitions to the right place in the file - Fix coding style - Adapted to queue bw cfg and qos cap list virtchnl message with flex array fields --- Jun Zhang (3): iavf: Add devlink and devlink port support iavf: Add devlink port function rate API support iavf: Add VIRTCHNL Opcodes Support for Queue bw Setting Wenjun Wu (2): virtchnl: support queue rate limit and quanta size configuration ice: Support VF queue rate limit and quanta size configuration drivers/net/ethernet/intel/Kconfig | 1 + drivers/net/ethernet/intel/iavf/Makefile | 2 +- drivers/net/ethernet/intel/iavf/iavf.h | 20 + .../net/ethernet/intel/iavf/iavf_devlink.c | 376 ++++++++++++++++++ .../net/ethernet/intel/iavf/iavf_devlink.h | 39 ++ drivers/net/ethernet/intel/iavf/iavf_main.c | 60 ++- .../net/ethernet/intel/iavf/iavf_virtchnl.c | 230 ++++++++++- drivers/net/ethernet/intel/ice/ice.h | 2 + drivers/net/ethernet/intel/ice/ice_base.c | 2 + drivers/net/ethernet/intel/ice/ice_common.c | 19 + .../net/ethernet/intel/ice/ice_hw_autogen.h | 8 + drivers/net/ethernet/intel/ice/ice_txrx.h | 2 + drivers/net/ethernet/intel/ice/ice_type.h | 1 + drivers/net/ethernet/intel/ice/ice_vf_lib.h | 9 + drivers/net/ethernet/intel/ice/ice_virtchnl.c | 312 +++++++++++++++ drivers/net/ethernet/intel/ice/ice_virtchnl.h | 11 + .../intel/ice/ice_virtchnl_allowlist.c | 6 + include/linux/avf/virtchnl.h | 119 ++++++ 18 files changed, 1216 insertions(+), 3 deletions(-) create mode 100644 drivers/net/ethernet/intel/iavf/iavf_devlink.c create mode 100644 drivers/net/ethernet/intel/iavf/iavf_devlink.h -- 2.34.1 _______________________________________________ Intel-wired-lan mailing list Intel-wired-lan@osuosl.org https://lists.osuosl.org/mailman/listinfo/intel-wired-lan