diff --git a/0011-Update-kernel-headers.patch b/0011-Update-kernel-headers.patch new file mode 100644 index 0000000..ee5e2b1 --- /dev/null +++ b/0011-Update-kernel-headers.patch @@ -0,0 +1,38 @@ +From 12d2a17d404e3d5ba76863f64307ea52a7d15d15 Mon Sep 17 00:00:00 2001 +From: Yixing Liu +Date: Sat, 29 Oct 2022 10:44:17 +0800 +Subject: [PATCH 11/12] Update kernel headers + +To commit ?? ("RDMA/hns: Support DSCP of userspace"). + +Signed-off-by: Yixing Liu +--- + kernel-headers/rdma/hns-abi.h | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/kernel-headers/rdma/hns-abi.h b/kernel-headers/rdma/hns-abi.h +index 41738b8..542be5e 100644 +--- a/kernel-headers/rdma/hns-abi.h ++++ b/kernel-headers/rdma/hns-abi.h +@@ -85,6 +85,18 @@ struct hns_roce_ib_create_qp_resp { + __aligned_u64 dwqe_mmap_key; + }; + ++struct hns_roce_ib_create_ah_resp { ++ __u8 priority; ++ __u8 tc_mode; ++ __u8 reserved[6]; ++}; ++ ++struct hns_roce_ib_modify_qp_resp { ++ __u8 tc_mode; ++ __u8 priority; ++ __u8 reserved[6]; ++}; ++ + enum { + HNS_ROCE_EXSGE_FLAGS = 1 << 0, + HNS_ROCE_RQ_INLINE_FLAGS = 1 << 1, +-- +2.30.0 + diff --git a/0012-libhns-Support-DSCP.patch b/0012-libhns-Support-DSCP.patch new file mode 100644 index 0000000..c7c5ea2 --- /dev/null +++ b/0012-libhns-Support-DSCP.patch @@ -0,0 +1,94 @@ +From 288a89df406d8c77b3e3d6a8ca375ef18b676769 Mon Sep 17 00:00:00 2001 +From: Yixing Liu +Date: Tue, 27 Sep 2022 19:06:00 +0800 +Subject: [PATCH 12/12] libhns: Support DSCP + +This patch adds user mode DSCP function through +the mapping of dscp-tc configured in kernel mode. + +Signed-off-by: Yixing Liu +--- + providers/hns/hns_roce_u.h | 7 +++++++ + providers/hns/hns_roce_u_hw_v2.c | 11 ++++++++++- + providers/hns/hns_roce_u_verbs.c | 3 +++ + 3 files changed, 20 insertions(+), 1 deletion(-) + +diff --git a/providers/hns/hns_roce_u.h b/providers/hns/hns_roce_u.h +index 6b64cd0..8c1cb1e 100644 +--- a/providers/hns/hns_roce_u.h ++++ b/providers/hns/hns_roce_u.h +@@ -175,6 +175,11 @@ enum hns_roce_db_type { + HNS_ROCE_DB_TYPE_NUM + }; + ++enum hns_roce_tc_map_mode { ++ HNS_ROCE_TC_MAP_MODE_PRIO, ++ HNS_ROCE_TC_MAP_MODE_DSCP, ++}; ++ + struct hns_roce_db_page { + struct hns_roce_db_page *prev, *next; + struct hns_roce_buf buf; +@@ -315,6 +320,8 @@ struct hns_roce_qp { + unsigned int next_sge; + int port_num; + uint8_t sl; ++ uint8_t tc_mode; ++ uint8_t priority; + unsigned int qkey; + enum ibv_mtu path_mtu; + +diff --git a/providers/hns/hns_roce_u_hw_v2.c b/providers/hns/hns_roce_u_hw_v2.c +index a30d461..c90a312 100644 +--- a/providers/hns/hns_roce_u_hw_v2.c ++++ b/providers/hns/hns_roce_u_hw_v2.c +@@ -1545,6 +1545,7 @@ static int hns_roce_u_v2_modify_qp(struct ibv_qp *qp, struct ibv_qp_attr *attr, + { + int ret; + struct ibv_modify_qp cmd; ++ struct hns_roce_modify_qp_ex_resp resp_ex = {}; + struct hns_roce_qp *hr_qp = to_hr_qp(qp); + bool flag = false; /* modify qp to error */ + +@@ -1564,8 +1565,13 @@ static int hns_roce_u_v2_modify_qp(struct ibv_qp *qp, struct ibv_qp_attr *attr, + if (ret) + return ret; + +- if (attr_mask & IBV_QP_STATE) ++ if (attr_mask & IBV_QP_STATE) { + qp->state = attr->qp_state; ++ if (attr->qp_state == IBV_QPS_RTR) { ++ hr_qp->tc_mode = resp_ex.drv_payload.tc_mode; ++ hr_qp->priority = resp_ex.drv_payload.priority; ++ } ++ } + + if ((attr_mask & IBV_QP_STATE) && attr->qp_state == IBV_QPS_RESET) { + if (qp->recv_cq) +@@ -1579,6 +1585,9 @@ static int hns_roce_u_v2_modify_qp(struct ibv_qp *qp, struct ibv_qp_attr *attr, + hns_roce_init_qp_indices(to_hr_qp(qp)); + } + ++ if (hr_qp->tc_mode == HNS_ROCE_TC_MAP_MODE_DSCP) ++ hr_qp->sl = hr_qp->priority; ++ + record_qp_attr(qp, attr, attr_mask); + + return ret; +diff --git a/providers/hns/hns_roce_u_verbs.c b/providers/hns/hns_roce_u_verbs.c +index cff9d1d..a21c837 100644 +--- a/providers/hns/hns_roce_u_verbs.c ++++ b/providers/hns/hns_roce_u_verbs.c +@@ -1483,6 +1483,9 @@ struct ibv_ah *hns_roce_u_create_ah(struct ibv_pd *pd, struct ibv_ah_attr *attr) + if (ibv_resolve_eth_l2_from_gid(pd->context, attr, ah->av.mac, NULL)) + goto err; + ++ if (resp.tc_mode == HNS_ROCE_TC_MAP_MODE_DSCP) ++ ah->av.sl = resp.priority; ++ + ah->av.udp_sport = get_ah_udp_sport(attr); + + return &ah->ibv_ah; +-- +2.30.0 + diff --git a/rdma-core.spec b/rdma-core.spec index fe073fb..6f98724 100644 --- a/rdma-core.spec +++ b/rdma-core.spec @@ -1,6 +1,6 @@ Name: rdma-core Version: 41.0 -Release: 2 +Release: 3 Summary: RDMA core userspace libraries and daemons License: GPLv2 or BSD Url: https://github.com/linux-rdma/rdma-core @@ -260,6 +260,12 @@ fi %{_mandir}/* %changelog +* Sat Oct 29 2022 tangchengchang - 41.0-3 +- Type: requirement +- ID: NA +- SUG: NA +- DESC: Support rq inline and cqe inline + * Sat Oct 08 2022 luoyouming - 41.0-2 - Type: requirement - ID: NA