get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 78146,
    "url": "http://patchwork.dpdk.org/api/patches/78146/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20200921064837.15957-3-yong.liu@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": "<20200921064837.15957-3-yong.liu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200921064837.15957-3-yong.liu@intel.com",
    "date": "2020-09-21T06:48:34",
    "name": "[v2,2/5] vhost: reuse packed ring functions",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "bc44acd5fc95242d3beee191dfbd98ea3568efe8",
    "submitter": {
        "id": 17,
        "url": "http://patchwork.dpdk.org/api/people/17/?format=api",
        "name": "Marvin Liu",
        "email": "yong.liu@intel.com"
    },
    "delegate": {
        "id": 2642,
        "url": "http://patchwork.dpdk.org/api/users/2642/?format=api",
        "username": "mcoquelin",
        "first_name": "Maxime",
        "last_name": "Coquelin",
        "email": "maxime.coquelin@redhat.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20200921064837.15957-3-yong.liu@intel.com/mbox/",
    "series": [
        {
            "id": 12370,
            "url": "http://patchwork.dpdk.org/api/series/12370/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=12370",
            "date": "2020-09-21T06:48:32",
            "name": "vhost add vectorized data path",
            "version": 2,
            "mbox": "http://patchwork.dpdk.org/series/12370/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/78146/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/78146/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id ADD79A04B7;\n\tMon, 21 Sep 2020 08:53:14 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id BA9821D96C;\n\tMon, 21 Sep 2020 08:53:01 +0200 (CEST)",
            "from mga18.intel.com (mga18.intel.com [134.134.136.126])\n by dpdk.org (Postfix) with ESMTP id AF07B1D941\n for <dev@dpdk.org>; Mon, 21 Sep 2020 08:52:57 +0200 (CEST)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 20 Sep 2020 23:52:57 -0700",
            "from npg-dpdk-virtual-marvin-dev.sh.intel.com ([10.67.119.56])\n by fmsmga001.fm.intel.com with ESMTP; 20 Sep 2020 23:52:55 -0700"
        ],
        "IronPort-SDR": [
            "\n 9b5i0YZYYDhrdXVGqBquCCeoW8i04MceT7dWJGvLIb4rF8gNsy/p3f9nuiGvrSJb0NjmceOmVl\n oBZfXyAy/qcQ==",
            "\n n2Eo3wocq779hKaPd/9Uzj5U0CubfOidECM1fqIQwFlm9MsVJ8OqmLlcqVQqmp06WGvkGfd2Bb\n rKayZw8+fIgg=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9750\"; a=\"148073426\"",
            "E=Sophos;i=\"5.77,285,1596524400\"; d=\"scan'208\";a=\"148073426\"",
            "E=Sophos;i=\"5.77,285,1596524400\"; d=\"scan'208\";a=\"412078408\""
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "From": "Marvin Liu <yong.liu@intel.com>",
        "To": "maxime.coquelin@redhat.com, chenbo.xia@intel.com, zhihong.wang@intel.com",
        "Cc": "dev@dpdk.org,\n\tMarvin Liu <yong.liu@intel.com>",
        "Date": "Mon, 21 Sep 2020 14:48:34 +0800",
        "Message-Id": "<20200921064837.15957-3-yong.liu@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20200921064837.15957-1-yong.liu@intel.com>",
        "References": "<20200819032414.51430-2-yong.liu@intel.com>\n <20200921064837.15957-1-yong.liu@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v2 2/5] vhost: reuse packed ring functions",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "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",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Move parse_ethernet, offload, extbuf functions to header file. These\nfunctions will be reused by vhost vectorized path.\n\nSigned-off-by: Marvin Liu <yong.liu@intel.com>",
    "diff": "diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h\nindex b556eb3bf6..5a5c945551 100644\n--- a/lib/librte_vhost/vhost.h\n+++ b/lib/librte_vhost/vhost.h\n@@ -20,6 +20,10 @@\n #include <rte_rwlock.h>\n #include <rte_malloc.h>\n \n+#include <rte_ip.h>\n+#include <rte_tcp.h>\n+#include <rte_udp.h>\n+#include <rte_sctp.h>\n #include \"rte_vhost.h\"\n #include \"rte_vdpa.h\"\n #include \"rte_vdpa_dev.h\"\n@@ -905,4 +909,215 @@ put_zmbuf(struct zcopy_mbuf *zmbuf)\n \tzmbuf->in_use = 0;\n }\n \n+static  __rte_always_inline bool\n+virtio_net_is_inorder(struct virtio_net *dev)\n+{\n+\treturn dev->features & (1ULL << VIRTIO_F_IN_ORDER);\n+}\n+\n+static __rte_always_inline void\n+parse_ethernet(struct rte_mbuf *m, uint16_t *l4_proto, void **l4_hdr)\n+{\n+\tstruct rte_ipv4_hdr *ipv4_hdr;\n+\tstruct rte_ipv6_hdr *ipv6_hdr;\n+\tvoid *l3_hdr = NULL;\n+\tstruct rte_ether_hdr *eth_hdr;\n+\tuint16_t ethertype;\n+\n+\teth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);\n+\n+\tm->l2_len = sizeof(struct rte_ether_hdr);\n+\tethertype = rte_be_to_cpu_16(eth_hdr->ether_type);\n+\n+\tif (ethertype == RTE_ETHER_TYPE_VLAN) {\n+\t\tstruct rte_vlan_hdr *vlan_hdr =\n+\t\t\t(struct rte_vlan_hdr *)(eth_hdr + 1);\n+\n+\t\tm->l2_len += sizeof(struct rte_vlan_hdr);\n+\t\tethertype = rte_be_to_cpu_16(vlan_hdr->eth_proto);\n+\t}\n+\n+\tl3_hdr = (char *)eth_hdr + m->l2_len;\n+\n+\tswitch (ethertype) {\n+\tcase RTE_ETHER_TYPE_IPV4:\n+\t\tipv4_hdr = l3_hdr;\n+\t\t*l4_proto = ipv4_hdr->next_proto_id;\n+\t\tm->l3_len = (ipv4_hdr->version_ihl & 0x0f) * 4;\n+\t\t*l4_hdr = (char *)l3_hdr + m->l3_len;\n+\t\tm->ol_flags |= PKT_TX_IPV4;\n+\t\tbreak;\n+\tcase RTE_ETHER_TYPE_IPV6:\n+\t\tipv6_hdr = l3_hdr;\n+\t\t*l4_proto = ipv6_hdr->proto;\n+\t\tm->l3_len = sizeof(struct rte_ipv6_hdr);\n+\t\t*l4_hdr = (char *)l3_hdr + m->l3_len;\n+\t\tm->ol_flags |= PKT_TX_IPV6;\n+\t\tbreak;\n+\tdefault:\n+\t\tm->l3_len = 0;\n+\t\t*l4_proto = 0;\n+\t\t*l4_hdr = NULL;\n+\t\tbreak;\n+\t}\n+}\n+\n+static __rte_always_inline bool\n+virtio_net_with_host_offload(struct virtio_net *dev)\n+{\n+\tif (dev->features &\n+\t\t\t((1ULL << VIRTIO_NET_F_CSUM) |\n+\t\t\t (1ULL << VIRTIO_NET_F_HOST_ECN) |\n+\t\t\t (1ULL << VIRTIO_NET_F_HOST_TSO4) |\n+\t\t\t (1ULL << VIRTIO_NET_F_HOST_TSO6) |\n+\t\t\t (1ULL << VIRTIO_NET_F_HOST_UFO)))\n+\t\treturn true;\n+\n+\treturn false;\n+}\n+\n+static __rte_always_inline void\n+vhost_dequeue_offload(struct virtio_net_hdr *hdr, struct rte_mbuf *m)\n+{\n+\tuint16_t l4_proto = 0;\n+\tvoid *l4_hdr = NULL;\n+\tstruct rte_tcp_hdr *tcp_hdr = NULL;\n+\n+\tif (hdr->flags == 0 && hdr->gso_type == VIRTIO_NET_HDR_GSO_NONE)\n+\t\treturn;\n+\n+\tparse_ethernet(m, &l4_proto, &l4_hdr);\n+\tif (hdr->flags == VIRTIO_NET_HDR_F_NEEDS_CSUM) {\n+\t\tif (hdr->csum_start == (m->l2_len + m->l3_len)) {\n+\t\t\tswitch (hdr->csum_offset) {\n+\t\t\tcase (offsetof(struct rte_tcp_hdr, cksum)):\n+\t\t\t\tif (l4_proto == IPPROTO_TCP)\n+\t\t\t\t\tm->ol_flags |= PKT_TX_TCP_CKSUM;\n+\t\t\t\tbreak;\n+\t\t\tcase (offsetof(struct rte_udp_hdr, dgram_cksum)):\n+\t\t\t\tif (l4_proto == IPPROTO_UDP)\n+\t\t\t\t\tm->ol_flags |= PKT_TX_UDP_CKSUM;\n+\t\t\t\tbreak;\n+\t\t\tcase (offsetof(struct rte_sctp_hdr, cksum)):\n+\t\t\t\tif (l4_proto == IPPROTO_SCTP)\n+\t\t\t\t\tm->ol_flags |= PKT_TX_SCTP_CKSUM;\n+\t\t\t\tbreak;\n+\t\t\tdefault:\n+\t\t\t\tbreak;\n+\t\t\t}\n+\t\t}\n+\t}\n+\n+\tif (l4_hdr && hdr->gso_type != VIRTIO_NET_HDR_GSO_NONE) {\n+\t\tswitch (hdr->gso_type & ~VIRTIO_NET_HDR_GSO_ECN) {\n+\t\tcase VIRTIO_NET_HDR_GSO_TCPV4:\n+\t\tcase VIRTIO_NET_HDR_GSO_TCPV6:\n+\t\t\ttcp_hdr = l4_hdr;\n+\t\t\tm->ol_flags |= PKT_TX_TCP_SEG;\n+\t\t\tm->tso_segsz = hdr->gso_size;\n+\t\t\tm->l4_len = (tcp_hdr->data_off & 0xf0) >> 2;\n+\t\t\tbreak;\n+\t\tcase VIRTIO_NET_HDR_GSO_UDP:\n+\t\t\tm->ol_flags |= PKT_TX_UDP_SEG;\n+\t\t\tm->tso_segsz = hdr->gso_size;\n+\t\t\tm->l4_len = sizeof(struct rte_udp_hdr);\n+\t\t\tbreak;\n+\t\tdefault:\n+\t\t\tVHOST_LOG_DATA(WARNING,\n+\t\t\t\t\"unsupported gso type %u.\\n\", hdr->gso_type);\n+\t\t\tbreak;\n+\t\t}\n+\t}\n+}\n+\n+static void\n+virtio_dev_extbuf_free(void *addr __rte_unused, void *opaque)\n+{\n+\trte_free(opaque);\n+}\n+\n+static int\n+virtio_dev_extbuf_alloc(struct rte_mbuf *pkt, uint32_t size)\n+{\n+\tstruct rte_mbuf_ext_shared_info *shinfo = NULL;\n+\tuint32_t total_len = RTE_PKTMBUF_HEADROOM + size;\n+\tuint16_t buf_len;\n+\trte_iova_t iova;\n+\tvoid *buf;\n+\n+\t/* Try to use pkt buffer to store shinfo to reduce the amount of memory\n+\t * required, otherwise store shinfo in the new buffer.\n+\t */\n+\tif (rte_pktmbuf_tailroom(pkt) >= sizeof(*shinfo))\n+\t\tshinfo = rte_pktmbuf_mtod(pkt,\n+\t\t\t\t\t  struct rte_mbuf_ext_shared_info *);\n+\telse {\n+\t\ttotal_len += sizeof(*shinfo) + sizeof(uintptr_t);\n+\t\ttotal_len = RTE_ALIGN_CEIL(total_len, sizeof(uintptr_t));\n+\t}\n+\n+\tif (unlikely(total_len > UINT16_MAX))\n+\t\treturn -ENOSPC;\n+\n+\tbuf_len = total_len;\n+\tbuf = rte_malloc(NULL, buf_len, RTE_CACHE_LINE_SIZE);\n+\tif (unlikely(buf == NULL))\n+\t\treturn -ENOMEM;\n+\n+\t/* Initialize shinfo */\n+\tif (shinfo) {\n+\t\tshinfo->free_cb = virtio_dev_extbuf_free;\n+\t\tshinfo->fcb_opaque = buf;\n+\t\trte_mbuf_ext_refcnt_set(shinfo, 1);\n+\t} else {\n+\t\tshinfo = rte_pktmbuf_ext_shinfo_init_helper(buf, &buf_len,\n+\t\t\t\t\t      virtio_dev_extbuf_free, buf);\n+\t\tif (unlikely(shinfo == NULL)) {\n+\t\t\trte_free(buf);\n+\t\t\tVHOST_LOG_DATA(ERR, \"Failed to init shinfo\\n\");\n+\t\t\treturn -1;\n+\t\t}\n+\t}\n+\n+\tiova = rte_malloc_virt2iova(buf);\n+\trte_pktmbuf_attach_extbuf(pkt, buf, iova, buf_len, shinfo);\n+\trte_pktmbuf_reset_headroom(pkt);\n+\n+\treturn 0;\n+}\n+\n+/*\n+ * Allocate a host supported pktmbuf.\n+ */\n+static __rte_always_inline struct rte_mbuf *\n+virtio_dev_pktmbuf_alloc(struct virtio_net *dev, struct rte_mempool *mp,\n+\t\t\t uint32_t data_len)\n+{\n+\tstruct rte_mbuf *pkt = rte_pktmbuf_alloc(mp);\n+\n+\tif (unlikely(pkt == NULL)) {\n+\t\tVHOST_LOG_DATA(ERR,\n+\t\t\t\"Failed to allocate memory for mbuf.\\n\");\n+\t\treturn NULL;\n+\t}\n+\n+\tif (rte_pktmbuf_tailroom(pkt) >= data_len)\n+\t\treturn pkt;\n+\n+\t/* attach an external buffer if supported */\n+\tif (dev->extbuf && !virtio_dev_extbuf_alloc(pkt, data_len))\n+\t\treturn pkt;\n+\n+\t/* check if chained buffers are allowed */\n+\tif (!dev->linearbuf)\n+\t\treturn pkt;\n+\n+\t/* Data doesn't fit into the buffer and the host supports\n+\t * only linear buffers\n+\t */\n+\trte_pktmbuf_free(pkt);\n+\n+\treturn NULL;\n+}\n+\n #endif /* _VHOST_NET_CDEV_H_ */\ndiff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c\nindex bd9303c8a9..6107662685 100644\n--- a/lib/librte_vhost/virtio_net.c\n+++ b/lib/librte_vhost/virtio_net.c\n@@ -32,12 +32,6 @@ rxvq_is_mergeable(struct virtio_net *dev)\n \treturn dev->features & (1ULL << VIRTIO_NET_F_MRG_RXBUF);\n }\n \n-static  __rte_always_inline bool\n-virtio_net_is_inorder(struct virtio_net *dev)\n-{\n-\treturn dev->features & (1ULL << VIRTIO_F_IN_ORDER);\n-}\n-\n static bool\n is_valid_virt_queue_idx(uint32_t idx, int is_tx, uint32_t nr_vring)\n {\n@@ -1804,121 +1798,6 @@ rte_vhost_submit_enqueue_burst(int vid, uint16_t queue_id,\n \treturn virtio_dev_rx_async_submit(dev, queue_id, pkts, count);\n }\n \n-static inline bool\n-virtio_net_with_host_offload(struct virtio_net *dev)\n-{\n-\tif (dev->features &\n-\t\t\t((1ULL << VIRTIO_NET_F_CSUM) |\n-\t\t\t (1ULL << VIRTIO_NET_F_HOST_ECN) |\n-\t\t\t (1ULL << VIRTIO_NET_F_HOST_TSO4) |\n-\t\t\t (1ULL << VIRTIO_NET_F_HOST_TSO6) |\n-\t\t\t (1ULL << VIRTIO_NET_F_HOST_UFO)))\n-\t\treturn true;\n-\n-\treturn false;\n-}\n-\n-static void\n-parse_ethernet(struct rte_mbuf *m, uint16_t *l4_proto, void **l4_hdr)\n-{\n-\tstruct rte_ipv4_hdr *ipv4_hdr;\n-\tstruct rte_ipv6_hdr *ipv6_hdr;\n-\tvoid *l3_hdr = NULL;\n-\tstruct rte_ether_hdr *eth_hdr;\n-\tuint16_t ethertype;\n-\n-\teth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);\n-\n-\tm->l2_len = sizeof(struct rte_ether_hdr);\n-\tethertype = rte_be_to_cpu_16(eth_hdr->ether_type);\n-\n-\tif (ethertype == RTE_ETHER_TYPE_VLAN) {\n-\t\tstruct rte_vlan_hdr *vlan_hdr =\n-\t\t\t(struct rte_vlan_hdr *)(eth_hdr + 1);\n-\n-\t\tm->l2_len += sizeof(struct rte_vlan_hdr);\n-\t\tethertype = rte_be_to_cpu_16(vlan_hdr->eth_proto);\n-\t}\n-\n-\tl3_hdr = (char *)eth_hdr + m->l2_len;\n-\n-\tswitch (ethertype) {\n-\tcase RTE_ETHER_TYPE_IPV4:\n-\t\tipv4_hdr = l3_hdr;\n-\t\t*l4_proto = ipv4_hdr->next_proto_id;\n-\t\tm->l3_len = (ipv4_hdr->version_ihl & 0x0f) * 4;\n-\t\t*l4_hdr = (char *)l3_hdr + m->l3_len;\n-\t\tm->ol_flags |= PKT_TX_IPV4;\n-\t\tbreak;\n-\tcase RTE_ETHER_TYPE_IPV6:\n-\t\tipv6_hdr = l3_hdr;\n-\t\t*l4_proto = ipv6_hdr->proto;\n-\t\tm->l3_len = sizeof(struct rte_ipv6_hdr);\n-\t\t*l4_hdr = (char *)l3_hdr + m->l3_len;\n-\t\tm->ol_flags |= PKT_TX_IPV6;\n-\t\tbreak;\n-\tdefault:\n-\t\tm->l3_len = 0;\n-\t\t*l4_proto = 0;\n-\t\t*l4_hdr = NULL;\n-\t\tbreak;\n-\t}\n-}\n-\n-static __rte_always_inline void\n-vhost_dequeue_offload(struct virtio_net_hdr *hdr, struct rte_mbuf *m)\n-{\n-\tuint16_t l4_proto = 0;\n-\tvoid *l4_hdr = NULL;\n-\tstruct rte_tcp_hdr *tcp_hdr = NULL;\n-\n-\tif (hdr->flags == 0 && hdr->gso_type == VIRTIO_NET_HDR_GSO_NONE)\n-\t\treturn;\n-\n-\tparse_ethernet(m, &l4_proto, &l4_hdr);\n-\tif (hdr->flags == VIRTIO_NET_HDR_F_NEEDS_CSUM) {\n-\t\tif (hdr->csum_start == (m->l2_len + m->l3_len)) {\n-\t\t\tswitch (hdr->csum_offset) {\n-\t\t\tcase (offsetof(struct rte_tcp_hdr, cksum)):\n-\t\t\t\tif (l4_proto == IPPROTO_TCP)\n-\t\t\t\t\tm->ol_flags |= PKT_TX_TCP_CKSUM;\n-\t\t\t\tbreak;\n-\t\t\tcase (offsetof(struct rte_udp_hdr, dgram_cksum)):\n-\t\t\t\tif (l4_proto == IPPROTO_UDP)\n-\t\t\t\t\tm->ol_flags |= PKT_TX_UDP_CKSUM;\n-\t\t\t\tbreak;\n-\t\t\tcase (offsetof(struct rte_sctp_hdr, cksum)):\n-\t\t\t\tif (l4_proto == IPPROTO_SCTP)\n-\t\t\t\t\tm->ol_flags |= PKT_TX_SCTP_CKSUM;\n-\t\t\t\tbreak;\n-\t\t\tdefault:\n-\t\t\t\tbreak;\n-\t\t\t}\n-\t\t}\n-\t}\n-\n-\tif (l4_hdr && hdr->gso_type != VIRTIO_NET_HDR_GSO_NONE) {\n-\t\tswitch (hdr->gso_type & ~VIRTIO_NET_HDR_GSO_ECN) {\n-\t\tcase VIRTIO_NET_HDR_GSO_TCPV4:\n-\t\tcase VIRTIO_NET_HDR_GSO_TCPV6:\n-\t\t\ttcp_hdr = l4_hdr;\n-\t\t\tm->ol_flags |= PKT_TX_TCP_SEG;\n-\t\t\tm->tso_segsz = hdr->gso_size;\n-\t\t\tm->l4_len = (tcp_hdr->data_off & 0xf0) >> 2;\n-\t\t\tbreak;\n-\t\tcase VIRTIO_NET_HDR_GSO_UDP:\n-\t\t\tm->ol_flags |= PKT_TX_UDP_SEG;\n-\t\t\tm->tso_segsz = hdr->gso_size;\n-\t\t\tm->l4_len = sizeof(struct rte_udp_hdr);\n-\t\t\tbreak;\n-\t\tdefault:\n-\t\t\tVHOST_LOG_DATA(WARNING,\n-\t\t\t\t\"unsupported gso type %u.\\n\", hdr->gso_type);\n-\t\t\tbreak;\n-\t\t}\n-\t}\n-}\n-\n static __rte_noinline void\n copy_vnet_hdr_from_desc(struct virtio_net_hdr *hdr,\n \t\tstruct buf_vector *buf_vec)\n@@ -2145,96 +2024,6 @@ get_zmbuf(struct vhost_virtqueue *vq)\n \treturn NULL;\n }\n \n-static void\n-virtio_dev_extbuf_free(void *addr __rte_unused, void *opaque)\n-{\n-\trte_free(opaque);\n-}\n-\n-static int\n-virtio_dev_extbuf_alloc(struct rte_mbuf *pkt, uint32_t size)\n-{\n-\tstruct rte_mbuf_ext_shared_info *shinfo = NULL;\n-\tuint32_t total_len = RTE_PKTMBUF_HEADROOM + size;\n-\tuint16_t buf_len;\n-\trte_iova_t iova;\n-\tvoid *buf;\n-\n-\t/* Try to use pkt buffer to store shinfo to reduce the amount of memory\n-\t * required, otherwise store shinfo in the new buffer.\n-\t */\n-\tif (rte_pktmbuf_tailroom(pkt) >= sizeof(*shinfo))\n-\t\tshinfo = rte_pktmbuf_mtod(pkt,\n-\t\t\t\t\t  struct rte_mbuf_ext_shared_info *);\n-\telse {\n-\t\ttotal_len += sizeof(*shinfo) + sizeof(uintptr_t);\n-\t\ttotal_len = RTE_ALIGN_CEIL(total_len, sizeof(uintptr_t));\n-\t}\n-\n-\tif (unlikely(total_len > UINT16_MAX))\n-\t\treturn -ENOSPC;\n-\n-\tbuf_len = total_len;\n-\tbuf = rte_malloc(NULL, buf_len, RTE_CACHE_LINE_SIZE);\n-\tif (unlikely(buf == NULL))\n-\t\treturn -ENOMEM;\n-\n-\t/* Initialize shinfo */\n-\tif (shinfo) {\n-\t\tshinfo->free_cb = virtio_dev_extbuf_free;\n-\t\tshinfo->fcb_opaque = buf;\n-\t\trte_mbuf_ext_refcnt_set(shinfo, 1);\n-\t} else {\n-\t\tshinfo = rte_pktmbuf_ext_shinfo_init_helper(buf, &buf_len,\n-\t\t\t\t\t      virtio_dev_extbuf_free, buf);\n-\t\tif (unlikely(shinfo == NULL)) {\n-\t\t\trte_free(buf);\n-\t\t\tVHOST_LOG_DATA(ERR, \"Failed to init shinfo\\n\");\n-\t\t\treturn -1;\n-\t\t}\n-\t}\n-\n-\tiova = rte_malloc_virt2iova(buf);\n-\trte_pktmbuf_attach_extbuf(pkt, buf, iova, buf_len, shinfo);\n-\trte_pktmbuf_reset_headroom(pkt);\n-\n-\treturn 0;\n-}\n-\n-/*\n- * Allocate a host supported pktmbuf.\n- */\n-static __rte_always_inline struct rte_mbuf *\n-virtio_dev_pktmbuf_alloc(struct virtio_net *dev, struct rte_mempool *mp,\n-\t\t\t uint32_t data_len)\n-{\n-\tstruct rte_mbuf *pkt = rte_pktmbuf_alloc(mp);\n-\n-\tif (unlikely(pkt == NULL)) {\n-\t\tVHOST_LOG_DATA(ERR,\n-\t\t\t\"Failed to allocate memory for mbuf.\\n\");\n-\t\treturn NULL;\n-\t}\n-\n-\tif (rte_pktmbuf_tailroom(pkt) >= data_len)\n-\t\treturn pkt;\n-\n-\t/* attach an external buffer if supported */\n-\tif (dev->extbuf && !virtio_dev_extbuf_alloc(pkt, data_len))\n-\t\treturn pkt;\n-\n-\t/* check if chained buffers are allowed */\n-\tif (!dev->linearbuf)\n-\t\treturn pkt;\n-\n-\t/* Data doesn't fit into the buffer and the host supports\n-\t * only linear buffers\n-\t */\n-\trte_pktmbuf_free(pkt);\n-\n-\treturn NULL;\n-}\n-\n static __rte_noinline uint16_t\n virtio_dev_tx_split(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \tstruct rte_mempool *mbuf_pool, struct rte_mbuf **pkts, uint16_t count)\n",
    "prefixes": [
        "v2",
        "2/5"
    ]
}