MCPcopy Create free account
hub / github.com/F-Stack/f-stack / mana_mp_primary_handle

Function mana_mp_primary_handle

dpdk/drivers/net/mana/mp.c:77–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77static int
78mana_mp_primary_handle(const struct rte_mp_msg *mp_msg, const void *peer)
79{
80 struct rte_eth_dev *dev;
81 const struct mana_mp_param *param =
82 (const struct mana_mp_param *)mp_msg->param;
83 struct rte_mp_msg mp_res = { 0 };
84 struct mana_mp_param *res = (struct mana_mp_param *)mp_res.param;
85 int ret;
86 struct mana_priv *priv;
87
88 if (!rte_eth_dev_is_valid_port(param->port_id)) {
89 DRV_LOG(ERR, "MP handle port ID %u invalid", param->port_id);
90 return -ENODEV;
91 }
92
93 dev = &rte_eth_devices[param->port_id];
94 priv = dev->data->dev_private;
95
96 mp_init_msg(&mp_res, param->type, param->port_id);
97
98 switch (param->type) {
99 case MANA_MP_REQ_CREATE_MR:
100 ret = mana_mp_mr_create(priv, param->addr, param->len);
101 res->result = ret;
102 ret = rte_mp_reply(&mp_res, peer);
103 break;
104
105 case MANA_MP_REQ_VERBS_CMD_FD:
106 mp_res.num_fds = 1;
107 mp_res.fds[0] = priv->ib_ctx->cmd_fd;
108 res->result = 0;
109 ret = rte_mp_reply(&mp_res, peer);
110 break;
111
112 default:
113 DRV_LOG(ERR, "Port %u unknown primary MP type %u",
114 param->port_id, param->type);
115 ret = -EINVAL;
116 }
117
118 return ret;
119}
120
121static int
122mana_mp_secondary_handle(const struct rte_mp_msg *mp_msg, const void *peer)

Callers

nothing calls this directly

Calls 4

mana_mp_mr_createFunction · 0.85
mp_init_msgFunction · 0.70
rte_mp_replyClass · 0.70

Tested by

no test coverage detected