]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
IB/hfi1: Consider LMC in 16B/bypass ingress packet check
authorAshutosh Dixit <ashutosh.dixit@intel.com>
Wed, 28 Nov 2018 18:19:47 +0000 (10:19 -0800)
committerJason Gunthorpe <jgg@mellanox.com>
Fri, 7 Dec 2018 02:50:09 +0000 (19:50 -0700)
Ingress packet check for 16B/bypass packets should consider the port
LMC. Not doing this will result in packets sent to the LMC LIDs getting
dropped. The check is implemented in HW for 9B packets.

Reviewed-by: Mike Ruhl <michael.j.ruhl@intel.com>
Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/hfi1/driver.c

index d5277c23cba60f3d077dfc88114448c2ac594984..a8ad70730203995c4529e909e09be028556afc18 100644 (file)
@@ -1426,7 +1426,7 @@ static int hfi1_bypass_ingress_pkt_check(struct hfi1_packet *packet)
        if ((!(hfi1_is_16B_mcast(packet->dlid))) &&
            (packet->dlid !=
                opa_get_lid(be32_to_cpu(OPA_LID_PERMISSIVE), 16B))) {
-               if (packet->dlid != ppd->lid)
+               if ((packet->dlid & ~((1 << ppd->lmc) - 1)) != ppd->lid)
                        return -EINVAL;
        }