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 <fengchuns...@huawei.com> >> Signed-off-by: Min Wang (Jushui) <wangm...@huawei.com> >> Signed-off-by: Wei Hu (Xavier) <xavier.hu...@huawei.com> >> Signed-off-by: Min Hu (Connor) <humi...@huawei.com> >> Signed-off-by: Hao Chen <chenhao...@huawei.com> >> Signed-off-by: Huisong Li <lihuis...@huawei.com> > <...> > >> @@ -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