Message ID | 20171129125948.31113.59826.stgit@phlsvslse11.ph.intel.com (mailing list archive) |
---|---|
State | Not Applicable |
Headers | show |
On Wed, Nov 29, 2017 at 07:59:49AM -0500, Mike Marciniszyn wrote: > From: Don Hiatt <don.hiatt@intel.com> > > Upstream commit 4988be5813ff2afdc0d8bfa315ef34a577d3efbf. > > On OPA devices opa_local_smp_check will receive 32Bit LIDs when the LID > is Extended. In such cases, it is okay to lose the upper 16 bits of the > LID as this information is obtained elsewhere. Do not issue a warning > when calling ib_lid_cpu16() in this case by masking out the upper 16Bits. The concept for the 32 bit lids was to keep it 32 bit inside the kernel, ingress_key_table_fail puts the lid into err_info_constraint.slid which is already 32 bits, so this cannot be the right place for this. These truncations should only appear at the uapi boundary. Jason -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Wed, Nov 29, 2017 at 11:43:24AM -0700, Jason Gunthorpe wrote: > On Wed, Nov 29, 2017 at 07:59:49AM -0500, Mike Marciniszyn wrote: > > From: Don Hiatt <don.hiatt@intel.com> > > > > Upstream commit 4988be5813ff2afdc0d8bfa315ef34a577d3efbf. > > > > On OPA devices opa_local_smp_check will receive 32Bit LIDs when the LID > > is Extended. In such cases, it is okay to lose the upper 16 bits of the > > LID as this information is obtained elsewhere. Do not issue a warning > > when calling ib_lid_cpu16() in this case by masking out the upper 16Bits. > > The concept for the 32 bit lids was to keep it 32 bit inside the > kernel, ingress_key_table_fail puts the lid into > err_info_constraint.slid which is already 32 bits, so this cannot be > the right place for this. > > These truncations should only appear at the uapi boundary. Ok, but that's what the change in Linus's tree does. If you object to that, please fix it there :) thanks, greg k-h -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 12/4/2017 4:13 AM, Greg KH wrote: > On Wed, Nov 29, 2017 at 11:43:24AM -0700, Jason Gunthorpe wrote: >> On Wed, Nov 29, 2017 at 07:59:49AM -0500, Mike Marciniszyn wrote: >>> From: Don Hiatt <don.hiatt@intel.com> >>> >>> Upstream commit 4988be5813ff2afdc0d8bfa315ef34a577d3efbf. >>> >>> On OPA devices opa_local_smp_check will receive 32Bit LIDs when the LID >>> is Extended. In such cases, it is okay to lose the upper 16 bits of the >>> LID as this information is obtained elsewhere. Do not issue a warning >>> when calling ib_lid_cpu16() in this case by masking out the upper 16Bits. >> The concept for the 32 bit lids was to keep it 32 bit inside the >> kernel, ingress_key_table_fail puts the lid into >> err_info_constraint.slid which is already 32 bits, so this cannot be >> the right place for this. >> >> These truncations should only appear at the uapi boundary. > Ok, but that's what the change in Linus's tree does. If you object to > that, please fix it there :) Hi Jason, I have changes for this that I can submit as a follow on patch, please let me know if this is how you'd like to proceed. don > thanks, > > greg k-h > -- > To unsubscribe from this list: send the line "unsubscribe linux-rdma" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Mon, Dec 04, 2017 at 09:28:07AM -0800, Don Hiatt wrote: > > > On 12/4/2017 4:13 AM, Greg KH wrote: > >On Wed, Nov 29, 2017 at 11:43:24AM -0700, Jason Gunthorpe wrote: > >>On Wed, Nov 29, 2017 at 07:59:49AM -0500, Mike Marciniszyn wrote: > >>>From: Don Hiatt <don.hiatt@intel.com> > >>> > >>>Upstream commit 4988be5813ff2afdc0d8bfa315ef34a577d3efbf. > >>> > >>>On OPA devices opa_local_smp_check will receive 32Bit LIDs when the LID > >>>is Extended. In such cases, it is okay to lose the upper 16 bits of the > >>>LID as this information is obtained elsewhere. Do not issue a warning > >>>when calling ib_lid_cpu16() in this case by masking out the upper 16Bits. > >>The concept for the 32 bit lids was to keep it 32 bit inside the > >>kernel, ingress_key_table_fail puts the lid into > >>err_info_constraint.slid which is already 32 bits, so this cannot be > >>the right place for this. > >> > >>These truncations should only appear at the uapi boundary. > >Ok, but that's what the change in Linus's tree does. If you object to > >that, please fix it there :) > Hi Jason, > > I have changes for this that I can submit as a follow on patch, > please let me know if this is how you'd like to proceed. Yes, please send a followup patch to mainline Jason -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/infiniband/hw/hfi1/mad.c b/drivers/infiniband/hw/hfi1/mad.c index f4c0ffc..07b80fa 100644 --- a/drivers/infiniband/hw/hfi1/mad.c +++ b/drivers/infiniband/hw/hfi1/mad.c @@ -4293,7 +4293,6 @@ static int opa_local_smp_check(struct hfi1_ibport *ibp, const struct ib_wc *in_wc) { struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); - u16 slid = ib_lid_cpu16(in_wc->slid); u16 pkey; if (in_wc->pkey_index >= ARRAY_SIZE(ppd->pkeys)) @@ -4320,7 +4319,11 @@ static int opa_local_smp_check(struct hfi1_ibport *ibp, */ if (pkey == LIM_MGMT_P_KEY || pkey == FULL_MGMT_P_KEY) return 0; - ingress_pkey_table_fail(ppd, pkey, slid); + /* + * On OPA devices it is okay to lose the upper 16 bits of LID as this + * information is obtained elsewhere. Mask off the upper 16 bits. + */ + ingress_pkey_table_fail(ppd, pkey, ib_lid_cpu16(0xFFFF & in_wc->slid)); return 1; }