Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 53526500 authored by Neel Desai's avatar Neel Desai Committed by Doug Ledford
Browse files

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: default avatarEaswar Hariharan <easwar.hariharan@intel.com>
Reviewed-by: default avatarDennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: default avatarNeel Desai <neel.desai@intel.com>
Signed-off-by: default avatarDennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 98b9ee20
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -484,6 +484,9 @@ void hfi1_init_pportdata(struct pci_dev *pdev, struct hfi1_pportdata *ppd,
	default_pkey_idx = 1;
	default_pkey_idx = 1;


	ppd->pkeys[default_pkey_idx] = DEFAULT_P_KEY;
	ppd->pkeys[default_pkey_idx] = DEFAULT_P_KEY;
	ppd->part_enforce |= HFI1_PART_ENFORCE_IN;
	ppd->part_enforce |= HFI1_PART_ENFORCE_OUT;

	if (loopback) {
	if (loopback) {
		hfi1_early_err(&pdev->dev,
		hfi1_early_err(&pdev->dev,
			       "Faking data partition 0x8001 in idx %u\n",
			       "Faking data partition 0x8001 in idx %u\n",
+0 −10
Original line number Original line Diff line number Diff line
@@ -1155,16 +1155,6 @@ static int __subn_set_opa_portinfo(struct opa_smp *smp, u32 am, u8 *data,
		ppd->linkinit_reason =
		ppd->linkinit_reason =
			(pi->partenforce_filterraw &
			(pi->partenforce_filterraw &
			 OPA_PI_MASK_LINKINIT_REASON);
			 OPA_PI_MASK_LINKINIT_REASON);
	/* enable/disable SW pkey checking as per FM control */
	if (pi->partenforce_filterraw & OPA_PI_MASK_PARTITION_ENFORCE_IN)
		ppd->part_enforce |= HFI1_PART_ENFORCE_IN;
	else
		ppd->part_enforce &= ~HFI1_PART_ENFORCE_IN;

	if (pi->partenforce_filterraw & OPA_PI_MASK_PARTITION_ENFORCE_OUT)
		ppd->part_enforce |= HFI1_PART_ENFORCE_OUT;
	else
		ppd->part_enforce &= ~HFI1_PART_ENFORCE_OUT;


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