Re: [PATCH rdma-core 3/6] mlx5: Fix missing break statement in sq_overhead

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 1/31/2017 11:12 PM, Jason Gunthorpe wrote:
On Tue, Jan 31, 2017 at 02:08:03PM -0700, Jason Gunthorpe wrote:
gcc 7.0.1 observes:

providers/mlx5/verbs.c:745:8: warning: this statement may fall through [-Wimplicit-fallthrough=]
   size = sizeof(struct mlx5_wqe_ctrl_seg) + mw_bind_size;

Signed-off-by: Jason Gunthorpe <jgunthorpe@xxxxxxxxxxxxxxxxxxxx>
 providers/mlx5/verbs.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/providers/mlx5/verbs.c b/providers/mlx5/verbs.c
index 04a5462ce41d03..60854402fec2d4 100644
+++ b/providers/mlx5/verbs.c
@@ -743,6 +743,8 @@ static int sq_overhead(enum ibv_qp_type	qp_type)

 	case IBV_QPT_XRC_SEND:
 		size = sizeof(struct mlx5_wqe_ctrl_seg) + mw_bind_size;
+		break;
+
 	case IBV_QPT_XRC_RECV:
 		size = max(size, sizeof(struct mlx5_wqe_ctrl_seg) +
 			   sizeof(struct mlx5_wqe_xrc_seg) +

Hum, looking again this confusing construction was probably as
intended before.. Yishai can you let me know?

The original code is correct, it intended to fallback to IBV_QPT_XRC_RECV to take into account the size of struct mlx5_wqe_xrc_seg in both cases.


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux