All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] IB/cxgb4: use skb_put_zero()/__skb_put_zero
@ 2018-04-28  7:31 ` YueHaibing
  0 siblings, 0 replies; 5+ messages in thread
From: YueHaibing @ 2018-04-28  7:31 UTC (permalink / raw)
  To: swise, dledford, jgg, monis; +Cc: linux-rdma, linux-kernel, YueHaibing

Use the recently introduced helper to replace the pattern of
skb_put_zero/__skb_put() && memset().

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/infiniband/hw/cxgb4/qp.c    | 9 +++------
 drivers/infiniband/sw/rxe/rxe_net.c | 4 +---
 2 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/infiniband/hw/cxgb4/qp.c b/drivers/infiniband/hw/cxgb4/qp.c
index de77b60..2dc9499 100644
--- a/drivers/infiniband/hw/cxgb4/qp.c
+++ b/drivers/infiniband/hw/cxgb4/qp.c
@@ -1297,8 +1297,7 @@ static void post_terminate(struct c4iw_qp *qhp, struct t4_cqe *err_cqe,
 
 	set_wr_txq(skb, CPL_PRIORITY_DATA, qhp->ep->txq_idx);
 
-	wqe = __skb_put(skb, sizeof(*wqe));
-	memset(wqe, 0, sizeof *wqe);
+	wqe = __skb_put_zero(skb, sizeof(*wqe));
 	wqe->op_compl = cpu_to_be32(FW_WR_OP_V(FW_RI_INIT_WR));
 	wqe->flowid_len16 = cpu_to_be32(
 		FW_WR_FLOWID_V(qhp->ep->hwtid) |
@@ -1421,8 +1420,7 @@ static int rdma_fini(struct c4iw_dev *rhp, struct c4iw_qp *qhp,
 
 	set_wr_txq(skb, CPL_PRIORITY_DATA, ep->txq_idx);
 
-	wqe = __skb_put(skb, sizeof(*wqe));
-	memset(wqe, 0, sizeof *wqe);
+	wqe = __skb_put_zero(skb, sizeof(*wqe));
 	wqe->op_compl = cpu_to_be32(
 		FW_WR_OP_V(FW_RI_INIT_WR) |
 		FW_WR_COMPL_F);
@@ -1487,8 +1485,7 @@ static int rdma_init(struct c4iw_dev *rhp, struct c4iw_qp *qhp)
 	}
 	set_wr_txq(skb, CPL_PRIORITY_DATA, qhp->ep->txq_idx);
 
-	wqe = __skb_put(skb, sizeof(*wqe));
-	memset(wqe, 0, sizeof *wqe);
+	wqe = __skb_put_zero(skb, sizeof(*wqe));
 	wqe->op_compl = cpu_to_be32(
 		FW_WR_OP_V(FW_RI_INIT_WR) |
 		FW_WR_COMPL_F);
diff --git a/drivers/infiniband/sw/rxe/rxe_net.c b/drivers/infiniband/sw/rxe/rxe_net.c
index 9da6e37..95dcd10 100644
--- a/drivers/infiniband/sw/rxe/rxe_net.c
+++ b/drivers/infiniband/sw/rxe/rxe_net.c
@@ -562,11 +562,9 @@ struct sk_buff *rxe_init_packet(struct rxe_dev *rxe, struct rxe_av *av,
 
 	pkt->rxe	= rxe;
 	pkt->port_num	= port_num;
-	pkt->hdr	= skb_put(skb, paylen);
+	pkt->hdr	= skb_put_zero(skb, paylen);
 	pkt->mask	|= RXE_GRH_MASK;
 
-	memset(pkt->hdr, 0, paylen);
-
 	dev_put(ndev);
 	return skb;
 }
-- 
2.7.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH] IB/cxgb4: use skb_put_zero()/__skb_put_zero
@ 2018-04-28  7:31 ` YueHaibing
  0 siblings, 0 replies; 5+ messages in thread
