[Patch v6 01/18] net/mana: add basic driver, build environment and doc

fengchengwen fengchengwen at huawei.com
Sat Sep 3 03:44:24 CEST 2022


On 2022/9/3 3:45, Long Li wrote:
>> Subject: Re: [Patch v6 01/18] net/mana: add basic driver, build environment and
>> doc
>>
>> On 2022/8/31 6:51, longli at linuxonhyperv.com wrote:
>>> From: Long Li <longli at microsoft.com>
>>>
>>> MANA is a PCI device. It uses IB verbs to access hardware through the
>>> kernel RDMA layer. This patch introduces build environment and basic
>>> device probe functions.
>>>
>>> Signed-off-by: Long Li <longli at microsoft.com>
>> ...
>>
>>> +static int mana_mp_primary_handle(const struct rte_mp_msg *mp_msg,
>>> +				  const void *peer)
>>> +{
>>> +	struct rte_eth_dev *dev;
>>> +	const struct mana_mp_param *param =
>>> +		(const struct mana_mp_param *)mp_msg->param;
>>> +	struct rte_mp_msg mp_res = { 0 };
>>> +	struct mana_mp_param *res = (struct mana_mp_param
>> *)mp_res.param;
>>> +	int ret;
>>> +	struct mana_priv *priv;
>>> +
>>> +	if (!rte_eth_dev_is_valid_port(param->port_id)) {
>>> +		DRV_LOG(ERR, "MP handle port ID %u invalid", param->port_id);
>>> +		return -ENODEV;
>>> +	}
>>> +
>>> +	dev = &rte_eth_devices[param->port_id];
>>> +	priv = dev->data->dev_private;
>>> +
>>> +	mp_init_msg(&mp_res, param->type, param->port_id);
>>> +
>>> +	switch (param->type) {
>>> +	case MANA_MP_REQ_VERBS_CMD_FD:
>>> +		mp_res.num_fds = 1;
>>> +		mp_res.fds[0] = priv->ib_ctx->cmd_fd;
>> The cmd_fd is system level handler?
>>
>> If it's process private handler, it should not used directly in another process.
> According to rte_mp_xxx semantics, the file handle is duplicated to another process. It's not directly used. It's required for secondary process to map to the same doorbell pages.


You are right. I notice the rte_mp_xx use AF_UNIX which could process it.

Thanks for clarify.


>
>>> +		res->result = 0;
>>> +		ret = rte_mp_reply(&mp_res, peer);
>>> +		break;
>>> +
>>> +	default:
>>> +		DRV_LOG(ERR, "Port %u unknown primary MP type %u",
>>> +			param->port_id, param->type);
>>> +		ret = -EINVAL;
>>> +	}
>>> +
>>> +	return ret;
>>> +}
>>> +


More information about the dev mailing list