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 E642AA0544; Fri, 2 Sep 2022 14:09:24 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C7D2B40695; Fri, 2 Sep 2022 14:09:24 +0200 (CEST) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by mails.dpdk.org (Postfix) with ESMTP id 6B3DC40693 for ; Fri, 2 Sep 2022 14:09:23 +0200 (CEST) Received: from dggpeml500024.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MJxV44kFXznTtJ; Fri, 2 Sep 2022 20:06:52 +0800 (CST) Received: from [10.67.100.224] (10.67.100.224) 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; Fri, 2 Sep 2022 20:09:21 +0800 Subject: Re: [Patch v6 01/18] net/mana: add basic driver, build environment and doc To: , Ferruh Yigit CC: , Ajay Sharma , Stephen Hemminger References: <1661899911-13086-1-git-send-email-longli@linuxonhyperv.com> <1661899911-13086-2-git-send-email-longli@linuxonhyperv.com> From: fengchengwen Message-ID: <452b1384-63ba-2eac-6458-152008b66c14@huawei.com> Date: Fri, 2 Sep 2022 20:09:21 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <1661899911-13086-2-git-send-email-longli@linuxonhyperv.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.100.224] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) 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/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. > + 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; > +} > +