IB/mlx4: Check for egress flow steering
authorBoris Pismenny <borisp@mellanox.com>
Wed, 28 Mar 2018 06:27:43 +0000 (09:27 +0300)
committerJason Gunthorpe <jgg@mellanox.com>
Wed, 4 Apr 2018 18:06:24 +0000 (12:06 -0600)
ConnectX3 doesn't support egress flow steering. Return an EOPNOTSUPP
error when such a flow is being created.

Signed-off-by: Boris Pismenny <borisp@mellanox.com>
Reviewed-by: Aviad Yehezkel <aviadye@mellanox.com>
Reviewed-by: Matan Barak <matanb@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/mlx4/main.c

index 8eca09b53fe8677106f23ffa8aa2625a459b30c7..5b70744f414ac7e50670c3ff710220613e2c8c5b 100644 (file)
@@ -1858,6 +1858,9 @@ static struct ib_flow *mlx4_ib_create_flow(struct ib_qp *qp,
        if (flow_attr->port < 1 || flow_attr->port > qp->device->phys_port_cnt)
                return ERR_PTR(-EINVAL);
 
+       if (flow_attr->flags & ~IB_FLOW_ATTR_FLAGS_DONT_TRAP)
+               return ERR_PTR(-EOPNOTSUPP);
+
        if ((flow_attr->flags & IB_FLOW_ATTR_FLAGS_DONT_TRAP) &&
            (flow_attr->type != IB_FLOW_ATTR_NORMAL))
                return ERR_PTR(-EOPNOTSUPP);