get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/38907/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 38907,
    "url": "https://patches.dpdk.org/api/patches/38907/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1524663944-30376-3-git-send-email-arnon@qwilt.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": "<1524663944-30376-3-git-send-email-arnon@qwilt.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1524663944-30376-3-git-send-email-arnon@qwilt.com",
    "date": "2018-04-25T13:45:36",
    "name": "[dpdk-dev,v8,02/10] bond: replace rte_panic instances in bonding driver",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "b38ae36a11e6fd92ccd75b68d2d11914cb54f4cb",
    "submitter": {
        "id": 986,
        "url": "https://patches.dpdk.org/api/people/986/?format=api",
        "name": "Arnon Warshavsky",
        "email": "arnon@qwilt.com"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1524663944-30376-3-git-send-email-arnon@qwilt.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/38907/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/38907/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 A50797CC0;\n\tWed, 25 Apr 2018 15:46:02 +0200 (CEST)",
            "from mta.qwilt.com (mta.qwilt.com [52.9.191.255])\n\tby dpdk.org (Postfix) with ESMTP id F181D7CC7\n\tfor <dev@dpdk.org>; Wed, 25 Apr 2018 15:45:57 +0200 (CEST)",
            "from localhost (localhost [127.0.0.1])\n\tby mta.qwilt.com (Postfix) with ESMTP id 6CB1C80C24C;\n\tWed, 25 Apr 2018 13:45:57 +0000 (UTC)",
            "from mta.qwilt.com ([127.0.0.1])\n\tby localhost (mta.qwilt.com [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id sknpKFxKp9cz; Wed, 25 Apr 2018 13:45:56 +0000 (UTC)",
            "from rd01.it.qwilt.com.qwilt.com (80.179.204.39.cable.012.net.il\n\t[80.179.204.39])\n\tby mta.qwilt.com (Postfix) with ESMTPSA id 4E4A68070A1;\n\tWed, 25 Apr 2018 13:45:54 +0000 (UTC)"
        ],
        "X-Virus-Scanned": "amavisd-new at qwilt.com",
        "From": "Arnon Warshavsky <arnon@qwilt.com>",
        "To": "thomas@monjalon.net, anatoly.burakov@intel.com, wenzhuo.lu@intel.com,\n\tdeclan.doherty@intel.com, jerin.jacob@caviumnetworks.com,\n\tbruce.richardson@intel.com, ferruh.yigit@intel.com",
        "Cc": "dev@dpdk.org,\n\tarnon@qwilt.com",
        "Date": "Wed, 25 Apr 2018 16:45:36 +0300",
        "Message-Id": "<1524663944-30376-3-git-send-email-arnon@qwilt.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1524663944-30376-1-git-send-email-arnon@qwilt.com>",
        "References": "<1524608213-2080-1-git-send-email-arnon@qwilt.com>\n\t<1524663944-30376-1-git-send-email-arnon@qwilt.com>",
        "Subject": "[dpdk-dev] [PATCH v8 02/10] bond: replace rte_panic instances in\n\tbonding driver",
        "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://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": "<https://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": "Replace panic calls with log and return value.\nLocal functions to this file,\nchanging from void to int are non-abi-breaking\n\nSigned-off-by: Arnon Warshavsky <arnon@qwilt.com>\n---\n drivers/net/bonding/rte_eth_bond_8023ad.c         | 29 ++++++++++++++---------\n drivers/net/bonding/rte_eth_bond_8023ad_private.h |  2 +-\n drivers/net/bonding/rte_eth_bond_api.c            | 22 ++++++++++++-----\n drivers/net/bonding/rte_eth_bond_pmd.c            |  9 ++++---\n drivers/net/bonding/rte_eth_bond_private.h        |  2 +-\n 5 files changed, 42 insertions(+), 22 deletions(-)",
    "diff": "diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c\nindex c452318..308e623 100644\n--- a/drivers/net/bonding/rte_eth_bond_8023ad.c\n+++ b/drivers/net/bonding/rte_eth_bond_8023ad.c\n@@ -893,7 +893,7 @@\n \t\t\tbond_mode_8023ad_periodic_cb, arg);\n }\n \n-void\n+int\n bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev,\n \t\t\t\tuint16_t slave_id)\n {\n@@ -939,7 +939,7 @@\n \ttimer_cancel(&port->warning_timer);\n \n \tif (port->mbuf_pool != NULL)\n-\t\treturn;\n+\t\treturn 0;\n \n \tRTE_ASSERT(port->rx_ring == NULL);\n \tRTE_ASSERT(port->tx_ring == NULL);\n@@ -968,8 +968,9 @@\n \t/* Any memory allocation failure in initialization is critical because\n \t * resources can't be free, so reinitialization is impossible. */\n \tif (port->mbuf_pool == NULL) {\n-\t\trte_panic(\"Slave %u: Failed to create memory pool '%s': %s\\n\",\n-\t\t\tslave_id, mem_name, rte_strerror(rte_errno));\n+\t\tRTE_BOND_LOG(ERR, \"%s() Slave %u: Failed to create memory pool '%s': %s\\n\",\n+\t\t\t__func__, slave_id, mem_name, rte_strerror(rte_errno));\n+\t\treturn -1;\n \t}\n \n \tsnprintf(mem_name, RTE_DIM(mem_name), \"slave_%u_rx\", slave_id);\n@@ -977,8 +978,9 @@\n \t\t\trte_align32pow2(BOND_MODE_8023AX_SLAVE_RX_PKTS), socket_id, 0);\n \n \tif (port->rx_ring == NULL) {\n-\t\trte_panic(\"Slave %u: Failed to create rx ring '%s': %s\\n\", slave_id,\n-\t\t\tmem_name, rte_strerror(rte_errno));\n+\t\tRTE_BOND_LOG(ERR, \"%s() Slave %u: Failed to create rx ring '%s': %s\\n\",\n+\t\t\t__func__, slave_id, mem_name, rte_strerror(rte_errno));\n+\t\treturn -1;\n \t}\n \n \t/* TX ring is at least one pkt longer to make room for marker packet. */\n@@ -987,9 +989,12 @@\n \t\t\trte_align32pow2(BOND_MODE_8023AX_SLAVE_TX_PKTS + 1), socket_id, 0);\n \n \tif (port->tx_ring == NULL) {\n-\t\trte_panic(\"Slave %u: Failed to create tx ring '%s': %s\\n\", slave_id,\n-\t\t\tmem_name, rte_strerror(rte_errno));\n+\t\tRTE_BOND_LOG(ERR, \"%s() Slave %u: Fail to create tx ring '%s': %s\\n\",\n+\t\t\t__func__, slave_id, mem_name, rte_strerror(rte_errno));\n+\t\treturn -1;\n \t}\n+\n+\treturn 0;\n }\n \n int\n@@ -1143,9 +1148,11 @@\n \tstruct bond_dev_private *internals = bond_dev->data->dev_private;\n \tuint8_t i;\n \n-\tfor (i = 0; i < internals->active_slave_count; i++)\n-\t\tbond_mode_8023ad_activate_slave(bond_dev,\n-\t\t\t\tinternals->active_slaves[i]);\n+\tfor (i = 0; i < internals->active_slave_count; i++) {\n+\t\tif (!bond_mode_8023ad_activate_slave(bond_dev,\n+\t\t\t\t\t\tinternals->active_slaves[i]))\n+\t\t\treturn -1;\n+\t}\n \n \treturn 0;\n }\ndiff --git a/drivers/net/bonding/rte_eth_bond_8023ad_private.h b/drivers/net/bonding/rte_eth_bond_8023ad_private.h\nindex 0f490a5..96a42f2 100644\n--- a/drivers/net/bonding/rte_eth_bond_8023ad_private.h\n+++ b/drivers/net/bonding/rte_eth_bond_8023ad_private.h\n@@ -263,7 +263,7 @@ struct mode8023ad_private {\n  * @return\n  *  0 on success, negative value otherwise.\n  */\n-void\n+int\n bond_mode_8023ad_activate_slave(struct rte_eth_dev *dev, uint16_t port_id);\n \n /**\ndiff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c\nindex aa89425..657fd74 100644\n--- a/drivers/net/bonding/rte_eth_bond_api.c\n+++ b/drivers/net/bonding/rte_eth_bond_api.c\n@@ -69,14 +69,15 @@\n \treturn 0;\n }\n \n-void\n+int\n activate_slave(struct rte_eth_dev *eth_dev, uint16_t port_id)\n {\n \tstruct bond_dev_private *internals = eth_dev->data->dev_private;\n \tuint8_t active_count = internals->active_slave_count;\n \n \tif (internals->mode == BONDING_MODE_8023AD)\n-\t\tbond_mode_8023ad_activate_slave(eth_dev, port_id);\n+\t\tif (bond_mode_8023ad_activate_slave(eth_dev, port_id) != 0)\n+\t\t\treturn -1;\n \n \tif (internals->mode == BONDING_MODE_TLB\n \t\t\t|| internals->mode == BONDING_MODE_ALB) {\n@@ -94,6 +95,8 @@\n \t\tbond_tlb_activate_slave(internals);\n \tif (internals->mode == BONDING_MODE_ALB)\n \t\tbond_mode_alb_client_list_upd(eth_dev);\n+\n+\treturn 0;\n }\n \n void\n@@ -357,10 +360,17 @@\n \t\t\t\tbond_ethdev_primary_set(internals,\n \t\t\t\t\t\t\tslave_port_id);\n \n-\t\t\tif (find_slave_by_id(internals->active_slaves,\n-\t\t\t\t\t     internals->active_slave_count,\n-\t\t\t\t\t     slave_port_id) == internals->active_slave_count)\n-\t\t\t\tactivate_slave(bonded_eth_dev, slave_port_id);\n+\t\t\tint rc =\n+\t\t\t\tfind_slave_by_id(internals->active_slaves,\n+\t\t\t\t\tinternals->active_slave_count,\n+\t\t\t\t\tslave_port_id);\n+\n+\t\t\tif (rc == internals->active_slave_count) {\n+\t\t\t\tint rc = activate_slave(bonded_eth_dev,\n+\t\t\t\t\t\t\tslave_port_id);\n+\t\t\t\tif (rc != 0)\n+\t\t\t\t\treturn -1;\n+\t\t\t}\n \t\t}\n \t}\n \ndiff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c\nindex 09696ea..d2dbe4a 100644\n--- a/drivers/net/bonding/rte_eth_bond_pmd.c\n+++ b/drivers/net/bonding/rte_eth_bond_pmd.c\n@@ -1741,8 +1741,10 @@ struct bwg_slave {\n \t\t/* Any memory allocation failure in initialization is critical because\n \t\t * resources can't be free, so reinitialization is impossible. */\n \t\tif (port->slow_pool == NULL) {\n-\t\t\trte_panic(\"Slave %u: Failed to create memory pool '%s': %s\\n\",\n-\t\t\t\tslave_id, mem_name, rte_strerror(rte_errno));\n+\t\t\tRTE_BOND_LOG(ERR, \"%s() Slave %u: Failed to create memory pool '%s': %s\\n\",\n+\t\t\t\t__func__, slave_id,\n+\t\t\t\tmem_name, rte_strerror(rte_errno));\n+\t\t\treturn -1;\n \t\t}\n \t}\n \n@@ -2673,7 +2675,8 @@ struct bwg_slave {\n \t\t\tmac_address_slaves_update(bonded_eth_dev);\n \t\t}\n \n-\t\tactivate_slave(bonded_eth_dev, port_id);\n+\t\tif (activate_slave(bonded_eth_dev, port_id) != 0)\n+\t\t\treturn -1;\n \n \t\t/* If user has defined the primary port then default to using it */\n \t\tif (internals->user_defined_primary_port &&\ndiff --git a/drivers/net/bonding/rte_eth_bond_private.h b/drivers/net/bonding/rte_eth_bond_private.h\nindex 94eca88..d99d42c 100644\n--- a/drivers/net/bonding/rte_eth_bond_private.h\n+++ b/drivers/net/bonding/rte_eth_bond_private.h\n@@ -187,7 +187,7 @@ struct bond_dev_private {\n void\n deactivate_slave(struct rte_eth_dev *eth_dev, uint16_t port_id);\n \n-void\n+int\n activate_slave(struct rte_eth_dev *eth_dev, uint16_t port_id);\n \n void\n",
    "prefixes": [
        "dpdk-dev",
        "v8",
        "02/10"
    ]
}