From: Liron Himi Date: Wed, 27 Jan 2021 16:09:37 +0000 (+0200) Subject: net/mvpp2: rearrange functions order X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=f85c08f7955e4cf58aaba9dfed5de51049540a84;p=dpdk.git net/mvpp2: rearrange functions order Rearrange functions order Signed-off-by: Liron Himi --- diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c index 843de37e6c..48f161bffd 100644 --- a/drivers/net/mvpp2/mrvl_ethdev.c +++ b/drivers/net/mvpp2/mrvl_ethdev.c @@ -189,6 +189,39 @@ static struct { MRVL_XSTATS_TBL_ENTRY(tx_errors) }; +/** + * Initialize packet processor. + * + * @return + * 0 on success, negative error value otherwise. + */ +static int +mrvl_init_pp2(void) +{ + struct pp2_init_params init_params; + + memset(&init_params, 0, sizeof(init_params)); + init_params.hif_reserved_map = MRVL_MUSDK_HIFS_RESERVED; + init_params.bm_pool_reserved_map = MRVL_MUSDK_BPOOLS_RESERVED; + init_params.rss_tbl_reserved_map = MRVL_MUSDK_RSS_RESERVED; + if (mrvl_cfg && mrvl_cfg->pp2_cfg.prs_udfs.num_udfs) + memcpy(&init_params.prs_udfs, &mrvl_cfg->pp2_cfg.prs_udfs, + sizeof(struct pp2_parse_udfs)); + return pp2_init(&init_params); +} + +/** + * Deinitialize packet processor. + * + * @return + * 0 on success, negative error value otherwise. + */ +static void +mrvl_deinit_pp2(void) +{ + pp2_deinit(); +} + static inline void mrvl_fill_shadowq(struct mrvl_shadow_txq *sq, struct rte_mbuf *buf) { @@ -205,6 +238,22 @@ mrvl_fill_shadowq(struct mrvl_shadow_txq *sq, struct rte_mbuf *buf) sq->size++; } +/** + * Deinitialize per-lcore MUSDK hardware interfaces (hifs). + */ +static void +mrvl_deinit_hifs(void) +{ + int i; + + for (i = mrvl_lcore_first; i <= mrvl_lcore_last; i++) { + if (hifs[i]) + pp2_hif_deinit(hifs[i]); + } + used_hifs = MRVL_MUSDK_HIFS_RESERVED; + memset(hifs, 0, sizeof(hifs)); +} + static inline void mrvl_fill_desc(struct pp2_ppio_desc *desc, struct rte_mbuf *buf) { @@ -2889,39 +2938,6 @@ mrvl_tx_sg_pkt_burst(void *txq, struct rte_mbuf **tx_pkts, return nb_pkts; } -/** - * Initialize packet processor. - * - * @return - * 0 on success, negative error value otherwise. - */ -static int -mrvl_init_pp2(void) -{ - struct pp2_init_params init_params; - - memset(&init_params, 0, sizeof(init_params)); - init_params.hif_reserved_map = MRVL_MUSDK_HIFS_RESERVED; - init_params.bm_pool_reserved_map = MRVL_MUSDK_BPOOLS_RESERVED; - init_params.rss_tbl_reserved_map = MRVL_MUSDK_RSS_RESERVED; - if (mrvl_cfg && mrvl_cfg->pp2_cfg.prs_udfs.num_udfs) - memcpy(&init_params.prs_udfs, &mrvl_cfg->pp2_cfg.prs_udfs, - sizeof(struct pp2_parse_udfs)); - return pp2_init(&init_params); -} - -/** - * Deinitialize packet processor. - * - * @return - * 0 on success, negative error value otherwise. - */ -static void -mrvl_deinit_pp2(void) -{ - pp2_deinit(); -} - /** * Create private device structure. * @@ -3061,22 +3077,6 @@ mrvl_get_ifnames(const char *key __rte_unused, const char *value, return 0; } -/** - * Deinitialize per-lcore MUSDK hardware interfaces (hifs). - */ -static void -mrvl_deinit_hifs(void) -{ - int i; - - for (i = mrvl_lcore_first; i <= mrvl_lcore_last; i++) { - if (hifs[i]) - pp2_hif_deinit(hifs[i]); - } - used_hifs = MRVL_MUSDK_HIFS_RESERVED; - memset(hifs, 0, sizeof(hifs)); -} - /** * DPDK callback to register the virtual device. *