From: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Easwar Hariharan
<easwar.hariharan-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
Mike Marciniszyn
<mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
Stuart Summers
<john.s.summers-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Subject: [PATCH 14/20] IB/hfi1: Cache neighbor secure data after link up
Date: Sun, 09 Apr 2017 10:16:53 -0700 [thread overview]
Message-ID: <20170409171652.10579.58089.stgit@scvm10.sc.intel.com> (raw)
In-Reply-To: <20170409171329.10579.92775.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
From: Stuart Summers <john.s.summers-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Secure data is transferred across the link during verify
cap. This includes Neighbor Guid, Type, and Port Number.
This transfer is not guaranteed to complete until the 8051
firmware has completed processing of the state_complete
frame. Move the consumption of this data from verify cap
handling to link up handling to ensure the data is finalized.
Additionally, do not notify the SM that the link is up until
after this data is actually available.
Reviewed-by: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Reviewed-by: Easwar Hariharan <easwar.hariharan-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Reviewed-by: Mike Marciniszyn <mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Stuart Summers <john.s.summers-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
drivers/infiniband/hw/hfi1/chip.c | 27 +--------------------------
drivers/infiniband/hw/hfi1/hfi.h | 11 ++++++++++-
drivers/infiniband/hw/hfi1/intr.c | 27 ++++++++++++++++-----------
3 files changed, 27 insertions(+), 38 deletions(-)
diff --git a/drivers/infiniband/hw/hfi1/chip.c b/drivers/infiniband/hw/hfi1/chip.c
index b5cbffa..b840656 100644
--- a/drivers/infiniband/hw/hfi1/chip.c
+++ b/drivers/infiniband/hw/hfi1/chip.c
@@ -7288,15 +7288,6 @@ void handle_verify_cap(struct work_struct *work)
lcb_shutdown(dd, 0);
adjust_lcb_for_fpga_serdes(dd);
- /*
- * These are now valid:
- * remote VerifyCap fields in the general LNI config
- * CSR DC8051_STS_REMOTE_GUID
- * CSR DC8051_STS_REMOTE_NODE_TYPE
- * CSR DC8051_STS_REMOTE_FM_SECURITY
- * CSR DC8051_STS_REMOTE_PORT_NO
- */
-
read_vc_remote_phy(dd, &power_management, &continious);
read_vc_remote_fabric(dd, &vau, &z, &vcu, &vl15buf,
&partner_supported_crc);
@@ -7427,20 +7418,6 @@ void handle_verify_cap(struct work_struct *work)
write_csr(dd, DC_LCB_ERR_EN, 0); /* mask LCB errors */
set_8051_lcb_access(dd);
- ppd->neighbor_guid =
- read_csr(dd, DC_DC8051_STS_REMOTE_GUID);
- ppd->neighbor_port_number = read_csr(dd, DC_DC8051_STS_REMOTE_PORT_NO) &
- DC_DC8051_STS_REMOTE_PORT_NO_VAL_SMASK;
- ppd->neighbor_type =
- read_csr(dd, DC_DC8051_STS_REMOTE_NODE_TYPE) &
- DC_DC8051_STS_REMOTE_NODE_TYPE_VAL_MASK;
- ppd->neighbor_fm_security =
- read_csr(dd, DC_DC8051_STS_REMOTE_FM_SECURITY) &
- DC_DC8051_STS_LOCAL_FM_SECURITY_DISABLED_MASK;
- dd_dev_info(dd,
- "Neighbor Guid: %llx Neighbor type %d MgmtAllowed %d FM security bypass %d\n",
- ppd->neighbor_guid, ppd->neighbor_type,
- ppd->mgmt_allowed, ppd->neighbor_fm_security);
if (ppd->mgmt_allowed)
add_full_mgmt_pkey(ppd);
@@ -10497,11 +10474,8 @@ int set_link_state(struct hfi1_pportdata *ppd, u32 state)
goto unexpected;
}
- ppd->host_link_state = HLS_UP_INIT;
ret = wait_logical_linkstate(ppd, IB_PORT_INIT, 1000);
if (ret) {
- /* logical state didn't change, stay at going_up */
- ppd->host_link_state = HLS_GOING_UP;
dd_dev_err(dd,
"%s: logical state did not change to INIT\n",
__func__);
@@ -10515,6 +10489,7 @@ int set_link_state(struct hfi1_pportdata *ppd, u32 state)
add_rcvctrl(dd, RCV_CTRL_RCV_PORT_ENABLE_SMASK);
handle_linkup_change(dd, 1);
+ ppd->host_link_state = HLS_UP_INIT;
}
break;
case HLS_UP_ARMED:
diff --git a/drivers/infiniband/hw/hfi1/hfi.h b/drivers/infiniband/hw/hfi1/hfi.h
index f44513c..9aec0a2 100644
--- a/drivers/infiniband/hw/hfi1/hfi.h
+++ b/drivers/infiniband/hw/hfi1/hfi.h
@@ -1254,7 +1254,16 @@ void hfi1_init_pportdata(struct pci_dev *, struct hfi1_pportdata *,
/* return the driver's idea of the logical OPA port state */
static inline u32 driver_lstate(struct hfi1_pportdata *ppd)
{
- return ppd->lstate; /* use the cached value */
+ /*
+ * The driver does some processing from the time the logical
+ * link state is at INIT to the time the SM can be notified
+ * as such. Return IB_PORT_DOWN until the software state
+ * is ready.
+ */
+ if (ppd->lstate == IB_PORT_INIT && !(ppd->host_link_state & HLS_UP))
+ return IB_PORT_DOWN;
+ else
+ return ppd->lstate;
}
void receive_interrupt_work(struct work_struct *work);
diff --git a/drivers/infiniband/hw/hfi1/intr.c b/drivers/infiniband/hw/hfi1/intr.c
index 65348d1..232014d 100644
--- a/drivers/infiniband/hw/hfi1/intr.c
+++ b/drivers/infiniband/hw/hfi1/intr.c
@@ -131,19 +131,24 @@ void handle_linkup_change(struct hfi1_devdata *dd, u32 linkup)
if (quick_linkup || dd->icode == ICODE_FUNCTIONAL_SIMULATOR) {
set_up_vl15(dd, dd->vau, dd->vl15_init);
assign_remote_cm_au_table(dd, dd->vcu);
- ppd->neighbor_guid =
- read_csr(dd, DC_DC8051_STS_REMOTE_GUID);
- ppd->neighbor_type =
- read_csr(dd, DC_DC8051_STS_REMOTE_NODE_TYPE) &
- DC_DC8051_STS_REMOTE_NODE_TYPE_VAL_MASK;
- ppd->neighbor_port_number =
- read_csr(dd, DC_DC8051_STS_REMOTE_PORT_NO) &
- DC_DC8051_STS_REMOTE_PORT_NO_VAL_SMASK;
- dd_dev_info(dd, "Neighbor GUID: %llx Neighbor type %d\n",
- ppd->neighbor_guid,
- ppd->neighbor_type);
}
+ ppd->neighbor_guid =
+ read_csr(dd, DC_DC8051_STS_REMOTE_GUID);
+ ppd->neighbor_type =
+ read_csr(dd, DC_DC8051_STS_REMOTE_NODE_TYPE) &
+ DC_DC8051_STS_REMOTE_NODE_TYPE_VAL_MASK;
+ ppd->neighbor_port_number =
+ read_csr(dd, DC_DC8051_STS_REMOTE_PORT_NO) &
+ DC_DC8051_STS_REMOTE_PORT_NO_VAL_SMASK;
+ ppd->neighbor_fm_security =
+ read_csr(dd, DC_DC8051_STS_REMOTE_FM_SECURITY) &
+ DC_DC8051_STS_LOCAL_FM_SECURITY_DISABLED_MASK;
+ dd_dev_info(dd,
+ "Neighbor Guid %llx, Type %d, Port Num %d\n",
+ ppd->neighbor_guid, ppd->neighbor_type,
+ ppd->neighbor_port_number);
+
/* physical link went up */
ppd->linkup = 1;
ppd->offline_disabled_reason =
--
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-09 17:16 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-09 17:15 [PATCH 00/20] IB/hfi1,rdmavt,core: Patches for-next Dennis Dalessandro
[not found] ` <20170409171329.10579.92775.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
2017-04-09 17:15 ` [PATCH 01/20] IB/core: If the MGID/MLID pair is not on the list return an error Dennis Dalessandro
2017-04-09 17:15 ` [PATCH 02/20] IB/hfi1: Remove hyper-thread siblings by walking CPU mask Dennis Dalessandro
[not found] ` <20170409171537.10579.68545.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
2017-04-10 7:49 ` Christoph Hellwig
[not found] ` <20170410074904.GA26626-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2017-04-20 17:20 ` Sanchez, Sebastian
[not found] ` <5CDA63463B33C94CA80846587415F07704076B86-8oqHQFITsIGkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2017-04-20 17:34 ` Leon Romanovsky
[not found] ` <20170420173420.GR14088-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-04-21 10:48 ` Christoph Hellwig
2017-04-09 17:15 ` [PATCH 03/20] IB/hfi1: Correct MulticastMask/CollectiveMask info to SMA output Dennis Dalessandro
2017-04-09 17:15 ` [PATCH 04/20] IB/core: For multicast functions, verify that LIDs are multicast LIDs Dennis Dalessandro
2017-04-15 15:01 ` Leon Romanovsky
2017-04-09 17:15 ` [PATCH 05/20] IB/rdmavt/hfi1/qib: Use the MGID and MLID for multicast addressing Dennis Dalessandro
2017-04-09 17:16 ` [PATCH 06/20] IB/hfi1: Validate the TID count before using it Dennis Dalessandro
2017-04-09 17:16 ` [PATCH 07/20] IB/hfi1: Return SC2VL mappings to FM with VL15 instead of ILLEGAL_VL Dennis Dalessandro
2017-04-09 17:16 ` [PATCH 08/20] IB/hfi1: Rename hdr2sc to hfi1_9B_get_sc5 Dennis Dalessandro
2017-04-09 17:16 ` [PATCH 09/20] IB/hfi1: Add functions to parse 9B headers Dennis Dalessandro
2017-04-09 17:16 ` [PATCH 10/20] IB/hfi1: Use defines from common headers Dennis Dalessandro
2017-04-09 17:16 ` [PATCH 11/20] IB/hfi1: Prevent kernel QP post send hard lockups Dennis Dalessandro
2017-04-09 17:16 ` [PATCH 12/20] IB/hfi1: Fix softlockup issue Dennis Dalessandro
2017-04-09 17:16 ` [PATCH 13/20] IB/hfi1: Adjust high temperature warning for QSFP cable Dennis Dalessandro
[not found] ` <20170409171646.10579.73509.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
2017-04-28 17:43 ` Doug Ledford
2017-04-09 17:16 ` Dennis Dalessandro [this message]
2017-04-09 17:16 ` [PATCH 15/20] IB/hfi1: Permanently enable P_Key checking in HFI Dennis Dalessandro
[not found] ` <20170409171658.10579.67996.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
2017-04-15 14:53 ` Leon Romanovsky
[not found] ` <20170415145317.GM1343-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-05-29 23:16 ` Dennis Dalessandro
2017-04-09 17:17 ` [PATCH 16/20] IB/hfi1: Fix misspelling in comment Dennis Dalessandro
2017-04-09 17:17 ` [PATCH 17/20] IB/hfi1: Convert %Lx to %llx Dennis Dalessandro
2017-04-09 17:17 ` [PATCH 18/20] IB/hfi1: Fix unbalanced braces around else Dennis Dalessandro
[not found] ` <20170409171717.10579.36147.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
2017-04-13 6:03 ` Leon Romanovsky
[not found] ` <20170413060343.GC1343-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-04-18 15:15 ` Dennis Dalessandro
2017-04-09 17:17 ` [PATCH 19/20] IB/hfi: Protect against writable mmap Dennis Dalessandro
2017-04-09 17:17 ` [PATCH 20/20] IB/hfi1: Use bool in process_ecn Dennis Dalessandro
2017-04-28 17:45 ` [PATCH 00/20] IB/hfi1,rdmavt,core: Patches for-next Doug Ledford
[not found] ` <1493401510.3041.164.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-04-28 17:50 ` Dennis Dalessandro
2017-04-28 18:09 ` Doug Ledford
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=20170409171652.10579.58089.stgit@scvm10.sc.intel.com \
--to=dennis.dalessandro-ral2jqcrhueavxtiumwx3w@public.gmane.org \
--cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=easwar.hariharan-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=john.s.summers-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@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).