get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 8351,
    "url": "http://patches.dpdk.org/api/patches/8351/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1446202336-8723-8-git-send-email-zhe.tao@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": "<1446202336-8723-8-git-send-email-zhe.tao@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1446202336-8723-8-git-send-email-zhe.tao@intel.com",
    "date": "2015-10-30T10:52:15",
    "name": "[dpdk-dev,7/8,v2] move all the extra definition out of share code",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "08b466e6e6051caf9487ede09f3ef1b6b971a599",
    "submitter": {
        "id": 276,
        "url": "http://patches.dpdk.org/api/people/276/?format=api",
        "name": "Zhe Tao",
        "email": "zhe.tao@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1446202336-8723-8-git-send-email-zhe.tao@intel.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/8351/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/8351/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 EB4508E8E;\n\tFri, 30 Oct 2015 11:52:46 +0100 (CET)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby dpdk.org (Postfix) with ESMTP id CA2148E72\n\tfor <dev@dpdk.org>; Fri, 30 Oct 2015 11:52:41 +0100 (CET)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby orsmga102.jf.intel.com with ESMTP; 30 Oct 2015 03:52:40 -0700",
            "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby FMSMGA003.fm.intel.com with ESMTP; 30 Oct 2015 03:52:40 -0700",
            "from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com\n\t[10.239.29.89])\n\tby shvmail01.sh.intel.com with ESMTP id t9UAqb2v012299;\n\tFri, 30 Oct 2015 18:52:37 +0800",
            "from shecgisg004.sh.intel.com (localhost [127.0.0.1])\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP\n\tid t9UAqYvx008866; Fri, 30 Oct 2015 18:52:36 +0800",
            "(from zhetao@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t9UAqY17008862; \n\tFri, 30 Oct 2015 18:52:34 +0800"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.20,217,1444719600\"; d=\"scan'208\";a=\"590946596\"",
        "From": "Zhe Tao <zhe.tao@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Fri, 30 Oct 2015 18:52:15 +0800",
        "Message-Id": "<1446202336-8723-8-git-send-email-zhe.tao@intel.com>",
        "X-Mailer": "git-send-email 1.7.4.1",
        "In-Reply-To": "<1446202336-8723-1-git-send-email-zhe.tao@intel.com>",
        "References": "<1443373527-28948-1-git-send-email-zhe.tao@intel.com>\n\t<1446202336-8723-1-git-send-email-zhe.tao@intel.com>",
        "Subject": "[dpdk-dev] [PATCH 7/8 v2] move all the extra definition out of\n\tshare code",
        "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": "move all the exta definition out of share code\n\nSigned-off-by: Zhe Tao <zhe.tao@intel.com>\n---\n drivers/net/i40e/base/i40e_type.h | 13 -------------\n drivers/net/i40e/i40e_ethdev.c    | 11 ++++++-----\n drivers/net/i40e/i40e_ethdev.h    |  6 ++++++\n drivers/net/i40e/i40e_ethdev_vf.c | 11 ++++++-----\n drivers/net/i40e/i40e_rxtx.c      | 39 ++++++++++++++++++++++-----------------\n drivers/net/i40e/i40e_rxtx.h      |  8 ++++++++\n 6 files changed, 48 insertions(+), 40 deletions(-)",
    "diff": "diff --git a/drivers/net/i40e/base/i40e_type.h b/drivers/net/i40e/base/i40e_type.h\nindex 9491f94..6ee398e 100644\n--- a/drivers/net/i40e/base/i40e_type.h\n+++ b/drivers/net/i40e/base/i40e_type.h\n@@ -113,11 +113,6 @@ typedef void (*I40E_ADMINQ_CALLBACK)(struct i40e_hw *, struct i40e_aq_desc *);\n #define I40E_HI_BYTE(x)\t\t((u8)(((x) >> 8) & 0xFF))\n #define I40E_LO_BYTE(x)\t\t((u8)((x) & 0xFF))\n \n-#undef container_of\n-#define container_of(ptr, type, member) ({ \\\n-\t\ttypeof(((type *)0)->member)(*__mptr) = (ptr); \\\n-\t\t(type *)((char *)__mptr - offsetof(type, member)); })\n-\n /* Number of Transmit Descriptors must be a multiple of 8. */\n #define I40E_REQ_TX_DESCRIPTOR_MULTIPLE\t8\n /* Number of Receive Descriptors must be a multiple of 32 if\n@@ -568,11 +563,6 @@ struct i40e_hw {\n \n \t/* debug mask */\n \tu32 debug_mask;\n-\n-\tbool rx_bulk_alloc_allowed;\n-\tbool rx_vec_allowed;\n-\tbool tx_simple_allowed;\n-\tbool tx_vec_allowed;\n };\n \n static inline bool i40e_is_vf(struct i40e_hw *hw)\n@@ -979,9 +969,6 @@ enum i40e_tx_desc_cmd_bits {\n #define I40E_TXD_QW1_OFFSET_MASK\t(0x3FFFFULL << \\\n \t\t\t\t\t I40E_TXD_QW1_OFFSET_SHIFT)\n \n-#define I40E_TD_CMD (I40E_TX_DESC_CMD_ICRC |\\\n-\t\t     I40E_TX_DESC_CMD_EOP)\n-\n enum i40e_tx_desc_length_fields {\n \t/* Note: These are predefined bit offsets */\n \tI40E_TX_DESC_LENGTH_MACLEN_SHIFT\t= 0, /* 7 BITS */\ndiff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c\nindex e241f66..153be45 100644\n--- a/drivers/net/i40e/i40e_ethdev.c\n+++ b/drivers/net/i40e/i40e_ethdev.c\n@@ -670,18 +670,19 @@ eth_i40e_dev_uninit(struct rte_eth_dev *dev)\n static int\n i40e_dev_configure(struct rte_eth_dev *dev)\n {\n+\tstruct i40e_adapter *ad =\n+\t\tI40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);\n \tstruct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);\n-\tstruct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n \tenum rte_eth_rx_mq_mode mq_mode = dev->data->dev_conf.rxmode.mq_mode;\n \tint ret;\n \n \t/* Initialize to TRUE. If any of Rx queues doesn't meet the\n \t * bulk allocation or vector Rx preconditions we will reset it.\n \t */\n-\thw->rx_bulk_alloc_allowed = true;\n-\thw->rx_vec_allowed = true;\n-\thw->tx_simple_allowed = true;\n-\thw->tx_vec_allowed = true;\n+\tad->rx_bulk_alloc_allowed = true;\n+\tad->rx_vec_allowed = true;\n+\tad->tx_simple_allowed = true;\n+\tad->tx_vec_allowed = true;\n \n \tif (dev->data->dev_conf.fdir_conf.mode == RTE_FDIR_MODE_PERFECT) {\n \t\tret = i40e_fdir_setup(pf);\ndiff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h\nindex 6185657..ab78c54 100644\n--- a/drivers/net/i40e/i40e_ethdev.h\n+++ b/drivers/net/i40e/i40e_ethdev.h\n@@ -462,6 +462,12 @@ struct i40e_adapter {\n \t\tstruct i40e_pf pf;\n \t\tstruct i40e_vf vf;\n \t};\n+\n+\t/* for vector PMD */\n+\tbool rx_bulk_alloc_allowed;\n+\tbool rx_vec_allowed;\n+\tbool tx_simple_allowed;\n+\tbool tx_vec_allowed;\n };\n \n int i40e_dev_switch_queues(struct i40e_pf *pf, bool on);\ndiff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c\nindex bdea8f0..b8ebacb 100644\n--- a/drivers/net/i40e/i40e_ethdev_vf.c\n+++ b/drivers/net/i40e/i40e_ethdev_vf.c\n@@ -1277,15 +1277,16 @@ PMD_REGISTER_DRIVER(rte_i40evf_driver);\n static int\n i40evf_dev_configure(struct rte_eth_dev *dev)\n {\n-\tstruct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\tstruct i40e_adapter *ad =\n+\t\tI40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);\n \n \t/* Initialize to TRUE. If any of Rx queues doesn't meet the bulk\n \t * allocation or vector Rx preconditions we will reset it.\n \t */\n-\thw->rx_bulk_alloc_allowed = true;\n-\thw->rx_vec_allowed = true;\n-\thw->tx_simple_allowed = true;\n-\thw->tx_vec_allowed = true;\n+\tad->rx_bulk_alloc_allowed = true;\n+\tad->rx_vec_allowed = true;\n+\tad->tx_simple_allowed = true;\n+\tad->tx_vec_allowed = true;\n \n \treturn i40evf_init_vlan(dev);\n }\ndiff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c\nindex 71f601f..8731712 100644\n--- a/drivers/net/i40e/i40e_rxtx.c\n+++ b/drivers/net/i40e/i40e_rxtx.c\n@@ -2105,6 +2105,8 @@ i40e_dev_rx_queue_setup(struct rte_eth_dev *dev,\n \tstruct i40e_vsi *vsi;\n \tstruct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n \tstruct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);\n+\tstruct i40e_adapter *ad =\n+\t\tI40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);\n \tstruct i40e_rx_queue *rxq;\n \tconst struct rte_memzone *rz;\n \tuint32_t ring_size;\n@@ -2226,7 +2228,7 @@ i40e_dev_rx_queue_setup(struct rte_eth_dev *dev,\n \t\t\t     \"or RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC is \"\n \t\t\t     \"not enabled on port=%d, queue=%d.\",\n \t\t\t     rxq->port_id, rxq->queue_id);\n-\t\thw->rx_bulk_alloc_allowed = false;\n+\t\tad->rx_bulk_alloc_allowed = false;\n \t}\n \n \treturn 0;\n@@ -3064,27 +3066,28 @@ i40e_fdir_setup_rx_resources(struct i40e_pf *pf)\n void __attribute__((cold))\n i40e_set_rx_function(struct rte_eth_dev *dev)\n {\n-\tstruct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\tstruct i40e_adapter *ad =\n+\t\tI40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);\n \tuint16_t rx_using_sse, i;\n \t/* In order to allow Vector Rx there are a few configuration\n \t * conditions to be met and Rx Bulk Allocation should be allowed.\n \t */\n \tif (rte_eal_process_type() == RTE_PROC_PRIMARY) {\n \t\tif (i40e_rx_vec_dev_conf_condition_check(dev) ||\n-\t\t    !hw->rx_bulk_alloc_allowed) {\n+\t\t    !ad->rx_bulk_alloc_allowed) {\n \t\t\tPMD_INIT_LOG(DEBUG, \"Port[%d] doesn't meet\"\n \t\t\t\t     \" Vector Rx preconditions\",\n \t\t\t\t     dev->data->port_id);\n \n-\t\t\thw->rx_vec_allowed = false;\n+\t\t\tad->rx_vec_allowed = false;\n \t\t}\n-\t\tif (hw->rx_vec_allowed) {\n+\t\tif (ad->rx_vec_allowed) {\n \t\t\tfor (i = 0; i < dev->data->nb_rx_queues; i++) {\n \t\t\t\tstruct i40e_rx_queue *rxq =\n \t\t\t\t\tdev->data->rx_queues[i];\n \n \t\t\t\tif (i40e_rxq_vec_setup(rxq)) {\n-\t\t\t\t\thw->rx_vec_allowed = false;\n+\t\t\t\t\tad->rx_vec_allowed = false;\n \t\t\t\t\tbreak;\n \t\t\t\t}\n \t\t\t}\n@@ -3095,7 +3098,7 @@ i40e_set_rx_function(struct rte_eth_dev *dev)\n \t\t/* Set the non-LRO scattered callback: there are Vector and\n \t\t * single allocation versions.\n \t\t */\n-\t\tif (hw->rx_vec_allowed) {\n+\t\tif (ad->rx_vec_allowed) {\n \t\t\tPMD_INIT_LOG(DEBUG, \"Using Vector Scattered Rx \"\n \t\t\t\t\t    \"callback (port=%d).\",\n \t\t\t\t     dev->data->port_id);\n@@ -3113,14 +3116,14 @@ i40e_set_rx_function(struct rte_eth_dev *dev)\n \t *    - Bulk Allocation\n \t *    - Single buffer allocation (the simplest one)\n \t */\n-\t} else if (hw->rx_vec_allowed) {\n+\t} else if (ad->rx_vec_allowed) {\n \t\tPMD_INIT_LOG(DEBUG, \"Vector rx enabled, please make sure RX \"\n \t\t\t\t    \"burst size no less than %d (port=%d).\",\n \t\t\t     RTE_I40E_DESCS_PER_LOOP,\n \t\t\t     dev->data->port_id);\n \n \t\tdev->rx_pkt_burst = i40e_recv_pkts_vec;\n-\t} else if (hw->rx_bulk_alloc_allowed) {\n+\t} else if (ad->rx_bulk_alloc_allowed) {\n \t\tPMD_INIT_LOG(DEBUG, \"Rx Burst Bulk Alloc Preconditions are \"\n \t\t\t\t    \"satisfied. Rx Burst Bulk Alloc function \"\n \t\t\t\t    \"will be used on port=%d.\",\n@@ -3153,7 +3156,8 @@ i40e_set_rx_function(struct rte_eth_dev *dev)\n void __attribute__((cold))\n i40e_set_tx_function_flag(struct rte_eth_dev *dev, struct i40e_tx_queue *txq)\n {\n-\tstruct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\tstruct i40e_adapter *ad =\n+\t\tI40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);\n \n \t/* Use a simple Tx queue (no offloads, no multi segs) if possible */\n \tif (((txq->txq_flags & I40E_SIMPLE_FLAGS) == I40E_SIMPLE_FLAGS)\n@@ -3163,35 +3167,36 @@ i40e_set_tx_function_flag(struct rte_eth_dev *dev, struct i40e_tx_queue *txq)\n \t\t\t\t     \" can be enabled on this txq.\");\n \n \t\t} else {\n-\t\t\thw->tx_vec_allowed = false;\n+\t\t\tad->tx_vec_allowed = false;\n \t\t}\n \t} else {\n-\t\thw->tx_simple_allowed = false;\n+\t\tad->tx_simple_allowed = false;\n \t}\n }\n \n void __attribute__((cold))\n i40e_set_tx_function(struct rte_eth_dev *dev)\n {\n-\tstruct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\tstruct i40e_adapter *ad =\n+\t\tI40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);\n \tint i;\n \n \tif (rte_eal_process_type() == RTE_PROC_PRIMARY) {\n-\t\tif (hw->tx_vec_allowed) {\n+\t\tif (ad->tx_vec_allowed) {\n \t\t\tfor (i = 0; i < dev->data->nb_tx_queues; i++) {\n \t\t\t\tstruct i40e_tx_queue *txq =\n \t\t\t\t\tdev->data->tx_queues[i];\n \n \t\t\t\tif (i40e_txq_vec_setup(txq)) {\n-\t\t\t\t\thw->tx_vec_allowed = false;\n+\t\t\t\t\tad->tx_vec_allowed = false;\n \t\t\t\t\tbreak;\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}\n \n-\tif (hw->tx_simple_allowed) {\n-\t\tif (hw->tx_vec_allowed) {\n+\tif (ad->tx_simple_allowed) {\n+\t\tif (ad->tx_vec_allowed) {\n \t\t\tPMD_INIT_LOG(DEBUG, \"Vector tx finally be used.\");\n \t\t\tdev->tx_pkt_burst = i40e_xmit_pkts_vec;\n \t\t} else {\ndiff --git a/drivers/net/i40e/i40e_rxtx.h b/drivers/net/i40e/i40e_rxtx.h\nindex dc575fd..39cb95a 100644\n--- a/drivers/net/i40e/i40e_rxtx.h\n+++ b/drivers/net/i40e/i40e_rxtx.h\n@@ -57,6 +57,14 @@\n #define I40E_RXBUF_SZ_1024 1024\n #define I40E_RXBUF_SZ_2048 2048\n \n+#undef container_of\n+#define container_of(ptr, type, member) ({ \\\n+\t\ttypeof(((type *)0)->member)(*__mptr) = (ptr); \\\n+\t\t(type *)((char *)__mptr - offsetof(type, member)); })\n+\n+#define I40E_TD_CMD (I40E_TX_DESC_CMD_ICRC |\\\n+\t\t     I40E_TX_DESC_CMD_EOP)\n+\n enum i40e_header_split_mode {\n \ti40e_header_split_none = 0,\n \ti40e_header_split_enabled = 1,\n",
    "prefixes": [
        "dpdk-dev",
        "7/8",
        "v2"
    ]
}