Skip to content

Commit 5352650

Browse files
Neel Desaidledford
authored andcommitted
IB/hfi1: Permanently enable P_Key checking in HFI
Ingress and egress port P_Key checking should always be performed for HFIs. This patch will enable ingress and egress P_Key checking when the port is initialized and will ignore the P_Key information sent by the FM in the port info structure which is meant to be used only by the switch. Reviewed-by: Easwar Hariharan <easwar.hariharan@intel.com> Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Neel Desai <neel.desai@intel.com> Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
1 parent 98b9ee2 commit 5352650

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

drivers/infiniband/hw/hfi1/init.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,9 @@ void hfi1_init_pportdata(struct pci_dev *pdev, struct hfi1_pportdata *ppd,
484484
default_pkey_idx = 1;
485485

486486
ppd->pkeys[default_pkey_idx] = DEFAULT_P_KEY;
487+
ppd->part_enforce |= HFI1_PART_ENFORCE_IN;
488+
ppd->part_enforce |= HFI1_PART_ENFORCE_OUT;
489+
487490
if (loopback) {
488491
hfi1_early_err(&pdev->dev,
489492
"Faking data partition 0x8001 in idx %u\n",

drivers/infiniband/hw/hfi1/mad.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,16 +1155,6 @@ static int __subn_set_opa_portinfo(struct opa_smp *smp, u32 am, u8 *data,
11551155
ppd->linkinit_reason =
11561156
(pi->partenforce_filterraw &
11571157
OPA_PI_MASK_LINKINIT_REASON);
1158-
/* enable/disable SW pkey checking as per FM control */
1159-
if (pi->partenforce_filterraw & OPA_PI_MASK_PARTITION_ENFORCE_IN)
1160-
ppd->part_enforce |= HFI1_PART_ENFORCE_IN;
1161-
else
1162-
ppd->part_enforce &= ~HFI1_PART_ENFORCE_IN;
1163-
1164-
if (pi->partenforce_filterraw & OPA_PI_MASK_PARTITION_ENFORCE_OUT)
1165-
ppd->part_enforce |= HFI1_PART_ENFORCE_OUT;
1166-
else
1167-
ppd->part_enforce &= ~HFI1_PART_ENFORCE_OUT;
11681158

11691159
/* Must be a valid unicast LID address. */
11701160
if ((smlid == 0 && ls_old > IB_PORT_INIT) ||

0 commit comments

Comments
 (0)