Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/59399/?format=api
https://patches.dpdk.org/api/patches/59399/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1568883774-92149-3-git-send-email-andy.pei@intel.com/", "project": { "id": 1, "url": "https://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<1568883774-92149-3-git-send-email-andy.pei@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1568883774-92149-3-git-send-email-andy.pei@intel.com", "date": "2019-09-19T09:02:39", "name": "[v6,02/17] raw/ifpga/base: add irq support", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "fe1ade393c4671e649c6a6610ae27a9bd69b1c2f", "submitter": { "id": 1185, "url": "https://patches.dpdk.org/api/people/1185/?format=api", "name": "Pei, Andy", "email": "andy.pei@intel.com" }, "delegate": { "id": 31221, "url": "https://patches.dpdk.org/api/users/31221/?format=api", "username": "yexl", "first_name": "xiaolong", "last_name": "ye", "email": "xiaolong.ye@intel.com" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/1568883774-92149-3-git-send-email-andy.pei@intel.com/mbox/", "series": [ { "id": 6445, "url": "https://patches.dpdk.org/api/series/6445/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=6445", "date": "2019-09-19T09:02:37", "name": "add PCIe AER disable and IRQ support for ipn3ke", "version": 6, "mbox": "https://patches.dpdk.org/series/6445/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/59399/comments/", "check": "fail", "checks": "https://patches.dpdk.org/api/patches/59399/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@dpdk.org", "Delivered-To": "patchwork@dpdk.org", "Received": [ "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 737931EBB3;\n\tThu, 19 Sep 2019 11:17:20 +0200 (CEST)", "from mga12.intel.com (mga12.intel.com [192.55.52.136])\n\tby dpdk.org (Postfix) with ESMTP id DCAD11EB9B\n\tfor <dev@dpdk.org>; Thu, 19 Sep 2019 11:17:12 +0200 (CEST)", "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t19 Sep 2019 02:17:12 -0700", "from dpdk-dipei.sh.intel.com ([10.67.110.224])\n\tby FMSMGA003.fm.intel.com with ESMTP; 19 Sep 2019 02:17:10 -0700" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.64,523,1559545200\"; d=\"scan'208\";a=\"194324818\"", "From": "Andy Pei <andy.pei@intel.com>", "To": "dev@dpdk.org", "Cc": "rosen.xu@intel.com, tianfei.zhang@intel.com, xiaolong.ye@intel.com,\n\tqi.z.zhang@intel.com, david.lomartire@intel.com, ferruh.yigit@intel.com", "Date": "Thu, 19 Sep 2019 17:02:39 +0800", "Message-Id": "<1568883774-92149-3-git-send-email-andy.pei@intel.com>", "X-Mailer": "git-send-email 1.8.3.1", "In-Reply-To": "<1568883774-92149-1-git-send-email-andy.pei@intel.com>", "References": "<1568881185-89233-2-git-send-email-andy.pei@intel.com>\n\t<1568883774-92149-1-git-send-email-andy.pei@intel.com>", "Subject": "[dpdk-dev] [PATCH v6 02/17] raw/ifpga/base: add irq support", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "From: Tianfei zhang <tianfei.zhang@intel.com>\n\nAdd irq support for ifpga FME globle error, port error and uint unit.\nWe implmented this feature by vfio interrupt mechanism.\n\nSigned-off-by: Tianfei zhang <tianfei.zhang@intel.com>\nSigned-off-by: Andy Pei <andy.pei@intel.com>\n---\n drivers/raw/ifpga/base/ifpga_feature_dev.c | 60 ++++++++++++++++++++++++++++++\n drivers/raw/ifpga/base/ifpga_fme_error.c | 22 +++++++++++\n drivers/raw/ifpga/base/ifpga_port.c | 20 ++++++++++\n drivers/raw/ifpga/base/ifpga_port_error.c | 21 +++++++++++\n 4 files changed, 123 insertions(+)", "diff": "diff --git a/drivers/raw/ifpga/base/ifpga_feature_dev.c b/drivers/raw/ifpga/base/ifpga_feature_dev.c\nindex 63c8bcc..f0fb242 100644\n--- a/drivers/raw/ifpga/base/ifpga_feature_dev.c\n+++ b/drivers/raw/ifpga/base/ifpga_feature_dev.c\n@@ -3,6 +3,7 @@\n */\n \n #include <sys/ioctl.h>\n+#include <rte_vfio.h>\n \n #include \"ifpga_feature_dev.h\"\n \n@@ -331,3 +332,62 @@ int port_hw_init(struct ifpga_port_hw *port)\n \tport_hw_uinit(port);\n \treturn ret;\n }\n+\n+/*\n+ * FIXME: we should get msix vec count during pci enumeration instead of\n+ * below hardcode value.\n+ */\n+#define FPGA_MSIX_VEC_COUNT\t20\n+/* irq set buffer length for interrupt */\n+#define MSIX_IRQ_SET_BUF_LEN (sizeof(struct vfio_irq_set) + \\\n+\t\t\t\tsizeof(int) * FPGA_MSIX_VEC_COUNT)\n+\n+/* only support msix for now*/\n+static int vfio_msix_enable_block(s32 vfio_dev_fd, unsigned int vec_start,\n+\t\t\t\t unsigned int count, s32 *fds)\n+{\n+\tchar irq_set_buf[MSIX_IRQ_SET_BUF_LEN];\n+\tstruct vfio_irq_set *irq_set;\n+\tint len, ret;\n+\tint *fd_ptr;\n+\n+\tlen = sizeof(irq_set_buf);\n+\n+\tirq_set = (struct vfio_irq_set *)irq_set_buf;\n+\tirq_set->argsz = len;\n+\tirq_set->count = count;\n+\tirq_set->flags = VFIO_IRQ_SET_DATA_EVENTFD |\n+\t\t\t\tVFIO_IRQ_SET_ACTION_TRIGGER;\n+\tirq_set->index = VFIO_PCI_MSIX_IRQ_INDEX;\n+\tirq_set->start = vec_start;\n+\n+\tfd_ptr = (int *)&irq_set->data;\n+\topae_memcpy(fd_ptr, fds, sizeof(int) * count);\n+\n+\tret = ioctl(vfio_dev_fd, VFIO_DEVICE_SET_IRQS, irq_set);\n+\tif (ret)\n+\t\tprintf(\"Error enabling MSI-X interrupts\\n\");\n+\n+\treturn ret;\n+}\n+\n+int fpga_msix_set_block(struct ifpga_feature *feature, unsigned int start,\n+\t\t\tunsigned int count, s32 *fds)\n+{\n+\tstruct feature_irq_ctx *ctx = feature->ctx;\n+\tunsigned int i;\n+\tint ret;\n+\n+\tif (start >= feature->ctx_num || start + count > feature->ctx_num)\n+\t\treturn -EINVAL;\n+\n+\t/* assume that each feature has continuous vector space in msix*/\n+\tret = vfio_msix_enable_block(feature->vfio_dev_fd,\n+\t\t\t\t ctx[start].idx, count, fds);\n+\tif (!ret) {\n+\t\tfor (i = 0; i < count; i++)\n+\t\t\tctx[i].eventfd = fds[i];\n+\t}\n+\n+\treturn ret;\n+}\ndiff --git a/drivers/raw/ifpga/base/ifpga_fme_error.c b/drivers/raw/ifpga/base/ifpga_fme_error.c\nindex 3794564..068f52c 100644\n--- a/drivers/raw/ifpga/base/ifpga_fme_error.c\n+++ b/drivers/raw/ifpga/base/ifpga_fme_error.c\n@@ -373,9 +373,31 @@ static int fme_global_error_set_prop(struct ifpga_feature *feature,\n \treturn -ENOENT;\n }\n \n+static int fme_global_err_set_irq(struct ifpga_feature *feature, void *irq_set)\n+{\n+\tstruct fpga_fme_err_irq_set *err_irq_set =\n+\t\t\t(struct fpga_fme_err_irq_set *)irq_set;\n+\tstruct ifpga_fme_hw *fme;\n+\tint ret;\n+\n+\tfme = (struct ifpga_fme_hw *)feature->parent;\n+\n+\tspinlock_lock(&fme->lock);\n+\tif (!(fme->capability & FPGA_FME_CAP_ERR_IRQ)) {\n+\t\tspinlock_unlock(&fme->lock);\n+\t\treturn -ENODEV;\n+\t}\n+\n+\tret = fpga_msix_set_block(feature, 0, 1, &err_irq_set->evtfd);\n+\tspinlock_unlock(&fme->lock);\n+\n+\treturn ret;\n+}\n+\n struct ifpga_feature_ops fme_global_err_ops = {\n \t.init = fme_global_error_init,\n \t.uinit = fme_global_error_uinit,\n \t.get_prop = fme_global_error_get_prop,\n \t.set_prop = fme_global_error_set_prop,\n+\t.set_irq = fme_global_err_set_irq,\n };\ndiff --git a/drivers/raw/ifpga/base/ifpga_port.c b/drivers/raw/ifpga/base/ifpga_port.c\nindex 6c41164..56b04a6 100644\n--- a/drivers/raw/ifpga/base/ifpga_port.c\n+++ b/drivers/raw/ifpga/base/ifpga_port.c\n@@ -384,9 +384,29 @@ static void port_uint_uinit(struct ifpga_feature *feature)\n \tdev_info(NULL, \"PORT UINT UInit.\\n\");\n }\n \n+static int port_uint_set_irq(struct ifpga_feature *feature, void *irq_set)\n+{\n+\tstruct fpga_uafu_irq_set *uafu_irq_set = irq_set;\n+\tstruct ifpga_port_hw *port = feature->parent;\n+\tint ret;\n+\n+\tspinlock_lock(&port->lock);\n+\tif (!(port->capability & FPGA_PORT_CAP_UAFU_IRQ)) {\n+\t\tspinlock_unlock(&port->lock);\n+\t\treturn -ENODEV;\n+\t}\n+\n+\tret = fpga_msix_set_block(feature, uafu_irq_set->start,\n+\t\t\t\t uafu_irq_set->count, uafu_irq_set->evtfds);\n+\tspinlock_unlock(&port->lock);\n+\n+\treturn ret;\n+}\n+\n struct ifpga_feature_ops ifpga_rawdev_port_uint_ops = {\n \t.init = port_uint_init,\n \t.uinit = port_uint_uinit,\n+\t.set_irq = port_uint_set_irq,\n };\n \n static int port_afu_init(struct ifpga_feature *feature)\ndiff --git a/drivers/raw/ifpga/base/ifpga_port_error.c b/drivers/raw/ifpga/base/ifpga_port_error.c\nindex 138284e..8aef7d7 100644\n--- a/drivers/raw/ifpga/base/ifpga_port_error.c\n+++ b/drivers/raw/ifpga/base/ifpga_port_error.c\n@@ -136,9 +136,30 @@ static int port_error_set_prop(struct ifpga_feature *feature,\n \treturn -ENOENT;\n }\n \n+static int port_error_set_irq(struct ifpga_feature *feature, void *irq_set)\n+{\n+\tstruct fpga_port_err_irq_set *err_irq_set = irq_set;\n+\tstruct ifpga_port_hw *port;\n+\tint ret;\n+\n+\tport = feature->parent;\n+\n+\tspinlock_lock(&port->lock);\n+\tif (!(port->capability & FPGA_PORT_CAP_ERR_IRQ)) {\n+\t\tspinlock_unlock(&port->lock);\n+\t\treturn -ENODEV;\n+\t}\n+\n+\tret = fpga_msix_set_block(feature, 0, 1, &err_irq_set->evtfd);\n+\tspinlock_unlock(&port->lock);\n+\n+\treturn ret;\n+}\n+\n struct ifpga_feature_ops ifpga_rawdev_port_error_ops = {\n \t.init = port_error_init,\n \t.uinit = port_error_uinit,\n \t.get_prop = port_error_get_prop,\n \t.set_prop = port_error_set_prop,\n+\t.set_irq = port_error_set_irq,\n };\n", "prefixes": [ "v6", "02/17" ] }{ "id": 59399, "url": "