From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 217AAA0543; Sat, 3 Sep 2022 03:44:30 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 16377427F2; Sat, 3 Sep 2022 03:44:30 +0200 (CEST) Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by mails.dpdk.org (Postfix) with ESMTP id 472E340685 for ; Sat, 3 Sep 2022 03:44:28 +0200 (CEST) Received: from dggpeml500024.china.huawei.com (unknown [172.30.72.57]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4MKHbG5KTPzrS2Y; Sat, 3 Sep 2022 09:42:34 +0800 (CST) Received: from [10.82.177.37] (10.82.177.37) by dggpeml500024.china.huawei.com (7.185.36.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Sat, 3 Sep 2022 09:44:24 +0800 Message-ID: Date: Sat, 3 Sep 2022 09:44:24 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.2.1 Subject: Re: [Patch v6 01/18] net/mana: add basic driver, build environment and doc Content-Language: en-US To: Long Li , Ferruh Yigit CC: "dev@dpdk.org" , Ajay Sharma , Stephen Hemminger References: <1661899911-13086-1-git-send-email-longli@linuxonhyperv.com> <1661899911-13086-2-git-send-email-longli@linuxonhyperv.com> <452b1384-63ba-2eac-6458-152008b66c14@huawei.com> From: fengchengwen In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.82.177.37] X-ClientProxiedBy: dggpeml500013.china.huawei.com (7.185.36.41) To dggpeml500024.china.huawei.com (7.185.36.10) X-CFilter-Loop: Reflected X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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@linuxonhyperv.com wrote: >>> From: Long Li >>> >>> 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 >> ... >> >>> +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; >>> +} >>> +