From: YueHaibing @ 2018-04-28  7:31 UTC (permalink / raw)
  To: swise, dledford, jgg, monis; +Cc: linux-rdma, linux-kernel, YueHaibing

Use the recently introduced helper to replace the pattern of
skb_put_zero/__skb_put() && memset().

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/infiniband/hw/cxgb4/qp.c    | 9 +++------
 drivers/infiniband/sw/rxe/rxe_net.c | 4 +---
 2 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/infiniband/hw/cxgb4/qp.c b/drivers/infiniband/hw/cxgb4/qp.c
index de77b60..2dc9499 100644
--- a/drivers/infiniband/hw/cxgb4/qp.c
+++ b/drivers/infiniband/hw/cxgb4/qp.c
@@ -1297,8 +1297,7 @@ static void post_terminate(struct c4iw_qp *qhp, struct t4_cqe *err_cqe,
 
 	set_wr_txq(skb, CPL_PRIORITY_DATA, qhp->ep->txq_idx);
 
-	wqe = __skb_put(skb, sizeof(*wqe));
-	memset(wqe, 0, sizeof *wqe);
+	wqe = __skb_put_zero(skb, sizeof(*wqe));
 	wqe->op_compl = cpu_to_be32(FW_WR_OP_V(FW_RI_INIT_WR));
 	wqe->flowid_len16 = cpu_to_be32(
 		FW_WR_FLOWID_V(qhp->ep->hwtid) |
@@ -1421,8 +1420,7 @@ static int rdma_fini(struct c4iw_dev *rhp, struct c4iw_qp *qhp,
 
 	set_wr_txq(skb, CPL_PRIORITY_DATA, ep->txq_idx);
 
-	wqe = __skb_put(skb, sizeof(*wqe));
-	memset(wqe, 0, sizeof *wqe);
+	wqe = __skb_put_zero(skb, sizeof(*wqe));
 	wqe->op_compl = cpu_to_be32(
 		FW_WR_OP_V(FW_RI_INIT_WR) |
 		FW_WR_COMPL_F);
@@ -1487,8 +1485,7 @@ static int rdma_init(struct c4iw_dev *rhp, struct c4iw_qp *qhp)
 	}
 	set_wr_txq(skb, CPL_PRIORITY_DATA, qhp->ep->txq_idx);
 
-	wqe = __skb_put(skb, sizeof(*wqe));
-	memset(wqe, 0, sizeof *wqe);
+	wqe = __skb_put_zero(skb, sizeof(*wqe));
 	wqe->op_compl = cpu_to_be32(
 		FW_WR_OP_V(FW_RI_INIT_WR) |
 		FW_WR_COMPL_F);
diff --git a/drivers/infiniband/sw/rxe/rxe_net.c b/drivers/infiniband/sw/rxe/rxe_net.c
index 9da6e37..95dcd10 100644
--- a/drivers/infiniband/sw/rxe/rxe_net.c
+++ b/drivers/infiniband/sw/rxe/rxe_net.c
@@ -562,11 +562,9 @@ struct sk_buff *rxe_init_packet(struct rxe_dev *rxe, struct rxe_av *av,
 
 	pkt->rxe	= rxe;
 	pkt->port_num	= port_num;
-	pkt->hdr	= skb_put(skb, paylen);
+	pkt->hdr	= skb_put_zero(skb, paylen);
 	pkt->mask	|= RXE_GRH_MASK;
 
-	memset(pkt->hdr, 0, paylen);
-
 	dev_put(ndev);
 	return skb;
 }
-- 
2.7.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* RE: [PATCH] IB/cxgb4: use skb_put_zero()/__skb_put_zero
  2018-04-28  7:31 ` YueHaibing
@ 2018-04-28 11:53   ` Steve Wise
  -1 siblings, 0 replies; 5+ messages in thread
From: Steve Wise @ 2018-04-28 11:53 UTC (permalink / raw)
  To: 'YueHaibing', swise, dledford, jgg, monis
  Cc: linux-rdma, linux-kernel



> -----Original Message-----
> From: YueHaibing <yuehaibing@huawei.com>
> Sent: Saturday, April 28, 2018 2:31 AM
> To: swise@chelsio.com; dledford@redhat.com; jgg@ziepe.ca;
> monis@mellanox.com
> Cc: linux-rdma@vger.kernel.org; linux-kernel@vger.kernel.org; YueHaibing
> <yuehaibing@huawei.com>
> Subject: [PATCH] IB/cxgb4: use skb_put_zero()/__skb_put_zero
> 
> Use the recently introduced helper to replace the pattern of
> skb_put_zero/__skb_put() && memset().
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Looks ok.

Reviewed-by: Steve Wise <swise@opengridcomputing.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH] IB/cxgb4: use skb_put_zero()/__skb_put_zero
@ 2018-04-28 11:53   ` Steve Wise
  0 siblings, 0 replies; 5+ messages in thread
From: Steve Wise @ 2018-04-28 11:53 UTC (permalink / raw)
  To: 'YueHaibing', swise, dledford, jgg, monis
  Cc: linux-rdma, linux-kernel



> -----Original Message-----
> From: YueHaibing <yuehaibing@huawei.com>
> Sent: Saturday, April 28, 2018 2:31 AM
> To: swise@chelsio.com; dledford@redhat.com; jgg@ziepe.ca;
> monis@mellanox.com
> Cc: linux-rdma@vger.kernel.org; linux-kernel@vger.kernel.org; YueHaibing
> <yuehaibing@huawei.com>
> Subject: [PATCH] IB/cxgb4: use skb_put_zero()/__skb_put_zero
> 
> Use the recently introduced helper to replace the pattern of
> skb_put_zero/__skb_put() && memset().
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Looks ok.

Reviewed-by: Steve Wise <swise@opengridcomputing.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] IB/cxgb4: use skb_put_zero()/__skb_put_zero
  2018-04-28 11:53   ` Steve Wise
  (?)
@ 2018-05-01 15:27   ` Doug Ledford
  -1 siblings, 0 replies; 5+ messages in thread
From: Doug Ledford @ 2018-05-01 15:27 UTC (permalink / raw)
  To: Steve Wise, 'YueHaibing', swise, jgg, monis
  Cc: linux-rdma, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 878 bytes --]

On Sat, 2018-04-28 at 06:53 -0500, Steve Wise wrote:
> > -----Original Message-----
> > From: YueHaibing <yuehaibing@huawei.com>
> > Sent: Saturday, April 28, 2018 2:31 AM
> > To: swise@chelsio.com; dledford@redhat.com; jgg@ziepe.ca;
> > monis@mellanox.com
> > Cc: linux-rdma@vger.kernel.org; linux-kernel@vger.kernel.org; YueHaibing
> > <yuehaibing@huawei.com>
> > Subject: [PATCH] IB/cxgb4: use skb_put_zero()/__skb_put_zero
> > 
> > Use the recently introduced helper to replace the pattern of
> > skb_put_zero/__skb_put() && memset().
> > 
> > Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> 
> Looks ok.
> 
> Reviewed-by: Steve Wise <swise@opengridcomputing.com>
> 
> 

Applied to for-next, thanks.

-- 
Doug Ledford <dledford@redhat.com>
    GPG KeyID: B826A3330E572FDD
    Key fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-05-01 15:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-28  7:31 [PATCH] IB/cxgb4: use skb_put_zero()/__skb_put_zero YueHaibing
2018-04-28  7:31 ` YueHaibing
2018-04-28 11:53 ` Steve Wise
2018-04-28 11:53   ` Steve Wise
2018-05-01 15:27   ` Doug Ledford

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.