Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/9543/?format=api
http://patches.dpdk.org/api/patches/9543/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/CAAyOgsYjzG_i=0_=PTxBOkaJMDLUHMt8=yMtMoUVJJKnryLzAw@mail.gmail.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": "<CAAyOgsYjzG_i=0_=PTxBOkaJMDLUHMt8=yMtMoUVJJKnryLzAw@mail.gmail.com>", "list_archive_url": "https://inbox.dpdk.org/dev/CAAyOgsYjzG_i=0_=PTxBOkaJMDLUHMt8=yMtMoUVJJKnryLzAw@mail.gmail.com", "date": "2015-12-14T16:09:51", "name": "[dpdk-dev,[PATCH,v2] 00/13] Add virtio support in arm/arm64", "commit_ref": null, "pull_url": null, "state": "not-applicable", "archived": true, "hash": "1f04d3c415439cb0938f25fb31ad526feb2fcd51", "submitter": { "id": 383, "url": "http://patches.dpdk.org/api/people/383/?format=api", "name": "Santosh Shukla", "email": "sshukla@mvista.com" }, "delegate": null, "mbox": "http://patches.dpdk.org/project/dpdk/patch/CAAyOgsYjzG_i=0_=PTxBOkaJMDLUHMt8=yMtMoUVJJKnryLzAw@mail.gmail.com/mbox/", "series": [], "comments": "http://patches.dpdk.org/api/patches/9543/comments/", "check": "pending", "checks": "http://patches.dpdk.org/api/patches/9543/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 80C3B8D93;\n\tMon, 14 Dec 2015 17:09:54 +0100 (CET)", "from mail-pf0-f169.google.com (mail-pf0-f169.google.com\n\t[209.85.192.169]) by dpdk.org (Postfix) with ESMTP id D6D70376C\n\tfor <dev@dpdk.org>; Mon, 14 Dec 2015 17:09:52 +0100 (CET)", "by pfbu66 with SMTP id u66so63230619pfb.3\n\tfor <dev@dpdk.org>; Mon, 14 Dec 2015 08:09:52 -0800 (PST)", "by 10.66.13.233 with HTTP; Mon, 14 Dec 2015 08:09:51 -0800 (PST)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=mvista-com.20150623.gappssmtp.com; s=20150623;\n\th=mime-version:in-reply-to:references:date:message-id:subject:from:to\n\t:cc:content-type;\n\tbh=xveHf4k8xZ9O1HyRoOyJwqNqONZIargE1JMXs3kXtgg=;\n\tb=ulLiXSrT9ALJPwjjUKBRoBJCf2c9uwwUlXlPRlqn+XXGg1pbT01iwgsg+oSsDI1tLF\n\t8tVDW3yE+hkHQOdypyan8aV/Ba0hY6sDA1AliV0umSxrMHzBpuUj7+3zj+4JGxYGQpQf\n\tSXjIFTqp4RCKqDkJTJyjjeklvYx9U69F4FZQUJqUY1vPcRf5sIwlsKsnTXAwH+gQ0ubY\n\tTYAcDoQPaH3DU3rPMn5tYTxxzFfbVAGi4S5BcwMmy48mLBRVbf0S+i4hzzt3Jq2LBsq9\n\tb0xIviItesRpyqS2s+lb3wiL2+zCGhHEXphYroaJhTVd32B57ozLx0g4HSV5nD81/kQV\n\tDqlw==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20130820;\n\th=x-gm-message-state:mime-version:in-reply-to:references:date\n\t:message-id:subject:from:to:cc:content-type;\n\tbh=xveHf4k8xZ9O1HyRoOyJwqNqONZIargE1JMXs3kXtgg=;\n\tb=EoZW3/xQ6kYu/zDoXrr1yAo+MxSKmIq4N1bl17xfeL/A9+Nka9R77bRmzuY5yYEbkz\n\tq4Mm9iv+KcfSHN+ugKsnRuux4+znitkHA5iWDqviHCQrE6TL0OKbBZH3Xxh6i87HV8az\n\t279Gc4x4GSrms8ZQSrDttu3+sc2nZ4ksjbW7obXydGuxM/1/MHHYXNqQhSabbG7GX2o8\n\taD2IhEwiA85dspkvD5HErxgEdnK2ziu7V7WVebhC+Vlwb8Odj2z6RH6KFyz5ofozuK8W\n\tTsg6ZO08pMmwUGXJaOzA4rGPiTDejJcy0pRIOBzOVkS1JRyTJPEgPIGTXLBIOmxV6tJN\n\t4l1Q==", "X-Gm-Message-State": "ALoCoQlPeT9IC+nHwWhGUFQWrxRsBvTFiOH6EWNRceZxeaO5Sy3AsIaMwezhHD2aqVpZQh6lau+Y0qzmwJCGKuYUk8doIcm4xfhiyJqZuPiOuf8HAHUwj60=", "MIME-Version": "1.0", "X-Received": "by 10.98.71.138 with SMTP id p10mr37529936pfi.61.1450109392081; \n\tMon, 14 Dec 2015 08:09:52 -0800 (PST)", "In-Reply-To": "<20151214153136.701b224c@pcviktorin.fit.vutbr.cz>", "References": "<1450098032-21198-1-git-send-email-sshukla@mvista.com>\n\t<20151214153136.701b224c@pcviktorin.fit.vutbr.cz>", "Date": "Mon, 14 Dec 2015 21:39:51 +0530", "Message-ID": "<CAAyOgsYjzG_i=0_=PTxBOkaJMDLUHMt8=yMtMoUVJJKnryLzAw@mail.gmail.com>", "From": "Santosh Shukla <sshukla@mvista.com>", "To": "Jan Viktorin <viktorin@rehivetech.com>", "Content-Type": "text/plain; charset=UTF-8", "Cc": "dev@dpdk.org", "Subject": "Re: [dpdk-dev] [ [PATCH v2] 00/13] Add virtio support in arm/arm64", "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": "On Mon, Dec 14, 2015 at 8:01 PM, Jan Viktorin <viktorin@rehivetech.com> wrote:\n> Hello,\n>\n> this patch set increases the number of warnings for the armv7 build. I\n> believe that most of them are false-positives.\n>\n> virtio_ethdev.c:729, GNU Make + GNU C Compiler (gcc), Priority: Normal\n> cast increases required alignment of target type [-Wcast-align]\n>\n> xstats[count].value = *(uint64_t *)(((char *)rxvq) +\n>\n> * Can you guarantee this is not an unaligned 64-bit access?\n>\n> virtio_ethdev.c:747, GNU Make + GNU C Compiler (gcc), Priority: Normal\n> cast increases required alignment of target type [-Wcast-align]\n>\n> ditto...\n>\n> virtio_pci.c:52, GNU Make + GNU C Compiler (gcc), Priority: Normal\n> cast increases required alignment of target type [-Wcast-align]\n>\n> *(uint32_t *)d = VIRTIO_READ_REG_4(hw, off);\n>\n> * I think, here we can live with unaligned_uint32_t, don't we?\n>\nYes.\n\n> virtio_pci.c:55, GNU Make + GNU C Compiler (gcc), Priority: Normal\n> cast increases required alignment of target type [-Wcast-align]\n>\n> similar...\n>\n> virtio_pci.c:75, GNU Make + GNU C Compiler (gcc), Priority: Normal\n> cast increases required alignment of target type [-Wcast-align]\n>\n> similar...\n>\n> virtio_pci.c:78, GNU Make + GNU C Compiler (gcc), Priority: Normal\n> cast increases required alignment of target type [-Wcast-align]\n>\n> similar...\n>\n> virtio_ring.h:144, GNU Make + GNU C Compiler (gcc), Priority: Normal\n> cast increases required alignment of target type [-Wcast-align]\n>\n> vr->desc = (struct vring_desc *) p;\n>\n> * What can we do here? Should we annotate vring_desc to be aligned properly?\n>\n> virtio_ring.h:145, GNU Make + GNU C Compiler (gcc), Priority: Normal\n> cast increases required alignment of target type [-Wcast-align]\n>\n> similar...\n>\n> virtio_rxtx.c:733, GNU Make + GNU C Compiler (gcc), Priority: Normal\n> cast increases required alignment of target type [-Wcast-align]\n>\n> header = (struct virtio_net_hdr_mrg_rxbuf *)((char *)rxm->buf_addr +\n> RTE_PKTMBUF_HEADROOM - hdr_size);\n>\n> * No idea how to solve this...\n>\n>\n\nThese warnings are in-general virtio-pmd warnings for armv7 case.\nPatchset enables virtio feature thus above warning noticed.\n\nI spent 10 min and noticed that most of those warning are types\n(uint64_t*) ((char *) ptr + offset). could avoid such warning by\n(uint64_t *) (uintptr) ((char*)ptr + offset) where ptr is void *, But\nthis not the case in virtio code, most of such places ptr is uint8_t,\nkeeping then void * then typecasting to ((char *)ptr + offset) then\nfollowing proposed-way, I guess won't harm functionality and could\nkeep armv7 happy. And yes they are all look false-positive to me too.\nPasting code a snape which could get rid of above warning for armv7\ncase. Let me know your feedback, Others thought/comment welcome.\nThanks!\n\n----------------------------------------------------------\ndiff --git a/drivers/net/virtio/virtio_ethdev.c\nb/drivers/net/virtio/virtio_ethdev.c\nindex 8107aef..7ef4d13 100644\n--- a/drivers/net/virtio/virtio_ethdev.c\ndiff --git a/drivers/net/virtio/virtio_ethdev.c\nb/drivers/net/virtio/virtio_ethdev.c\nindex 8107aef..7ef4d13 100644\n seg_num = header->num_buffers;\n\n-----------------------------------------------------------------------------------\n\n> Any other ideas are welcome.\n>\n> Regards\n> Jan\n>\n> On Mon, 14 Dec 2015 18:30:19 +0530\n> Santosh Shukla <sshukla@mvista.com> wrote:\n>\n>> This patch set add basic infrastrucure to run virtio-net-pci pmd driver for\n>> arm64/arm. Tested on ThunderX platfrom. Verified for existing dpdk(s) test\n>> applications like:\n>> - ovs-dpdk-vhost-user: across the VM's, for the use-cases like guest2guest and\n>> Host2Guest\n>> - testpmd application: Tested for max virtio-net-pci interface currently\n>> supported in kernel i.e. 31 interface.\n>>\n>> Builds successfully for armv7/v8/thunderX and x86_64/i686 platforms. Made sure\n>> that patch changes donot break for x86_64 case. Done similar tests for x86_64\n>> too.\n>>\n>> Patch History:\n>> v2:\n>> - Removed ifdef arm.. clutter from igb_uio / virtio_ethedev files\n>> - Introduced rte_io.h header file in generic/ and arch specifics i.e.. for\n>> armv7 --> rte_io_32.h, for armv8 --> rte_io_64.h.\n>> - Removed RTE_ARCH_X86 ifdef clutter too and added rte_io.h header which nothing\n>> but wraps sys/io.h for x86_64 and i686\n>> - Moved all the RTE_ARCH_ARM/64 dependancy for igb_uio case to separate header\n>> file named igbuio_ioport_misc.h. Now igb_uio.c will call only three function\n>> - igbuio_iomap\n>> - igbuio_ioport_register\n>> - igbuio_ioport_unregister\n>> - Moved ARM/64 specific definition to include/exec-env/rte_virt_ioport.h header\n>> - Included virtio_ioport.c/h; has all private and public api required to map\n>> iopci bar for non-x86 arch. Tested on thunderX and x86_64 both.\n>> Private api includes:\n>> - virtio_map_ioport\n>> - virtio_set_ioport_addr\n>> Public api includes:\n>> - virtio_ioport_init\n>> - virtio_ioport_unmap\n>>\n>> - Last patch is the miscllanious format specifier fix identifid for 64bit case\n>> during regression.\n>>\n>>\n>> v1:\n>> - First patch adds RTE_VIRTIO_INC_VECTOR config, much needed for archs like\n>> arm/arm64 as they don't support vectored implementation, also wont able to\n>> build.\n>> - Second patch is in-general fix for i686.\n>> - Third patch is to emulate x86-style of {in,out}[b,w,l] api support for armv7/v8.\n>> As virtio-net-pci pmd driver uses those apis for port rd/wr {b,w,l}\n>> - Fourth patch to enable VIRTIO_PMD feature in armv7/v8/thunderX config.\n>> - Fifth patch to disable iopl syscall, As arm/arm64 linux kernel doesn't support\n>> them.\n>> - Sixth patch introduces ioport memdevice called /dev/igb_ioport by which virtio\n>> pmd driver could able to rd/wr PCI_IOBAR.\n>> {applicable for arm/arm64 only, tested for arm64 as of now}\n>>\n>>\n>> Santosh Shukla (13):\n>> virtio: Introduce config RTE_VIRTIO_INC_VECTOR\n>> config: i686: set RTE_VIRTIO_INC_VECTOR=n\n>> rte_io: armv7/v8: Introduce api to emulate x86-style of PCI/ISA\n>> ioport access\n>> virtio_pci: use rte_io.h for non-x86 arch\n>> virtio: change io_base datatype from uint32_t to uint64_type\n>> config: armv7/v8: Enable RTE_LIBRTE_VIRTIO_PMD\n>> linuxapp: eal: arm: Always return 0 for rte_eal_iopl_init()\n>> rte_io: x86: Remove sys/io.h ifdef x86 clutter\n>> igb_uio: ioport: map iopci region for armv7/v8\n>> include/exec-env: ioport: add rte_virt_ioport header file\n>> virtio_ioport: armv7/v8: mmap virtio iopci bar region\n>> virtio_ethdev: use virtio_ioport api at device init/close\n>> virtio_ethdev : fix format specifier error for 64bit addr case\n>>\n>> config/common_linuxapp | 1 +\n>> config/defconfig_arm-armv7a-linuxapp-gcc | 6 +-\n>> config/defconfig_arm64-armv8a-linuxapp-gcc | 6 +-\n>> config/defconfig_i686-native-linuxapp-gcc | 1 +\n>> config/defconfig_i686-native-linuxapp-icc | 1 +\n>> drivers/net/virtio/Makefile | 3 +-\n>> drivers/net/virtio/virtio_ethdev.c | 10 +-\n>> drivers/net/virtio/virtio_ioport.c | 163 ++++++++++++++++++++\n>> drivers/net/virtio/virtio_ioport.h | 42 +++++\n>> drivers/net/virtio/virtio_pci.h | 6 +-\n>> drivers/net/virtio/virtio_rxtx.c | 7 +\n>> lib/librte_eal/common/Makefile | 1 +\n>> lib/librte_eal/common/include/arch/arm/rte_io.h | 60 +++++++\n>> lib/librte_eal/common/include/arch/arm/rte_io_32.h | 155 +++++++++++++++++++\n>> lib/librte_eal/common/include/arch/arm/rte_io_64.h | 155 +++++++++++++++++++\n>> lib/librte_eal/common/include/arch/x86/rte_io.h | 42 +++++\n>> lib/librte_eal/common/include/generic/rte_io.h | 81 ++++++++++\n>> lib/librte_eal/linuxapp/eal/Makefile | 2 +-\n>> lib/librte_eal/linuxapp/eal/eal.c | 7 +-\n>> .../eal/include/exec-env/rte_virt_ioport.h | 81 ++++++++++\n>> lib/librte_eal/linuxapp/igb_uio/igb_uio.c | 8 +-\n>> .../linuxapp/igb_uio/igbuio_ioport_misc.h | 133 ++++++++++++++++\n>> 22 files changed, 957 insertions(+), 14 deletions(-)\n>> create mode 100644 drivers/net/virtio/virtio_ioport.c\n>> create mode 100644 drivers/net/virtio/virtio_ioport.h\n>> create mode 100644 lib/librte_eal/common/include/arch/arm/rte_io.h\n>> create mode 100644 lib/librte_eal/common/include/arch/arm/rte_io_32.h\n>> create mode 100644 lib/librte_eal/common/include/arch/arm/rte_io_64.h\n>> create mode 100644 lib/librte_eal/common/include/arch/x86/rte_io.h\n>> create mode 100644 lib/librte_eal/common/include/generic/rte_io.h\n>> create mode 100644 lib/librte_eal/linuxapp/eal/include/exec-env/rte_virt_ioport.h\n>> create mode 100644 lib/librte_eal/linuxapp/igb_uio/igbuio_ioport_misc.h\n>>\n>\n>\n>\n> --\n> Jan Viktorin E-mail: Viktorin@RehiveTech.com\n> System Architect Web: www.RehiveTech.com\n> RehiveTech\n> Brno, Czech Republic", "diff": "--- a/drivers/net/virtio/virtio_ethdev.c\n+++ b/drivers/net/virtio/virtio_ethdev.c\n@@ -726,7 +726,7 @@ virtio_dev_xstats_get(struct rte_eth_dev *dev,\nstruct rte_eth_xstats *xstats,\n snprintf(xstats[count].name, sizeof(xstats[count].name),\n \"rx_q%u_%s\", i,\n rte_virtio_q_stat_strings[t].name);\n- xstats[count].value = *(uint64_t *)(((char *)rxvq) +\n+ xstats[count].value = *(uint64_t\n*)(uintptr_t)(((char *)rxvq) +\n rte_virtio_q_stat_strings[t].offset);\n count++;\n }\n@@ -744,7 +744,7 @@ virtio_dev_xstats_get(struct rte_eth_dev *dev,\nstruct rte_eth_xstats *xstats,\n snprintf(xstats[count].name, sizeof(xstats[count].name),\n \"tx_q%u_%s\", i,\n rte_virtio_q_stat_strings[t].name);\n- xstats[count].value = *(uint64_t *)(((char *)txvq) +\n+ xstats[count].value = *(uint64_t\n*)(uintptr_t)(((char *)txvq) +\n rte_virtio_q_stat_strings[t].offset);\n count++;\n }\ndiff --git a/drivers/net/virtio/virtio_ring.h b/drivers/net/virtio/virtio_ring.h\nindex 447760a..f2f85b4 100644\n--- a/drivers/net/virtio/virtio_ring.h\n+++ b/drivers/net/virtio/virtio_ring.h\n@@ -141,8 +141,8 @@ vring_init(struct vring *vr, unsigned int num, uint8_t *p,\n unsigned long align)\n {\n vr->num = num;\n- vr->desc = (struct vring_desc *) p;\n- vr->avail = (struct vring_avail *) (p +\n+ vr->desc = (struct vring_desc *) (uintptr_t)p;\n+ vr->avail = (struct vring_avail *) ((uintptr_t)p +\n num * sizeof(struct vring_desc));\n vr->used = (void *)\n RTE_ALIGN_CEIL((uintptr_t)(&vr->avail->ring[num]), align);\ndiff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c\nindex 23be1ff..d636e08 100644\n--- a/drivers/net/virtio/virtio_rxtx.c\n+++ b/drivers/net/virtio/virtio_rxtx.c\n@@ -730,7 +730,7 @@ virtio_recv_mergeable_pkts(void *rx_queue,\n continue;\n }\n\n- header = (struct virtio_net_hdr_mrg_rxbuf *)((char\n*)rxm->buf_addr +\n+ header = (struct virtio_net_hdr_mrg_rxbuf\n*)(uintptr_t)((char *)rxm->buf_addr +\n RTE_PKTMBUF_HEADROOM - hdr_size);\n", "prefixes": [ "dpdk-dev", "[PATCH", "v2" ] }{ "id": 9543, "url": "