Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/12402/?format=api
http://patches.dpdk.org/api/patches/12402/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1462461300-9962-2-git-send-email-bernard.iremonger@intel.com/", "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": "<1462461300-9962-2-git-send-email-bernard.iremonger@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1462461300-9962-2-git-send-email-bernard.iremonger@intel.com", "date": "2016-05-05T15:14:56", "name": "[dpdk-dev,1/5] bonding: replace spinlock with read/write lock", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "c8d8a674767ea372bbee8463f13fa2bb5f12ca74", "submitter": { "id": 91, "url": "http://patches.dpdk.org/api/people/91/?format=api", "name": "Iremonger, Bernard", "email": "bernard.iremonger@intel.com" }, "delegate": { "id": 10, "url": "http://patches.dpdk.org/api/users/10/?format=api", "username": "bruce", "first_name": "Bruce", "last_name": "Richardson", "email": "bruce.richardson@intel.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/1462461300-9962-2-git-send-email-bernard.iremonger@intel.com/mbox/", "series": [], "comments": "http://patches.dpdk.org/api/patches/12402/comments/", "check": "pending", "checks": "http://patches.dpdk.org/api/patches/12402/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 B5CBC5A0A;\n\tThu, 5 May 2016 17:38:24 +0200 (CEST)", "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n\tby dpdk.org (Postfix) with ESMTP id 738755A08\n\tfor <dev@dpdk.org>; Thu, 5 May 2016 17:38:23 +0200 (CEST)", "from orsmga003.jf.intel.com ([10.7.209.27])\n\tby orsmga103.jf.intel.com with ESMTP; 05 May 2016 08:38:23 -0700", "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby orsmga003.jf.intel.com with ESMTP; 05 May 2016 08:38:21 -0700", "from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com\n\t[10.237.217.45])\n\tby irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\n\tu45FF68O016505; Thu, 5 May 2016 16:15:06 +0100", "from sivswdev01.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev01.ir.intel.com with ESMTP id u45FF6VX010052;\n\tThu, 5 May 2016 16:15:06 +0100", "(from bairemon@localhost)\n\tby sivswdev01.ir.intel.com with id u45FF6Iw010048;\n\tThu, 5 May 2016 16:15:06 +0100" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.24,582,1455004800\"; d=\"scan'208\";a=\"799609756\"", "From": "Bernard Iremonger <bernard.iremonger@intel.com>", "To": "dev@dpdk.org", "Cc": "declan.doherty@intel.com, Bernard Iremonger <bernard.iremonger@intel.com>", "Date": "Thu, 5 May 2016 16:14:56 +0100", "Message-Id": "<1462461300-9962-2-git-send-email-bernard.iremonger@intel.com>", "X-Mailer": "git-send-email 1.7.4.1", "In-Reply-To": "<1462461300-9962-1-git-send-email-bernard.iremonger@intel.com>", "References": "<1462461300-9962-1-git-send-email-bernard.iremonger@intel.com>", "Subject": "[dpdk-dev] [PATCH 1/5] bonding: replace spinlock with read/write\n\tlock", "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": "Fixes: a45b288ef21a (\"bond: support link status polling\")\nSigned-off-by: Bernard Iremonger <bernard.iremonger@intel.com>\n---\n drivers/net/bonding/rte_eth_bond_api.c | 10 +++---\n drivers/net/bonding/rte_eth_bond_pmd.c | 57 +++++++++++++++---------------\n drivers/net/bonding/rte_eth_bond_private.h | 6 ++--\n 3 files changed, 36 insertions(+), 37 deletions(-)", "diff": "diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c\nindex d3bda35..c77626d 100644\n--- a/drivers/net/bonding/rte_eth_bond_api.c\n+++ b/drivers/net/bonding/rte_eth_bond_api.c\n@@ -227,7 +227,7 @@ rte_eth_bond_create(const char *name, uint8_t mode, uint8_t socket_id)\n \teth_dev->data->drv_name = pmd_bond_driver_name;\n \teth_dev->data->numa_node = socket_id;\n \n-\trte_spinlock_init(&internals->lock);\n+\trte_rwlock_init(&internals->rwlock);\n \n \tinternals->port_id = eth_dev->data->port_id;\n \tinternals->mode = BONDING_MODE_INVALID;\n@@ -451,11 +451,11 @@ rte_eth_bond_slave_add(uint8_t bonded_port_id, uint8_t slave_port_id)\n \tbonded_eth_dev = &rte_eth_devices[bonded_port_id];\n \tinternals = bonded_eth_dev->data->dev_private;\n \n-\trte_spinlock_lock(&internals->lock);\n+\trte_rwlock_write_lock(&internals->rwlock);\n \n \tretval = __eth_bond_slave_add_lock_free(bonded_port_id, slave_port_id);\n \n-\trte_spinlock_unlock(&internals->lock);\n+\trte_rwlock_write_unlock(&internals->rwlock);\n \n \treturn retval;\n }\n@@ -553,11 +553,11 @@ rte_eth_bond_slave_remove(uint8_t bonded_port_id, uint8_t slave_port_id)\n \tbonded_eth_dev = &rte_eth_devices[bonded_port_id];\n \tinternals = bonded_eth_dev->data->dev_private;\n \n-\trte_spinlock_lock(&internals->lock);\n+\trte_rwlock_write_lock(&internals->rwlock);\n \n \tretval = __eth_bond_slave_remove_lock_free(bonded_port_id, slave_port_id);\n \n-\trte_spinlock_unlock(&internals->lock);\n+\trte_rwlock_write_unlock(&internals->rwlock);\n \n \treturn retval;\n }\ndiff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c\nindex 129f04b..ed6245b 100644\n--- a/drivers/net/bonding/rte_eth_bond_pmd.c\n+++ b/drivers/net/bonding/rte_eth_bond_pmd.c\n@@ -1,7 +1,7 @@\n /*-\n * BSD LICENSE\n *\n- * Copyright(c) 2010-2015 Intel Corporation. All rights reserved.\n+ * Copyright(c) 2010-2016 Intel Corporation. All rights reserved.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n@@ -1750,37 +1750,36 @@ bond_ethdev_slave_link_status_change_monitor(void *cb_arg)\n \t\t!internals->link_status_polling_enabled)\n \t\treturn;\n \n-\t/* If device is currently being configured then don't check slaves link\n-\t * status, wait until next period */\n-\tif (rte_spinlock_trylock(&internals->lock)) {\n-\t\tif (internals->slave_count > 0)\n-\t\t\tpolling_slave_found = 0;\n+\trte_rwlock_read_lock(&internals->rwlock);\n+\tif (internals->slave_count > 0)\n+\t\tpolling_slave_found = 0;\n \n-\t\tfor (i = 0; i < internals->slave_count; i++) {\n-\t\t\tif (!internals->slaves[i].link_status_poll_enabled)\n-\t\t\t\tcontinue;\n-\n-\t\t\tslave_ethdev = &rte_eth_devices[internals->slaves[i].port_id];\n-\t\t\tpolling_slave_found = 1;\n-\n-\t\t\t/* Update slave link status */\n-\t\t\t(*slave_ethdev->dev_ops->link_update)(slave_ethdev,\n-\t\t\t\t\tinternals->slaves[i].link_status_wait_to_complete);\n-\n-\t\t\t/* if link status has changed since last checked then call lsc\n-\t\t\t * event callback */\n-\t\t\tif (slave_ethdev->data->dev_link.link_status !=\n-\t\t\t\t\tinternals->slaves[i].last_link_status) {\n-\t\t\t\tinternals->slaves[i].last_link_status =\n-\t\t\t\t\t\tslave_ethdev->data->dev_link.link_status;\n-\n-\t\t\t\tbond_ethdev_lsc_event_callback(internals->slaves[i].port_id,\n-\t\t\t\t\t\tRTE_ETH_EVENT_INTR_LSC,\n-\t\t\t\t\t\t&bonded_ethdev->data->port_id);\n-\t\t\t}\n+\tfor (i = 0; i < internals->slave_count; i++) {\n+\t\tif (!internals->slaves[i].link_status_poll_enabled)\n+\t\t\tcontinue;\n+\n+\t\tslave_ethdev = &rte_eth_devices[internals->slaves[i].port_id];\n+\t\tpolling_slave_found = 1;\n+\n+\t\t/* Update slave link status */\n+\t\t(*slave_ethdev->dev_ops->link_update)(slave_ethdev,\n+\t\t\tinternals->slaves[i].link_status_wait_to_complete);\n+\n+\t\t/* if link status has changed since last checked then call lsc\n+\t\t * event callback\n+\t\t */\n+\t\tif (slave_ethdev->data->dev_link.link_status !=\n+\t\t\tinternals->slaves[i].last_link_status) {\n+\t\t\tinternals->slaves[i].last_link_status =\n+\t\t\t\tslave_ethdev->data->dev_link.link_status;\n+\n+\t\t\tbond_ethdev_lsc_event_callback(\n+\t\t\t\t\tinternals->slaves[i].port_id,\n+\t\t\t\t\tRTE_ETH_EVENT_INTR_LSC,\n+\t\t\t\t\t&bonded_ethdev->data->port_id);\n \t\t}\n-\t\trte_spinlock_unlock(&internals->lock);\n \t}\n+\trte_rwlock_read_unlock(&internals->rwlock);\n \n \tif (polling_slave_found)\n \t\t/* Set alarm to continue monitoring link status of slave ethdev's */\ndiff --git a/drivers/net/bonding/rte_eth_bond_private.h b/drivers/net/bonding/rte_eth_bond_private.h\nindex 8312397..72ea679 100644\n--- a/drivers/net/bonding/rte_eth_bond_private.h\n+++ b/drivers/net/bonding/rte_eth_bond_private.h\n@@ -1,7 +1,7 @@\n /*-\n * BSD LICENSE\n *\n- * Copyright(c) 2010-2015 Intel Corporation. All rights reserved.\n+ * Copyright(c) 2010-2016 Intel Corporation. All rights reserved.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n@@ -35,7 +35,7 @@\n #define _RTE_ETH_BOND_PRIVATE_H_\n \n #include <rte_ethdev.h>\n-#include <rte_spinlock.h>\n+#include <rte_rwlock.h>\n \n #include \"rte_eth_bond.h\"\n #include \"rte_eth_bond_8023ad_private.h\"\n@@ -115,7 +115,7 @@ struct bond_dev_private {\n \tuint8_t port_id;\t\t\t\t\t/**< Port Id of Bonded Port */\n \tuint8_t mode;\t\t\t\t\t\t/**< Link Bonding Mode */\n \n-\trte_spinlock_t lock;\n+\trte_rwlock_t rwlock;\n \n \tuint8_t primary_port;\t\t\t\t/**< Primary Slave Port */\n \tuint8_t current_primary_port;\t\t/**< Primary Slave Port */\n", "prefixes": [ "dpdk-dev", "1/5" ] }{ "id": 12402, "url": "