Show a patch.

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

{
    "id": 180,
    "url": "http://patches.dpdk.org/api/patches/180/",
    "web_url": "http://patches.dpdk.org/patch/180/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/",
        "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": "<1408456313-28812-3-git-send-email-declan.doherty@intel.com>",
    "date": "2014-08-19T13:51:49",
    "name": "[dpdk-dev,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": "http://patches.dpdk.org/api/people/11/",
        "name": "Doherty, Declan",
        "email": "declan.doherty@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/patch/180/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/180/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/180/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<dwdohert@ecsmtp.ir.intel.com>",
        "References": "<1408456313-28812-1-git-send-email-declan.doherty@intel.com>",
        "X-Mailman-Version": "2.1.15",
        "X-IronPort-AV": "E=Sophos;i=\"4.97,862,1389772800\"; d=\"scan'208\";a=\"374260143\"",
        "From": "Declan Doherty <declan.doherty@intel.com>",
        "X-List-Received-Date": "Tue, 19 Aug 2014 13:48:37 -0000",
        "X-BeenThere": "dev@dpdk.org",
        "Message-Id": "<1408456313-28812-3-git-send-email-declan.doherty@intel.com>",
        "Received": [
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby dpdk.org (Postfix) with ESMTP id 7CCB6B370\n\tfor <dev@dpdk.org>; Tue, 19 Aug 2014 15:48:36 +0200 (CEST)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby fmsmga101.fm.intel.com with ESMTP; 19 Aug 2014 06:52:03 -0700",
            "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby FMSMGA003.fm.intel.com with ESMTP; 19 Aug 2014 06:48:19 -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\ts7JDq155002073; Tue, 19 Aug 2014 14:52:01 +0100",
            "from sivswdev02.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev02.ir.intel.com with ESMTP id s7JDq1xV002908;\n\tTue, 19 Aug 2014 14:52:01 +0100",
            "(from dwdohert@localhost)\n\tby sivswdev02.ir.intel.com with  id s7JDq1uo002904;\n\tTue, 19 Aug 2014 14:52:01 +0100"
        ],
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "X-Mailer": "git-send-email 1.7.0.7",
        "Precedence": "list",
        "Date": "Tue, 19 Aug 2014 14:51:49 +0100",
        "Subject": "[dpdk-dev] [PATCH 2/6] bond: removing switch statement from rx\n\tburst method",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "X-ExtLoop1": "1",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "In-Reply-To": "<1408456313-28812-1-git-send-email-declan.doherty@intel.com>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "To": "dev@dpdk.org"
    },
    "content": "Splitting rx burst function into seperate functions to avoid the need for \na switch statement and also to match the structure of the tx burst functions.\n\nSigned-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",
        "2/6"
    ]
}