get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 119014,
    "url": "http://patchwork.dpdk.org/api/patches/119014/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20221024131227.1062446-10-junfeng.guo@intel.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<20221024131227.1062446-10-junfeng.guo@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20221024131227.1062446-10-junfeng.guo@intel.com",
    "date": "2022-10-24T13:12:18",
    "name": "[v11,09/18] net/idpf: add support for packet type get",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "ba3f302635e8044fbc4368c605f9137e343a13e7",
    "submitter": {
        "id": 1785,
        "url": "http://patchwork.dpdk.org/api/people/1785/?format=api",
        "name": "Junfeng Guo",
        "email": "junfeng.guo@intel.com"
    },
    "delegate": {
        "id": 3961,
        "url": "http://patchwork.dpdk.org/api/users/3961/?format=api",
        "username": "arybchenko",
        "first_name": "Andrew",
        "last_name": "Rybchenko",
        "email": "andrew.rybchenko@oktetlabs.ru"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20221024131227.1062446-10-junfeng.guo@intel.com/mbox/",
    "series": [
        {
            "id": 25386,
            "url": "http://patchwork.dpdk.org/api/series/25386/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=25386",
            "date": "2022-10-24T13:12:09",
            "name": "add support for idpf PMD in DPDK",
            "version": 11,
            "mbox": "http://patchwork.dpdk.org/series/25386/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/119014/comments/",
    "check": "warning",
    "checks": "http://patchwork.dpdk.org/api/patches/119014/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 E2BBDA034C;\n\tMon, 24 Oct 2022 15:15:17 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id CFD4042BD6;\n\tMon, 24 Oct 2022 15:14:29 +0200 (CEST)",
            "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n by mails.dpdk.org (Postfix) with ESMTP id D640242BA6\n for <dev@dpdk.org>; Mon, 24 Oct 2022 15:14:26 +0200 (CEST)",
            "from orsmga001.jf.intel.com ([10.7.209.18])\n by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 24 Oct 2022 06:14:26 -0700",
            "from dpdk-jf-ntb-one.sh.intel.com ([10.67.111.104])\n by orsmga001.jf.intel.com with ESMTP; 24 Oct 2022 06:14:23 -0700"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1666617267; x=1698153267;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=nErDuAnoETk/YxshWjjVxV6nk6wPC3cBHjQYX4/7YXk=;\n b=iGpmC/z9Iei2Fk1X4w9eBLKjqjKhpGrWe3cVaNPqEQISZVafSesREgFC\n brnstGzReHJAtjqhtOFa9f3r96WRscuEckDYpb8VwW+Z7zxMDx3WF/heo\n XaGHY8OyGI9U2VpXOagum2LCZSbHB0it3wCv1NQQvjxD8096f7h55MiEI\n QKE5e27LJOekv3SV4jYClge4qgIfSJ9Z0ltG0pi/TFZZfKU71HOn/34/Q\n M4D36yesG4ne47kK75JDn+Ad0r+0g+gciMvoOXNHzlttbFtSs0ll26yhe\n W2pKvmcK+TX5OmIGqfN/T1tccfAk+evcP80S76nyZGhnaibtalm8HJbpb w==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6500,9779,10510\"; a=\"309100040\"",
            "E=Sophos;i=\"5.95,209,1661842800\"; d=\"scan'208\";a=\"309100040\"",
            "E=McAfee;i=\"6500,9779,10510\"; a=\"664540025\"",
            "E=Sophos;i=\"5.95,209,1661842800\"; d=\"scan'208\";a=\"664540025\""
        ],
        "X-ExtLoop1": "1",
        "From": "Junfeng Guo <junfeng.guo@intel.com>",
        "To": "andrew.rybchenko@oktetlabs.ru, qi.z.zhang@intel.com,\n jingjing.wu@intel.com,\n beilei.xing@intel.com",
        "Cc": "dev@dpdk.org, Junfeng Guo <junfeng.guo@intel.com>,\n Wenjun Wu <wenjun1.wu@intel.com>",
        "Subject": "[PATCH v11 09/18] net/idpf: add support for packet type get",
        "Date": "Mon, 24 Oct 2022 21:12:18 +0800",
        "Message-Id": "<20221024131227.1062446-10-junfeng.guo@intel.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "In-Reply-To": "<20221024131227.1062446-1-junfeng.guo@intel.com>",
        "References": "<20221024130134.1046536-2-junfeng.guo@intel.com>\n <20221024131227.1062446-1-junfeng.guo@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 dev ops dev_supported_ptypes_get.\n\nSigned-off-by: Wenjun Wu <wenjun1.wu@intel.com>\nSigned-off-by: Junfeng Guo <junfeng.guo@intel.com>\n---\n doc/guides/nics/features/idpf.ini |   1 +\n drivers/net/idpf/idpf_ethdev.c    |   7 +\n drivers/net/idpf/idpf_ethdev.h    |   6 +\n drivers/net/idpf/idpf_rxtx.c      |  19 +++\n drivers/net/idpf/idpf_rxtx.h      |   7 +\n drivers/net/idpf/idpf_vchnl.c     | 240 ++++++++++++++++++++++++++++++\n 6 files changed, 280 insertions(+)",
    "diff": "diff --git a/doc/guides/nics/features/idpf.ini b/doc/guides/nics/features/idpf.ini\nindex 30e1c0831e..a03068df85 100644\n--- a/doc/guides/nics/features/idpf.ini\n+++ b/doc/guides/nics/features/idpf.ini\n@@ -8,4 +8,5 @@\n ;\n [Features]\n Queue start/stop     = Y\n+Packet type parsing  = Y\n Linux                = Y\ndiff --git a/drivers/net/idpf/idpf_ethdev.c b/drivers/net/idpf/idpf_ethdev.c\nindex 4c058660b4..80826569c8 100644\n--- a/drivers/net/idpf/idpf_ethdev.c\n+++ b/drivers/net/idpf/idpf_ethdev.c\n@@ -57,6 +57,7 @@ idpf_dev_link_update(struct rte_eth_dev *dev,\n }\n \n static const struct eth_dev_ops idpf_eth_dev_ops = {\n+\t.dev_supported_ptypes_get\t= idpf_dev_supported_ptypes_get,\n \t.dev_configure\t\t\t= idpf_dev_configure,\n \t.dev_start\t\t\t= idpf_dev_start,\n \t.dev_stop\t\t\t= idpf_dev_stop,\n@@ -641,6 +642,12 @@ idpf_adapter_init(struct rte_pci_device *pci_dev, struct idpf_adapter *adapter)\n \t\tgoto err_api;\n \t}\n \n+\tret = idpf_get_pkt_type(adapter);\n+\tif (ret != 0) {\n+\t\tPMD_INIT_LOG(ERR, \"Failed to set ptype table\");\n+\t\tgoto err_api;\n+\t}\n+\n \tadapter->caps = rte_zmalloc(\"idpf_caps\",\n \t\t\t\tsizeof(struct virtchnl2_get_capabilities), 0);\n \tif (adapter->caps == NULL) {\ndiff --git a/drivers/net/idpf/idpf_ethdev.h b/drivers/net/idpf/idpf_ethdev.h\nindex 094f123be1..58f070c976 100644\n--- a/drivers/net/idpf/idpf_ethdev.h\n+++ b/drivers/net/idpf/idpf_ethdev.h\n@@ -47,6 +47,8 @@\n \n #define IDPF_NUM_MACADDR_MAX\t64\n \n+#define IDPF_MAX_PKT_TYPE\t1024\n+\n #define IDPF_VLAN_TAG_SIZE\t4\n #define IDPF_ETH_OVERHEAD \\\n \t(RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN + IDPF_VLAN_TAG_SIZE * 2)\n@@ -141,6 +143,8 @@ struct idpf_adapter {\n \tuint32_t max_rxq_per_msg;\n \tuint32_t max_txq_per_msg;\n \n+\tuint32_t ptype_tbl[IDPF_MAX_PKT_TYPE] __rte_cache_min_aligned;\n+\n \tbool stopped;\n };\n \n@@ -202,6 +206,7 @@ int idpf_dev_link_update(struct rte_eth_dev *dev,\n \t\t\t __rte_unused int wait_to_complete);\n void idpf_handle_virtchnl_msg(struct rte_eth_dev *dev);\n int idpf_vc_check_api_version(struct idpf_adapter *adapter);\n+int idpf_get_pkt_type(struct idpf_adapter *adapter);\n int idpf_vc_get_caps(struct idpf_adapter *adapter);\n int idpf_vc_create_vport(struct idpf_adapter *adapter);\n int idpf_vc_destroy_vport(struct idpf_vport *vport);\n@@ -213,6 +218,7 @@ int idpf_switch_queue(struct idpf_vport *vport, uint16_t qid,\n \t\t      bool rx, bool on);\n int idpf_vc_ena_dis_queues(struct idpf_vport *vport, bool enable);\n int idpf_vc_ena_dis_vport(struct idpf_vport *vport, bool enable);\n+int idpf_vc_query_ptype_info(struct idpf_adapter *adapter);\n int idpf_read_one_msg(struct idpf_adapter *adapter, uint32_t ops,\n \t\t      uint16_t buf_len, uint8_t *buf);\n \ndiff --git a/drivers/net/idpf/idpf_rxtx.c b/drivers/net/idpf/idpf_rxtx.c\nindex 298eaf0a1a..c3c4acb69f 100644\n--- a/drivers/net/idpf/idpf_rxtx.c\n+++ b/drivers/net/idpf/idpf_rxtx.c\n@@ -8,6 +8,25 @@\n #include \"idpf_ethdev.h\"\n #include \"idpf_rxtx.h\"\n \n+const uint32_t *\n+idpf_dev_supported_ptypes_get(struct rte_eth_dev *dev __rte_unused)\n+{\n+\tstatic const uint32_t ptypes[] = {\n+\t\tRTE_PTYPE_L2_ETHER,\n+\t\tRTE_PTYPE_L3_IPV4_EXT_UNKNOWN,\n+\t\tRTE_PTYPE_L3_IPV6_EXT_UNKNOWN,\n+\t\tRTE_PTYPE_L4_FRAG,\n+\t\tRTE_PTYPE_L4_NONFRAG,\n+\t\tRTE_PTYPE_L4_UDP,\n+\t\tRTE_PTYPE_L4_TCP,\n+\t\tRTE_PTYPE_L4_SCTP,\n+\t\tRTE_PTYPE_L4_ICMP,\n+\t\tRTE_PTYPE_UNKNOWN\n+\t};\n+\n+\treturn ptypes;\n+}\n+\n static inline int\n check_rx_thresh(uint16_t nb_desc, uint16_t thresh)\n {\ndiff --git a/drivers/net/idpf/idpf_rxtx.h b/drivers/net/idpf/idpf_rxtx.h\nindex 9f767079b2..11f1fde5d4 100644\n--- a/drivers/net/idpf/idpf_rxtx.h\n+++ b/drivers/net/idpf/idpf_rxtx.h\n@@ -21,6 +21,10 @@\n #define IDPF_DEFAULT_TX_RS_THRESH\t32\n #define IDPF_DEFAULT_TX_FREE_THRESH\t32\n \n+#define IDPF_GET_PTYPE_SIZE(p) \\\n+\t(sizeof(struct virtchnl2_ptype) + \\\n+\t(((p)->proto_id_count ? ((p)->proto_id_count - 1) : 0) * sizeof((p)->proto_id[0])))\n+\n struct idpf_rx_queue {\n \tstruct idpf_adapter *adapter;\t/* the adapter this queue belongs to */\n \tstruct rte_mempool *mp;\t\t/* mbuf pool to populate Rx ring */\n@@ -137,4 +141,7 @@ int idpf_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id);\n void idpf_dev_tx_queue_release(struct rte_eth_dev *dev, uint16_t qid);\n \n void idpf_stop_queues(struct rte_eth_dev *dev);\n+\n+const uint32_t *idpf_dev_supported_ptypes_get(struct rte_eth_dev *dev);\n+\n #endif /* _IDPF_RXTX_H_ */\ndiff --git a/drivers/net/idpf/idpf_vchnl.c b/drivers/net/idpf/idpf_vchnl.c\nindex 9138799989..86a55d2ff1 100644\n--- a/drivers/net/idpf/idpf_vchnl.c\n+++ b/drivers/net/idpf/idpf_vchnl.c\n@@ -238,6 +238,11 @@ idpf_execute_vc_cmd(struct idpf_adapter *adapter, struct idpf_cmd_info *args)\n \t\terr = idpf_read_one_msg(adapter, args->ops, args->out_size, args->out_buffer);\n \t\tclear_cmd(adapter);\n \t\tbreak;\n+\tcase VIRTCHNL2_OP_GET_PTYPE_INFO:\n+\t\t/* for multuple response message,\n+\t\t * do not handle the response here.\n+\t\t */\n+\t\tbreak;\n \tdefault:\n \t\t/* For other virtchnl ops in running time,\n \t\t * wait for the cmd done flag.\n@@ -286,6 +291,215 @@ idpf_vc_check_api_version(struct idpf_adapter *adapter)\n \treturn err;\n }\n \n+int __rte_cold\n+idpf_get_pkt_type(struct idpf_adapter *adapter)\n+{\n+\tstruct virtchnl2_get_ptype_info *ptype_info;\n+\tuint16_t ptype_recvd = 0, ptype_offset, i, j;\n+\tint ret;\n+\n+\tret = idpf_vc_query_ptype_info(adapter);\n+\tif (ret != 0) {\n+\t\tPMD_DRV_LOG(ERR, \"Fail to query packet type information\");\n+\t\treturn ret;\n+\t}\n+\n+\tptype_info = rte_zmalloc(\"ptype_info\", IDPF_DFLT_MBX_BUF_SIZE, 0);\n+\t\tif (ptype_info == NULL)\n+\t\t\treturn -ENOMEM;\n+\n+\twhile (ptype_recvd < IDPF_MAX_PKT_TYPE) {\n+\t\tret = idpf_read_one_msg(adapter, VIRTCHNL2_OP_GET_PTYPE_INFO,\n+\t\t\t\t\tIDPF_DFLT_MBX_BUF_SIZE, (u8 *)ptype_info);\n+\t\tif (ret != 0) {\n+\t\t\tPMD_DRV_LOG(ERR, \"Fail to get packet type information\");\n+\t\t\tgoto free_ptype_info;\n+\t\t}\n+\n+\t\tptype_recvd += ptype_info->num_ptypes;\n+\t\tptype_offset = sizeof(struct virtchnl2_get_ptype_info) -\n+\t\t\t\t\t\tsizeof(struct virtchnl2_ptype);\n+\n+\t\tfor (i = 0; i < rte_cpu_to_le_16(ptype_info->num_ptypes); i++) {\n+\t\t\tbool is_inner = false, is_ip = false;\n+\t\t\tstruct virtchnl2_ptype *ptype;\n+\t\t\tuint32_t proto_hdr = 0;\n+\n+\t\t\tptype = (struct virtchnl2_ptype *)\n+\t\t\t\t\t((u8 *)ptype_info + ptype_offset);\n+\t\t\tptype_offset += IDPF_GET_PTYPE_SIZE(ptype);\n+\t\t\tif (ptype_offset > IDPF_DFLT_MBX_BUF_SIZE) {\n+\t\t\t\tret = -EINVAL;\n+\t\t\t\tgoto free_ptype_info;\n+\t\t\t}\n+\n+\t\t\tif (rte_cpu_to_le_16(ptype->ptype_id_10) == 0xFFFF)\n+\t\t\t\tgoto free_ptype_info;\n+\n+\t\t\tfor (j = 0; j < ptype->proto_id_count; j++) {\n+\t\t\t\tswitch (rte_cpu_to_le_16(ptype->proto_id[j])) {\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_GRE:\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_VXLAN:\n+\t\t\t\t\tproto_hdr &= ~RTE_PTYPE_L4_MASK;\n+\t\t\t\t\tproto_hdr |= RTE_PTYPE_TUNNEL_GRENAT;\n+\t\t\t\t\tis_inner = true;\n+\t\t\t\t\tbreak;\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_MAC:\n+\t\t\t\t\tif (is_inner) {\n+\t\t\t\t\t\tproto_hdr &= ~RTE_PTYPE_INNER_L2_MASK;\n+\t\t\t\t\t\tproto_hdr |= RTE_PTYPE_INNER_L2_ETHER;\n+\t\t\t\t\t} else {\n+\t\t\t\t\t\tproto_hdr &= ~RTE_PTYPE_L2_MASK;\n+\t\t\t\t\t\tproto_hdr |= RTE_PTYPE_L2_ETHER;\n+\t\t\t\t\t}\n+\t\t\t\t\tbreak;\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_VLAN:\n+\t\t\t\t\tif (is_inner) {\n+\t\t\t\t\t\tproto_hdr &= ~RTE_PTYPE_INNER_L2_MASK;\n+\t\t\t\t\t\tproto_hdr |= RTE_PTYPE_INNER_L2_ETHER_VLAN;\n+\t\t\t\t\t}\n+\t\t\t\t\tbreak;\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_PTP:\n+\t\t\t\t\tproto_hdr &= ~RTE_PTYPE_L2_MASK;\n+\t\t\t\t\tproto_hdr |= RTE_PTYPE_L2_ETHER_TIMESYNC;\n+\t\t\t\t\tbreak;\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_LLDP:\n+\t\t\t\t\tproto_hdr &= ~RTE_PTYPE_L2_MASK;\n+\t\t\t\t\tproto_hdr |= RTE_PTYPE_L2_ETHER_LLDP;\n+\t\t\t\t\tbreak;\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_ARP:\n+\t\t\t\t\tproto_hdr &= ~RTE_PTYPE_L2_MASK;\n+\t\t\t\t\tproto_hdr |= RTE_PTYPE_L2_ETHER_ARP;\n+\t\t\t\t\tbreak;\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_PPPOE:\n+\t\t\t\t\tproto_hdr &= ~RTE_PTYPE_L2_MASK;\n+\t\t\t\t\tproto_hdr |= RTE_PTYPE_L2_ETHER_PPPOE;\n+\t\t\t\t\tbreak;\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_IPV4:\n+\t\t\t\t\tif (!is_ip) {\n+\t\t\t\t\t\tproto_hdr |= RTE_PTYPE_L3_IPV4_EXT_UNKNOWN;\n+\t\t\t\t\t\tis_ip = true;\n+\t\t\t\t\t} else {\n+\t\t\t\t\t\tproto_hdr |= RTE_PTYPE_INNER_L3_IPV4_EXT_UNKNOWN |\n+\t\t\t\t\t\t\t     RTE_PTYPE_TUNNEL_IP;\n+\t\t\t\t\t\tis_inner = true;\n+\t\t\t\t\t}\n+\t\t\t\t\t\tbreak;\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_IPV6:\n+\t\t\t\t\tif (!is_ip) {\n+\t\t\t\t\t\tproto_hdr |= RTE_PTYPE_L3_IPV6_EXT_UNKNOWN;\n+\t\t\t\t\t\tis_ip = true;\n+\t\t\t\t\t} else {\n+\t\t\t\t\t\tproto_hdr |= RTE_PTYPE_INNER_L3_IPV6_EXT_UNKNOWN |\n+\t\t\t\t\t\t\t     RTE_PTYPE_TUNNEL_IP;\n+\t\t\t\t\t\tis_inner = true;\n+\t\t\t\t\t}\n+\t\t\t\t\tbreak;\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_IPV4_FRAG:\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_IPV6_FRAG:\n+\t\t\t\t\tif (is_inner)\n+\t\t\t\t\t\tproto_hdr |= RTE_PTYPE_INNER_L4_FRAG;\n+\t\t\t\t\telse\n+\t\t\t\t\t\tproto_hdr |= RTE_PTYPE_L4_FRAG;\n+\t\t\t\t\tbreak;\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_UDP:\n+\t\t\t\t\tif (is_inner)\n+\t\t\t\t\t\tproto_hdr |= RTE_PTYPE_INNER_L4_UDP;\n+\t\t\t\t\telse\n+\t\t\t\t\t\tproto_hdr |= RTE_PTYPE_L4_UDP;\n+\t\t\t\t\tbreak;\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_TCP:\n+\t\t\t\t\tif (is_inner)\n+\t\t\t\t\t\tproto_hdr |= RTE_PTYPE_INNER_L4_TCP;\n+\t\t\t\t\telse\n+\t\t\t\t\t\tproto_hdr |= RTE_PTYPE_L4_TCP;\n+\t\t\t\t\tbreak;\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_SCTP:\n+\t\t\t\t\tif (is_inner)\n+\t\t\t\t\t\tproto_hdr |= RTE_PTYPE_INNER_L4_SCTP;\n+\t\t\t\t\telse\n+\t\t\t\t\t\tproto_hdr |= RTE_PTYPE_L4_SCTP;\n+\t\t\t\t\tbreak;\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_ICMP:\n+\t\t\t\t\tif (is_inner)\n+\t\t\t\t\t\tproto_hdr |= RTE_PTYPE_INNER_L4_ICMP;\n+\t\t\t\t\telse\n+\t\t\t\t\t\tproto_hdr |= RTE_PTYPE_L4_ICMP;\n+\t\t\t\t\tbreak;\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_ICMPV6:\n+\t\t\t\t\tif (is_inner)\n+\t\t\t\t\t\tproto_hdr |= RTE_PTYPE_INNER_L4_ICMP;\n+\t\t\t\t\telse\n+\t\t\t\t\t\tproto_hdr |= RTE_PTYPE_L4_ICMP;\n+\t\t\t\t\tbreak;\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_L2TPV2:\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_L2TPV2_CONTROL:\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_L2TPV3:\n+\t\t\t\t\tis_inner = true;\n+\t\t\t\t\tproto_hdr |= RTE_PTYPE_TUNNEL_L2TP;\n+\t\t\t\t\tbreak;\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_NVGRE:\n+\t\t\t\t\tis_inner = true;\n+\t\t\t\t\tproto_hdr |= RTE_PTYPE_TUNNEL_NVGRE;\n+\t\t\t\t\tbreak;\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_GTPC_TEID:\n+\t\t\t\t\tis_inner = true;\n+\t\t\t\t\tproto_hdr |= RTE_PTYPE_TUNNEL_GTPC;\n+\t\t\t\t\tbreak;\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_GTPU:\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_GTPU_UL:\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_GTPU_DL:\n+\t\t\t\t\tis_inner = true;\n+\t\t\t\t\tproto_hdr |= RTE_PTYPE_TUNNEL_GTPU;\n+\t\t\t\t\tbreak;\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_PAY:\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_IPV6_EH:\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_PRE_MAC:\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_POST_MAC:\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_ETHERTYPE:\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_SVLAN:\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_CVLAN:\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_MPLS:\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_MMPLS:\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_CTRL:\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_ECP:\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_EAPOL:\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_PPPOD:\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_IGMP:\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_AH:\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_ESP:\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_IKE:\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_NATT_KEEP:\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_GTP:\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_GTP_EH:\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_GTPCV2:\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_ECPRI:\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_VRRP:\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_OSPF:\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_TUN:\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_VXLAN_GPE:\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_GENEVE:\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_NSH:\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_QUIC:\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_PFCP:\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_PFCP_NODE:\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_PFCP_SESSION:\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_RTP:\n+\t\t\t\tcase VIRTCHNL2_PROTO_HDR_NO_PROTO:\n+\t\t\t\tdefault:\n+\t\t\t\t\tcontinue;\n+\t\t\t\t}\n+\t\t\t\tadapter->ptype_tbl[ptype->ptype_id_10] = proto_hdr;\n+\t\t\t}\n+\t\t}\n+\t}\n+\n+free_ptype_info:\n+\trte_free(ptype_info);\n+\tclear_cmd(adapter);\n+\treturn ret;\n+}\n+\n int\n idpf_vc_get_caps(struct idpf_adapter *adapter)\n {\n@@ -984,3 +1198,29 @@ idpf_vc_ena_dis_vport(struct idpf_vport *vport, bool enable)\n \n \treturn err;\n }\n+\n+int\n+idpf_vc_query_ptype_info(struct idpf_adapter *adapter)\n+{\n+\tstruct virtchnl2_get_ptype_info *ptype_info;\n+\tstruct idpf_cmd_info args;\n+\tint len, err;\n+\n+\tlen = sizeof(struct virtchnl2_get_ptype_info);\n+\tptype_info = rte_zmalloc(\"ptype_info\", len, 0);\n+\tif (ptype_info == NULL)\n+\t\treturn -ENOMEM;\n+\n+\tptype_info->start_ptype_id = 0;\n+\tptype_info->num_ptypes = IDPF_MAX_PKT_TYPE;\n+\targs.ops = VIRTCHNL2_OP_GET_PTYPE_INFO;\n+\targs.in_args = (u8 *)ptype_info;\n+\targs.in_args_size = len;\n+\n+\terr = idpf_execute_vc_cmd(adapter, &args);\n+\tif (err != 0)\n+\t\tPMD_DRV_LOG(ERR, \"Failed to execute command of VIRTCHNL2_OP_GET_PTYPE_INFO\");\n+\n+\trte_free(ptype_info);\n+\treturn err;\n+}\n",
    "prefixes": [
        "v11",
        "09/18"
    ]
}