Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1950/?format=api
http://patches.dpdk.org/api/patches/1950/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1418275627-17145-1-git-send-email-jmiao@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": "<1418275627-17145-1-git-send-email-jmiao@redhat.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1418275627-17145-1-git-send-email-jmiao@redhat.com", "date": "2014-12-11T05:27:07", "name": "[dpdk-dev] kni: fix build on RHEL6.5", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "508bf57be2f8690f35b0928c724a37fb06dd4989", "submitter": { "id": 99, "url": "http://patches.dpdk.org/api/people/99/?format=api", "name": "Jincheng Miao", "email": "jmiao@redhat.com" }, "delegate": null, "mbox": "http://patches.dpdk.org/project/dpdk/patch/1418275627-17145-1-git-send-email-jmiao@redhat.com/mbox/", "series": [], "comments": "http://patches.dpdk.org/api/patches/1950/comments/", "check": "pending", "checks": "http://patches.dpdk.org/api/patches/1950/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 55DB16A95;\n\tThu, 11 Dec 2014 06:29:40 +0100 (CET)", "from mx1.redhat.com (mx1.redhat.com [209.132.183.28])\n\tby dpdk.org (Postfix) with ESMTP id E182368BE\n\tfor <dev@dpdk.org>; Thu, 11 Dec 2014 06:29:38 +0100 (CET)", "from int-mx11.intmail.prod.int.phx2.redhat.com\n\t(int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24])\n\tby mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sBB5TZJa016019\n\t(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256\n\tverify=FAIL); Thu, 11 Dec 2014 00:29:35 -0500", "from dhcp-66-71-51.eng.nay.redhat.com.com\n\t(dhcp-66-71-51.eng.nay.redhat.com [10.66.71.51] (may be forged))\n\tby int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with\n\tESMTP id sBB5TVec024921; Thu, 11 Dec 2014 00:29:32 -0500" ], "From": "Jincheng Miao <jmiao@redhat.com>", "To": "dev@dpdk.org", "Date": "Thu, 11 Dec 2014 13:27:07 +0800", "Message-Id": "<1418275627-17145-1-git-send-email-jmiao@redhat.com>", "X-Scanned-By": "MIMEDefang 2.68 on 10.5.11.24", "Subject": "[dpdk-dev] [PATCH] kni: fix build on RHEL6.5", "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": "RHEL6.5 kernel is based on 2.6.32. But there are two changing\nfrom 2.6.35:\n1. socket struct is changed\nIt wrappered previous wait_queue_head_t of socket to\nstruct socket_wq. So for the kernel older than 2.6.35, we should\ndirectly use socket->wait instead.\n\n2. new function sk_sleep()\nThis function is implemented from 2.6.35 to obtain wait queue\nfrom struct sock. This patch adds a macro in kni/compat.h\nto be compatible with older kernels.\n\nPatch is tested in RHEL6.5 and RHEL7.0 with:\nCONFIG_RTE_LIBRTE_KNI=y\nCONFIG_RTE_KNI_KO_DEBUG=y\nCONFIG_RTE_KNI_VHOST=y\nCONFIG_RTE_KNI_VHOST_MAX_CACHE_SIZE=1024\nCONFIG_RTE_KNI_VHOST_VNET_HDR_EN=y\nCONFIG_RTE_KNI_VHOST_DEBUG_RX=y\nCONFIG_RTE_KNI_VHOST_DEBUG_TX=y\n\n\nSigned-off-by: Jincheng Miao <jmiao@redhat.com>\n---\n lib/librte_eal/linuxapp/kni/compat.h | 6 ++++++\n lib/librte_eal/linuxapp/kni/kni_vhost.c | 17 +++++++++++++++++\n 2 files changed, 23 insertions(+), 0 deletions(-)", "diff": "diff --git a/lib/librte_eal/linuxapp/kni/compat.h b/lib/librte_eal/linuxapp/kni/compat.h\nindex 0d87421..1313523 100644\n--- a/lib/librte_eal/linuxapp/kni/compat.h\n+++ b/lib/librte_eal/linuxapp/kni/compat.h\n@@ -13,3 +13,9 @@\n #define kstrtoul strict_strtoul\n \n #endif /* < 2.6.39 */\n+\n+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)\n+\n+#define sk_sleep(s) (s)->sk_sleep\n+\n+#endif /* < 2.6.35 */\ndiff --git a/lib/librte_eal/linuxapp/kni/kni_vhost.c b/lib/librte_eal/linuxapp/kni/kni_vhost.c\nindex c05c868..7141f83 100644\n--- a/lib/librte_eal/linuxapp/kni/kni_vhost.c\n+++ b/lib/librte_eal/linuxapp/kni/kni_vhost.c\n@@ -33,6 +33,7 @@\n #include <linux/if_tun.h>\n #include <linux/version.h>\n \n+#include \"compat.h\"\n #include \"kni_dev.h\"\n #include \"kni_fifo.h\"\n \n@@ -215,10 +216,19 @@ kni_sock_poll(struct file *file, struct socket *sock, poll_table * wait)\n \t\treturn POLLERR;\n \n \tkni = q->kni;\n+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)\n \tKNI_DBG(\"start kni_poll on group %d, wq 0x%16llx\\n\",\n \t\t kni->group_id, (uint64_t)sock->wq);\n+#else\n+\tKNI_DBG(\"start kni_poll on group %d, wait at 0x%16llx\\n\",\n+\t\t kni->group_id, (uint64_t)&sock->wait);\n+#endif\n \n+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)\n \tpoll_wait(file, &sock->wq->wait, wait);\n+#else\n+\tpoll_wait(file, &sock->wait, wait);\n+#endif\n \n \tif (kni_fifo_count(kni->rx_q) > 0)\n \t\tmask |= POLLIN | POLLRDNORM;\n@@ -681,10 +691,17 @@ kni_vhost_backend_init(struct kni_dev *kni)\n \n \tkni->vq_status = BE_START;\n \n+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)\n \tKNI_DBG(\"backend init sockfd=%d, sock->wq=0x%16llx,\"\n \t\t \"sk->sk_wq=0x%16llx\",\n \t\t q->sockfd, (uint64_t)q->sock->wq,\n \t\t (uint64_t)q->sk.sk_wq);\n+#else\n+\tKNI_DBG(\"backend init sockfd=%d, sock->wait at 0x%16llx,\"\n+\t\t \"sk->sk_sleep=0x%16llx\",\n+\t\t q->sockfd, (uint64_t)&q->sock->wait,\n+\t\t (uint64_t)q->sk.sk_sleep);\n+#endif\n \n \treturn 0;\n \n", "prefixes": [ "dpdk-dev" ] }{ "id": 1950, "url": "