get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 8347,
    "url": "http://patches.dpdk.org/api/patches/8347/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1446202336-8723-5-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-5-git-send-email-zhe.tao@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1446202336-8723-5-git-send-email-zhe.tao@intel.com",
    "date": "2015-10-30T10:52:12",
    "name": "[dpdk-dev,4/8,v2] add RX and TX selection function for FVL",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "759d458c815870ecf538dcce46f9f599633030cf",
    "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-5-git-send-email-zhe.tao@intel.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/8347/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/8347/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 7D93A8E65;\n\tFri, 30 Oct 2015 11:52:41 +0100 (CET)",
            "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby dpdk.org (Postfix) with ESMTP id 09AE78E68\n\tfor <dev@dpdk.org>; Fri, 30 Oct 2015 11:52:38 +0100 (CET)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby orsmga101.jf.intel.com with ESMTP; 30 Oct 2015 03:52:36 -0700",
            "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby orsmga002.jf.intel.com with ESMTP; 30 Oct 2015 03:52:34 -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 t9UAqUaO012288;\n\tFri, 30 Oct 2015 18:52:30 +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 t9UAqRdj008845; Fri, 30 Oct 2015 18:52:29 +0800",
            "(from zhetao@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t9UAqRkV008841; \n\tFri, 30 Oct 2015 18:52:27 +0800"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.20,217,1444719600\"; d=\"scan'208\";a=\"838757603\"",
        "From": "Zhe Tao <zhe.tao@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Fri, 30 Oct 2015 18:52:12 +0800",
        "Message-Id": "<1446202336-8723-5-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 4/8 v2] add RX and TX selection function for FVL",
        "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": "To support FVL PMD can select which RX and TX function should be used\naccording to the queue config.\n\nSigned-off-by: Zhe Tao <zhe.tao@intel.com>\n---\n drivers/net/i40e/base/i40e_type.h |  10 +++\n drivers/net/i40e/i40e_ethdev.c    |  19 +++-\n drivers/net/i40e/i40e_ethdev_vf.c |  27 ++++--\n drivers/net/i40e/i40e_rxtx.c      | 177 +++++++++++++++++++++++++++++++++++---\n drivers/net/i40e/i40e_rxtx.h      |   6 ++\n drivers/net/i40e/i40e_rxtx_vec.c  |  32 +++++++\n 6 files changed, 251 insertions(+), 20 deletions(-)",
    "diff": "diff --git a/drivers/net/i40e/base/i40e_type.h b/drivers/net/i40e/base/i40e_type.h\nindex 2720177..9491f94 100644\n--- a/drivers/net/i40e/base/i40e_type.h\n+++ b/drivers/net/i40e/base/i40e_type.h\n@@ -113,6 +113,11 @@ 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@@ -563,6 +568,11 @@ 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)\ndiff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c\nindex 2dd9fdc..e241f66 100644\n--- a/drivers/net/i40e/i40e_ethdev.c\n+++ b/drivers/net/i40e/i40e_ethdev.c\n@@ -403,8 +403,8 @@ eth_i40e_dev_init(struct rte_eth_dev *dev)\n \t * has already done this work. Only check we don't need a different\n \t * RX function */\n \tif (rte_eal_process_type() != RTE_PROC_PRIMARY){\n-\t\tif (dev->data->scattered_rx)\n-\t\t\tdev->rx_pkt_burst = i40e_recv_scattered_pkts;\n+\t\ti40e_set_rx_function(dev);\n+\t\ti40e_set_tx_function(dev);\n \t\treturn 0;\n \t}\n \tpci_dev = dev->pci_dev;\n@@ -671,9 +671,18 @@ static int\n i40e_dev_configure(struct rte_eth_dev *dev)\n {\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+\n \tif (dev->data->dev_conf.fdir_conf.mode == RTE_FDIR_MODE_PERFECT) {\n \t\tret = i40e_fdir_setup(pf);\n \t\tif (ret != I40E_SUCCESS) {\n@@ -3707,6 +3716,9 @@ i40e_dev_tx_init(struct i40e_pf *pf)\n \t\tif (ret != I40E_SUCCESS)\n \t\t\tbreak;\n \t}\n+\tif (ret == I40E_SUCCESS)\n+\t\ti40e_set_tx_function(container_of(pf, struct i40e_adapter, pf)\n+\t\t\t\t     ->eth_dev);\n \n \treturn ret;\n }\n@@ -3733,6 +3745,9 @@ i40e_dev_rx_init(struct i40e_pf *pf)\n \t\t\tbreak;\n \t\t}\n \t}\n+\tif (ret == I40E_SUCCESS)\n+\t\ti40e_set_rx_function(container_of(pf, struct i40e_adapter, pf)\n+\t\t\t\t     ->eth_dev);\n \n \treturn ret;\n }\ndiff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c\nindex b694400..bdea8f0 100644\n--- a/drivers/net/i40e/i40e_ethdev_vf.c\n+++ b/drivers/net/i40e/i40e_ethdev_vf.c\n@@ -1182,8 +1182,8 @@ i40evf_dev_init(struct rte_eth_dev *eth_dev)\n \t * has already done this work.\n \t */\n \tif (rte_eal_process_type() != RTE_PROC_PRIMARY){\n-\t\tif (eth_dev->data->scattered_rx)\n-\t\t\teth_dev->rx_pkt_burst = i40e_recv_scattered_pkts;\n+\t\ti40e_set_rx_function(eth_dev);\n+\t\ti40e_set_tx_function(eth_dev);\n \t\treturn 0;\n \t}\n \n@@ -1277,6 +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+\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+\n \treturn i40evf_init_vlan(dev);\n }\n \n@@ -1508,7 +1518,6 @@ i40evf_rxq_init(struct rte_eth_dev *dev, struct i40e_rx_queue *rxq)\n \tif (dev_data->dev_conf.rxmode.enable_scatter ||\n \t    (rxq->max_pkt_len + 2 * I40E_VLAN_TAG_SIZE) > buf_size) {\n \t\tdev_data->scattered_rx = 1;\n-\t\tdev->rx_pkt_burst = i40e_recv_scattered_pkts;\n \t}\n \n \treturn 0;\n@@ -1519,6 +1528,7 @@ i40evf_rx_init(struct rte_eth_dev *dev)\n {\n \tstruct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);\n \tuint16_t i;\n+\tint ret = I40E_SUCCESS;\n \tstruct i40e_rx_queue **rxq =\n \t\t(struct i40e_rx_queue **)dev->data->rx_queues;\n \n@@ -1526,11 +1536,14 @@ i40evf_rx_init(struct rte_eth_dev *dev)\n \tfor (i = 0; i < dev->data->nb_rx_queues; i++) {\n \t\tif (!rxq[i] || !rxq[i]->q_set)\n \t\t\tcontinue;\n-\t\tif (i40evf_rxq_init(dev, rxq[i]) < 0)\n-\t\t\treturn -EFAULT;\n+\t\tret = i40evf_rxq_init(dev, rxq[i]);\n+\t\tif (ret != I40E_SUCCESS)\n+\t\t\tbreak;\n \t}\n+\tif (ret == I40E_SUCCESS)\n+\t\ti40e_set_rx_function(dev);\n \n-\treturn 0;\n+\treturn ret;\n }\n \n static void\n@@ -1543,6 +1556,8 @@ i40evf_tx_init(struct rte_eth_dev *dev)\n \n \tfor (i = 0; i < dev->data->nb_tx_queues; i++)\n \t\ttxq[i]->qtx_tail = hw->hw_addr + I40E_QTX_TAIL1(i);\n+\n+\ti40e_set_tx_function(dev);\n }\n \n static inline void\ndiff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c\nindex d37cbde..71f601f 100644\n--- a/drivers/net/i40e/i40e_rxtx.c\n+++ b/drivers/net/i40e/i40e_rxtx.c\n@@ -2213,13 +2213,12 @@ i40e_dev_rx_queue_setup(struct rte_eth_dev *dev,\n \n \tuse_def_burst_func = check_rx_burst_bulk_alloc_preconditions(rxq);\n \n-\tif (!use_def_burst_func && !dev->data->scattered_rx) {\n+\tif (!use_def_burst_func) {\n #ifdef RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC\n \t\tPMD_INIT_LOG(DEBUG, \"Rx Burst Bulk Alloc Preconditions are \"\n \t\t\t     \"satisfied. Rx Burst Bulk Alloc function will be \"\n \t\t\t     \"used on port=%d, queue=%d.\",\n \t\t\t     rxq->port_id, rxq->queue_id);\n-\t\tdev->rx_pkt_burst = i40e_recv_pkts_bulk_alloc;\n #endif /* RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC */\n \t} else {\n \t\tPMD_INIT_LOG(DEBUG, \"Rx Burst Bulk Alloc Preconditions are \"\n@@ -2227,6 +2226,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}\n \n \treturn 0;\n@@ -2488,14 +2488,7 @@ i40e_dev_tx_queue_setup(struct rte_eth_dev *dev,\n \tdev->data->tx_queues[queue_idx] = txq;\n \n \t/* Use a simple TX queue without offloads or multi segs if possible */\n-\tif (((txq->txq_flags & I40E_SIMPLE_FLAGS) == I40E_SIMPLE_FLAGS) &&\n-\t\t\t\t(txq->tx_rs_thresh >= I40E_TX_MAX_BURST)) {\n-\t\tPMD_INIT_LOG(INFO, \"Using simple tx path\");\n-\t\tdev->tx_pkt_burst = i40e_xmit_pkts_simple;\n-\t} else {\n-\t\tPMD_INIT_LOG(INFO, \"Using full-featured tx path\");\n-\t\tdev->tx_pkt_burst = i40e_xmit_pkts;\n-\t}\n+\ti40e_set_tx_function_flag(dev, txq);\n \n \treturn 0;\n }\n@@ -2564,6 +2557,12 @@ i40e_rx_queue_release_mbufs(struct i40e_rx_queue *rxq)\n {\n \tuint16_t i;\n \n+\t/* SSE Vector driver has a different way of releasing mbufs. */\n+\tif (rxq->rx_using_sse) {\n+\t\ti40e_rx_queue_release_mbufs_vec(rxq);\n+\t\treturn;\n+\t}\n+\n \tif (!rxq || !rxq->sw_ring) {\n \t\tPMD_DRV_LOG(DEBUG, \"Pointer to rxq or sw_ring is NULL\");\n \t\treturn;\n@@ -2837,7 +2836,6 @@ i40e_rx_queue_init(struct i40e_rx_queue *rxq)\n \tint err = I40E_SUCCESS;\n \tstruct i40e_hw *hw = I40E_VSI_TO_HW(rxq->vsi);\n \tstruct rte_eth_dev_data *dev_data = I40E_VSI_TO_DEV_DATA(rxq->vsi);\n-\tstruct rte_eth_dev *dev = I40E_VSI_TO_ETH_DEV(rxq->vsi);\n \tuint16_t pf_q = rxq->reg_idx;\n \tuint16_t buf_size;\n \tstruct i40e_hmc_obj_rxq rx_ctx;\n@@ -2893,7 +2891,6 @@ i40e_rx_queue_init(struct i40e_rx_queue *rxq)\n \t/* Check if scattered RX needs to be used. */\n \tif ((rxq->max_pkt_len + 2 * I40E_VLAN_TAG_SIZE) > buf_size) {\n \t\tdev_data->scattered_rx = 1;\n-\t\tdev->rx_pkt_burst = i40e_recv_scattered_pkts;\n \t}\n \n \t/* Init the RX tail regieter. */\n@@ -3064,7 +3061,156 @@ i40e_fdir_setup_rx_resources(struct i40e_pf *pf)\n \treturn I40E_SUCCESS;\n }\n \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+\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\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}\n+\t\tif (hw->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\tbreak;\n+\t\t\t\t}\n+\t\t\t}\n+\t\t}\n+\t}\n+\n+\tif (dev->data->scattered_rx) {\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\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+\n+\t\t\tdev->rx_pkt_burst = i40e_recv_scattered_pkts_vec;\n+\t\t} else {\n+\t\t\tPMD_INIT_LOG(DEBUG, \"Using a Scattered with bulk \"\n+\t\t\t\t\t   \"allocation callback (port=%d).\",\n+\t\t\t\t     dev->data->port_id);\n+\t\t\tdev->rx_pkt_burst = i40e_recv_scattered_pkts;\n+\t\t}\n+\t/* If parameters allow we are going to choose between the following\n+\t * callbacks:\n+\t *    - Vector\n+\t *    - Bulk Allocation\n+\t *    - Single buffer allocation (the simplest one)\n+\t */\n+\t} else if (hw->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\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+\t\t\t     dev->data->port_id);\n+\n+\t\tdev->rx_pkt_burst = i40e_recv_pkts_bulk_alloc;\n+\t} else {\n+\t\tPMD_INIT_LOG(DEBUG, \"Rx Burst Bulk Alloc Preconditions are not \"\n+\t\t\t\t    \"satisfied, or Scattered Rx is requested \"\n+\t\t\t\t    \"(port=%d).\",\n+\t\t\t     dev->data->port_id);\n+\n+\t\tdev->rx_pkt_burst = i40e_recv_pkts;\n+\t}\n+\n+\t/* Propagate information about RX function choice through all queues. */\n+\tif (rte_eal_process_type() == RTE_PROC_PRIMARY) {\n+\t\trx_using_sse =\n+\t\t\t(dev->rx_pkt_burst == i40e_recv_scattered_pkts_vec ||\n+\t\t\t dev->rx_pkt_burst == i40e_recv_pkts_vec);\n+\n+\t\tfor (i = 0; i < dev->data->nb_rx_queues; i++) {\n+\t\t\tstruct i40e_rx_queue *rxq = dev->data->rx_queues[i];\n+\n+\t\t\trxq->rx_using_sse = rx_using_sse;\n+\t\t}\n+\t}\n+}\n+\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+\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+\t\t\t&& (txq->tx_rs_thresh >= RTE_PMD_I40E_TX_MAX_BURST)) {\n+\t\tif (txq->tx_rs_thresh <= RTE_I40E_TX_MAX_FREE_BUF_SZ) {\n+\t\t\tPMD_INIT_LOG(DEBUG, \"Vector tx\"\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}\n+\t} else {\n+\t\thw->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+\tint i;\n+\n+\tif (rte_eal_process_type() == RTE_PROC_PRIMARY) {\n+\t\tif (hw->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\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+\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 {\n+\t\t\tPMD_INIT_LOG(DEBUG, \"Simple tx finally be used.\");\n+\t\t\tdev->tx_pkt_burst = i40e_xmit_pkts_simple;\n+\t\t}\n+\t} else {\n+\t\tPMD_INIT_LOG(DEBUG, \"Xmit tx finally be used.\");\n+\t\tdev->tx_pkt_burst = i40e_xmit_pkts;\n+\t}\n+}\n+\n /* Stubs needed for linkage when CONFIG_RTE_I40E_INC_VECTOR is set to 'n' */\n+int __attribute__((weak))\n+i40e_rx_vec_dev_conf_condition_check(struct rte_eth_dev __rte_unused *dev)\n+{\n+\treturn -1;\n+}\n+\n uint16_t __attribute__((weak))\n i40e_recv_pkts_vec(\n \tvoid __rte_unused *rx_queue,\n@@ -3089,6 +3235,12 @@ i40e_rxq_vec_setup(struct i40e_rx_queue __rte_unused *rxq)\n \treturn -1;\n }\n \n+int __attribute__((weak))\n+i40e_txq_vec_setup(struct i40e_tx_queue __rte_unused *txq)\n+{\n+\treturn -1;\n+}\n+\n void __attribute__((weak))\n i40e_rx_queue_release_mbufs_vec(struct i40e_rx_queue __rte_unused*rxq)\n {\n@@ -3102,3 +3254,4 @@ i40e_xmit_pkts_vec(void __rte_unused *tx_queue,\n {\n \treturn 0;\n }\n+\ndiff --git a/drivers/net/i40e/i40e_rxtx.h b/drivers/net/i40e/i40e_rxtx.h\nindex 8d4f53a..dc575fd 100644\n--- a/drivers/net/i40e/i40e_rxtx.h\n+++ b/drivers/net/i40e/i40e_rxtx.h\n@@ -124,6 +124,7 @@ struct i40e_rx_queue {\n \tuint8_t hs_mode; /* Header Split mode */\n \tbool q_set; /**< indicate if rx queue has been configured */\n \tbool rx_deferred_start; /**< don't start this queue in dev start */\n+\tuint16_t rx_using_sse; /**<flag indicate the usage of vPMD for rx */\n };\n \n struct i40e_tx_entry {\n@@ -226,10 +227,15 @@ uint16_t i40e_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts,\n uint16_t i40e_recv_scattered_pkts_vec(void *rx_queue,\n \t\t\t\t      struct rte_mbuf **rx_pkts,\n \t\t\t\t      uint16_t nb_pkts);\n+int i40e_rx_vec_dev_conf_condition_check(struct rte_eth_dev *dev);\n int i40e_rxq_vec_setup(struct i40e_rx_queue *rxq);\n int i40e_txq_vec_setup(struct i40e_tx_queue *txq);\n void i40e_rx_queue_release_mbufs_vec(struct i40e_rx_queue *rxq);\n uint16_t i40e_xmit_pkts_vec(void *tx_queue, struct rte_mbuf **tx_pkts,\n \t\t\t    uint16_t nb_pkts);\n+void i40e_set_rx_function(struct rte_eth_dev *dev);\n+void i40e_set_tx_function_flag(struct rte_eth_dev *dev,\n+\t\t\t       struct i40e_tx_queue *txq);\n+void i40e_set_tx_function(struct rte_eth_dev *dev);\n \n #endif /* _I40E_RXTX_H_ */\ndiff --git a/drivers/net/i40e/i40e_rxtx_vec.c b/drivers/net/i40e/i40e_rxtx_vec.c\nindex 86a84af..b2993e9 100644\n--- a/drivers/net/i40e/i40e_rxtx_vec.c\n+++ b/drivers/net/i40e/i40e_rxtx_vec.c\n@@ -747,3 +747,35 @@ i40e_txq_vec_setup(struct i40e_tx_queue __rte_unused *txq)\n {\n \treturn 0;\n }\n+\n+int __attribute__((cold))\n+i40e_rx_vec_dev_conf_condition_check(struct rte_eth_dev *dev)\n+{\n+#ifndef RTE_LIBRTE_IEEE1588\n+\tstruct rte_eth_rxmode *rxmode = &dev->data->dev_conf.rxmode;\n+\tstruct rte_fdir_conf *fconf = &dev->data->dev_conf.fdir_conf;\n+\n+#ifndef RTE_LIBRTE_I40E_RX_OLFLAGS_ENABLE\n+\t/* whithout rx ol_flags, no VP flag report */\n+\tif (rxmode->hw_vlan_strip != 0 ||\n+\t    rxmode->hw_vlan_extend != 0)\n+\t\treturn -1;\n+#endif\n+\n+\t/* no fdir support */\n+\tif (fconf->mode != RTE_FDIR_MODE_NONE)\n+\t\treturn -1;\n+\n+\t /* - no csum error report support\n+\t * - no header split support\n+\t */\n+\tif (rxmode->hw_ip_checksum == 1 ||\n+\t    rxmode->header_split == 1)\n+\t\treturn -1;\n+\n+\treturn 0;\n+#else\n+\tRTE_SET_USED(dev);\n+\treturn -1;\n+#endif\n+}\n",
    "prefixes": [
        "dpdk-dev",
        "4/8",
        "v2"
    ]
}