Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/6834/?format=api
http://patches.dpdk.org/api/patches/6834/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1441014108-3125-8-git-send-email-jijiang.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": "<1441014108-3125-8-git-send-email-jijiang.liu@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1441014108-3125-8-git-send-email-jijiang.liu@intel.com", "date": "2015-08-31T09:41:47", "name": "[dpdk-dev,RFC,7/8] examples/vhost:support tso in vhost sample", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "1f822e3ca84252b3cd0cd39811283448a7a259ac", "submitter": { "id": 52, "url": "http://patches.dpdk.org/api/people/52/?format=api", "name": "Jijiang Liu", "email": "jijiang.liu@intel.com" }, "delegate": null, "mbox": "http://patches.dpdk.org/project/dpdk/patch/1441014108-3125-8-git-send-email-jijiang.liu@intel.com/mbox/", "series": [], "comments": "http://patches.dpdk.org/api/patches/6834/comments/", "check": "pending", "checks": "http://patches.dpdk.org/api/patches/6834/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 BBDCB91C0;\n\tMon, 31 Aug 2015 11:42:16 +0200 (CEST)", "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby dpdk.org (Postfix) with ESMTP id 92C4C91BF\n\tfor <dev@dpdk.org>; Mon, 31 Aug 2015 11:42:15 +0200 (CEST)", "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby fmsmga103.fm.intel.com with ESMTP; 31 Aug 2015 02:42:15 -0700", "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby orsmga001.jf.intel.com with ESMTP; 31 Aug 2015 02:42:14 -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 t7V9gCKs007100;\n\tMon, 31 Aug 2015 17:42:12 +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 t7V9gAbx003217; Mon, 31 Aug 2015 17:42:12 +0800", "(from jijiangl@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t7V9gAKr003213; \n\tMon, 31 Aug 2015 17:42:10 +0800" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.17,439,1437462000\"; d=\"scan'208\";a=\"759004671\"", "From": "Jijiang Liu <jijiang.liu@intel.com>", "To": "dev@dpdk.org", "Date": "Mon, 31 Aug 2015 17:41:47 +0800", "Message-Id": "<1441014108-3125-8-git-send-email-jijiang.liu@intel.com>", "X-Mailer": "git-send-email 1.7.12.2", "In-Reply-To": "<1441014108-3125-1-git-send-email-jijiang.liu@intel.com>", "References": "<1441014108-3125-1-git-send-email-jijiang.liu@intel.com>", "Subject": "[dpdk-dev] [RFC PATCH 7/8] examples/vhost:support tso in vhost\n\tsample", "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": "Change the vhost sample in order to support and test TSO offload.\n\nSigned-off-by: Jijiang Liu <jijiang.liu@intel.com>\n---\n examples/vhost/main.c | 20 ++++++++++++++++++--\n 1 files changed, 18 insertions(+), 2 deletions(-)", "diff": "diff --git a/examples/vhost/main.c b/examples/vhost/main.c\nindex 1b137b9..482f7af 100644\n--- a/examples/vhost/main.c\n+++ b/examples/vhost/main.c\n@@ -50,6 +50,7 @@\n #include <rte_string_fns.h>\n #include <rte_malloc.h>\n #include <rte_virtio_net.h>\n+#include <rte_tcp.h>\n \n #include \"main.h\"\n \n@@ -441,6 +442,9 @@ port_init(uint8_t port)\n \n \tif (port >= rte_eth_dev_count()) return -1;\n \n+\tif (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_TCP_TSO)\n+\t\trte_vhost_feature_enable(1ULL << VIRTIO_NET_F_HOST_TSO4);\n+\n \trx_rings = (uint16_t)dev_info.max_rx_queues;\n \t/* Configure ethernet device. */\n \tretval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);\n@@ -1148,6 +1152,13 @@ virtio_tx_route(struct vhost_dev *vdev, struct rte_mbuf *m, uint16_t vlan_tag)\n \tlen = tx_q->len;\n \n \tnh = rte_pktmbuf_mtod(m, struct ether_hdr *);\n+\tm->l2_len = sizeof(struct ether_hdr);\n+\tm->l3_len = sizeof(struct ipv4_hdr);\n+\tif (m->tso_segsz) {\n+\t\tm->l4_len = sizeof(struct tcp_hdr);\n+\t\tm->ol_flags |= PKT_TX_IP_CKSUM;\n+\t}\n+\n \tif (unlikely(nh->ether_type == rte_cpu_to_be_16(ETHER_TYPE_VLAN))) {\n \t\t/* Guest has inserted the vlan tag. */\n \t\tstruct vlan_hdr *vh = (struct vlan_hdr *) (nh + 1);\n@@ -1155,8 +1166,9 @@ virtio_tx_route(struct vhost_dev *vdev, struct rte_mbuf *m, uint16_t vlan_tag)\n \t\tif ((vm2vm_mode == VM2VM_HARDWARE) &&\n \t\t\t(vh->vlan_tci != vlan_tag_be))\n \t\t\tvh->vlan_tci = vlan_tag_be;\n+\t\tm->l2_len += sizeof(struct vlan_hdr); \n \t} else {\n-\t\tm->ol_flags = PKT_TX_VLAN_PKT;\n+\t\tm->ol_flags |= PKT_TX_VLAN_PKT;\n \n \t\t/*\n \t\t * Find the right seg to adjust the data len when offset is\n@@ -1841,10 +1853,14 @@ virtio_tx_route_zcp(struct virtio_net *dev, struct rte_mbuf *m,\n \t\tmbuf->buf_physaddr = m->buf_physaddr;\n \t\tmbuf->buf_addr = m->buf_addr;\n \t}\n-\tmbuf->ol_flags = PKT_TX_VLAN_PKT;\n+\tmbuf->ol_flags |= PKT_TX_VLAN_PKT;\n \tmbuf->vlan_tci = vlan_tag;\n \tmbuf->l2_len = sizeof(struct ether_hdr);\n \tmbuf->l3_len = sizeof(struct ipv4_hdr);\n+\tif (mbuf->tso_segsz) {\n+\t\tmbuf->l4_len = sizeof(struct tcp_hdr);\n+\t\tmbuf->ol_flags |= PKT_TX_IP_CKSUM;\n+\t}\n \tMBUF_HEADROOM_UINT32(mbuf) = (uint32_t)desc_idx;\n \n \ttx_q->m_table[len] = mbuf;\n", "prefixes": [ "dpdk-dev", "RFC", "7/8" ] }{ "id": 6834, "url": "