Show a patch.

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

{
    "id": 268,
    "url": "https://patches.dpdk.org/api/patches/268/?format=api",
    "web_url": "https://patches.dpdk.org/patch/268/",
    "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"
    },
    "msgid": "<1409560289-29558-3-git-send-email-declan.doherty@intel.com>",
    "date": "2014-09-01T08:31:25",
    "name": "[dpdk-dev,v2,2/6] bond: removing switch statement from rx burst method",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "a186252fd39ed3449d1a6f9463803bc88e53bda1",
    "submitter": {
        "id": 11,
        "url": "https://patches.dpdk.org/api/people/11/?format=api",
        "name": "Doherty, Declan",
        "email": "declan.doherty@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/patch/268/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/268/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/268/checks/",
    "tags": {},
    "headers": {
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "Return-Path": "<dwdohert@ecsmtp.ir.intel.com>",
        "Message-Id": "<1409560289-29558-3-git-send-email-declan.doherty@intel.com>",
        "X-Mailer": "git-send-email 1.7.0.7",
        "To": "dev@dpdk.org",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "X-BeenThere": "dev@dpdk.org",
        "Received": [
            "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby dpdk.org (Postfix) with ESMTP id 22FB95947\n\tfor <dev@dpdk.org>; Mon,  1 Sep 2014 10:27:12 +0200 (CEST)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby orsmga101.jf.intel.com with ESMTP; 01 Sep 2014 01:31:38 -0700",
            "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby orsmga002.jf.intel.com with ESMTP; 01 Sep 2014 01:31:36 -0700",
            "from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com\n\t[10.237.217.46])\n\tby irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\n\ts818VZJC010176; Mon, 1 Sep 2014 09:31:36 +0100",
            "from sivswdev02.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev02.ir.intel.com with ESMTP id s818VZ9u002103;\n\tMon, 1 Sep 2014 09:31:35 +0100",
            "(from dwdohert@localhost)\n\tby sivswdev02.ir.intel.com with  id s818VZRj002099;\n\tMon, 1 Sep 2014 09:31:35 +0100"
        ],
        "Subject": "[dpdk-dev] [PATCH v2 2/6] bond: removing switch statement from rx\n\tburst method",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "In-Reply-To": "<1408456313-28812-1-git-send-email-declan.doherty@intel.com>",
        "X-ExtLoop1": "1",
        "Precedence": "list",
        "From": "Declan Doherty <declan.doherty@intel.com>",
        "X-IronPort-AV": "E=Sophos;i=\"5.04,441,1406617200\"; d=\"scan'208\";a=\"596144687\"",
        "References": "<1408456313-28812-1-git-send-email-declan.doherty@intel.com>",
        "X-List-Received-Date": "Mon, 01 Sep 2014 08:27:13 -0000",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "Date": "Mon,  1 Sep 2014 09:31:25 +0100",
        "X-Mailman-Version": "2.1.15"
    },
    "content": "Signed-off-by: Declan Doherty <declan.doherty@intel.com>\n---\n lib/librte_pmd_bond/rte_eth_bond_pmd.c |   62 ++++++++++++++++++--------------\n 1 files changed, 35 insertions(+), 27 deletions(-)",
    "diff": "diff --git a/lib/librte_pmd_bond/rte_eth_bond_pmd.c b/lib/librte_pmd_bond/rte_eth_bond_pmd.c\nindex cd3eecf..683b146 100644\n--- a/lib/librte_pmd_bond/rte_eth_bond_pmd.c\n+++ b/lib/librte_pmd_bond/rte_eth_bond_pmd.c\n@@ -59,33 +59,37 @@ bond_ethdev_rx_burst(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)\n \n \tinternals = bd_rx_q->dev_private;\n \n-\tswitch (internals->mode) {\n-\tcase BONDING_MODE_ROUND_ROBIN:\n-\tcase BONDING_MODE_BROADCAST:\n-\tcase BONDING_MODE_BALANCE:\n-\t\tfor (i = 0; i < internals->active_slave_count && nb_pkts; i++) {\n-\t\t\t/* Offset of pointer to *bufs increases as packets are received\n-\t\t\t * from other slaves */\n-\t\t\tnum_rx_slave = rte_eth_rx_burst(internals->active_slaves[i],\n-\t\t\t\t\tbd_rx_q->queue_id, bufs + num_rx_total, nb_pkts);\n-\t\t\tif (num_rx_slave) {\n-\t\t\t\tnum_rx_total += num_rx_slave;\n-\t\t\t\tnb_pkts -= num_rx_slave;\n-\t\t\t}\n+\tfor (i = 0; i < internals->active_slave_count && nb_pkts; i++) {\n+\t\t/* Offset of pointer to *bufs increases as packets are received\n+\t\t * from other slaves */\n+\t\tnum_rx_slave = rte_eth_rx_burst(internals->active_slaves[i],\n+\t\t\t\tbd_rx_q->queue_id, bufs + num_rx_total, nb_pkts);\n+\t\tif (num_rx_slave) {\n+\t\t\tnum_rx_total += num_rx_slave;\n+\t\t\tnb_pkts -= num_rx_slave;\n \t\t}\n-\t\tbreak;\n-\tcase BONDING_MODE_ACTIVE_BACKUP:\n-\t\tnum_rx_slave = rte_eth_rx_burst(internals->current_primary_port,\n-\t\t\t\tbd_rx_q->queue_id, bufs, nb_pkts);\n-\t\tif (num_rx_slave)\n-\t\t\tnum_rx_total = num_rx_slave;\n-\t\tbreak;\n \t}\n+\n \treturn num_rx_total;\n }\n \n static uint16_t\n-bond_ethdev_tx_round_robin(void *queue, struct rte_mbuf **bufs,\n+bond_ethdev_rx_burst_active_backup(void *queue, struct rte_mbuf **bufs,\n+\t\tuint16_t nb_pkts)\n+{\n+\tstruct bond_dev_private *internals;\n+\n+\t/* Cast to structure, containing bonded device's port id and queue id */\n+\tstruct bond_rx_queue *bd_rx_q = (struct bond_rx_queue *)queue;\n+\n+\tinternals = bd_rx_q->dev_private;\n+\n+\treturn rte_eth_rx_burst(internals->current_primary_port,\n+\t\t\tbd_rx_q->queue_id, bufs, nb_pkts);\n+}\n+\n+static uint16_t\n+bond_ethdev_tx_burst_round_robin(void *queue, struct rte_mbuf **bufs,\n \t\tuint16_t nb_pkts)\n {\n \tstruct bond_dev_private *dev_private;\n@@ -134,7 +138,7 @@ bond_ethdev_tx_round_robin(void *queue, struct rte_mbuf **bufs,\n }\n \n static uint16_t\n-bond_ethdev_tx_active_backup(void *queue,\n+bond_ethdev_tx_burst_active_backup(void *queue,\n \t\tstruct rte_mbuf **bufs, uint16_t nb_pkts)\n {\n \tstruct bond_dev_private *internals;\n@@ -270,7 +274,8 @@ xmit_slave_hash(const struct rte_mbuf *buf, uint8_t slave_count, uint8_t policy)\n }\n \n static uint16_t\n-bond_ethdev_tx_balance(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)\n+bond_ethdev_tx_burst_balance(void *queue, struct rte_mbuf **bufs,\n+\t\tuint16_t nb_pkts)\n {\n \tstruct bond_dev_private *internals;\n \tstruct bond_tx_queue *bd_tx_q;\n@@ -480,22 +485,25 @@ bond_ethdev_mode_set(struct rte_eth_dev *eth_dev, int mode)\n \n \tswitch (mode) {\n \tcase BONDING_MODE_ROUND_ROBIN:\n-\t\teth_dev->tx_pkt_burst = bond_ethdev_tx_round_robin;\n+\t\teth_dev->tx_pkt_burst = bond_ethdev_tx_burst_round_robin;\n+\t\teth_dev->rx_pkt_burst = bond_ethdev_rx_burst;\n \t\tbreak;\n \tcase BONDING_MODE_ACTIVE_BACKUP:\n-\t\teth_dev->tx_pkt_burst = bond_ethdev_tx_active_backup;\n+\t\teth_dev->tx_pkt_burst = bond_ethdev_tx_burst_active_backup;\n+\t\teth_dev->rx_pkt_burst = bond_ethdev_rx_burst_active_backup;\n \t\tbreak;\n \tcase BONDING_MODE_BALANCE:\n-\t\teth_dev->tx_pkt_burst = bond_ethdev_tx_balance;\n+\t\teth_dev->tx_pkt_burst = bond_ethdev_tx_burst_balance;\n+\t\teth_dev->rx_pkt_burst = bond_ethdev_rx_burst;\n \t\tbreak;\n \tcase BONDING_MODE_BROADCAST:\n \t\teth_dev->tx_pkt_burst = bond_ethdev_tx_burst_broadcast;\n+\t\teth_dev->rx_pkt_burst = bond_ethdev_rx_burst;\n \t\tbreak;\n \tdefault:\n \t\treturn -1;\n \t}\n \n-\teth_dev->rx_pkt_burst = bond_ethdev_rx_burst;\n \tinternals->mode = mode;\n \n \treturn 0;\n",
    "prefixes": [
        "dpdk-dev",
        "v2",
        "2/6"
    ]
}