Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions debian/ibverbs-providers.symbols
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,10 @@ libhns.so.1 ibverbs-providers #MINVER#
libmana.so.1 ibverbs-providers #MINVER#
* Build-Depends-Package: libibverbs-dev
MANA_1.0@MANA_1.0 41
MANA_1.1@MANA_1.1 62
manadv_init_obj@MANA_1.0 41
manadv_set_context_attr@MANA_1.0 41
manadv_alloc_pd@MANA_1.1 62
libionic.so.1 ibverbs-providers #MINVER#
* Build-Depends-Package: libibverbs-dev
IONIC_1.0@IONIC_1.0 59
Expand Down
16 changes: 16 additions & 0 deletions kernel-headers/rdma/bnxt_re-abi.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ enum {
BNXT_RE_UCNTX_CMASK_DBR_PACING_ENABLED = 0x08ULL,
BNXT_RE_UCNTX_CMASK_POW2_DISABLED = 0x10ULL,
BNXT_RE_UCNTX_CMASK_MSN_TABLE_ENABLED = 0x40,
BNXT_RE_UCNTX_CMASK_QP_RATE_LIMIT_ENABLED = 0x80ULL,
};

enum bnxt_re_wqe_mode {
Expand Down Expand Up @@ -215,4 +216,19 @@ enum bnxt_re_toggle_mem_methods {
BNXT_RE_METHOD_GET_TOGGLE_MEM = (1U << UVERBS_ID_NS_SHIFT),
BNXT_RE_METHOD_RELEASE_TOGGLE_MEM,
};

struct bnxt_re_packet_pacing_caps {
__u32 qp_rate_limit_min;
__u32 qp_rate_limit_max; /* In kbps */
/* Corresponding bit will be set if qp type from
* 'enum ib_qp_type' is supported, e.g.
* supported_qpts |= 1 << IB_QPT_RC
*/
__u32 supported_qpts;
__u32 reserved;
};

struct bnxt_re_query_device_ex_resp {
struct bnxt_re_packet_pacing_caps packet_pacing_caps;
};
#endif /* __BNXT_RE_UVERBS_ABI_H__*/
17 changes: 17 additions & 0 deletions kernel-headers/rdma/mana-abi.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
#define MANA_IB_UVERBS_ABI_VERSION 1

enum mana_ib_create_cq_flags {
/* Reserved for backward compatibility. Legacy
* kernel versions use it to create CQs in RNIC
*/
MANA_IB_CREATE_RNIC_CQ = 1 << 0,
};

Expand Down Expand Up @@ -84,4 +87,18 @@ struct mana_ib_create_qp_rss_resp {
struct rss_resp_entry entries[64];
};

enum mana_ib_create_pd_flags {
MANA_IB_PD_SHORT_PDN = 1 << 0,
};

struct mana_ib_alloc_pd {
__u32 flags;
__u32 reserved;
};

struct mana_ib_alloc_pd_resp {
__u32 pdn;
__u32 reserved;
};

#endif
2 changes: 1 addition & 1 deletion kernel-headers/rdma/mlx4-abi.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ enum mlx4_ib_rx_hash_function_flags {
};

/*
* RX Hash flags, these flags allow setting which incoming packet's field should
* RX Hash flags, these flags allows to set which incoming packet's field should
* participates in RX Hash. Each flag represent certain packet's field,
* when the flag is set the field that is represented by the flag will
* participate in RX Hash calculation.
Expand Down
2 changes: 1 addition & 1 deletion kernel-headers/rdma/mlx5-abi.h
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ enum mlx5_rx_hash_function_flags {
};

/*
* RX Hash flags, these flags allow setting which incoming packet's field should
* RX Hash flags, these flags allows to set which incoming packet's field should
* participates in RX Hash. Each flag represent certain packet's field,
* when the flag is set the field that is represented by the flag will
* participate in RX Hash calculation.
Expand Down
2 changes: 1 addition & 1 deletion providers/mana/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
rdma_shared_provider(mana libmana.map
1 1.0.${PACKAGE_VERSION}
1 1.1.${PACKAGE_VERSION}
mana.c
manadv.c
qp.c
Expand Down
5 changes: 5 additions & 0 deletions providers/mana/libmana.map
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,8 @@ MANA_1.0 {
manadv_init_obj;
local: *;
};

MANA_1.1 {
global:
manadv_alloc_pd;
} MANA_1.0;
1 change: 1 addition & 0 deletions providers/mana/man/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ rdma_man_pages(
manadv.7.md
manadv_init_obj.3.md
manadv_set_context_attr.3.md
manadv_alloc_pd.3.md
)
36 changes: 36 additions & 0 deletions providers/mana/man/manadv_alloc_pd.3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
layout: page
title: manadv_alloc_pd
section: 3
tagline: Verbs
---

# NAME
manadv_alloc_pd \- Create a MANA specific PD for the RDMA device context.

# SYNOPSIS"
```c
#include <infiniband/manadv.h>

struct ibv_pd *manadv_alloc_pd(struct ibv_context *context, uint32_t flags);
```

# DESCRIPTION
**manadv_alloc_pd()** allocates a PD for the RDMA device context with additional
creation flags.

# ARGUMENTS
*context*
: RDMA device context to work on.

*flags*
: A bitwise OR of the various values described below.

MANADV_PD_FLAGS_SHORT_PDN:
allocates a PD with 16 bit PDN.

# RETURN VALUE
returns a pointer to the allocated PD, or NULL if the request fails.

# AUTHORS
Konstantin Taranov <kotaranov@microsoft.com>
10 changes: 10 additions & 0 deletions providers/mana/man/manadv_init_obj.3.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ struct manadv_rwq {
void *db_page;
};

struct manadv_pd {
uint32_t pdn;
};

struct manadv_obj {
struct {
struct ibv_qp *in;
Expand All @@ -63,6 +67,11 @@ struct manadv_obj {
struct ibv_wq *in;
struct manadv_rwq *out;
} rwq;

struct {
struct ibv_pd *in;
struct manadv_pd *out;
} pd;
};
```

Expand All @@ -74,6 +83,7 @@ enum manadv_obj_type {
MANADV_OBJ_QP = 1 << 0,
MANADV_OBJ_CQ = 1 << 1,
MANADV_OBJ_RWQ = 1 << 2,
MANADV_OBJ_PD = 1 << 3,
};
```
# RETURN VALUE
Expand Down
23 changes: 18 additions & 5 deletions providers/mana/mana.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
DECLARE_DRV_CMD(mana_alloc_ucontext, IB_USER_VERBS_CMD_GET_CONTEXT, empty,
empty);

DECLARE_DRV_CMD(mana_alloc_pd, IB_USER_VERBS_CMD_ALLOC_PD, empty, empty);
DECLARE_DRV_CMD(mana_alloc_pd, IB_USER_VERBS_CMD_ALLOC_PD, mana_ib_alloc_pd,
mana_ib_alloc_pd_resp);

static const struct verbs_match_ent hca_table[] = {
VERBS_DRIVER_ID(RDMA_DRIVER_MANA),
Expand Down Expand Up @@ -111,18 +112,23 @@ int mana_query_port(struct ibv_context *context, uint8_t port,
return ibv_cmd_query_port(context, port, attr, &cmd, sizeof(cmd));
}

struct ibv_pd *mana_alloc_pd(struct ibv_context *context)
struct ibv_pd *mana_alloc_pd_ex(struct ibv_context *context, uint32_t flags)
{
struct ibv_alloc_pd cmd;
struct mana_alloc_pd_resp resp;
struct mana_alloc_pd_resp resp = {};
struct mana_ib_alloc_pd *cmd_drv;
struct mana_alloc_pd cmd = {};
struct mana_pd *pd;
int ret;

pd = calloc(1, sizeof(*pd));
if (!pd)
return NULL;

ret = ibv_cmd_alloc_pd(context, &pd->ibv_pd, &cmd, sizeof(cmd),
cmd_drv = &cmd.drv_payload;
cmd_drv->flags = flags;
resp.pdn = UINT32_MAX;

ret = ibv_cmd_alloc_pd(context, &pd->ibv_pd, &cmd.ibv_cmd, sizeof(cmd),
&resp.ibv_resp, sizeof(resp));
if (ret) {
verbs_err(verbs_get_ctx(context), "Failed to allocate PD\n");
Expand All @@ -131,9 +137,16 @@ struct ibv_pd *mana_alloc_pd(struct ibv_context *context)
return NULL;
}

pd->pdn = resp.pdn;

return &pd->ibv_pd;
}

static struct ibv_pd *mana_alloc_pd(struct ibv_context *context)
{
return mana_alloc_pd_ex(context, 0);
}

struct ibv_pd *
mana_alloc_parent_domain(struct ibv_context *context,
struct ibv_parent_domain_init_attr *attr)
Expand Down
3 changes: 2 additions & 1 deletion providers/mana/mana.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ struct mana_device {

struct mana_pd {
struct ibv_pd ibv_pd;
uint32_t pdn;
struct mana_pd *mprotection_domain;
};

Expand All @@ -192,7 +193,7 @@ int mana_query_device_ex(struct ibv_context *context,
int mana_query_port(struct ibv_context *context, uint8_t port,
struct ibv_port_attr *attr);

struct ibv_pd *mana_alloc_pd(struct ibv_context *context);
struct ibv_pd *mana_alloc_pd_ex(struct ibv_context *context, uint32_t flags);
struct ibv_pd *
mana_alloc_parent_domain(struct ibv_context *context,
struct ibv_parent_domain_init_attr *attr);
Expand Down
14 changes: 13 additions & 1 deletion providers/mana/manadv.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ int manadv_set_context_attr(struct ibv_context *ibv_ctx,

int manadv_init_obj(struct manadv_obj *obj, uint64_t obj_type)
{
if (obj_type & ~(MANADV_OBJ_QP | MANADV_OBJ_CQ | MANADV_OBJ_RWQ))
if (obj_type & ~(MANADV_OBJ_QP | MANADV_OBJ_CQ | MANADV_OBJ_RWQ | MANADV_OBJ_PD))
return EINVAL;

if (obj_type & MANADV_OBJ_QP) {
Expand Down Expand Up @@ -84,5 +84,17 @@ int manadv_init_obj(struct manadv_obj *obj, uint64_t obj_type)
obj->rwq.out->db_page = ctx->db_page;
}

if (obj_type & MANADV_OBJ_PD) {
struct ibv_pd *ibpd = obj->pd.in;
struct mana_pd *pd = container_of(ibpd, struct mana_pd, ibv_pd);

obj->pd.out->pdn = pd->pdn;
}

return 0;
}

struct ibv_pd *manadv_alloc_pd(struct ibv_context *context, uint32_t flags)
{
return mana_alloc_pd_ex(context, flags);
}
15 changes: 15 additions & 0 deletions providers/mana/manadv.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ struct manadv_rwq {
void *db_page;
};

struct manadv_pd {
uint32_t pdn;
};

struct manadv_obj {
struct {
struct ibv_qp *in;
Expand All @@ -67,16 +71,27 @@ struct manadv_obj {
struct ibv_wq *in;
struct manadv_rwq *out;
} rwq;
struct {
struct ibv_pd *in;
struct manadv_pd *out;
} pd;
};

enum manadv_obj_type {
MANADV_OBJ_QP = 1 << 0,
MANADV_OBJ_CQ = 1 << 1,
MANADV_OBJ_RWQ = 1 << 2,
MANADV_OBJ_PD = 1 << 3,
};

enum {
MANADV_PD_FLAGS_SHORT_PDN = 1 << 0,
};

int manadv_init_obj(struct manadv_obj *obj, uint64_t obj_type);

struct ibv_pd *manadv_alloc_pd(struct ibv_context *context, uint32_t flags);

#ifdef __cplusplus
}
#endif
Expand Down