From: "Tan, Jianfeng" <jianfeng.tan@intel.com>
To: "Huawei@dpdk.org" <Huawei@dpdk.org>, "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] xenvirt: fix compilation issues
Date: Sat, 12 Dec 2015 07:15:05 +0000 [thread overview]
Message-ID: <ED26CBA2FAD1BF48A8719AEF02201E36671CE7@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <1449760558-63146-1-git-send-email-huawei.xie@intel.com>
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Huawei@dpdk.org
> Sent: Thursday, December 10, 2015 11:16 PM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH] xenvirt: fix compilation issues
>
> Reported-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
> Signed-off-by: Huawei Xie <huawei.xie@intel.com>
> ---
> drivers/net/xenvirt/rte_mempool_gntalloc.c | 6 +++---
> drivers/net/xenvirt/rte_xen_lib.c | 4 ++--
> drivers/net/xenvirt/virtqueue.h | 4 ++--
> 3 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/net/xenvirt/rte_mempool_gntalloc.c
> b/drivers/net/xenvirt/rte_mempool_gntalloc.c
> index 3a650e8..0585f08 100644
> --- a/drivers/net/xenvirt/rte_mempool_gntalloc.c
> +++ b/drivers/net/xenvirt/rte_mempool_gntalloc.c
> @@ -184,10 +184,10 @@ _create_mempool(const char *name, unsigned
> elt_num, unsigned elt_size,
> rv = ioctl(gntalloc_fd,
> IOCTL_GNTALLOC_DEALLOC_GREF, &arg);
> if (rv) {
> /* shouldn't fail here */
> - RTE_LOG(ERR, PMD, "va=%p pa=%p
> index=%p %s\n",
> + RTE_LOG(ERR, PMD, "va=%p
> pa=%"PRIu64"x index=%"PRIu64" %s\n",
> gnt_arr[i].va,
> - (void *)gnt_arr[i].pa,
> - (void *)arg.index,
> strerror(errno));
> + gnt_arr[i].pa,
> + arg.index, strerror(errno));
> rte_panic("gntdealloc failed when
> freeing pages\n");
> }
> }
> diff --git a/drivers/net/xenvirt/rte_xen_lib.c
> b/drivers/net/xenvirt/rte_xen_lib.c
> index 3e97c1a..de63cd3 100644
> --- a/drivers/net/xenvirt/rte_xen_lib.c
> +++ b/drivers/net/xenvirt/rte_xen_lib.c
> @@ -115,8 +115,8 @@ get_phys_map(void *va, phys_addr_t pa[], uint32_t
> pg_num, uint32_t pg_sz)
> (rc = pread(fd, pa, nb, ofs)) < 0 ||
> (rc -= nb) != 0) {
> RTE_LOG(ERR, PMD, "%s: failed read of %u bytes from \'%s\'
> "
> - "at offset %zu, error code: %d\n",
> - __func__, nb, PAGEMAP_FNAME, ofs, errno);
> + "at offset %lu, error code: %d\n",
> + __func__, nb, PAGEMAP_FNAME, (unsigned
> long)ofs, errno);
> rc = ENOENT;
> }
>
> diff --git a/drivers/net/xenvirt/virtqueue.h
> b/drivers/net/xenvirt/virtqueue.h
> index 6dcb0ef..5312347 100644
> --- a/drivers/net/xenvirt/virtqueue.h
> +++ b/drivers/net/xenvirt/virtqueue.h
> @@ -55,7 +55,7 @@ struct rte_mbuf;
> * rather than gpa<->hva in virito spec.
> */
> #define RTE_MBUF_DATA_DMA_ADDR(mb) \
> - rte_pktmbuf_mtod(mb, uint64_t)
> + ((uint64_t)(uintptr_t)rte_pktmbuf_mtod(mb, void *))
>
> enum { VTNET_RQ = 0, VTNET_TQ = 1, VTNET_CQ = 2 };
>
> @@ -198,7 +198,7 @@ virtqueue_enqueue_recv_refill(struct virtqueue
> *rxvq, struct rte_mbuf *cookie)
> dxp->ndescs = needed;
>
> start_dp[head_idx].addr =
> - (uint64_t) ((uint64_t)cookie->buf_addr +
> RTE_PKTMBUF_HEADROOM - sizeof(struct virtio_net_hdr));
> + (uint64_t) ((uintptr_t)cookie->buf_addr +
> RTE_PKTMBUF_HEADROOM - sizeof(struct virtio_net_hdr));
> start_dp[head_idx].len = cookie->buf_len -
> RTE_PKTMBUF_HEADROOM + sizeof(struct virtio_net_hdr);
> start_dp[head_idx].flags = VRING_DESC_F_WRITE;
> rxvq->vq_desc_head_idx = start_dp[head_idx].next;
> --
> 1.8.1.4
Looks good to me. Just one thing, shall we keep unified on printing out either errno, or strerror(errno)?
Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>
Thanks,
Jianfeng
next prev parent reply other threads:[~2015-12-12 7:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-10 15:15 Huawei
2015-12-12 7:15 ` Tan, Jianfeng [this message]
2015-12-12 21:19 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ED26CBA2FAD1BF48A8719AEF02201E36671CE7@SHSMSX103.ccr.corp.intel.com \
--to=jianfeng.tan@intel.com \
--cc=Huawei@dpdk.org \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).