Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/51648/?format=api
https://patches.dpdk.org/api/patches/51648/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1553533414-9911-13-git-send-email-viacheslavo@mellanox.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": "<1553533414-9911-13-git-send-email-viacheslavo@mellanox.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1553533414-9911-13-git-send-email-viacheslavo@mellanox.com", "date": "2019-03-25T17:03:33", "name": "[v2,12/13] net/mlx5: update event handler for multiport IB devices", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": true, "hash": "0ff068af8be6893c1012f9241f34d722be25ffbc", "submitter": { "id": 1102, "url": "https://patches.dpdk.org/api/people/1102/?format=api", "name": "Slava Ovsiienko", "email": "viacheslavo@mellanox.com" }, "delegate": { "id": 6624, "url": "https://patches.dpdk.org/api/users/6624/?format=api", "username": "shahafs", "first_name": "Shahaf", "last_name": "Shuler", "email": "shahafs@mellanox.com" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/1553533414-9911-13-git-send-email-viacheslavo@mellanox.com/mbox/", "series": [ { "id": 3902, "url": "https://patches.dpdk.org/api/series/3902/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=3902", "date": "2019-03-25T17:03:24", "name": "net/mlx5: add support for multiport IB devices", "version": 2, "mbox": "https://patches.dpdk.org/series/3902/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/51648/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/51648/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 65C095424;\n\tMon, 25 Mar 2019 18:04:18 +0100 (CET)", "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n\tby dpdk.org (Postfix) with ESMTP id 62FE4378E\n\tfor <dev@dpdk.org>; Mon, 25 Mar 2019 18:03:46 +0100 (CET)", "from Internal Mail-Server by MTLPINE1 (envelope-from\n\tviacheslavo@mellanox.com)\n\twith ESMTPS (AES256-SHA encrypted); 25 Mar 2019 19:03:42 +0200", "from pegasus12.mtr.labs.mlnx. (pegasus12.mtr.labs.mlnx\n\t[10.210.17.40])\n\tby labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x2PH3fbi020888;\n\tMon, 25 Mar 2019 19:03:42 +0200" ], "From": "Viacheslav Ovsiienko <viacheslavo@mellanox.com>", "To": "dev@dpdk.org", "Cc": "shahafs@mellanox.com", "Date": "Mon, 25 Mar 2019 17:03:33 +0000", "Message-Id": "<1553533414-9911-13-git-send-email-viacheslavo@mellanox.com>", "X-Mailer": "git-send-email 1.8.3.1", "In-Reply-To": "<1553533414-9911-1-git-send-email-viacheslavo@mellanox.com>", "References": "<1553155888-27498-1-git-send-email-viacheslavo@mellanox.com>\n\t<1553533414-9911-1-git-send-email-viacheslavo@mellanox.com>", "Subject": "[dpdk-dev] [PATCH v2 12/13] net/mlx5: update event handler for\n\tmultiport IB devices", "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": "This patch modifies asynchronous event handler to support multiport\nInfiniband devices. Handler queries the event parameters, including\nevent source port index, and invokes the handler for specific\ndevices with appropriate port_id.\n\nSigned-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>\n---\n drivers/net/mlx5/mlx5_ethdev.c | 101 +++++++++++++++++++++--------------------\n 1 file changed, 51 insertions(+), 50 deletions(-)", "diff": "diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c\nindex d41f66b..5871c62 100644\n--- a/drivers/net/mlx5/mlx5_ethdev.c\n+++ b/drivers/net/mlx5/mlx5_ethdev.c\n@@ -1032,66 +1032,67 @@ int mlx5_fw_version_get(struct rte_eth_dev *dev, char *fw_ver, size_t fw_size)\n }\n \n /**\n- * Device status handler.\n+ * Handle shared asynchronous events the NIC (removal event\n+ * and link status change). Supports multiport IB device.\n *\n- * @param dev\n- * Pointer to Ethernet device.\n- * @param events\n- * Pointer to event flags holder.\n- *\n- * @return\n- * Events bitmap of callback process which can be called immediately.\n+ * @param cb_arg\n+ * Callback argument.\n */\n-static uint32_t\n-mlx5_dev_status_handler(struct rte_eth_dev *dev)\n+void\n+mlx5_dev_interrupt_handler(void *cb_arg)\n {\n-\tstruct mlx5_priv *priv = dev->data->dev_private;\n+\tstruct mlx5_ibv_shared *sh = cb_arg;\n \tstruct ibv_async_event event;\n-\tuint32_t ret = 0;\n \n-\tif (mlx5_link_update(dev, 0) == -EAGAIN) {\n-\t\tusleep(0);\n-\t\treturn 0;\n-\t}\n-\t/* Read all message and acknowledge them. */\n+\t/* Read all message from the IB device and acknowledge them. */\n \tfor (;;) {\n-\t\tif (mlx5_glue->get_async_event(priv->sh->ctx, &event))\n+\t\tstruct rte_eth_dev *dev;\n+\t\tuint32_t tmp;\n+\n+\t\tif (mlx5_glue->get_async_event(sh->ctx, &event))\n \t\t\tbreak;\n+\t\t/* Retrieve and check IB port index. */\n+\t\ttmp = (uint32_t)event.element.port_num;\n+\t\tassert(tmp && (tmp <= sh->max_port));\n+\t\tif (!tmp ||\n+\t\t tmp > sh->max_port ||\n+\t\t sh->port[tmp - 1].ih_port_id >= RTE_MAX_ETHPORTS) {\n+\t\t\t/*\n+\t\t\t * Invalid IB port index or no handler\n+\t\t\t * installed for this port.\n+\t\t\t */\n+\t\t\tmlx5_glue->ack_async_event(&event);\n+\t\t\tcontinue;\n+\t\t}\n+\t\t/* Retrieve ethernet device descriptor. */\n+\t\ttmp = sh->port[tmp - 1].ih_port_id;\n+\t\tdev = &rte_eth_devices[tmp];\n+\t\ttmp = 0;\n+\t\tassert(dev);\n \t\tif ((event.event_type == IBV_EVENT_PORT_ACTIVE ||\n-\t\t\tevent.event_type == IBV_EVENT_PORT_ERR) &&\n-\t\t\t(dev->data->dev_conf.intr_conf.lsc == 1))\n-\t\t\tret |= (1 << RTE_ETH_EVENT_INTR_LSC);\n-\t\telse if (event.event_type == IBV_EVENT_DEVICE_FATAL &&\n-\t\t\tdev->data->dev_conf.intr_conf.rmv == 1)\n-\t\t\tret |= (1 << RTE_ETH_EVENT_INTR_RMV);\n-\t\telse\n-\t\t\tDRV_LOG(DEBUG,\n-\t\t\t\t\"port %u event type %d on not handled\",\n-\t\t\t\tdev->data->port_id, event.event_type);\n+\t\t event.event_type == IBV_EVENT_PORT_ERR) &&\n+\t\t\tdev->data->dev_conf.intr_conf.lsc) {\n+\t\t\tmlx5_glue->ack_async_event(&event);\n+\t\t\tif (mlx5_link_update(dev, 0) == -EAGAIN) {\n+\t\t\t\tusleep(0);\n+\t\t\t\tcontinue;\n+\t\t\t}\n+\t\t\t_rte_eth_dev_callback_process\n+\t\t\t\t(dev, RTE_ETH_EVENT_INTR_LSC, NULL);\n+\t\t\tcontinue;\n+\t\t}\n+\t\tif (event.event_type == IBV_EVENT_DEVICE_FATAL &&\n+\t\t dev->data->dev_conf.intr_conf.rmv) {\n+\t\t\tmlx5_glue->ack_async_event(&event);\n+\t\t\t_rte_eth_dev_callback_process\n+\t\t\t\t(dev, RTE_ETH_EVENT_INTR_RMV, NULL);\n+\t\t\tcontinue;\n+\t\t}\n+\t\tDRV_LOG(DEBUG,\n+\t\t\t\"port %u event type %d on not handled\",\n+\t\t\tdev->data->port_id, event.event_type);\n \t\tmlx5_glue->ack_async_event(&event);\n \t}\n-\treturn ret;\n-}\n-\n-/**\n- * Handle interrupts from the NIC.\n- *\n- * @param[in] intr_handle\n- * Interrupt handler.\n- * @param cb_arg\n- * Callback argument.\n- */\n-void\n-mlx5_dev_interrupt_handler(void *cb_arg)\n-{\n-\tstruct rte_eth_dev *dev = cb_arg;\n-\tuint32_t events;\n-\n-\tevents = mlx5_dev_status_handler(dev);\n-\tif (events & (1 << RTE_ETH_EVENT_INTR_LSC))\n-\t\t_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL);\n-\tif (events & (1 << RTE_ETH_EVENT_INTR_RMV))\n-\t\t_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_RMV, NULL);\n }\n \n /**\n", "prefixes": [ "v2", "12/13" ] }{ "id": 51648, "url": "