From: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Don Hiatt <don.hiatt-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
Dasaratharaman Chandramouli
<dasaratharaman.chandramouli-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Subject: [PATCH v2 07/19] IB/hfi1: Rename hdr2sc to hfi1_9B_get_sc5
Date: Fri, 28 Apr 2017 10:39:37 -0700 [thread overview]
Message-ID: <20170428173936.23960.98894.stgit@scvm10.sc.intel.com> (raw)
In-Reply-To: <20170428173443.23960.32602.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
From: Dasaratharaman Chandramouli <dasaratharaman.chandramouli-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
The function really returned the 5-bit sc value from
the header and rhf. hdr2sc didn't quite describe what it did.
Reviewed-by: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Reviewed-by: Don Hiatt <don.hiatt-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Dasaratharaman Chandramouli <dasaratharaman.chandramouli-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
drivers/infiniband/hw/hfi1/driver.c | 7 ++++---
drivers/infiniband/hw/hfi1/hfi.h | 2 +-
drivers/infiniband/hw/hfi1/ud.c | 2 +-
drivers/infiniband/hw/hfi1/verbs.c | 2 +-
4 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/infiniband/hw/hfi1/driver.c b/drivers/infiniband/hw/hfi1/driver.c
index 64bdbce..d731b5e 100644
--- a/drivers/infiniband/hw/hfi1/driver.c
+++ b/drivers/infiniband/hw/hfi1/driver.c
@@ -397,7 +397,7 @@ static void rcv_hdrerr(struct hfi1_ctxtdata *rcd, struct hfi1_pportdata *ppd,
u16 rlid;
u8 svc_type, sl, sc5;
- sc5 = hdr2sc(rhdr, packet->rhf);
+ sc5 = hfi1_9B_get_sc5(rhdr, packet->rhf);
sl = ibp->sc_to_sl[sc5];
lqpn = be32_to_cpu(bth[1]) & RVT_QPN_MASK;
@@ -492,7 +492,7 @@ void hfi1_process_ecn_slowpath(struct rvt_qp *qp, struct hfi1_packet *pkt,
return;
}
- sc = hdr2sc(hdr, pkt->rhf);
+ sc = hfi1_9B_get_sc5(hdr, pkt->rhf);
bth1 = be32_to_cpu(ohdr->bth[1]);
if (do_cnp && (bth1 & HFI1_FECN_SMASK)) {
@@ -909,7 +909,8 @@ static inline int set_armed_to_active(struct hfi1_ctxtdata *rcd,
packet->rhf_addr);
u8 etype = rhf_rcv_type(packet->rhf);
- if (etype == RHF_RCV_TYPE_IB && hdr2sc(hdr, packet->rhf) != 0xf) {
+ if (etype == RHF_RCV_TYPE_IB &&
+ hfi1_9B_get_sc5(hdr, packet->rhf) != 0xf) {
int hwstate = read_logical_state(dd);
if (hwstate != LSTATE_ACTIVE) {
diff --git a/drivers/infiniband/hw/hfi1/hfi.h b/drivers/infiniband/hw/hfi1/hfi.h
index a31638c..8509502 100644
--- a/drivers/infiniband/hw/hfi1/hfi.h
+++ b/drivers/infiniband/hw/hfi1/hfi.h
@@ -1261,7 +1261,7 @@ static inline u32 driver_lstate(struct hfi1_pportdata *ppd)
void receive_interrupt_work(struct work_struct *work);
/* extract service channel from header and rhf */
-static inline int hdr2sc(struct ib_header *hdr, u64 rhf)
+static inline int hfi1_9B_get_sc5(struct ib_header *hdr, u64 rhf)
{
return ((be16_to_cpu(hdr->lrh[0]) >> 12) & 0xf) |
((!!(rhf_dc_info(rhf))) << 4);
diff --git a/drivers/infiniband/hw/hfi1/ud.c b/drivers/infiniband/hw/hfi1/ud.c
index 13ea4eb..fd105cf 100644
--- a/drivers/infiniband/hw/hfi1/ud.c
+++ b/drivers/infiniband/hw/hfi1/ud.c
@@ -680,7 +680,7 @@ void hfi1_ud_rcv(struct hfi1_packet *packet)
u32 tlen = packet->tlen;
struct rvt_qp *qp = packet->qp;
bool has_grh = rcv_flags & HFI1_HAS_GRH;
- u8 sc5 = hdr2sc(hdr, packet->rhf);
+ u8 sc5 = hfi1_9B_get_sc5(hdr, packet->rhf);
u32 bth1;
u8 sl_from_sc, sl;
u16 slid;
diff --git a/drivers/infiniband/hw/hfi1/verbs.c b/drivers/infiniband/hw/hfi1/verbs.c
index f74abb1..66a2378 100644
--- a/drivers/infiniband/hw/hfi1/verbs.c
+++ b/drivers/infiniband/hw/hfi1/verbs.c
@@ -1928,7 +1928,7 @@ void hfi1_cnp_rcv(struct hfi1_packet *packet)
return;
}
- sc5 = hdr2sc(hdr, packet->rhf);
+ sc5 = hfi1_9B_get_sc5(hdr, packet->rhf);
sl = ibp->sc_to_sl[sc5];
lqpn = qp->ibqp.qp_num;
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2017-04-28 17:39 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-28 17:38 [PATCH v2 00/19] IB/hfi1,rdmavt,core: Patches for-next Dennis Dalessandro
2017-04-28 17:39 ` [PATCH v2 03/19] IB/core: For multicast functions, verify that LIDs are multicast LIDs Dennis Dalessandro
[not found] ` <20170428173443.23960.32602.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
2017-04-28 17:38 ` [PATCH v2 01/19] IB/core: If the MGID/MLID pair is not on the list return an error Dennis Dalessandro
2017-04-28 17:39 ` [PATCH v2 02/19] IB/hfi1: Correct MulticastMask/CollectiveMask info to SMA output Dennis Dalessandro
2017-04-28 17:39 ` [PATCH v2 04/19] IB/rdmavt/hfi1/qib: Use the MGID and MLID for multicast addressing Dennis Dalessandro
2017-04-28 17:39 ` [PATCH v2 05/19] IB/hfi1: Validate the TID count before using it Dennis Dalessandro
2017-04-28 17:39 ` [PATCH v2 06/19] IB/hfi1: Return SC2VL mappings to FM with VL15 instead of ILLEGAL_VL Dennis Dalessandro
2017-04-28 17:39 ` Dennis Dalessandro [this message]
2017-04-28 17:39 ` [PATCH v2 08/19] IB/hfi1: Add functions to parse 9B headers Dennis Dalessandro
2017-04-28 17:39 ` [PATCH v2 09/19] IB/hfi1: Use defines from common headers Dennis Dalessandro
2017-04-28 17:39 ` [PATCH v2 10/19] IB/hfi1: Prevent kernel QP post send hard lockups Dennis Dalessandro
2017-04-28 17:40 ` [PATCH v2 11/19] IB/hfi1: Fix softlockup issue Dennis Dalessandro
2017-04-28 17:40 ` [PATCH v2 12/19] IB/hfi1: Adjust high temperature warning for QSFP cable Dennis Dalessandro
2017-04-28 17:40 ` [PATCH v2 13/19] IB/hfi1: Cache neighbor secure data after link up Dennis Dalessandro
2017-04-28 17:40 ` [PATCH v2 14/19] IB/hfi1: Permanently enable P_Key checking in HFI Dennis Dalessandro
2017-04-28 17:40 ` [PATCH v2 15/19] IB/hfi1: Fix misspelling in comment Dennis Dalessandro
2017-04-28 17:40 ` [PATCH v2 16/19] IB/hfi1: Convert %Lx to %llx Dennis Dalessandro
2017-04-28 17:40 ` [PATCH v2 17/19] IB/hfi1: Fix unbalanced braces around else Dennis Dalessandro
2017-04-28 17:40 ` [PATCH v2 18/19] IB/hfi: Protect against writable mmap Dennis Dalessandro
2017-04-28 17:40 ` [PATCH v2 19/19] IB/hfi1: Use bool in process_ecn Dennis Dalessandro
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=20170428173936.23960.98894.stgit@scvm10.sc.intel.com \
--to=dennis.dalessandro-ral2jqcrhueavxtiumwx3w@public.gmane.org \
--cc=dasaratharaman.chandramouli-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=don.hiatt-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.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).