Show a patch.

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

{
    "id": 137,
    "url": "https://patches.dpdk.org/api/patches/137/",
    "web_url": "https://patches.dpdk.org/patch/137/",
    "project": {
        "id": 1,
        "url": "https://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": "<1407789890-17355-12-git-send-email-bruce.richardson@intel.com>",
    "date": "2014-08-11T20:44:47",
    "name": "[dpdk-dev,RFC,11/14] ixgbe: make mbuf_initializer queue variable global",
    "commit_ref": "",
    "pull_url": "",
    "state": "rfc",
    "archived": true,
    "hash": "bebc5d704af93936252ac1765f129e07f23b866b",
    "submitter": {
        "id": 20,
        "url": "https://patches.dpdk.org/api/people/20/",
        "name": "Bruce Richardson",
        "email": "bruce.richardson@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/patch/137/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/137/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/137/checks/",
    "tags": {},
    "headers": {
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\r\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Date": "Mon, 11 Aug 2014 21:44:47 +0100",
        "In-Reply-To": "<1407789890-17355-1-git-send-email-bruce.richardson@intel.com>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "X-BeenThere": "dev@dpdk.org",
        "References": "<1407789890-17355-1-git-send-email-bruce.richardson@intel.com>",
        "X-Mailer": "git-send-email 1.7.0.7",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "To": "dev@dpdk.org",
        "Received": [
            "from mga03.intel.com (mga03.intel.com [143.182.124.21])\r\n\tby dpdk.org (Postfix) with ESMTP id 40322B377\r\n\tfor <dev@dpdk.org>; Mon, 11 Aug 2014 22:42:20 +0200 (CEST)",
            "from azsmga001.ch.intel.com ([10.2.17.19])\r\n\tby azsmga101.ch.intel.com with ESMTP; 11 Aug 2014 13:45:09 -0700",
            "from irvmail001.ir.intel.com ([163.33.26.43])\r\n\tby azsmga001.ch.intel.com with ESMTP; 11 Aug 2014 13:44:53 -0700",
            "from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com\r\n\t[10.237.217.46])\r\n\tby irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\r\n\ts7BKiqaA020966; Mon, 11 Aug 2014 21:44:52 +0100",
            "from sivswdev02.ir.intel.com (localhost [127.0.0.1])\r\n\tby sivswdev02.ir.intel.com with ESMTP id s7BKiqHK017716;\r\n\tMon, 11 Aug 2014 21:44:52 +0100",
            "(from bricha3@localhost)\r\n\tby sivswdev02.ir.intel.com with  id s7BKiq7f017712;\r\n\tMon, 11 Aug 2014 21:44:52 +0100"
        ],
        "From": "Bruce Richardson <bruce.richardson@intel.com>",
        "Precedence": "list",
        "X-ExtLoop1": "1",
        "Message-Id": "<1407789890-17355-12-git-send-email-bruce.richardson@intel.com>",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "Subject": "[dpdk-dev] [RFC PATCH 11/14] ixgbe: make mbuf_initializer queue\r\n\tvariable global",
        "X-List-Received-Date": "Mon, 11 Aug 2014 20:42:21 -0000",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\r\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "Return-Path": "<bricha3@ecsmtp.ir.intel.com>",
        "X-IronPort-AV": "E=Sophos;i=\"5.01,844,1400050800\"; d=\"scan'208\";a=\"467575644\"",
        "List-Post": "<mailto:dev@dpdk.org>",
        "X-Mailman-Version": "2.1.15"
    },
    "content": "On descriptor rearm, the mbuf_initializer variable can be used to do a\nsingle-shot write to an mbuf to initialize all variables that can be\nset. This is currently used only by vector PMD function, but now allow\nit to be generally used by other RX code paths.\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\n---\n lib/librte_pmd_ixgbe/ixgbe_rxtx.c     | 25 +++++++++++++++++++++++--\n lib/librte_pmd_ixgbe/ixgbe_rxtx.h     |  9 ++++++---\n lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c | 25 +------------------------\n 3 files changed, 30 insertions(+), 29 deletions(-)",
    "diff": "diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c\r\nindex f9cc352..fadb9a0 100644\r\n--- a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c\r\n+++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c\r\n@@ -90,6 +90,27 @@\r\n \t\tETH_RSS_IPV6_UDP | \\\r\n \t\tETH_RSS_IPV6_UDP_EX)\r\n \r\n+int\r\n+ixgbe_set_mbuf_initializer(struct igb_rx_queue *rxq)\r\n+{\r\n+\tstatic struct rte_mbuf mb_def = {\r\n+\t\t.buf_len = 0,\r\n+\t\t.data_len = 0,\r\n+\r\n+\t\t.data_off = RTE_PKTMBUF_HEADROOM,\r\n+#ifdef RTE_MBUF_REFCNT\r\n+\t\t.refcnt = 1,\r\n+#endif\r\n+\t\t.nb_segs = 1,\r\n+\t\t.port = 0\r\n+\t};\r\n+\r\n+\tmb_def.buf_len = rxq->mb_pool->elt_size - sizeof(struct rte_mbuf);\r\n+\tmb_def.port = rxq->port_id;\r\n+\trxq->mbuf_initializer = *((uint64_t *)&mb_def.rearm_data);\r\n+\treturn 0;\r\n+}\r\n+\r\n static inline struct rte_mbuf *\r\n rte_rxmbuf_alloc(struct rte_mempool *mp)\r\n {\r\n@@ -1878,7 +1899,7 @@ ixgbe_dev_tx_queue_setup(struct rte_eth_dev *dev,\r\n \t\tPMD_INIT_LOG(INFO, \"Using simple tx code path\\n\");\r\n #ifdef RTE_IXGBE_INC_VECTOR\r\n \t\tif (txq->tx_rs_thresh <= RTE_IXGBE_TX_MAX_FREE_BUF_SZ &&\r\n-\t\t    ixgbe_txq_vec_setup(txq, socket_id) == 0) {\r\n+\t\t    ixgbe_txq_vec_setup(txq) == 0) {\r\n \t\t\tPMD_INIT_LOG(INFO, \"Vector tx enabled.\\n\");\r\n \t\t\tdev->tx_pkt_burst = ixgbe_xmit_pkts_vec;\r\n \t\t}\r\n@@ -2169,7 +2190,6 @@ ixgbe_dev_rx_queue_setup(struct rte_eth_dev *dev,\r\n \t\tif (!ixgbe_rx_vec_condition_check(dev)) {\r\n \t\t\tPMD_INIT_LOG(INFO, \"Vector rx enabled, please make \"\r\n \t\t\t\t     \"sure RX burst size no less than 32.\\n\");\r\n-\t\t\tixgbe_rxq_vec_setup(rxq, socket_id);\r\n \t\t\tdev->rx_pkt_burst = ixgbe_recv_pkts_vec;\r\n \t\t}\r\n #endif\r\n@@ -2183,6 +2203,7 @@ ixgbe_dev_rx_queue_setup(struct rte_eth_dev *dev,\r\n \t}\r\n \tdev->data->rx_queues[queue_idx] = rxq;\r\n \r\n+\tixgbe_set_mbuf_initializer(rxq);\r\n \tixgbe_reset_rx_queue(rxq);\r\n \r\n \treturn 0;\r\ndiff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx.h b/lib/librte_pmd_ixgbe/ixgbe_rxtx.h\r\nindex d9889d9..76db3ca 100644\r\n--- a/lib/librte_pmd_ixgbe/ixgbe_rxtx.h\r\n+++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx.h\r\n@@ -107,6 +107,7 @@ struct igb_rx_queue {\r\n \tstruct igb_rx_entry *sw_ring; /**< address of RX software ring. */\r\n \tstruct rte_mbuf *pkt_first_seg; /**< First segment of current packet. */\r\n \tstruct rte_mbuf *pkt_last_seg; /**< Last segment of current packet. */\r\n+\tuint64_t            mbuf_initializer; /**< value to init mbufs */\r\n \tuint16_t            nb_rx_desc; /**< number of RX descriptors. */\r\n \tuint16_t            rx_tail;  /**< current value of RDT register. */\r\n \tuint16_t            nb_rx_hold; /**< number of held free RX desc. */\r\n@@ -118,7 +119,6 @@ struct igb_rx_queue {\r\n #ifdef RTE_IXGBE_INC_VECTOR\r\n \tuint16_t            rxrearm_nb; /**< the idx we start the re-arming from */\r\n \tuint16_t            rxrearm_start;  /**< number of remaining to be re-armed */\r\n-\tuint64_t            mbuf_initializer; /**< value to init mbufs */\r\n #endif\r\n \tuint16_t            rx_free_thresh; /**< max free RX desc to hold. */\r\n \tuint16_t            queue_id; /**< RX queue index. */\r\n@@ -226,9 +226,12 @@ struct ixgbe_txq_ops {\r\n #ifdef RTE_IXGBE_INC_VECTOR\r\n uint16_t ixgbe_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts);\r\n uint16_t ixgbe_xmit_pkts_vec(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts);\r\n-int ixgbe_txq_vec_setup(struct igb_tx_queue *txq, unsigned int socket_id);\r\n-int ixgbe_rxq_vec_setup(struct igb_rx_queue *rxq, unsigned int socket_id);\r\n+int ixgbe_txq_vec_setup(struct igb_tx_queue *txq);\r\n int ixgbe_rx_vec_condition_check(struct rte_eth_dev *dev);\r\n #endif\r\n \r\n+int\r\n+ixgbe_set_mbuf_initializer(struct igb_rx_queue *rxq);\r\n+\r\n+\r\n #endif\r\ndiff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c b/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c\r\nindex c98356e..39c06e2 100644\r\n--- a/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c\r\n+++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c\r\n@@ -45,28 +45,6 @@\r\n #endif\r\n \r\n \r\n-int\r\n-ixgbe_rxq_vec_setup(struct igb_rx_queue *rxq,\r\n-\t\t\t__rte_unused unsigned int socket_id)\r\n-{\r\n-\tstatic struct rte_mbuf mb_def = {\r\n-\t\t.buf_len = 0,\r\n-\t\t.data_len = 0,\r\n-\r\n-\t\t.data_off = RTE_PKTMBUF_HEADROOM,\r\n-#ifdef RTE_MBUF_REFCNT\r\n-\t\t.refcnt = 1,\r\n-#endif\r\n-\t\t.nb_segs = 1,\r\n-\t\t.port = 0\r\n-\t};\r\n-\r\n-\tmb_def.buf_len = rxq->mb_pool->elt_size - sizeof(struct rte_mbuf);\r\n-\tmb_def.port = rxq->port_id;\r\n-\trxq->mbuf_initializer = *((uint64_t *)&mb_def.rearm_data);\r\n-\treturn 0;\r\n-}\r\n-\r\n static inline void\r\n ixgbe_rxq_rearm(struct igb_rx_queue *rxq)\r\n {\r\n@@ -586,8 +564,7 @@ static struct ixgbe_txq_ops vec_txq_ops = {\r\n \t.reset = ixgbe_reset_tx_queue,\r\n };\r\n \r\n-int ixgbe_txq_vec_setup(struct igb_tx_queue *txq,\r\n-\t\t\tunsigned int socket_id __rte_unused)\r\n+int ixgbe_txq_vec_setup(struct igb_tx_queue *txq)\r\n {\r\n \tif (txq->sw_ring == NULL)\r\n \t\treturn -1;\r\n",
    "prefixes": [
        "dpdk-dev",
        "RFC",
        "11/14"
    ]
}