Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/8529/?format=api
https://patches.dpdk.org/api/patches/8529/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1446467130-300-6-git-send-email-alejandro.lucero@netronome.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": "<1446467130-300-6-git-send-email-alejandro.lucero@netronome.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1446467130-300-6-git-send-email-alejandro.lucero@netronome.com", "date": "2015-11-02T12:25:25", "name": "[dpdk-dev,v5,5/9] nfp: adding link functionality", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "59e72e171c94180470f719037c4893bd78381388", "submitter": { "id": 270, "url": "https://patches.dpdk.org/api/people/270/?format=api", "name": "Alejandro Lucero", "email": "alejandro.lucero@netronome.com" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dpdk/patch/1446467130-300-6-git-send-email-alejandro.lucero@netronome.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/8529/comments/", "check": "pending", "checks": "https://patches.dpdk.org/api/patches/8529/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 [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 6C78F8E9E;\n\tMon, 2 Nov 2015 13:25:36 +0100 (CET)", "from ubuntu (host217-39-174-19.in-addr.btopenworld.com\n\t[217.39.174.19]) by dpdk.org (Postfix) with SMTP id CB40C8E81\n\tfor <dev@dpdk.org>; Mon, 2 Nov 2015 13:25:31 +0100 (CET)", "by ubuntu (Postfix, from userid 5466)\n\tid 372CCEA76B; Mon, 2 Nov 2015 12:25:30 +0000 (GMT)" ], "From": "\"Alejandro.Lucero\" <alejandro.lucero@netronome.com>", "To": "dev@dpdk.org", "Date": "Mon, 2 Nov 2015 12:25:25 +0000", "Message-Id": "<1446467130-300-6-git-send-email-alejandro.lucero@netronome.com>", "X-Mailer": "git-send-email 1.7.9.5", "In-Reply-To": "<1446467130-300-1-git-send-email-alejandro.lucero@netronome.com>", "References": "<1446467130-300-1-git-send-email-alejandro.lucero@netronome.com>", "Subject": "[dpdk-dev] [PATCH v5 5/9] nfp: adding link functionality", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "patches and discussions about DPDK <dev.dpdk.org>", "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://dpdk.org/ml/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<http://dpdk.org/ml/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: \"Alejandro.Lucero\" <alejandro.lucero@netronome.com>\n\nSigned-off-by: Alejandro.Lucero <alejandro.lucero@netronome.com>\nSigned-off-by: Rolf.Neugebauer <rolf.neugebauer@netronome.com>\n---\n drivers/net/nfp/nfp_net.c | 94 +++++++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 94 insertions(+)", "diff": "diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c\nindex e1badc3..9cc7776 100644\n--- a/drivers/net/nfp/nfp_net.c\n+++ b/drivers/net/nfp/nfp_net.c\n@@ -232,6 +232,57 @@ ring_dma_zone_reserve(struct rte_eth_dev *dev, const char *ring_name,\n \t\t\t\t\t NFP_MEMZONE_ALIGN);\n }\n \n+/*\n+ * Atomically reads link status information from global structure rte_eth_dev.\n+ *\n+ * @param dev\n+ * - Pointer to the structure rte_eth_dev to read from.\n+ * - Pointer to the buffer to be saved with the link status.\n+ *\n+ * @return\n+ * - On success, zero.\n+ * - On failure, negative value.\n+ */\n+static inline int\n+nfp_net_dev_atomic_read_link_status(struct rte_eth_dev *dev,\n+\t\t\t\t struct rte_eth_link *link)\n+{\n+\tstruct rte_eth_link *dst = link;\n+\tstruct rte_eth_link *src = &dev->data->dev_link;\n+\n+\tif (rte_atomic64_cmpset((uint64_t *)dst, *(uint64_t *)dst,\n+\t\t\t\t*(uint64_t *)src) == 0)\n+\t\treturn -1;\n+\n+\treturn 0;\n+}\n+\n+/*\n+ * Atomically writes the link status information into global\n+ * structure rte_eth_dev.\n+ *\n+ * @param dev\n+ * - Pointer to the structure rte_eth_dev to read from.\n+ * - Pointer to the buffer to be saved with the link status.\n+ *\n+ * @return\n+ * - On success, zero.\n+ * - On failure, negative value.\n+ */\n+static inline int\n+nfp_net_dev_atomic_write_link_status(struct rte_eth_dev *dev,\n+\t\t\t\t struct rte_eth_link *link)\n+{\n+\tstruct rte_eth_link *dst = &dev->data->dev_link;\n+\tstruct rte_eth_link *src = link;\n+\n+\tif (rte_atomic64_cmpset((uint64_t *)dst, *(uint64_t *)dst,\n+\t\t\t\t*(uint64_t *)src) == 0)\n+\t\treturn -1;\n+\n+\treturn 0;\n+}\n+\n static void\n nfp_net_rx_queue_release_mbufs(struct nfp_net_rxq *rxq)\n {\n@@ -688,6 +739,49 @@ nfp_net_close(struct rte_eth_dev *dev)\n \t */\n }\n \n+/*\n+ * return 0 means link status changed, -1 means not changed\n+ *\n+ * Wait to complete is needed as it can take up to 9 seconds to get the Link\n+ * status.\n+ */\n+static int\n+nfp_net_link_update(struct rte_eth_dev *dev, __rte_unused int wait_to_complete)\n+{\n+\tstruct nfp_net_hw *hw;\n+\tstruct rte_eth_link link, old;\n+\tuint32_t nn_link_status;\n+\n+\tPMD_DRV_LOG(DEBUG, \"Link update\\n\");\n+\n+\thw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\n+\tmemset(&old, 0, sizeof(old));\n+\tnfp_net_dev_atomic_read_link_status(dev, &old);\n+\n+\tnn_link_status = nn_cfg_readl(hw, NFP_NET_CFG_STS);\n+\n+\tmemset(&link, 0, sizeof(struct rte_eth_link));\n+\n+\tif (nn_link_status & NFP_NET_CFG_STS_LINK)\n+\t\tlink.link_status = 1;\n+\n+\tlink.link_duplex = ETH_LINK_FULL_DUPLEX;\n+\t/* Other cards can limit the tx and rx rate per VF */\n+\tlink.link_speed = ETH_LINK_SPEED_40G;\n+\n+\tif (old.link_status != link.link_status) {\n+\t\tnfp_net_dev_atomic_write_link_status(dev, &link);\n+\t\tif (link.link_status)\n+\t\t\tPMD_DRV_LOG(INFO, \"NIC Link is Up\\n\");\n+\t\telse\n+\t\t\tPMD_DRV_LOG(INFO, \"NIC Link is Down\\n\");\n+\t\treturn 0;\n+\t}\n+\n+\treturn -1;\n+}\n+\n static void\n nfp_net_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)\n {\n", "prefixes": [ "dpdk-dev", "v5", "5/9" ] }{ "id": 8529, "url": "