get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 8390,
    "url": "http://patches.dpdk.org/api/patches/8390/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1446210115-13927-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": "<1446210115-13927-5-git-send-email-zhe.tao@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1446210115-13927-5-git-send-email-zhe.tao@intel.com",
    "date": "2015-10-30T13:01:55",
    "name": "[dpdk-dev,4/4,v3] add RX and TX selection function for FVL",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "ca5fb552002c148350c722c373e7b5dd0262102a",
    "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/1446210115-13927-5-git-send-email-zhe.tao@intel.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/8390/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/8390/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 EE7278E9D;\n\tFri, 30 Oct 2015 14:02:50 +0100 (CET)",
            "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby dpdk.org (Postfix) with ESMTP id EBE148E71\n\tfor <dev@dpdk.org>; Fri, 30 Oct 2015 14:02:48 +0100 (CET)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby orsmga101.jf.intel.com with ESMTP; 30 Oct 2015 06:02:19 -0700",
            "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby fmsmga001.fm.intel.com with ESMTP; 30 Oct 2015 06:02:18 -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 t9UD2GLY031149;\n\tFri, 30 Oct 2015 21:02:16 +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 t9UD2DmW013998; Fri, 30 Oct 2015 21:02:16 +0800",
            "(from zhetao@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t9UD2DQD013994; \n\tFri, 30 Oct 2015 21:02:13 +0800"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.20,218,1444719600\"; d=\"scan'208\";a=\"823126325\"",
        "From": "Zhe Tao <zhe.tao@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Fri, 30 Oct 2015 21:01:55 +0800",
        "Message-Id": "<1446210115-13927-5-git-send-email-zhe.tao@intel.com>",
        "X-Mailer": "git-send-email 1.7.4.1",
        "In-Reply-To": "<1446210115-13927-1-git-send-email-zhe.tao@intel.com>",
        "References": "<1446202336-8723-1-git-send-email-zhe.tao@intel.com>\n\t<1446210115-13927-1-git-send-email-zhe.tao@intel.com>",
        "Subject": "[dpdk-dev] [PATCH 4/4 v3] 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 doc/guides/rel_notes/release_2_2.rst |   4 +\n drivers/net/i40e/i40e_ethdev.c       |  20 +++-\n drivers/net/i40e/i40e_ethdev.h       |   6 ++\n drivers/net/i40e/i40e_ethdev_vf.c    |  28 ++++--\n drivers/net/i40e/i40e_rxtx.c         | 182 ++++++++++++++++++++++++++++++++---\n drivers/net/i40e/i40e_rxtx.h         |   6 ++\n drivers/net/i40e/i40e_rxtx_vec.c     |  32 ++++++\n 7 files changed, 258 insertions(+), 20 deletions(-)",
    "diff": "diff --git a/doc/guides/rel_notes/release_2_2.rst b/doc/guides/rel_notes/release_2_2.rst\nindex bc9b00f..c78ceca 100644\n--- a/doc/guides/rel_notes/release_2_2.rst\n+++ b/doc/guides/rel_notes/release_2_2.rst\n@@ -39,6 +39,10 @@ Drivers\n   Fixed i40e issue that occurred when a DPDK application didn't initialize\n   ports if memory wasn't available on socket 0.\n \n+* **i40e: Add vector PMD support for FVL.**\n+\n+  Add vector RX/TX support for FVL\n+\n * **vhost: Fixed Qemu shutdown.**\n \n   Fixed issue with libvirt ``virsh destroy`` not killing the VM.\ndiff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c\nindex 2dd9fdc..153be45 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@@ -670,10 +670,20 @@ 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 \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+\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);\n \t\tif (ret != I40E_SUCCESS) {\n@@ -3707,6 +3717,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 +3746,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.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 b694400..b8ebacb 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,17 @@ PMD_REGISTER_DRIVER(rte_i40evf_driver);\n static int\n i40evf_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+\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+\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 }\n \n@@ -1508,7 +1519,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 +1529,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 +1537,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 +1557,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..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@@ -2213,13 +2215,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 +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\tad->rx_bulk_alloc_allowed = false;\n \t}\n \n \treturn 0;\n@@ -2488,14 +2490,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 +2559,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 +2838,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 +2893,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 +3063,159 @@ 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_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    !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\tad->rx_vec_allowed = false;\n+\t\t}\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\tad->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 (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+\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 (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 (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+\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_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+\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\tad->tx_vec_allowed = false;\n+\t\t}\n+\t} else {\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_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 (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\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 (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 {\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 +3240,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 +3259,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 98d6e90..39cb95a 100644\n--- a/drivers/net/i40e/i40e_rxtx.h\n+++ b/drivers/net/i40e/i40e_rxtx.h\n@@ -132,6 +132,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@@ -234,10 +235,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 50eafef..f5b2db6 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/4",
        "v3"
    ]
}