From: Bob Pearson <rpearsonhpe@gmail.com>
To: jgg@nvidia.com, zyjzyj2000@gmail.com, linux-rdma@vger.kernel.org,
jhack@hpe.com
Cc: Bob Pearson <rpearsonhpe@gmail.com>
Subject: [PATCH for-next v3 7/8] RDMA/rxe: Combine setting pkt info
Date: Thu, 27 Jul 2023 14:28:31 -0500 [thread overview]
Message-ID: <20230727192831.65495-8-rpearsonhpe@gmail.com> (raw)
In-Reply-To: <20230727192831.65495-1-rpearsonhpe@gmail.com>
Move setting some rxe_pkt_info fields in rxe_init_packet() together
with the rest of the fields in rxe_init_req_packet() and
prepare_ack_packet().
Signed-off-by: Bob Pearson <rpearsonhpe@gmail.com>
---
drivers/infiniband/sw/rxe/rxe_net.c | 6 ------
drivers/infiniband/sw/rxe/rxe_req.c | 4 +++-
drivers/infiniband/sw/rxe/rxe_resp.c | 12 ++++++++----
3 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/drivers/infiniband/sw/rxe/rxe_net.c b/drivers/infiniband/sw/rxe/rxe_net.c
index 006c2d60f04d..94e347a7f386 100644
--- a/drivers/infiniband/sw/rxe/rxe_net.c
+++ b/drivers/infiniband/sw/rxe/rxe_net.c
@@ -516,7 +516,6 @@ struct sk_buff *rxe_init_packet(struct rxe_dev *rxe, struct rxe_av *av,
unsigned int hdr_len;
struct sk_buff *skb = NULL;
struct net_device *ndev = rxe->ndev;
- const int port_num = 1;
if (av->network_type == RXE_NETWORK_TYPE_IPV4)
hdr_len = ETH_HLEN + sizeof(struct udphdr) +
@@ -540,11 +539,6 @@ struct sk_buff *rxe_init_packet(struct rxe_dev *rxe, struct rxe_av *av,
else
skb->protocol = htons(ETH_P_IPV6);
- pkt->rxe = rxe;
- pkt->port_num = port_num;
- pkt->hdr = skb_put(skb, pkt->paylen);
- pkt->mask |= RXE_GRH_MASK;
-
out:
return skb;
}
diff --git a/drivers/infiniband/sw/rxe/rxe_req.c b/drivers/infiniband/sw/rxe/rxe_req.c
index 8423d259f26a..4db1bacdfdb8 100644
--- a/drivers/infiniband/sw/rxe/rxe_req.c
+++ b/drivers/infiniband/sw/rxe/rxe_req.c
@@ -512,7 +512,7 @@ static struct sk_buff *rxe_init_req_packet(struct rxe_qp *qp,
pkt->opcode = opcode;
pkt->qp = qp;
pkt->psn = qp->req.psn;
- pkt->mask = rxe_opcode[opcode].mask;
+ pkt->mask = rxe_opcode[opcode].mask | RXE_GRH_MASK;
pkt->wqe = wqe;
pkt->port_num = 1;
@@ -535,6 +535,8 @@ static struct sk_buff *rxe_init_req_packet(struct rxe_qp *qp,
goto err_out;
}
+ pkt->hdr = skb_put(skb, pkt->paylen);
+
/* init roce headers */
rxe_init_roce_hdrs(qp, wqe, pkt);
diff --git a/drivers/infiniband/sw/rxe/rxe_resp.c b/drivers/infiniband/sw/rxe/rxe_resp.c
index 7e79d3e4d64e..8a25c56dfd86 100644
--- a/drivers/infiniband/sw/rxe/rxe_resp.c
+++ b/drivers/infiniband/sw/rxe/rxe_resp.c
@@ -768,6 +768,13 @@ static struct sk_buff *prepare_ack_packet(struct rxe_qp *qp,
struct sk_buff *skb;
int err;
+ ack->rxe = rxe;
+ ack->qp = qp;
+ ack->opcode = opcode;
+ ack->mask = rxe_opcode[opcode].mask | RXE_GRH_MASK;
+ ack->psn = psn;
+ ack->port_num = 1;
+
/*
* allocate packet
*/
@@ -779,10 +786,7 @@ static struct sk_buff *prepare_ack_packet(struct rxe_qp *qp,
if (!skb)
return NULL;
- ack->qp = qp;
- ack->opcode = opcode;
- ack->mask = rxe_opcode[opcode].mask;
- ack->psn = psn;
+ ack->hdr = skb_put(skb, ack->paylen);
bth_init(ack, opcode, 0, 0, ack->pad, IB_DEFAULT_PKEY_FULL,
qp->attr.dest_qp_num, 0, psn);
--
2.39.2
next prev parent reply other threads:[~2023-07-27 19:29 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-27 19:28 [PATCH for-next v3 0/7] RDMA/rxe: Misc cleanups Bob Pearson
2023-07-27 19:28 ` [PATCH for-next v3 1/8] RDMA/rxe: Add pad size to struct rxe_pkt_info Bob Pearson
2023-07-27 19:28 ` [PATCH for-next v3 2/8] RDMA/rxe: Isolate code to fill request roce headers Bob Pearson
2023-07-27 19:28 ` [PATCH for-next v3 3/8] RDMA/rxe: Isolate request payload code in a subroutine Bob Pearson
2023-07-27 19:28 ` [PATCH for-next v3 4/8] RDMA/rxe: Remove paylen parameter from rxe_init_packet Bob Pearson
2023-07-27 19:28 ` [PATCH for-next v3 5/8] RDMA/rxe: Isolate code to build request packet Bob Pearson
2023-07-27 19:28 ` [PATCH for-next v3 6/8] RDMA/rxe: Put fake udp send code in a subroutine Bob Pearson
2023-07-27 19:28 ` Bob Pearson [this message]
2023-07-27 19:28 ` [PATCH for-next v3 8/8] RDMA/rxe: Move next_opcode to rxe_opcode.c Bob Pearson
2023-08-09 19:20 ` [PATCH for-next v3 0/7] RDMA/rxe: Misc cleanups Jason Gunthorpe
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=20230727192831.65495-8-rpearsonhpe@gmail.com \
--to=rpearsonhpe@gmail.com \
--cc=jgg@nvidia.com \
--cc=jhack@hpe.com \
--cc=linux-rdma@vger.kernel.org \
--cc=zyjzyj2000@gmail.com \
/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