Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/21425/?format=api
http://patches.dpdk.org/api/patches/21425/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20170306082740.5675-5-maxime.coquelin@redhat.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": "<20170306082740.5675-5-maxime.coquelin@redhat.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20170306082740.5675-5-maxime.coquelin@redhat.com", "date": "2017-03-06T08:27:37", "name": "[dpdk-dev,v2,4/7] vhost: Add API to get MTU value", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "6999bc95bb93a56b4035432e5e959050a23319bc", "submitter": { "id": 512, "url": "http://patches.dpdk.org/api/people/512/?format=api", "name": "Maxime Coquelin", "email": "maxime.coquelin@redhat.com" }, "delegate": { "id": 355, "url": "http://patches.dpdk.org/api/users/355/?format=api", "username": "yliu", "first_name": "Yuanhan", "last_name": "Liu", "email": "yuanhan.liu@linux.intel.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20170306082740.5675-5-maxime.coquelin@redhat.com/mbox/", "series": [], "comments": "http://patches.dpdk.org/api/patches/21425/comments/", "check": "fail", "checks": "http://patches.dpdk.org/api/patches/21425/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 A5EBCBD32;\n\tMon, 6 Mar 2017 09:28:34 +0100 (CET)", "from mx1.redhat.com (mx1.redhat.com [209.132.183.28])\n\tby dpdk.org (Postfix) with ESMTP id E98BB567C\n\tfor <dev@dpdk.org>; Mon, 6 Mar 2017 09:28:05 +0100 (CET)", "from int-mx13.intmail.prod.int.phx2.redhat.com\n\t(int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 1912DC00BB3A;\n\tMon, 6 Mar 2017 08:28:06 +0000 (UTC)", "from max-t460s.redhat.com (ovpn-116-235.ams2.redhat.com\n\t[10.36.116.235])\n\tby int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with\n\tESMTP id v268RmvE006934; Mon, 6 Mar 2017 03:28:02 -0500" ], "From": "Maxime Coquelin <maxime.coquelin@redhat.com>", "To": "aconole@redhat.com, sodey@sonusnet.com, yuanhan.liu@linux.intel.com,\n\tjianfeng.tan@intel.com, dev@dpdk.org", "Cc": "Maxime Coquelin <maxime.coquelin@redhat.com>", "Date": "Mon, 6 Mar 2017 09:27:37 +0100", "Message-Id": "<20170306082740.5675-5-maxime.coquelin@redhat.com>", "In-Reply-To": "<20170306082740.5675-1-maxime.coquelin@redhat.com>", "References": "<20170213142820.8964-1-maxime.coquelin@redhat.com>\n\t<20170306082740.5675-1-maxime.coquelin@redhat.com>", "X-Scanned-By": "MIMEDefang 2.68 on 10.5.11.26", "X-Greylist": "Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.31]); Mon, 06 Mar 2017 08:28:06 +0000 (UTC)", "Subject": "[dpdk-dev] [PATCH v2 4/7] vhost: Add API to get MTU value", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <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": "This patch implements the function for the application to\nget the MTU value.\n\nrte_vhost_mtu_get() fills the mtu parameter with the MTU value\nset in QEMU if VIRTIO_NET_F_MTU has been negotiated and returns 0,\n-ENOTSUP otherwise.\n\nThe function returns -EAGAIN if Virtio feature negotiation\ndidn't happened yet.\n\nSigned-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>\n---\n lib/librte_vhost/rte_virtio_net.h | 15 +++++++++++++++\n lib/librte_vhost/vhost.c | 19 +++++++++++++++++++\n 2 files changed, 34 insertions(+)", "diff": "diff --git a/lib/librte_vhost/rte_virtio_net.h b/lib/librte_vhost/rte_virtio_net.h\nindex 926039c..ff02e9b 100644\n--- a/lib/librte_vhost/rte_virtio_net.h\n+++ b/lib/librte_vhost/rte_virtio_net.h\n@@ -100,6 +100,21 @@ int rte_vhost_driver_callback_register(struct virtio_net_device_ops const * cons\n int rte_vhost_driver_session_start(void);\n \n /**\n+ * Get the MTU value of the device if set in QEMU.\n+ *\n+ * @param vid\n+ * virtio-net device ID\n+ * @param mtu\n+ * The variable to store the MTU value\n+ *\n+ * @return\n+ * 0: success\n+ * -EAGAIN: device not yet started\n+ * -ENOTSUP: device does not support MTU feature\n+ */\n+int rte_vhost_mtu_get(int vid, uint16_t *mtu);\n+\n+/**\n * Get the numa node from which the virtio net device's memory\n * is allocated.\n *\ndiff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c\nindex 3974087..bbf7f7e 100644\n--- a/lib/librte_vhost/vhost.c\n+++ b/lib/librte_vhost/vhost.c\n@@ -313,6 +313,25 @@ vhost_enable_dequeue_zero_copy(int vid)\n }\n \n int\n+rte_vhost_mtu_get(int vid, uint16_t *mtu)\n+{\n+\tstruct virtio_net *dev = get_device(vid);\n+\n+\tif (!dev)\n+\t\treturn -ENODEV;\n+\n+\tif (!(dev->flags & VIRTIO_DEV_READY))\n+\t\treturn -EAGAIN;\n+\n+\tif (!(dev->features & VIRTIO_NET_F_MTU))\n+\t\treturn -ENOTSUP;\n+\n+\t*mtu = dev->mtu;\n+\n+\treturn 0;\n+}\n+\n+int\n rte_vhost_get_numa_node(int vid)\n {\n #ifdef RTE_LIBRTE_VHOST_NUMA\n", "prefixes": [ "dpdk-dev", "v2", "4/7" ] }{ "id": 21425, "url": "