get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 122272,
    "url": "http://patches.dpdk.org/api/patches/122272/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230118073304.903093-1-mingxia.liu@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": "<20230118073304.903093-1-mingxia.liu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230118073304.903093-1-mingxia.liu@intel.com",
    "date": "2023-01-18T07:33:02",
    "name": "[v3,15/21] net/cpfl: add AVX512 data path for single queue model",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "73ddb5d573695cda85ac893062d36196638e6d9d",
    "submitter": {
        "id": 2514,
        "url": "http://patches.dpdk.org/api/people/2514/?format=api",
        "name": "Liu, Mingxia",
        "email": "mingxia.liu@intel.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20230118073304.903093-1-mingxia.liu@intel.com/mbox/",
    "series": [
        {
            "id": 26589,
            "url": "http://patches.dpdk.org/api/series/26589/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=26589",
            "date": "2023-01-18T07:33:02",
            "name": null,
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/26589/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/122272/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/122272/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id C8C0A4240B;\n\tWed, 18 Jan 2023 09:30:07 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 6F21E42D3F;\n\tWed, 18 Jan 2023 09:28:46 +0100 (CET)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n by mails.dpdk.org (Postfix) with ESMTP id 6E823410EE\n for <dev@dpdk.org>; Wed, 18 Jan 2023 09:28:44 +0100 (CET)",
            "from fmsmga004.fm.intel.com ([10.253.24.48])\n by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 18 Jan 2023 00:28:43 -0800",
            "from dpdk-mingxial-01.sh.intel.com ([10.67.119.167])\n by fmsmga004.fm.intel.com with ESMTP; 18 Jan 2023 00:28:41 -0800"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1674030524; x=1705566524;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=FfDV9nSd0cOEQf7wp3NdiGX2+xuPoLUUBlKOP8hcTKw=;\n b=al+gNGYvd30v3Dh6MSw/ttJ/7IZxWOgUZ4bC0zaqAdko7o/cDeyC4V78\n FyOzkiAUjj2zkvXAzAzk85n21kGMpw0QJRkIx4peRNXe3sxuqGY8l19jd\n wcU8TjIQlKdRK+wnvEb2FY1nuI25hd4+VHfs/iG0eJ5ns9fdINWrJBy2Y\n Q0ej5Dw4BflPPUqTZmchjsyyYSiiNG8a7yqIVlK0a4bmWVA7PJ6IdeOHi\n vMCRVnimxLzqfP3YkDrInWvxZH7fTWDPtB3CpG8fp4ViUpJVY9ENe+k33\n +bhlT6idV2yC/6sefKPlnXa4NVqbSPe0aWDMB0Sj4UOakEmAnBSQ0sJIL w==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6500,9779,10593\"; a=\"322620066\"",
            "E=Sophos;i=\"5.97,224,1669104000\"; d=\"scan'208\";a=\"322620066\"",
            "E=McAfee;i=\"6500,9779,10593\"; a=\"728100081\"",
            "E=Sophos;i=\"5.97,224,1669104000\"; d=\"scan'208\";a=\"728100081\""
        ],
        "X-ExtLoop1": "1",
        "From": "Mingxia Liu <mingxia.liu@intel.com>",
        "To": "dev@dpdk.org, qi.z.zhang@intel.com, jingjing.wu@intel.com,\n beilei.xing@intel.com",
        "Cc": "wenjun1.wu@intel.com,\n\tMingxia Liu <mingxia.liu@intel.com>",
        "Subject": "[PATCH v3 15/21] net/cpfl: add AVX512 data path for single queue\n model",
        "Date": "Wed, 18 Jan 2023 07:33:02 +0000",
        "Message-Id": "<20230118073304.903093-1-mingxia.liu@intel.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20230113081931.221576-1-mingxia.liu@intel.com>",
        "References": "<20230113081931.221576-1-mingxia.liu@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org"
    },
    "content": "Add support of AVX512 vector data path for single queue model.\n\nSigned-off-by: Wenjun Wu <wenjun1.wu@intel.com>\nSigned-off-by: Mingxia Liu <mingxia.liu@intel.com>\n---\n doc/guides/nics/cpfl.rst                |  24 +++++-\n drivers/net/cpfl/cpfl_ethdev.c          |   3 +-\n drivers/net/cpfl/cpfl_rxtx.c            |  85 ++++++++++++++++++++\n drivers/net/cpfl/cpfl_rxtx_vec_common.h | 100 ++++++++++++++++++++++++\n drivers/net/cpfl/meson.build            |  25 +++++-\n 5 files changed, 234 insertions(+), 3 deletions(-)\n create mode 100644 drivers/net/cpfl/cpfl_rxtx_vec_common.h",
    "diff": "diff --git a/doc/guides/nics/cpfl.rst b/doc/guides/nics/cpfl.rst\nindex 35a4bd44c6..1b275eb166 100644\n--- a/doc/guides/nics/cpfl.rst\n+++ b/doc/guides/nics/cpfl.rst\n@@ -63,4 +63,26 @@ Runtime Config Options\n Driver compilation and testing\n ------------------------------\n \n-Refer to the document :doc:`build_and_test` for details.\n\\ No newline at end of file\n+Refer to the document :doc:`build_and_test` for details.\n+\n+Features\n+--------\n+\n+Vector PMD\n+~~~~~~~~~~\n+\n+Vector path for Rx and Tx path are selected automatically.\n+The paths are chosen based on 2 conditions:\n+\n+- ``CPU``\n+\n+  On the x86 platform, the driver checks if the CPU supports AVX512.\n+  If the CPU supports AVX512 and EAL argument ``--force-max-simd-bitwidth``\n+  is set to 512, AVX512 paths will be chosen.\n+\n+- ``Offload features``\n+\n+  The supported HW offload features are described in the document cpfl.ini,\n+  A value \"P\" means the offload feature is not supported by vector path.\n+  If any not supported features are used, cpfl vector PMD is disabled\n+  and the scalar paths are chosen.\ndiff --git a/drivers/net/cpfl/cpfl_ethdev.c b/drivers/net/cpfl/cpfl_ethdev.c\nindex 20e16c815a..dcff55e5b5 100644\n--- a/drivers/net/cpfl/cpfl_ethdev.c\n+++ b/drivers/net/cpfl/cpfl_ethdev.c\n@@ -111,7 +111,8 @@ cpfl_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)\n \t\tRTE_ETH_TX_OFFLOAD_TCP_CKSUM\t\t|\n \t\tRTE_ETH_TX_OFFLOAD_SCTP_CKSUM\t\t|\n \t\tRTE_ETH_TX_OFFLOAD_TCP_TSO\t\t|\n-\t\tRTE_ETH_TX_OFFLOAD_MULTI_SEGS;\n+\t\tRTE_ETH_TX_OFFLOAD_MULTI_SEGS\t\t|\n+\t\tRTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE;\n \n \tdev_info->default_txconf = (struct rte_eth_txconf) {\n \t\t.tx_free_thresh = CPFL_DEFAULT_TX_FREE_THRESH,\ndiff --git a/drivers/net/cpfl/cpfl_rxtx.c b/drivers/net/cpfl/cpfl_rxtx.c\nindex 8724d391ad..6b5ea46a7b 100644\n--- a/drivers/net/cpfl/cpfl_rxtx.c\n+++ b/drivers/net/cpfl/cpfl_rxtx.c\n@@ -8,6 +8,7 @@\n \n #include \"cpfl_ethdev.h\"\n #include \"cpfl_rxtx.h\"\n+#include \"cpfl_rxtx_vec_common.h\"\n \n static uint64_t\n cpfl_rx_offload_convert(uint64_t offload)\n@@ -739,22 +740,106 @@ void\n cpfl_set_rx_function(struct rte_eth_dev *dev)\n {\n \tstruct idpf_vport *vport = dev->data->dev_private;\n+#ifdef RTE_ARCH_X86\n+\tstruct idpf_rx_queue *rxq;\n+\tint i;\n+\n+\tif (cpfl_rx_vec_dev_check_default(dev) == CPFL_VECTOR_PATH &&\n+\t    rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_128) {\n+\t\tvport->rx_vec_allowed = true;\n+\n+\t\tif (rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_512)\n+#ifdef CC_AVX512_SUPPORT\n+\t\t\tif (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1 &&\n+\t\t\t    rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512BW) == 1 &&\n+\t\t\t    rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512DQ))\n+\t\t\t\tvport->rx_use_avx512 = true;\n+#else\n+\t\tPMD_DRV_LOG(NOTICE,\n+\t\t\t    \"AVX512 is not supported in build env\");\n+#endif /* CC_AVX512_SUPPORT */\n+\t} else {\n+\t\tvport->rx_vec_allowed = false;\n+\t}\n+#endif /* RTE_ARCH_X86 */\n+\n+#ifdef RTE_ARCH_X86\n+\tif (vport->rxq_model == VIRTCHNL2_QUEUE_MODEL_SPLIT) {\n+\t\tdev->rx_pkt_burst = idpf_splitq_recv_pkts;\n+\t} else {\n+\t\tif (vport->rx_vec_allowed) {\n+\t\t\tfor (i = 0; i < dev->data->nb_rx_queues; i++) {\n+\t\t\t\trxq = dev->data->rx_queues[i];\n+\t\t\t\t(void)idpf_singleq_rx_vec_setup(rxq);\n+\t\t\t}\n+#ifdef CC_AVX512_SUPPORT\n+\t\t\tif (vport->rx_use_avx512) {\n+\t\t\t\tdev->rx_pkt_burst = idpf_singleq_recv_pkts_avx512;\n+\t\t\t\treturn;\n+\t\t\t}\n+#endif /* CC_AVX512_SUPPORT */\n+\t\t}\n \n+\t\tdev->rx_pkt_burst = idpf_singleq_recv_pkts;\n+\t}\n+#else\n \tif (vport->rxq_model == VIRTCHNL2_QUEUE_MODEL_SPLIT)\n \t\tdev->rx_pkt_burst = idpf_splitq_recv_pkts;\n \telse\n \t\tdev->rx_pkt_burst = idpf_singleq_recv_pkts;\n+#endif /* RTE_ARCH_X86 */\n }\n \n void\n cpfl_set_tx_function(struct rte_eth_dev *dev)\n {\n \tstruct idpf_vport *vport = dev->data->dev_private;\n+#ifdef RTE_ARCH_X86\n+#ifdef CC_AVX512_SUPPORT\n+\tstruct idpf_tx_queue *txq;\n+\tint i;\n+#endif /* CC_AVX512_SUPPORT */\n+\n+\tif (cpfl_tx_vec_dev_check_default(dev) == CPFL_VECTOR_PATH &&\n+\t    rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_128) {\n+\t\tvport->tx_vec_allowed = true;\n+\t\tif (rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_512)\n+#ifdef CC_AVX512_SUPPORT\n+\t\t{\n+\t\t\tif (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1 &&\n+\t\t\t    rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512BW) == 1)\n+\t\t\t\tvport->tx_use_avx512 = true;\n+\t\t\tif (vport->tx_use_avx512) {\n+\t\t\t\tfor (i = 0; i < dev->data->nb_tx_queues; i++) {\n+\t\t\t\t\ttxq = dev->data->tx_queues[i];\n+\t\t\t\t\tidpf_tx_vec_setup_avx512(txq);\n+\t\t\t\t}\n+\t\t\t}\n+\t\t}\n+#else\n+\t\tPMD_DRV_LOG(NOTICE,\n+\t\t\t    \"AVX512 is not supported in build env\");\n+#endif /* CC_AVX512_SUPPORT */\n+\t} else {\n+\t\tvport->tx_vec_allowed = false;\n+\t}\n+#endif /* RTE_ARCH_X86 */\n \n \tif (vport->txq_model == VIRTCHNL2_QUEUE_MODEL_SPLIT) {\n \t\tdev->tx_pkt_burst = idpf_splitq_xmit_pkts;\n \t\tdev->tx_pkt_prepare = idpf_prep_pkts;\n \t} else {\n+#ifdef RTE_ARCH_X86\n+\t\tif (vport->tx_vec_allowed) {\n+#ifdef CC_AVX512_SUPPORT\n+\t\t\tif (vport->tx_use_avx512) {\n+\t\t\t\tdev->tx_pkt_burst = idpf_singleq_xmit_pkts_avx512;\n+\t\t\t\tdev->tx_pkt_prepare = idpf_prep_pkts;\n+\t\t\t\treturn;\n+\t\t\t}\n+#endif /* CC_AVX512_SUPPORT */\n+\t\t}\n+#endif /* RTE_ARCH_X86 */\n \t\tdev->tx_pkt_burst = idpf_singleq_xmit_pkts;\n \t\tdev->tx_pkt_prepare = idpf_prep_pkts;\n \t}\ndiff --git a/drivers/net/cpfl/cpfl_rxtx_vec_common.h b/drivers/net/cpfl/cpfl_rxtx_vec_common.h\nnew file mode 100644\nindex 0000000000..503bc87f21\n--- /dev/null\n+++ b/drivers/net/cpfl/cpfl_rxtx_vec_common.h\n@@ -0,0 +1,100 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2022 Intel Corporation\n+ */\n+\n+#ifndef _CPFL_RXTX_VEC_COMMON_H_\n+#define _CPFL_RXTX_VEC_COMMON_H_\n+#include <stdint.h>\n+#include <ethdev_driver.h>\n+#include <rte_malloc.h>\n+\n+#include \"cpfl_ethdev.h\"\n+#include \"cpfl_rxtx.h\"\n+\n+#ifndef __INTEL_COMPILER\n+#pragma GCC diagnostic ignored \"-Wcast-qual\"\n+#endif\n+\n+#define CPFL_SCALAR_PATH\t\t0\n+#define CPFL_VECTOR_PATH\t\t1\n+#define CPFL_RX_NO_VECTOR_FLAGS (\t\t\\\n+\t\tRTE_ETH_RX_OFFLOAD_IPV4_CKSUM |\t\\\n+\t\tRTE_ETH_RX_OFFLOAD_UDP_CKSUM |\t\\\n+\t\tRTE_ETH_RX_OFFLOAD_TCP_CKSUM |\t\\\n+\t\tRTE_ETH_RX_OFFLOAD_OUTER_IPV4_CKSUM |\t\\\n+\t\tRTE_ETH_RX_OFFLOAD_TIMESTAMP)\n+#define CPFL_TX_NO_VECTOR_FLAGS (\t\t\\\n+\t\tRTE_ETH_TX_OFFLOAD_TCP_TSO |\t\\\n+\t\tRTE_ETH_TX_OFFLOAD_MULTI_SEGS)\n+\n+static inline int\n+cpfl_rx_vec_queue_default(struct idpf_rx_queue *rxq)\n+{\n+\tif (rxq == NULL)\n+\t\treturn CPFL_SCALAR_PATH;\n+\n+\tif (rte_is_power_of_2(rxq->nb_rx_desc) == 0)\n+\t\treturn CPFL_SCALAR_PATH;\n+\n+\tif (rxq->rx_free_thresh < IDPF_VPMD_RX_MAX_BURST)\n+\t\treturn CPFL_SCALAR_PATH;\n+\n+\tif ((rxq->nb_rx_desc % rxq->rx_free_thresh) != 0)\n+\t\treturn CPFL_SCALAR_PATH;\n+\n+\tif ((rxq->offloads & CPFL_RX_NO_VECTOR_FLAGS) != 0)\n+\t\treturn CPFL_SCALAR_PATH;\n+\n+\treturn CPFL_VECTOR_PATH;\n+}\n+\n+static inline int\n+cpfl_tx_vec_queue_default(struct idpf_tx_queue *txq)\n+{\n+\tif (txq == NULL)\n+\t\treturn CPFL_SCALAR_PATH;\n+\n+\tif (txq->rs_thresh < IDPF_VPMD_TX_MAX_BURST ||\n+\t    (txq->rs_thresh & 3) != 0)\n+\t\treturn CPFL_SCALAR_PATH;\n+\n+\tif ((txq->offloads & CPFL_TX_NO_VECTOR_FLAGS) != 0)\n+\t\treturn CPFL_SCALAR_PATH;\n+\n+\treturn CPFL_VECTOR_PATH;\n+}\n+\n+static inline int\n+cpfl_rx_vec_dev_check_default(struct rte_eth_dev *dev)\n+{\n+\tstruct idpf_rx_queue *rxq;\n+\tint i, ret = 0;\n+\n+\tfor (i = 0; i < dev->data->nb_rx_queues; i++) {\n+\t\trxq = dev->data->rx_queues[i];\n+\t\tret = (cpfl_rx_vec_queue_default(rxq));\n+\t\tif (ret == CPFL_SCALAR_PATH)\n+\t\t\treturn CPFL_SCALAR_PATH;\n+\t}\n+\n+\treturn CPFL_VECTOR_PATH;\n+}\n+\n+static inline int\n+cpfl_tx_vec_dev_check_default(struct rte_eth_dev *dev)\n+{\n+\tint i;\n+\tstruct idpf_tx_queue *txq;\n+\tint ret = 0;\n+\n+\tfor (i = 0; i < dev->data->nb_tx_queues; i++) {\n+\t\ttxq = dev->data->tx_queues[i];\n+\t\tret = cpfl_tx_vec_queue_default(txq);\n+\t\tif (ret == CPFL_SCALAR_PATH)\n+\t\t\treturn CPFL_SCALAR_PATH;\n+\t}\n+\n+\treturn CPFL_VECTOR_PATH;\n+}\n+\n+#endif /*_CPFL_RXTX_VEC_COMMON_H_*/\ndiff --git a/drivers/net/cpfl/meson.build b/drivers/net/cpfl/meson.build\nindex 3ccee15703..40ed8dbb7b 100644\n--- a/drivers/net/cpfl/meson.build\n+++ b/drivers/net/cpfl/meson.build\n@@ -7,9 +7,32 @@ if is_windows\n     subdir_done()\n endif\n \n+if dpdk_conf.get('RTE_IOVA_AS_PA') == 0\n+    build = false\n+    reason = 'driver does not support disabling IOVA as PA mode'\n+    subdir_done()\n+endif\n+\n deps += ['common_idpf']\n \n sources = files(\n         'cpfl_ethdev.c',\n         'cpfl_rxtx.c',\n-)\n\\ No newline at end of file\n+)\n+\n+if arch_subdir == 'x86'\n+    cpfl_avx512_cpu_support = (\n+        cc.get_define('__AVX512F__', args: machine_args) != '' and\n+        cc.get_define('__AVX512BW__', args: machine_args) != ''\n+    )\n+\n+    cpfl_avx512_cc_support = (\n+        not machine_args.contains('-mno-avx512f') and\n+        cc.has_argument('-mavx512f') and\n+        cc.has_argument('-mavx512bw')\n+    )\n+\n+    if cpfl_avx512_cpu_support == true or cpfl_avx512_cc_support == true\n+        cflags += ['-DCC_AVX512_SUPPORT']\n+    endif\n+endif\n",
    "prefixes": [
        "v3",
        "15/21"
    ]
}