Patch "IB/mlx5: Assign DSCP for R-RoCE QPs Address Path" has been added to the 4.9-stable tree
Subsystems (3)
This is a note to let you know that I've just added the patch titled
IB/mlx5: Assign DSCP for R-RoCE QPs Address Path
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
ib-mlx5-assign-dscp-for-r-roce-qps-address-path.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From foo@baz Mon Nov 6 10:07:35 CET 2017
From: Majd Dibbiny <[email protected]>
Date: Sat, 7 Oct 2017 22:36:47 +0000
Subject: IB/mlx5: Assign DSCP for R-RoCE QPs Address Path
From: Majd Dibbiny <[email protected]>
[ Upstream commit ed88451e1f2d400fd6a743d0a481631cf9f97550 ]
For Routable RoCE QPs, the DSCP should be set in the QP's address path.
The DSCP's value is derived from the traffic class.
--- drivers/infiniband/hw/mlx5/main.c | 21 +++++++++++++++++++++ drivers/infiniband/hw/mlx5/mlx5_ib.h | 2 ++ drivers/infiniband/hw/mlx5/qp.c | 7 +++++++ 3 files changed, 30 insertions(+)
drivers/infiniband/hw/mlx5/main.c +21 -0
@@ -325,6 +325,27 @@ __be16 mlx5_get_roce_udp_sport(struct mlreturn cpu_to_be16 (MLX5_CAP_ROCE (dev->mdev, r_roce_min_src_udp_port)); } +int mlx5_get_roce_gid_type (struct mlx5_ib_dev *dev,u8 port_num, +int index,enum ib_gid_type *gid_type) +{ +struct ib_gid_attr attr; +union ib_gid gid; +int ret; + + ret =ib_get_cached_gid (&dev->ib_dev, port_num, index, &gid, &attr); +if (ret) +return ret; + +if (!attr.ndev) +return -ENODEV ; + +dev_put (attr.ndev); + + *gid_type = attr.gid_type; + +return 0 ; +} +static int mlx5_use_mad_ifc (struct mlx5_ib_dev *dev) {if (MLX5_CAP_GEN (dev->mdev, port_type) ==MLX5_CAP_PORT_TYPE_IB )
drivers/infiniband/hw/mlx5/mlx5_ib.h +2 -0
@@ -892,6 +892,8 @@ int mlx5_ib_set_vf_guid(struct ib_device__be16 mlx5_get_roce_udp_sport (struct mlx5_ib_dev *dev,u8 port_num,int index); +int mlx5_get_roce_gid_type (struct mlx5_ib_dev *dev,u8 port_num, +int index,enum ib_gid_type *gid_type);/* GSI QP helper functions */ struct ib_qp *mlx5_ib_gsi_create_qp(struct ib_pd *pd,
drivers/infiniband/hw/mlx5/qp.c +7 -0
@@ -2226,6 +2226,7 @@ static int mlx5_set_path(struct mlx5_ib_ {enum rdma_link_layer ll =rdma_port_get_link_layer (&dev->ib_dev, port);int err; +enum ib_gid_type gid_type;if (attr_mask &IB_QP_PKEY_INDEX ) path->pkey_index = cpu_to_be16(alt ? attr->alt_pkey_index :
@@ -2244,10 +2245,16 @@ static int mlx5_set_path(struct mlx5_ib_if (ll ==IB_LINK_LAYER_ETHERNET ) {if (!(ah->ah_flags &IB_AH_GRH ))return -EINVAL ; + err =mlx5_get_roce_gid_type (dev, port, ah->grh.sgid_index, + &gid_type); +if (err) +return err;memcpy (path->rmac, ah->dmac,sizeof (ah->dmac)); path->udp_sport =mlx5_get_roce_udp_sport (dev, port, ah->grh.sgid_index); path->dci_cfi_prio_sl = (ah->sl &0x7 ) <<4 ; +if (gid_type ==IB_GID_TYPE_ROCE_UDP_ENCAP ) + path->ecn_dscp = (ah->grh.traffic_class >>2 ) &0x3f ; }else { path->fl_free_ar = (path_flags &MLX5_PATH_FLAG_FL ) ?0x80 :0 ; path->fl_free_ar |=
Patches currently in stable-queue which might be from [email protected] are
queue-4.9/ib-mlx5-assign-dscp-for-r-roce-qps-address-path.patch