* [Qemu-devel] [PATCH] hw/pvrdma: Make function pvrdma_qp_send/recv return void.
@ 2019-01-09 20:21 Yuval Shaia
2019-01-12 15:14 ` Marcel Apfelbaum
2019-01-14 10:49 ` Philippe Mathieu-Daudé
0 siblings, 2 replies; 3+ messages in thread
From: Yuval Shaia @ 2019-01-09 20:21 UTC (permalink / raw
To: yuval.shaia, marcel.apfelbaum, qemu-devel
The functions handles errors internaly, callers have nothing to do with
the return value.
Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
---
hw/rdma/vmw/pvrdma_qp_ops.c | 14 ++++++--------
hw/rdma/vmw/pvrdma_qp_ops.h | 4 ++--
2 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/hw/rdma/vmw/pvrdma_qp_ops.c b/hw/rdma/vmw/pvrdma_qp_ops.c
index 0565eba981..ce5a60e184 100644
--- a/hw/rdma/vmw/pvrdma_qp_ops.c
+++ b/hw/rdma/vmw/pvrdma_qp_ops.c
@@ -143,7 +143,7 @@ int pvrdma_qp_ops_init(void)
return 0;
}
-int pvrdma_qp_send(PVRDMADev *dev, uint32_t qp_handle)
+void pvrdma_qp_send(PVRDMADev *dev, uint32_t qp_handle)
{
RdmaRmQP *qp;
PvrdmaSqWqe *wqe;
@@ -155,7 +155,8 @@ int pvrdma_qp_send(PVRDMADev *dev, uint32_t qp_handle)
qp = rdma_rm_get_qp(&dev->rdma_dev_res, qp_handle);
if (unlikely(!qp)) {
- return -EINVAL;
+ pr_dbg("Invalid qpn\n");
+ return;
}
ring = (PvrdmaRing *)qp->opaque;
@@ -212,11 +213,9 @@ int pvrdma_qp_send(PVRDMADev *dev, uint32_t qp_handle)
wqe = pvrdma_ring_next_elem_read(ring);
}
-
- return 0;
}
-int pvrdma_qp_recv(PVRDMADev *dev, uint32_t qp_handle)
+void pvrdma_qp_recv(PVRDMADev *dev, uint32_t qp_handle)
{
RdmaRmQP *qp;
PvrdmaRqWqe *wqe;
@@ -226,7 +225,8 @@ int pvrdma_qp_recv(PVRDMADev *dev, uint32_t qp_handle)
qp = rdma_rm_get_qp(&dev->rdma_dev_res, qp_handle);
if (unlikely(!qp)) {
- return -EINVAL;
+ pr_dbg("Invalid qpn\n");
+ return;
}
ring = &((PvrdmaRing *)qp->opaque)[1];
@@ -262,8 +262,6 @@ int pvrdma_qp_recv(PVRDMADev *dev, uint32_t qp_handle)
wqe = pvrdma_ring_next_elem_read(ring);
}
-
- return 0;
}
void pvrdma_cq_poll(RdmaDeviceResources *dev_res, uint32_t cq_handle)
diff --git a/hw/rdma/vmw/pvrdma_qp_ops.h b/hw/rdma/vmw/pvrdma_qp_ops.h
index ac46bf7fdf..31cb48ba29 100644
--- a/hw/rdma/vmw/pvrdma_qp_ops.h
+++ b/hw/rdma/vmw/pvrdma_qp_ops.h
@@ -20,8 +20,8 @@
int pvrdma_qp_ops_init(void);
void pvrdma_qp_ops_fini(void);
-int pvrdma_qp_send(PVRDMADev *dev, uint32_t qp_handle);
-int pvrdma_qp_recv(PVRDMADev *dev, uint32_t qp_handle);
+void pvrdma_qp_send(PVRDMADev *dev, uint32_t qp_handle);
+void pvrdma_qp_recv(PVRDMADev *dev, uint32_t qp_handle);
void pvrdma_cq_poll(RdmaDeviceResources *dev_res, uint32_t cq_handle);
#endif
--
2.17.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] hw/pvrdma: Make function pvrdma_qp_send/recv return void.
2019-01-09 20:21 [Qemu-devel] [PATCH] hw/pvrdma: Make function pvrdma_qp_send/recv return void Yuval Shaia
@ 2019-01-12 15:14 ` Marcel Apfelbaum
2019-01-14 10:49 ` Philippe Mathieu-Daudé
1 sibling, 0 replies; 3+ messages in thread
From: Marcel Apfelbaum @ 2019-01-12 15:14 UTC (permalink / raw
To: Yuval Shaia, qemu-devel
On 1/9/19 10:21 PM, Yuval Shaia wrote:
> The functions handles errors internaly, callers have nothing to do with
> the return value.
>
> Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
> ---
> hw/rdma/vmw/pvrdma_qp_ops.c | 14 ++++++--------
> hw/rdma/vmw/pvrdma_qp_ops.h | 4 ++--
> 2 files changed, 8 insertions(+), 10 deletions(-)
>
> diff --git a/hw/rdma/vmw/pvrdma_qp_ops.c b/hw/rdma/vmw/pvrdma_qp_ops.c
> index 0565eba981..ce5a60e184 100644
> --- a/hw/rdma/vmw/pvrdma_qp_ops.c
> +++ b/hw/rdma/vmw/pvrdma_qp_ops.c
> @@ -143,7 +143,7 @@ int pvrdma_qp_ops_init(void)
> return 0;
> }
>
> -int pvrdma_qp_send(PVRDMADev *dev, uint32_t qp_handle)
> +void pvrdma_qp_send(PVRDMADev *dev, uint32_t qp_handle)
> {
> RdmaRmQP *qp;
> PvrdmaSqWqe *wqe;
> @@ -155,7 +155,8 @@ int pvrdma_qp_send(PVRDMADev *dev, uint32_t qp_handle)
>
> qp = rdma_rm_get_qp(&dev->rdma_dev_res, qp_handle);
> if (unlikely(!qp)) {
> - return -EINVAL;
> + pr_dbg("Invalid qpn\n");
> + return;
> }
>
> ring = (PvrdmaRing *)qp->opaque;
> @@ -212,11 +213,9 @@ int pvrdma_qp_send(PVRDMADev *dev, uint32_t qp_handle)
>
> wqe = pvrdma_ring_next_elem_read(ring);
> }
> -
> - return 0;
> }
>
> -int pvrdma_qp_recv(PVRDMADev *dev, uint32_t qp_handle)
> +void pvrdma_qp_recv(PVRDMADev *dev, uint32_t qp_handle)
> {
> RdmaRmQP *qp;
> PvrdmaRqWqe *wqe;
> @@ -226,7 +225,8 @@ int pvrdma_qp_recv(PVRDMADev *dev, uint32_t qp_handle)
>
> qp = rdma_rm_get_qp(&dev->rdma_dev_res, qp_handle);
> if (unlikely(!qp)) {
> - return -EINVAL;
> + pr_dbg("Invalid qpn\n");
> + return;
> }
>
> ring = &((PvrdmaRing *)qp->opaque)[1];
> @@ -262,8 +262,6 @@ int pvrdma_qp_recv(PVRDMADev *dev, uint32_t qp_handle)
>
> wqe = pvrdma_ring_next_elem_read(ring);
> }
> -
> - return 0;
> }
>
> void pvrdma_cq_poll(RdmaDeviceResources *dev_res, uint32_t cq_handle)
> diff --git a/hw/rdma/vmw/pvrdma_qp_ops.h b/hw/rdma/vmw/pvrdma_qp_ops.h
> index ac46bf7fdf..31cb48ba29 100644
> --- a/hw/rdma/vmw/pvrdma_qp_ops.h
> +++ b/hw/rdma/vmw/pvrdma_qp_ops.h
> @@ -20,8 +20,8 @@
>
> int pvrdma_qp_ops_init(void);
> void pvrdma_qp_ops_fini(void);
> -int pvrdma_qp_send(PVRDMADev *dev, uint32_t qp_handle);
> -int pvrdma_qp_recv(PVRDMADev *dev, uint32_t qp_handle);
> +void pvrdma_qp_send(PVRDMADev *dev, uint32_t qp_handle);
> +void pvrdma_qp_recv(PVRDMADev *dev, uint32_t qp_handle);
> void pvrdma_cq_poll(RdmaDeviceResources *dev_res, uint32_t cq_handle);
>
> #endif
Reviewed-by: Marcel Apfelbaum<marcel.apfelbaum@gmail.com>
Thanks,
Marcel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] hw/pvrdma: Make function pvrdma_qp_send/recv return void.
2019-01-09 20:21 [Qemu-devel] [PATCH] hw/pvrdma: Make function pvrdma_qp_send/recv return void Yuval Shaia
2019-01-12 15:14 ` Marcel Apfelbaum
@ 2019-01-14 10:49 ` Philippe Mathieu-Daudé
1 sibling, 0 replies; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-01-14 10:49 UTC (permalink / raw
To: Yuval Shaia, marcel.apfelbaum, qemu-devel
On 1/9/19 9:21 PM, Yuval Shaia wrote:
> The functions handles errors internaly, callers have nothing to do with
> the return value.
>
> Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> hw/rdma/vmw/pvrdma_qp_ops.c | 14 ++++++--------
> hw/rdma/vmw/pvrdma_qp_ops.h | 4 ++--
> 2 files changed, 8 insertions(+), 10 deletions(-)
>
> diff --git a/hw/rdma/vmw/pvrdma_qp_ops.c b/hw/rdma/vmw/pvrdma_qp_ops.c
> index 0565eba981..ce5a60e184 100644
> --- a/hw/rdma/vmw/pvrdma_qp_ops.c
> +++ b/hw/rdma/vmw/pvrdma_qp_ops.c
> @@ -143,7 +143,7 @@ int pvrdma_qp_ops_init(void)
> return 0;
> }
>
> -int pvrdma_qp_send(PVRDMADev *dev, uint32_t qp_handle)
> +void pvrdma_qp_send(PVRDMADev *dev, uint32_t qp_handle)
> {
> RdmaRmQP *qp;
> PvrdmaSqWqe *wqe;
> @@ -155,7 +155,8 @@ int pvrdma_qp_send(PVRDMADev *dev, uint32_t qp_handle)
>
> qp = rdma_rm_get_qp(&dev->rdma_dev_res, qp_handle);
> if (unlikely(!qp)) {
> - return -EINVAL;
> + pr_dbg("Invalid qpn\n");
> + return;
> }
>
> ring = (PvrdmaRing *)qp->opaque;
> @@ -212,11 +213,9 @@ int pvrdma_qp_send(PVRDMADev *dev, uint32_t qp_handle)
>
> wqe = pvrdma_ring_next_elem_read(ring);
> }
> -
> - return 0;
> }
>
> -int pvrdma_qp_recv(PVRDMADev *dev, uint32_t qp_handle)
> +void pvrdma_qp_recv(PVRDMADev *dev, uint32_t qp_handle)
> {
> RdmaRmQP *qp;
> PvrdmaRqWqe *wqe;
> @@ -226,7 +225,8 @@ int pvrdma_qp_recv(PVRDMADev *dev, uint32_t qp_handle)
>
> qp = rdma_rm_get_qp(&dev->rdma_dev_res, qp_handle);
> if (unlikely(!qp)) {
> - return -EINVAL;
> + pr_dbg("Invalid qpn\n");
> + return;
> }
>
> ring = &((PvrdmaRing *)qp->opaque)[1];
> @@ -262,8 +262,6 @@ int pvrdma_qp_recv(PVRDMADev *dev, uint32_t qp_handle)
>
> wqe = pvrdma_ring_next_elem_read(ring);
> }
> -
> - return 0;
> }
>
> void pvrdma_cq_poll(RdmaDeviceResources *dev_res, uint32_t cq_handle)
> diff --git a/hw/rdma/vmw/pvrdma_qp_ops.h b/hw/rdma/vmw/pvrdma_qp_ops.h
> index ac46bf7fdf..31cb48ba29 100644
> --- a/hw/rdma/vmw/pvrdma_qp_ops.h
> +++ b/hw/rdma/vmw/pvrdma_qp_ops.h
> @@ -20,8 +20,8 @@
>
> int pvrdma_qp_ops_init(void);
> void pvrdma_qp_ops_fini(void);
> -int pvrdma_qp_send(PVRDMADev *dev, uint32_t qp_handle);
> -int pvrdma_qp_recv(PVRDMADev *dev, uint32_t qp_handle);
> +void pvrdma_qp_send(PVRDMADev *dev, uint32_t qp_handle);
> +void pvrdma_qp_recv(PVRDMADev *dev, uint32_t qp_handle);
> void pvrdma_cq_poll(RdmaDeviceResources *dev_res, uint32_t cq_handle);
>
> #endif
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-01-14 10:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-09 20:21 [Qemu-devel] [PATCH] hw/pvrdma: Make function pvrdma_qp_send/recv return void Yuval Shaia
2019-01-12 15:14 ` Marcel Apfelbaum
2019-01-14 10:49 ` Philippe Mathieu-Daudé
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.