From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 55580A2D4B for ; Mon, 2 Sep 2019 15:42:00 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C01CC1D41C; Mon, 2 Sep 2019 15:41:59 +0200 (CEST) Received: from huawei.com (szxga05-in.huawei.com [45.249.212.191]) by dpdk.org (Postfix) with ESMTP id D3EA91C2DD for ; Mon, 2 Sep 2019 15:41:57 +0200 (CEST) Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 2847810E0CE073D82F65; Mon, 2 Sep 2019 21:41:56 +0800 (CST) Received: from [127.0.0.1] (10.57.115.182) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.439.0; Mon, 2 Sep 2019 21:41:49 +0800 To: Ferruh Yigit , References: <1566568031-45991-1-git-send-email-xavier.huwei@huawei.com> <1566568031-45991-22-git-send-email-xavier.huwei@huawei.com> CC: , , , From: "Wei Hu (Xavier)" Message-ID: <69501316-8167-735c-759b-57c7d7118409@huawei.com> Date: Mon, 2 Sep 2019 21:41:49 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.57.115.182] X-CFilter-Loop: Reflected Subject: Re: [dpdk-dev] [PATCH 21/22] net/hns3: add multiple process support for hns3 PMD driver X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi, Ferruh Yigit On 2019/8/30 23:14, Ferruh Yigit wrote: > On 8/23/2019 2:47 PM, Wei Hu (Xavier) wrote: >> This patch adds multiple process support for hns3 PMD driver. >> Multi-process support selection queue by configuring RSS or >> flow director. The primary process supports various management >> ops, and the secondary process only supports queries ops. >> The primary process notifies the secondary processes to start >> or stop tranceiver. >> >> Signed-off-by: Chunsong Feng >> Signed-off-by: Min Wang (Jushui) >> Signed-off-by: Wei Hu (Xavier) >> Signed-off-by: Min Hu (Connor) >> Signed-off-by: Hao Chen >> Signed-off-by: Huisong Li > <...> > >> @@ -1556,6 +1559,25 @@ static const struct eth_dev_ops hns3vf_eth_dev_ops = { >> .dev_supported_ptypes_get = hns3_dev_supported_ptypes_get, >> }; >> >> +static const struct eth_dev_ops hns3vf_eth_dev_secondary_ops = { >> + .stats_get = hns3_stats_get, >> + .stats_reset = hns3_stats_reset, >> + .xstats_get = hns3_dev_xstats_get, >> + .xstats_get_names = hns3_dev_xstats_get_names, >> + .xstats_reset = hns3_dev_xstats_reset, >> + .xstats_get_by_id = hns3_dev_xstats_get_by_id, >> + .xstats_get_names_by_id = hns3_dev_xstats_get_names_by_id, >> + .dev_infos_get = hns3vf_dev_infos_get, >> + .link_update = hns3vf_dev_link_update, >> + .rss_hash_update = hns3_dev_rss_hash_update, >> + .rss_hash_conf_get = hns3_dev_rss_hash_conf_get, >> + .reta_update = hns3_dev_rss_reta_update, >> + .reta_query = hns3_dev_rss_reta_query, >> + .filter_ctrl = hns3_dev_filter_ctrl, >> + .get_reg = hns3_get_regs, >> + .dev_supported_ptypes_get = hns3_dev_supported_ptypes_get, >> +}; >> + > There shouldn't need to define separate dev_ops for the secondary processes, > what is the difference of this one used for primary process, why not use that one? We limit the slave process to only perform query ops actions, and cannot perform configuration ops actions to prevent the master and slave processes from performing configuration ops at the same time, which may cause conflicts. > > <...> > >> +/* >> + * Initialize by secondary process. >> + */ >> +void hns3_mp_init_secondary(void) >> +{ >> + rte_mp_action_register(HNS3_MP_NAME, mp_secondary_handle); > What is this handler for? Most of the case the MP communication is done in eal > level and nothing need to be done in the driver level. > When the primary process executes dev_stop, it will release the mbuf of all rx queues. The secondary process may access the mbuf of the rx queue, and a segmentation error will occur.So MP is used in multi-process to solve this problem. When primary process executes dev_stop, it informs the process to stop receiving, and then releases the mbuf, so that the secondary process will not have a segmentation error. Regards Xavier