Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/56417/?format=api
http://patches.dpdk.org/api/patches/56417/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190712205425.17781-3-stephen@networkplumber.org/", "project": { "id": 1, "url": "http://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": "<20190712205425.17781-3-stephen@networkplumber.org>", "list_archive_url": "https://inbox.dpdk.org/dev/20190712205425.17781-3-stephen@networkplumber.org", "date": "2019-07-12T20:54:25", "name": "[2/2] net/mlx5: fix crash in dev_info_get in secondary process", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "5566eaf495ff87482f40cf63dcbeb085118c6f69", "submitter": { "id": 27, "url": "http://patches.dpdk.org/api/people/27/?format=api", "name": "Stephen Hemminger", "email": "stephen@networkplumber.org" }, "delegate": { "id": 3268, "url": "http://patches.dpdk.org/api/users/3268/?format=api", "username": "rasland", "first_name": "Raslan", "last_name": "Darawsheh", "email": "rasland@nvidia.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20190712205425.17781-3-stephen@networkplumber.org/mbox/", "series": [ { "id": 5482, "url": "http://patches.dpdk.org/api/series/5482/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=5482", "date": "2019-07-12T20:54:23", "name": "fix dev_info_get in mlx secondary process", "version": 1, "mbox": "http://patches.dpdk.org/series/5482/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/56417/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/56417/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 C0EF51B9D6;\n\tSat, 13 Jul 2019 00:15:38 +0200 (CEST)", "from mail-pf1-f196.google.com (mail-pf1-f196.google.com\n\t[209.85.210.196]) by dpdk.org (Postfix) with ESMTP id A8047493D\n\tfor <dev@dpdk.org>; Sat, 13 Jul 2019 00:15:34 +0200 (CEST)", "by mail-pf1-f196.google.com with SMTP id r7so4895038pfl.3\n\tfor <dev@dpdk.org>; Fri, 12 Jul 2019 15:15:34 -0700 (PDT)", "from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127])\n\tby smtp.gmail.com with ESMTPSA id\n\tq69sm16634170pjb.0.2019.07.12.15.15.32\n\t(version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256);\n\tFri, 12 Jul 2019 15:15:33 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=networkplumber-org.20150623.gappssmtp.com; s=20150623;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=54EOHvWBIhAMDoysqV18ltcmurAzdmDB+sntQ/SnKXc=;\n\tb=q8izaBv+BQe3Vj27Itord8GJFSFZ+H7u3XHxIRBU8qlezZQkbnZm7d5JjhdXCQSTr7\n\t0TCzpBMuKn6cP2+SqraDBGTTAZLp+cfAi4zeXdoRImgm/qpJVNxmtPrlFN1IicFabH2+\n\t1Ikz1YxD7Nqbb/xIymKYjorCriAmw2evjwqQLJRVjC7yXdqSXRp0zzTim5X4DJkjPuYh\n\tqkyXyQC0x8JV178ogqJgw5Xem12XuRcjCfzG9bBJOD6lqk0eKaUUmXKGGl3gpYxm0IKi\n\thsynir76d7+JxmjBowK/Zk03vXcXmORYbeC+0yodENRTQY10+08ogx1kQkooGDaumDo5\n\tGE8g==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=54EOHvWBIhAMDoysqV18ltcmurAzdmDB+sntQ/SnKXc=;\n\tb=KcAi0RbG0AczsxGHfIWA4CkMEBb6VH46widXxDfkg6Kk/RMZxYr5BbUYOuxAnSS11H\n\tbZRmAtfC/cevviXjk6T3ZoKN2iqXcLEmpGs5h7V43XD2PrW1rX2qcRLSPw8nGSOB2Con\n\tEPiZy44SoPKZrR9Kf/6pD7oaXr1wFGW2HiHN4qdSlG/enep4FscvGrqyRPLsr0UyevDV\n\tSFV32CsWWF1jXSA+8it11D+TMp2/5Bgi8uxIcbmILLj4+sBQccx4WZieVdHDC0Wls2+B\n\t8JXRsmX9qfBWaWTFEYwR1OoZFUHsthhDVRQmS4G1BWLGK4ZdnULrKsoJigchAZMeK5y4\n\tUVgw==", "X-Gm-Message-State": "APjAAAVUfcjqAM2x1kSQCFJ6TWD6FugmChkyLu+b6NKTlwXcr1Na1CZz\n\tRF0aIIhspZjMQCqM+icr7jE=", "X-Google-Smtp-Source": "APXvYqyQtWaPeLAno8aTJ+O4HWnoa7/L2gQIYNZ0R+kCeHR+F0QcMSgrhsoek4JIpXzIVxzGli2e4A==", "X-Received": "by 2002:a63:3f84:: with SMTP id\n\tm126mr13900380pga.213.1562969733813; \n\tFri, 12 Jul 2019 15:15:33 -0700 (PDT)", "From": "Stephen Hemminger <stephen@networkplumber.org>", "To": "matan@mellanox.com, shahafs@mellanox.com, yskoh@mellanox.com,\n\tviacheslavo@mellanox.com", "Cc": "dev@dpdk.org, sju@paloaltonetworks.com,\n\tStephen Hemminger <stephen@networkplumber.org>", "Date": "Fri, 12 Jul 2019 13:54:25 -0700", "Message-Id": "<20190712205425.17781-3-stephen@networkplumber.org>", "X-Mailer": "git-send-email 2.20.1", "In-Reply-To": "<20190712205425.17781-1-stephen@networkplumber.org>", "References": "<20190712205425.17781-1-stephen@networkplumber.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[dpdk-dev] [PATCH 2/2] net/mlx5: fix crash in dev_info_get in\n\tsecondary process", "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": "mlx5_dev_info_get calls mlx5_get_ifname, but mlx5_get_ifname\nuses priv->ctx which is not a valid pointer in a secondary\nprocess. The fix is to cache the value in primary.\n\nIn the primary process, get and store the interface index of\nthe device so that secondary process can see it.\n\nFixes: e60fbd5b24fc (\"mlx5: add device configure/start/stop\")\nSigned-off-by: Stephen Hemminger <stephen@networkplumber.org>\n---\n drivers/net/mlx5/mlx5.c | 17 ++++++++---------\n drivers/net/mlx5/mlx5.h | 1 +\n drivers/net/mlx5/mlx5_ethdev.c | 4 +---\n 3 files changed, 10 insertions(+), 12 deletions(-)", "diff": "diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c\nindex d93f92db56b5..27c5ef9b1763 100644\n--- a/drivers/net/mlx5/mlx5.c\n+++ b/drivers/net/mlx5/mlx5.c\n@@ -1105,6 +1105,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,\n \tint own_domain_id = 0;\n \tuint16_t port_id;\n \tunsigned int i;\n+\tchar ifname[IF_NAMESIZE];\n \n \t/* Determine if this port representor is supposed to be spawned. */\n \tif (switch_info->representor && dpdk_dev->devargs) {\n@@ -1479,18 +1480,16 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,\n \t\tmac.addr_bytes[0], mac.addr_bytes[1],\n \t\tmac.addr_bytes[2], mac.addr_bytes[3],\n \t\tmac.addr_bytes[4], mac.addr_bytes[5]);\n-#ifndef NDEBUG\n-\t{\n-\t\tchar ifname[IF_NAMESIZE];\n \n-\t\tif (mlx5_get_ifname(eth_dev, &ifname) == 0)\n-\t\t\tDRV_LOG(DEBUG, \"port %u ifname is \\\"%s\\\"\",\n+\tif (mlx5_get_ifname(eth_dev, &ifname) == 0) {\n+\t\tpriv->if_index = if_nametoindex(ifname);\n+\t\tDRV_LOG(DEBUG, \"port %u ifname is \\\"%s\\\"\",\n \t\t\t\teth_dev->data->port_id, ifname);\n-\t\telse\n-\t\t\tDRV_LOG(DEBUG, \"port %u ifname is unknown\",\n-\t\t\t\teth_dev->data->port_id);\n+\t} else {\n+\t\tDRV_LOG(DEBUG, \"port %u ifname is unknown\",\n+\t\t\teth_dev->data->port_id);\n \t}\n-#endif\n+\n \t/* Get actual MTU if possible. */\n \terr = mlx5_get_mtu(eth_dev, &priv->mtu);\n \tif (err) {\ndiff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h\nindex 5af3f413cdcb..a06ffd444255 100644\n--- a/drivers/net/mlx5/mlx5.h\n+++ b/drivers/net/mlx5/mlx5.h\n@@ -342,6 +342,7 @@ struct mlx5_priv {\n \tuint16_t vlan_filter[MLX5_MAX_VLAN_IDS]; /* VLAN filters table. */\n \tunsigned int vlan_filter_n; /* Number of configured VLAN filters. */\n \t/* Device properties. */\n+\tunsigned int if_index; /* Associated kernel network device index. */\n \tuint16_t mtu; /* Configured MTU. */\n \tunsigned int isolated:1; /* Whether isolated mode is enabled. */\n \tunsigned int representor:1; /* Device is a port representor. */\ndiff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c\nindex eeefe4df3cd4..41e58db5e573 100644\n--- a/drivers/net/mlx5/mlx5_ethdev.c\n+++ b/drivers/net/mlx5/mlx5_ethdev.c\n@@ -605,7 +605,6 @@ mlx5_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)\n \tstruct mlx5_priv *priv = dev->data->dev_private;\n \tstruct mlx5_dev_config *config = &priv->config;\n \tunsigned int max;\n-\tchar ifname[IF_NAMESIZE];\n \n \t/* FIXME: we should ask the device for these values. */\n \tinfo->min_rx_bufsize = 32;\n@@ -626,8 +625,7 @@ mlx5_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)\n \tinfo->rx_offload_capa = (mlx5_get_rx_port_offloads() |\n \t\t\t\t info->rx_queue_offload_capa);\n \tinfo->tx_offload_capa = mlx5_get_tx_port_offloads(dev);\n-\tif (mlx5_get_ifname(dev, &ifname) == 0)\n-\t\tinfo->if_index = if_nametoindex(ifname);\n+\tinfo->if_index = priv->if_index;\n \tinfo->reta_size = priv->reta_idx_n ?\n \t\tpriv->reta_idx_n : config->ind_table_max_size;\n \tinfo->hash_key_size = MLX5_RSS_HASH_KEY_LEN;\n", "prefixes": [ "2/2" ] }{ "id": 56417, "url": "