get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/1198428/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 1198428,
    "url": "http://patchwork.ozlabs.org/api/patches/1198428/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20191120170150.36240-1-mustafa.ismail@intel.com/",
    "project": {
        "id": 46,
        "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api",
        "name": "Intel Wired Ethernet development",
        "link_name": "intel-wired-lan",
        "list_id": "intel-wired-lan.osuosl.org",
        "list_email": "intel-wired-lan@osuosl.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20191120170150.36240-1-mustafa.ismail@intel.com>",
    "list_archive_url": null,
    "date": "2019-11-20T17:01:50",
    "name": "i40e: Register a virtbus device to provide RDMA",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "72e6085782cb3e315ee5c5430bbacc55e2e0d896",
    "submitter": {
        "id": 77953,
        "url": "http://patchwork.ozlabs.org/api/people/77953/?format=api",
        "name": "Ismail, Mustafa",
        "email": "mustafa.ismail@intel.com"
    },
    "delegate": {
        "id": 68,
        "url": "http://patchwork.ozlabs.org/api/users/68/?format=api",
        "username": "jtkirshe",
        "first_name": "Jeff",
        "last_name": "Kirsher",
        "email": "jeffrey.t.kirsher@intel.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20191120170150.36240-1-mustafa.ismail@intel.com/mbox/",
    "series": [
        {
            "id": 144135,
            "url": "http://patchwork.ozlabs.org/api/series/144135/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=144135",
            "date": "2019-11-20T17:01:50",
            "name": "i40e: Register a virtbus device to provide RDMA",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/144135/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1198428/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1198428/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<intel-wired-lan-bounces@osuosl.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@bilbo.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Authentication-Results": [
            "ozlabs.org; spf=pass (sender SPF authorized)\n\tsmtp.mailfrom=osuosl.org (client-ip=140.211.166.137;\n\thelo=fraxinus.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org;\n\tdmarc=fail (p=none dis=none) header.from=intel.com"
        ],
        "Received": [
            "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 47J9cc32yYz9sQp\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 21 Nov 2019 05:06:39 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 229BA86DB4;\n\tWed, 20 Nov 2019 18:06:38 +0000 (UTC)",
            "from fraxinus.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id pS1GQyfJWDO0; Wed, 20 Nov 2019 18:06:36 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id EEBB986DEF;\n\tWed, 20 Nov 2019 18:06:35 +0000 (UTC)",
            "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id 231EB1BF2CA\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 20 Nov 2019 17:02:20 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 1D94E86DBF\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 20 Nov 2019 17:02:20 +0000 (UTC)",
            "from fraxinus.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id nRpg88eFXQS3 for <intel-wired-lan@lists.osuosl.org>;\n\tWed, 20 Nov 2019 17:02:18 +0000 (UTC)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby fraxinus.osuosl.org (Postfix) with ESMTPS id 235C586D9A\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 20 Nov 2019 17:02:18 +0000 (UTC)",
            "from fmsmga002.fm.intel.com ([10.253.24.26])\n\tby fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t20 Nov 2019 09:02:17 -0800",
            "from mustafai-mobl1.amr.corp.intel.com ([10.122.128.226])\n\tby fmsmga002.fm.intel.com with ESMTP; 20 Nov 2019 09:02:16 -0800"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6",
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.69,222,1571727600\"; d=\"scan'208\";a=\"237809144\"",
        "From": "Mustafa Ismail <mustafa.ismail@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Wed, 20 Nov 2019 11:01:50 -0600",
        "Message-Id": "<20191120170150.36240-1-mustafa.ismail@intel.com>",
        "X-Mailer": "git-send-email 2.17.0",
        "X-Mailman-Approved-At": "Wed, 20 Nov 2019 18:06:27 +0000",
        "Subject": "[Intel-wired-lan] [PATCH] i40e: Register a virtbus device to\n\tprovide RDMA",
        "X-BeenThere": "intel-wired-lan@osuosl.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.osuosl.org>",
        "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>",
        "List-Post": "<mailto:intel-wired-lan@osuosl.org>",
        "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>",
        "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>",
        "Cc": "mustafa.ismail@intel.com, sindhu.devale@intel.com,\n\tShiraz Saleem <shiraz.saleem@intel.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "intel-wired-lan-bounces@osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>"
    },
    "content": "From: \"Shiraz Saleem\" <shiraz.saleem@intel.com>\n\nRegister client virtbus device on the virtbus for the RDMA\nvirtbus driver (irdma) to bind to. It allows to realize a\nsingle RDMA driver capable of working with multiple netdev\ndrivers over multi-generation Intel HW supporting RDMA.\nThere is also no load ordering dependencies between i40e and\nirdma.\n\nSummary of changes:\n* Support to add/remove virtbus devices\n* Add 2 new client ops.\n\t* i40e_client_device_register() which is called during RDMA\n\t  probe() per PF. Validate client drv OPs and schedule service\n\t  task to call open()\n\t* i40e_client_device_unregister() called during RDMA remove()\n\t  per PF. Call client close() and release_qvlist.\n* The global register/unregister calls exported for i40iw are retained\n  until i40iw is removed from the kernel.\n\nSigned-off-by: Mustafa Ismail <mustafa.ismail@intel.com>\nSigned-off-by: Shiraz Saleem <shiraz.saleem@intel.com>\n---\n drivers/infiniband/hw/i40iw/Makefile          |   1 -\n drivers/infiniband/hw/i40iw/i40iw.h           |   2 +-\n drivers/net/ethernet/intel/Kconfig            |   1 +\n drivers/net/ethernet/intel/i40e/i40e.h        |   3 +-\n drivers/net/ethernet/intel/i40e/i40e_client.c | 109 +++++++++++--\n drivers/net/ethernet/intel/i40e/i40e_client.h | 203 ------------------------\n include/linux/net/intel/i40e_client.h         | 213 ++++++++++++++++++++++++++\n 7 files changed, 310 insertions(+), 222 deletions(-)\n delete mode 100644 drivers/net/ethernet/intel/i40e/i40e_client.h\n create mode 100644 include/linux/net/intel/i40e_client.h",
    "diff": "diff --git a/drivers/infiniband/hw/i40iw/Makefile b/drivers/infiniband/hw/i40iw/Makefile\nindex 8942f82..34da9eb 100644\n--- a/drivers/infiniband/hw/i40iw/Makefile\n+++ b/drivers/infiniband/hw/i40iw/Makefile\n@@ -1,5 +1,4 @@\n # SPDX-License-Identifier: GPL-2.0\n-ccflags-y :=  -I $(srctree)/drivers/net/ethernet/intel/i40e\n \n obj-$(CONFIG_INFINIBAND_I40IW) += i40iw.o\n \ndiff --git a/drivers/infiniband/hw/i40iw/i40iw.h b/drivers/infiniband/hw/i40iw/i40iw.h\nindex 8feec35..3197e35 100644\n--- a/drivers/infiniband/hw/i40iw/i40iw.h\n+++ b/drivers/infiniband/hw/i40iw/i40iw.h\n@@ -57,7 +57,7 @@\n #include \"i40iw_d.h\"\n #include \"i40iw_hmc.h\"\n \n-#include <i40e_client.h>\n+#include <linux/net/intel/i40e_client.h>\n #include \"i40iw_type.h\"\n #include \"i40iw_p.h\"\n #include <rdma/i40iw-abi.h>\ndiff --git a/drivers/net/ethernet/intel/Kconfig b/drivers/net/ethernet/intel/Kconfig\nindex 154e2e8..a19fb3c 100644\n--- a/drivers/net/ethernet/intel/Kconfig\n+++ b/drivers/net/ethernet/intel/Kconfig\n@@ -241,6 +241,7 @@ config I40E\n \ttristate \"Intel(R) Ethernet Controller XL710 Family support\"\n \timply PTP_1588_CLOCK\n \tdepends on PCI\n+\tselect VIRTUAL_BUS\n \t---help---\n \t  This driver supports Intel(R) Ethernet Controller XL710 Family of\n \t  devices.  For more information on how to identify your adapter, go\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h\nindex 2af9f63..ed7c721 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e.h\n@@ -38,7 +38,7 @@\n #include <net/xdp_sock.h>\n #include \"i40e_type.h\"\n #include \"i40e_prototype.h\"\n-#include \"i40e_client.h\"\n+#include <linux/net/intel/i40e_client.h>\n #include <linux/avf/virtchnl.h>\n #include \"i40e_virtchnl_pf.h\"\n #include \"i40e_txrx.h\"\n@@ -655,6 +655,7 @@ struct i40e_pf {\n \tu16 last_sw_conf_valid_flags;\n \t/* List to keep previous DDP profiles to be rolled back in the future */\n \tstruct list_head ddp_old_prof;\n+\tint peer_idx;\n };\n \n /**\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_client.c b/drivers/net/ethernet/intel/i40e/i40e_client.c\nindex e81530c..a3dee72 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_client.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_client.c\n@@ -1,12 +1,12 @@\n // SPDX-License-Identifier: GPL-2.0\n /* Copyright(c) 2013 - 2018 Intel Corporation. */\n \n+#include <linux/net/intel/i40e_client.h>\n #include <linux/list.h>\n #include <linux/errno.h>\n \n #include \"i40e.h\"\n #include \"i40e_prototype.h\"\n-#include \"i40e_client.h\"\n \n static const char i40e_client_interface_version_str[] = I40E_CLIENT_VERSION_STR;\n static struct i40e_client *registered_client;\n@@ -30,11 +30,17 @@ static int i40e_client_update_vsi_ctxt(struct i40e_info *ldev,\n \t\t\t\t       bool is_vf, u32 vf_id,\n \t\t\t\t       u32 flag, u32 valid_flag);\n \n+static int i40e_client_device_register(struct i40e_info *ldev);\n+\n+static void i40e_client_device_unregister(struct i40e_info *ldev);\n+\n static struct i40e_ops i40e_lan_ops = {\n \t.virtchnl_send = i40e_client_virtchnl_send,\n \t.setup_qvlist = i40e_client_setup_qvlist,\n \t.request_reset = i40e_client_request_reset,\n \t.update_vsi_ctxt = i40e_client_update_vsi_ctxt,\n+\t.client_device_register = i40e_client_device_register,\n+\t.client_device_unregister = i40e_client_device_unregister,\n };\n \n /**\n@@ -275,6 +281,27 @@ void i40e_client_update_msix_info(struct i40e_pf *pf)\n \tcdev->lan_info.msix_entries = &pf->msix_entries[pf->iwarp_base_vector];\n }\n \n+static int i40e_init_client_virtdev(struct i40e_pf *pf)\n+{\n+\tstruct i40e_info *ldev = &pf->cinst->lan_info;\n+\tstruct pci_dev *pdev = pf->pdev;\n+\tstruct virtbus_device *vdev;\n+\tint ret;\n+\n+\tvdev = &ldev->vdev;\n+\tvdev->name = I40E_PEER_RDMA_NAME;\n+\tvdev->dev.parent = &pf->pdev->dev;\n+\n+\tret = virtbus_dev_register(vdev);\n+\tif (ret) {\n+\t\tdev_err(&pdev->dev, \"Failure adding client virtbus dev %s %d\\n\",\n+\t\t\tI40E_PEER_RDMA_NAME, ret);\n+\t\treturn ret;\n+\t}\n+\n+\treturn 0;\n+}\n+\n /**\n  * i40e_client_add_instance - add a client instance struct to the instance list\n  * @pf: pointer to the board struct\n@@ -288,9 +315,6 @@ static void i40e_client_add_instance(struct i40e_pf *pf)\n \tstruct netdev_hw_addr *mac = NULL;\n \tstruct i40e_vsi *vsi = pf->vsi[pf->lan_vsi];\n \n-\tif (!registered_client || pf->cinst)\n-\t\treturn;\n-\n \tcdev = kzalloc(sizeof(*cdev), GFP_KERNEL);\n \tif (!cdev)\n \t\treturn;\n@@ -326,7 +350,11 @@ static void i40e_client_add_instance(struct i40e_pf *pf)\n \tcdev->client = registered_client;\n \tpf->cinst = cdev;\n \n-\ti40e_client_update_msix_info(pf);\n+\tcdev->lan_info.msix_count = pf->num_iwarp_msix;\n+\tcdev->lan_info.msix_entries = &pf->msix_entries[pf->iwarp_base_vector];\n+\n+\ti40e_init_client_virtdev(pf);\n+\tset_bit(__I40E_CLIENT_INSTANCE_NONE, &cdev->state);\n }\n \n /**\n@@ -347,7 +375,7 @@ void i40e_client_del_instance(struct i40e_pf *pf)\n  **/\n void i40e_client_subtask(struct i40e_pf *pf)\n {\n-\tstruct i40e_client *client = registered_client;\n+\tstruct i40e_client *client;\n \tstruct i40e_client_instance *cdev;\n \tstruct i40e_vsi *vsi = pf->vsi[pf->lan_vsi];\n \tint ret = 0;\n@@ -361,9 +389,11 @@ void i40e_client_subtask(struct i40e_pf *pf)\n \t    test_bit(__I40E_CONFIG_BUSY, pf->state))\n \t\treturn;\n \n-\tif (!client || !cdev)\n+\tif (!cdev || !cdev->client)\n \t\treturn;\n \n+\tclient = cdev->client;\n+\n \t/* Here we handle client opens. If the client is down, and\n \t * the netdev is registered, then open the client.\n \t */\n@@ -424,16 +454,8 @@ int i40e_lan_add_device(struct i40e_pf *pf)\n \t\t pf->hw.pf_id, pf->hw.bus.bus_id,\n \t\t pf->hw.bus.device, pf->hw.bus.func);\n \n-\t/* If a client has already been registered, we need to add an instance\n-\t * of it to our new LAN device.\n-\t */\n-\tif (registered_client)\n-\t\ti40e_client_add_instance(pf);\n+\ti40e_client_add_instance(pf);\n \n-\t/* Since in some cases register may have happened before a device gets\n-\t * added, we can schedule a subtask to go initiate the clients if\n-\t * they can be launched at probe time.\n-\t */\n \tset_bit(__I40E_CLIENT_SERVICE_REQUESTED, pf->state);\n \ti40e_service_event_schedule(pf);\n \n@@ -453,6 +475,8 @@ int i40e_lan_del_device(struct i40e_pf *pf)\n \tstruct i40e_device *ldev, *tmp;\n \tint ret = -ENODEV;\n \n+\tvirtbus_dev_unregister(&pf->cinst->lan_info.vdev);\n+\n \t/* First, remove any client instance. */\n \ti40e_client_del_instance(pf);\n \n@@ -733,6 +757,59 @@ static int i40e_client_update_vsi_ctxt(struct i40e_info *ldev,\n \treturn err;\n }\n \n+static int i40e_client_device_register(struct i40e_info *ldev)\n+{\n+\tstruct i40e_client *client;\n+\tstruct i40e_pf *pf;\n+\n+\tif (!ldev) {\n+\t\tpr_err(\"Failed to reg client dev: ldev ptr NULL\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tclient = ldev->client;\n+\tpf = ldev->pf;\n+\tif (!client) {\n+\t\tpr_err(\"Failed to reg client dev: client ptr NULL\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tif (!ldev->ops || !client->ops) {\n+\t\tpr_err(\"Failed to reg client dev: client dev peer_ops/ops NULL\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tpf->cinst->client = ldev->client;\n+\tset_bit(__I40E_CLIENT_SERVICE_REQUESTED, pf->state);\n+\ti40e_service_event_schedule(pf);\n+\n+\treturn 0;\n+}\n+\n+static void i40e_client_device_unregister(struct i40e_info *ldev)\n+{\n+\tstruct i40e_pf *pf = ldev->pf;\n+\tstruct i40e_client_instance *cdev = pf->cinst;\n+\n+\twhile (test_and_set_bit(__I40E_SERVICE_SCHED, pf->state))\n+\t\tusleep_range(500, 1000);\n+\n+\tif (!cdev || !cdev->client || !cdev->client->ops ||\n+\t    !cdev->client->ops->close) {\n+\t\tdev_err(&pf->pdev->dev, \"Cannot close client device\\n\");\n+\t\treturn;\n+\t}\n+\tcdev->client->ops->close(&cdev->lan_info, cdev->client, false);\n+\tclear_bit(__I40E_CLIENT_INSTANCE_OPENED, &cdev->state);\n+\ti40e_client_release_qvlist(&cdev->lan_info);\n+\tpf->cinst->client = NULL;\n+\tclear_bit(__I40E_SERVICE_SCHED, pf->state);\n+}\n+\n+/* Retain legacy global registration/unregistration calls till i40iw is\n+ * deprecated from the kernel. The irdma unified driver does not use these\n+ * exported symbols.\n+ */\n /**\n  * i40e_register_client - Register a i40e client driver with the L2 driver\n  * @client: pointer to the i40e_client struct\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_client.h b/drivers/net/ethernet/intel/i40e/i40e_client.h\ndeleted file mode 100644\nindex 72994ba..0000000\n--- a/drivers/net/ethernet/intel/i40e/i40e_client.h\n+++ /dev/null\n@@ -1,203 +0,0 @@\n-/* SPDX-License-Identifier: GPL-2.0 */\n-/* Copyright(c) 2013 - 2018 Intel Corporation. */\n-\n-#ifndef _I40E_CLIENT_H_\n-#define _I40E_CLIENT_H_\n-\n-#define I40E_CLIENT_STR_LENGTH 10\n-\n-/* Client interface version should be updated anytime there is a change in the\n- * existing APIs or data structures.\n- */\n-#define I40E_CLIENT_VERSION_MAJOR 0\n-#define I40E_CLIENT_VERSION_MINOR 01\n-#define I40E_CLIENT_VERSION_BUILD 00\n-#define I40E_CLIENT_VERSION_STR     \\\n-\t__stringify(I40E_CLIENT_VERSION_MAJOR) \".\" \\\n-\t__stringify(I40E_CLIENT_VERSION_MINOR) \".\" \\\n-\t__stringify(I40E_CLIENT_VERSION_BUILD)\n-\n-struct i40e_client_version {\n-\tu8 major;\n-\tu8 minor;\n-\tu8 build;\n-\tu8 rsvd;\n-};\n-\n-enum i40e_client_state {\n-\t__I40E_CLIENT_NULL,\n-\t__I40E_CLIENT_REGISTERED\n-};\n-\n-enum i40e_client_instance_state {\n-\t__I40E_CLIENT_INSTANCE_NONE,\n-\t__I40E_CLIENT_INSTANCE_OPENED,\n-};\n-\n-struct i40e_ops;\n-struct i40e_client;\n-\n-/* HW does not define a type value for AEQ; only for RX/TX and CEQ.\n- * In order for us to keep the interface simple, SW will define a\n- * unique type value for AEQ.\n- */\n-#define I40E_QUEUE_TYPE_PE_AEQ  0x80\n-#define I40E_QUEUE_INVALID_IDX\t0xFFFF\n-\n-struct i40e_qv_info {\n-\tu32 v_idx; /* msix_vector */\n-\tu16 ceq_idx;\n-\tu16 aeq_idx;\n-\tu8 itr_idx;\n-};\n-\n-struct i40e_qvlist_info {\n-\tu32 num_vectors;\n-\tstruct i40e_qv_info qv_info[1];\n-};\n-\n-#define I40E_CLIENT_MSIX_ALL 0xFFFFFFFF\n-\n-/* set of LAN parameters useful for clients managed by LAN */\n-\n-/* Struct to hold per priority info */\n-struct i40e_prio_qos_params {\n-\tu16 qs_handle; /* qs handle for prio */\n-\tu8 tc; /* TC mapped to prio */\n-\tu8 reserved;\n-};\n-\n-#define I40E_CLIENT_MAX_USER_PRIORITY        8\n-/* Struct to hold Client QoS */\n-struct i40e_qos_params {\n-\tstruct i40e_prio_qos_params prio_qos[I40E_CLIENT_MAX_USER_PRIORITY];\n-};\n-\n-struct i40e_params {\n-\tstruct i40e_qos_params qos;\n-\tu16 mtu;\n-};\n-\n-/* Structure to hold Lan device info for a client device */\n-struct i40e_info {\n-\tstruct i40e_client_version version;\n-\tu8 lanmac[6];\n-\tstruct net_device *netdev;\n-\tstruct pci_dev *pcidev;\n-\tu8 __iomem *hw_addr;\n-\tu8 fid;\t/* function id, PF id or VF id */\n-#define I40E_CLIENT_FTYPE_PF 0\n-#define I40E_CLIENT_FTYPE_VF 1\n-\tu8 ftype; /* function type, PF or VF */\n-\tvoid *pf;\n-\n-\t/* All L2 params that could change during the life span of the PF\n-\t * and needs to be communicated to the client when they change\n-\t */\n-\tstruct i40e_qvlist_info *qvlist_info;\n-\tstruct i40e_params params;\n-\tstruct i40e_ops *ops;\n-\n-\tu16 msix_count;\t /* number of msix vectors*/\n-\t/* Array down below will be dynamically allocated based on msix_count */\n-\tstruct msix_entry *msix_entries;\n-\tu16 itr_index; /* Which ITR index the PE driver is suppose to use */\n-\tu16 fw_maj_ver;                 /* firmware major version */\n-\tu16 fw_min_ver;                 /* firmware minor version */\n-\tu32 fw_build;                   /* firmware build number */\n-};\n-\n-#define I40E_CLIENT_RESET_LEVEL_PF   1\n-#define I40E_CLIENT_RESET_LEVEL_CORE 2\n-#define I40E_CLIENT_VSI_FLAG_TCP_ENABLE  BIT(1)\n-\n-struct i40e_ops {\n-\t/* setup_q_vector_list enables queues with a particular vector */\n-\tint (*setup_qvlist)(struct i40e_info *ldev, struct i40e_client *client,\n-\t\t\t    struct i40e_qvlist_info *qv_info);\n-\n-\tint (*virtchnl_send)(struct i40e_info *ldev, struct i40e_client *client,\n-\t\t\t     u32 vf_id, u8 *msg, u16 len);\n-\n-\t/* If the PE Engine is unresponsive, RDMA driver can request a reset.\n-\t * The level helps determine the level of reset being requested.\n-\t */\n-\tvoid (*request_reset)(struct i40e_info *ldev,\n-\t\t\t      struct i40e_client *client, u32 level);\n-\n-\t/* API for the RDMA driver to set certain VSI flags that control\n-\t * PE Engine.\n-\t */\n-\tint (*update_vsi_ctxt)(struct i40e_info *ldev,\n-\t\t\t       struct i40e_client *client,\n-\t\t\t       bool is_vf, u32 vf_id,\n-\t\t\t       u32 flag, u32 valid_flag);\n-};\n-\n-struct i40e_client_ops {\n-\t/* Should be called from register_client() or whenever PF is ready\n-\t * to create a specific client instance.\n-\t */\n-\tint (*open)(struct i40e_info *ldev, struct i40e_client *client);\n-\n-\t/* Should be called when netdev is unavailable or when unregister\n-\t * call comes in. If the close is happenening due to a reset being\n-\t * triggered set the reset bit to true.\n-\t */\n-\tvoid (*close)(struct i40e_info *ldev, struct i40e_client *client,\n-\t\t      bool reset);\n-\n-\t/* called when some l2 managed parameters changes - mtu */\n-\tvoid (*l2_param_change)(struct i40e_info *ldev,\n-\t\t\t\tstruct i40e_client *client,\n-\t\t\t\tstruct i40e_params *params);\n-\n-\tint (*virtchnl_receive)(struct i40e_info *ldev,\n-\t\t\t\tstruct i40e_client *client, u32 vf_id,\n-\t\t\t\tu8 *msg, u16 len);\n-\n-\t/* called when a VF is reset by the PF */\n-\tvoid (*vf_reset)(struct i40e_info *ldev,\n-\t\t\t struct i40e_client *client, u32 vf_id);\n-\n-\t/* called when the number of VFs changes */\n-\tvoid (*vf_enable)(struct i40e_info *ldev,\n-\t\t\t  struct i40e_client *client, u32 num_vfs);\n-\n-\t/* returns true if VF is capable of specified offload */\n-\tint (*vf_capable)(struct i40e_info *ldev,\n-\t\t\t  struct i40e_client *client, u32 vf_id);\n-};\n-\n-/* Client device */\n-struct i40e_client_instance {\n-\tstruct list_head list;\n-\tstruct i40e_info lan_info;\n-\tstruct i40e_client *client;\n-\tunsigned long  state;\n-};\n-\n-struct i40e_client {\n-\tstruct list_head list;\t\t/* list of registered clients */\n-\tchar name[I40E_CLIENT_STR_LENGTH];\n-\tstruct i40e_client_version version;\n-\tunsigned long state;\t\t/* client state */\n-\tatomic_t ref_cnt;  /* Count of all the client devices of this kind */\n-\tu32 flags;\n-#define I40E_CLIENT_FLAGS_LAUNCH_ON_PROBE\tBIT(0)\n-#define I40E_TX_FLAGS_NOTIFY_OTHER_EVENTS\tBIT(2)\n-\tu8 type;\n-#define I40E_CLIENT_IWARP 0\n-\tconst struct i40e_client_ops *ops; /* client ops provided by the client */\n-};\n-\n-static inline bool i40e_client_is_registered(struct i40e_client *client)\n-{\n-\treturn test_bit(__I40E_CLIENT_REGISTERED, &client->state);\n-}\n-\n-/* used by clients */\n-int i40e_register_client(struct i40e_client *client);\n-int i40e_unregister_client(struct i40e_client *client);\n-\n-#endif /* _I40E_CLIENT_H_ */\ndiff --git a/include/linux/net/intel/i40e_client.h b/include/linux/net/intel/i40e_client.h\nnew file mode 100644\nindex 0000000..7e147d3\n--- /dev/null\n+++ b/include/linux/net/intel/i40e_client.h\n@@ -0,0 +1,213 @@\n+/* SPDX-License-Identifier: GPL-2.0 */\n+/* Copyright(c) 2013 - 2018 Intel Corporation. */\n+\n+#ifndef _I40E_CLIENT_H_\n+#define _I40E_CLIENT_H_\n+\n+#include <linux/virtual_bus.h>\n+\n+#define I40E_PEER_RDMA_NAME\t\"i40e_rdma\"\n+#define I40E_CLIENT_STR_LENGTH 10\n+\n+/* Client interface version should be updated anytime there is a change in the\n+ * existing APIs or data structures.\n+ */\n+#define I40E_CLIENT_VERSION_MAJOR 0\n+#define I40E_CLIENT_VERSION_MINOR 01\n+#define I40E_CLIENT_VERSION_BUILD 00\n+#define I40E_CLIENT_VERSION_STR     \\\n+\t__stringify(I40E_CLIENT_VERSION_MAJOR) \".\" \\\n+\t__stringify(I40E_CLIENT_VERSION_MINOR) \".\" \\\n+\t__stringify(I40E_CLIENT_VERSION_BUILD)\n+\n+struct i40e_client_version {\n+\tu8 major;\n+\tu8 minor;\n+\tu8 build;\n+\tu8 rsvd;\n+};\n+\n+enum i40e_client_state {\n+\t__I40E_CLIENT_NULL,\n+\t__I40E_CLIENT_REGISTERED\n+};\n+\n+enum i40e_client_instance_state {\n+\t__I40E_CLIENT_INSTANCE_NONE,\n+\t__I40E_CLIENT_INSTANCE_OPENED,\n+};\n+\n+struct i40e_ops;\n+struct i40e_client;\n+\n+/* HW does not define a type value for AEQ; only for RX/TX and CEQ.\n+ * In order for us to keep the interface simple, SW will define a\n+ * unique type value for AEQ.\n+ */\n+#define I40E_QUEUE_TYPE_PE_AEQ  0x80\n+#define I40E_QUEUE_INVALID_IDX\t0xFFFF\n+\n+struct i40e_qv_info {\n+\tu32 v_idx; /* msix_vector */\n+\tu16 ceq_idx;\n+\tu16 aeq_idx;\n+\tu8 itr_idx;\n+};\n+\n+struct i40e_qvlist_info {\n+\tu32 num_vectors;\n+\tstruct i40e_qv_info qv_info[1];\n+};\n+\n+#define I40E_CLIENT_MSIX_ALL 0xFFFFFFFF\n+\n+/* set of LAN parameters useful for clients managed by LAN */\n+\n+/* Struct to hold per priority info */\n+struct i40e_prio_qos_params {\n+\tu16 qs_handle; /* qs handle for prio */\n+\tu8 tc; /* TC mapped to prio */\n+\tu8 reserved;\n+};\n+\n+#define I40E_CLIENT_MAX_USER_PRIORITY        8\n+/* Struct to hold Client QoS */\n+struct i40e_qos_params {\n+\tstruct i40e_prio_qos_params prio_qos[I40E_CLIENT_MAX_USER_PRIORITY];\n+};\n+\n+struct i40e_params {\n+\tstruct i40e_qos_params qos;\n+\tu16 mtu;\n+};\n+\n+/* Structure to hold Lan device info for a client device */\n+struct i40e_info {\n+\tstruct virtbus_device vdev;\n+\tstruct i40e_client_version version;\n+\tu8 lanmac[6];\n+\tstruct net_device *netdev;\n+\tstruct pci_dev *pcidev;\n+\tu8 __iomem *hw_addr;\n+\tu8 fid;\t/* function id, PF id or VF id */\n+#define I40E_CLIENT_FTYPE_PF 0\n+#define I40E_CLIENT_FTYPE_VF 1\n+\tu8 ftype; /* function type, PF or VF */\n+\tvoid *pf;\n+\n+\t/* All L2 params that could change during the life span of the PF\n+\t * and needs to be communicated to the client when they change\n+\t */\n+\tstruct i40e_qvlist_info *qvlist_info;\n+\tstruct i40e_params params;\n+\tstruct i40e_ops *ops;\n+\tstruct i40e_client *client;\n+\n+\tu16 msix_count;\t /* number of msix vectors*/\n+\t/* Array down below will be dynamically allocated based on msix_count */\n+\tstruct msix_entry *msix_entries;\n+\tu16 itr_index; /* Which ITR index the PE driver is suppose to use */\n+\tu16 fw_maj_ver;                 /* firmware major version */\n+\tu16 fw_min_ver;                 /* firmware minor version */\n+\tu32 fw_build;                   /* firmware build number */\n+};\n+\n+#define I40E_CLIENT_RESET_LEVEL_PF   1\n+#define I40E_CLIENT_RESET_LEVEL_CORE 2\n+#define I40E_CLIENT_VSI_FLAG_TCP_ENABLE  BIT(1)\n+\n+struct i40e_ops {\n+\t/* setup_q_vector_list enables queues with a particular vector */\n+\tint (*setup_qvlist)(struct i40e_info *ldev, struct i40e_client *client,\n+\t\t\t    struct i40e_qvlist_info *qv_info);\n+\n+\tint (*virtchnl_send)(struct i40e_info *ldev, struct i40e_client *client,\n+\t\t\t     u32 vf_id, u8 *msg, u16 len);\n+\n+\t/* If the PE Engine is unresponsive, RDMA driver can request a reset.\n+\t * The level helps determine the level of reset being requested.\n+\t */\n+\tvoid (*request_reset)(struct i40e_info *ldev,\n+\t\t\t      struct i40e_client *client, u32 level);\n+\n+\t/* API for the RDMA driver to set certain VSI flags that control\n+\t * PE Engine.\n+\t */\n+\tint (*update_vsi_ctxt)(struct i40e_info *ldev,\n+\t\t\t       struct i40e_client *client,\n+\t\t\t       bool is_vf, u32 vf_id,\n+\t\t\t       u32 flag, u32 valid_flag);\n+\n+\tint (*client_device_register)(struct i40e_info *ldev);\n+\n+\tvoid (*client_device_unregister)(struct i40e_info *ldev);\n+\n+};\n+\n+struct i40e_client_ops {\n+\t/* Should be called from register_client() or whenever PF is ready\n+\t * to create a specific client instance.\n+\t */\n+\tint (*open)(struct i40e_info *ldev, struct i40e_client *client);\n+\n+\t/* Should be called when netdev is unavailable or when unregister\n+\t * call comes in. If the close is happenening due to a reset being\n+\t * triggered set the reset bit to true.\n+\t */\n+\tvoid (*close)(struct i40e_info *ldev, struct i40e_client *client,\n+\t\t      bool reset);\n+\n+\t/* called when some l2 managed parameters changes - mtu */\n+\tvoid (*l2_param_change)(struct i40e_info *ldev,\n+\t\t\t\tstruct i40e_client *client,\n+\t\t\t\tstruct i40e_params *params);\n+\n+\tint (*virtchnl_receive)(struct i40e_info *ldev,\n+\t\t\t\tstruct i40e_client *client, u32 vf_id,\n+\t\t\t\tu8 *msg, u16 len);\n+\n+\t/* called when a VF is reset by the PF */\n+\tvoid (*vf_reset)(struct i40e_info *ldev,\n+\t\t\t struct i40e_client *client, u32 vf_id);\n+\n+\t/* called when the number of VFs changes */\n+\tvoid (*vf_enable)(struct i40e_info *ldev,\n+\t\t\t  struct i40e_client *client, u32 num_vfs);\n+\n+\t/* returns true if VF is capable of specified offload */\n+\tint (*vf_capable)(struct i40e_info *ldev,\n+\t\t\t  struct i40e_client *client, u32 vf_id);\n+};\n+\n+/* Client device */\n+struct i40e_client_instance {\n+\tstruct list_head list;\n+\tstruct i40e_info lan_info;\n+\tstruct i40e_client *client;\n+\tunsigned long  state;\n+};\n+\n+struct i40e_client {\n+\tstruct list_head list;\t\t/* list of registered clients */\n+\tchar name[I40E_CLIENT_STR_LENGTH];\n+\tstruct i40e_client_version version;\n+\tunsigned long state;\t\t/* client state */\n+\tatomic_t ref_cnt;  /* Count of all the client devices of this kind */\n+\tu32 flags;\n+#define I40E_CLIENT_FLAGS_LAUNCH_ON_PROBE\tBIT(0)\n+#define I40E_TX_FLAGS_NOTIFY_OTHER_EVENTS\tBIT(2)\n+\tu8 type;\n+#define I40E_CLIENT_IWARP 0\n+\tconst struct i40e_client_ops *ops; /* client ops provided by the client */\n+};\n+\n+static inline bool i40e_client_is_registered(struct i40e_client *client)\n+{\n+\treturn test_bit(__I40E_CLIENT_REGISTERED, &client->state);\n+}\n+\n+/* used by clients */\n+int i40e_register_client(struct i40e_client *client);\n+int i40e_unregister_client(struct i40e_client *client);\n+\n+#endif /* _I40E_CLIENT_H_ */\n",
    "prefixes": []
}