@@ -1078,6 +1078,28 @@ struct ibv_cq_ex *efadv_create_cq(struct ibv_context *ibvctx,
10781078 return create_cq (ibvctx , attr_ex , & local_efa_attr );
10791079}
10801080
1081+ int efadv_query_cq (struct ibv_cq * ibvcq , struct efadv_cq_attr * attr , uint32_t inlen )
1082+ {
1083+ struct efa_cq * cq = to_efa_cq (ibvcq );
1084+
1085+ if (!is_efa_dev (ibvcq -> context -> device )) {
1086+ verbs_err (verbs_get_ctx (ibvcq -> context ), "Not an EFA device\n" );
1087+ return EOPNOTSUPP ;
1088+ }
1089+
1090+ if (!vext_field_avail (typeof (* attr ), num_entries , inlen )) {
1091+ verbs_err (verbs_get_ctx (ibvcq -> context ), "Compatibility issues\n" );
1092+ return EINVAL ;
1093+ }
1094+
1095+ attr -> comp_mask = 0 ;
1096+ attr -> buffer = cq -> buf ;
1097+ attr -> entry_size = cq -> cqe_size ;
1098+ attr -> num_entries = ibvcq -> cqe ;
1099+
1100+ return 0 ;
1101+ }
1102+
10811103struct efadv_cq * efadv_cq_from_ibv_cq_ex (struct ibv_cq_ex * ibvcqx )
10821104{
10831105 struct efa_cq * cq = to_efa_cq_ex (ibvcqx );
@@ -1655,7 +1677,7 @@ struct ibv_qp *efadv_create_qp_ex(struct ibv_context *ibvctx,
16551677 !vext_field_avail (struct efadv_qp_init_attr ,
16561678 driver_qp_type , inlen ) ||
16571679 efa_attr -> comp_mask ||
1658- ! is_reserved_cleared ( efa_attr -> reserved ) ||
1680+ efa_attr -> reserved ||
16591681 (inlen > sizeof (* efa_attr ) && !is_ext_cleared (efa_attr , inlen ))) {
16601682 verbs_err (verbs_get_ctx (ibvctx ), "Compatibility issues\n" );
16611683 errno = EINVAL ;
@@ -1699,6 +1721,38 @@ int efa_query_qp(struct ibv_qp *ibvqp, struct ibv_qp_attr *attr,
16991721 & cmd , sizeof (cmd ));
17001722}
17011723
1724+ int efadv_query_qp_wqs (struct ibv_qp * ibvqp , struct efadv_wq_attr * sq_attr ,
1725+ struct efadv_wq_attr * rq_attr , uint32_t inlen )
1726+ {
1727+ struct efa_qp * qp = to_efa_qp (ibvqp );
1728+
1729+ if (!is_efa_dev (ibvqp -> context -> device )) {
1730+ verbs_err (verbs_get_ctx (ibvqp -> context ), "Not an EFA device\n" );
1731+ return EOPNOTSUPP ;
1732+ }
1733+
1734+ if (!vext_field_avail (typeof (* sq_attr ), max_batch , inlen )) {
1735+ verbs_err (verbs_get_ctx (ibvqp -> context ), "Compatibility issues\n" );
1736+ return EINVAL ;
1737+ }
1738+
1739+ sq_attr -> comp_mask = 0 ;
1740+ sq_attr -> buffer = qp -> sq .desc ;
1741+ sq_attr -> entry_size = sizeof (struct efa_io_tx_wqe );
1742+ sq_attr -> num_entries = qp -> sq .wq .wqe_cnt ;
1743+ sq_attr -> doorbell = qp -> sq .wq .db ;
1744+ sq_attr -> max_batch = qp -> sq .max_batch_wr ;
1745+
1746+ rq_attr -> comp_mask = 0 ;
1747+ rq_attr -> buffer = qp -> rq .buf ;
1748+ rq_attr -> entry_size = sizeof (struct efa_io_rx_desc );
1749+ rq_attr -> num_entries = qp -> rq .wq .desc_mask + 1 ;
1750+ rq_attr -> doorbell = qp -> rq .wq .db ;
1751+ rq_attr -> max_batch = rq_attr -> num_entries ;
1752+
1753+ return 0 ;
1754+ }
1755+
17021756int efa_query_qp_data_in_order (struct ibv_qp * ibvqp , enum ibv_wr_opcode op ,
17031757 uint32_t flags )
17041758{
0 commit comments