X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fdpaa2%2Fbase%2Fdpaa2_hw_dpni.c;h=5aa12db9447e0c48f7e3730361cd9a8580f659f7;hb=645bd25ad8f905fcdf06b9c319228af03ff8708e;hp=08f53b37e1ee69be1d8d9128217c21324d757f46;hpb=bee61d863e0f04abd31d3624b7c79177631afd3c;p=dpdk.git diff --git a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c index 08f53b37e1..5aa12db944 100644 --- a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c +++ b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c @@ -2,7 +2,7 @@ * BSD LICENSE * * Copyright (c) 2016 Freescale Semiconductor, Inc. All rights reserved. - * Copyright (c) 2016 NXP. All rights reserved. + * Copyright 2016 NXP. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -76,7 +76,7 @@ dpaa2_setup_flow_dist(struct rte_eth_dev *eth_dev, memset(&tc_cfg, 0, sizeof(struct dpni_rx_tc_dist_cfg)); dpaa2_distset_to_dpkg_profile_cfg(req_dist_set, &kg_cfg); - tc_cfg.key_cfg_iova = (uint64_t)(p_params); + tc_cfg.key_cfg_iova = (uint64_t)(DPAA2_VADDR_TO_IOVA(p_params)); tc_cfg.dist_size = eth_dev->data->nb_rx_queues; tc_cfg.dist_mode = DPNI_DIST_MODE_HASH; @@ -91,8 +91,9 @@ dpaa2_setup_flow_dist(struct rte_eth_dev *eth_dev, &tc_cfg); rte_free(p_params); if (ret) { - RTE_LOG(ERR, PMD, "Setting distribution for Rx failed with" - " err code: %d\n", ret); + RTE_LOG(ERR, PMD, + "Setting distribution for Rx failed with err: %d\n", + ret); return ret; } @@ -119,7 +120,7 @@ int dpaa2_remove_flow_dist( memset(p_params, 0, DIST_PARAM_IOVA_SIZE); memset(&tc_cfg, 0, sizeof(struct dpni_rx_tc_dist_cfg)); - tc_cfg.key_cfg_iova = (uint64_t)(p_params); + tc_cfg.key_cfg_iova = (uint64_t)(DPAA2_VADDR_TO_IOVA(p_params)); tc_cfg.dist_size = 0; tc_cfg.dist_mode = DPNI_DIST_MODE_NONE; @@ -134,8 +135,9 @@ int dpaa2_remove_flow_dist( &tc_cfg); rte_free(p_params); if (ret) { - RTE_LOG(ERR, PMD, "Setting distribution for Rx failed with" - " err code: %d\n", ret); + RTE_LOG(ERR, PMD, + "Setting distribution for Rx failed with err: %d\n", + ret); return ret; } return ret; @@ -306,15 +308,22 @@ dpaa2_attach_bp_list(struct dpaa2_dev_priv *priv, */ /* ... rx buffer layout ... */ - tot_size = DPAA2_HW_BUF_RESERVE + RTE_PKTMBUF_HEADROOM; - tot_size = RTE_ALIGN_CEIL(tot_size, - DPAA2_PACKET_LAYOUT_ALIGN); + tot_size = RTE_PKTMBUF_HEADROOM; + tot_size = RTE_ALIGN_CEIL(tot_size, DPAA2_PACKET_LAYOUT_ALIGN); memset(&layout, 0, sizeof(struct dpni_buffer_layout)); - layout.options = DPNI_BUF_LAYOUT_OPT_DATA_HEAD_ROOM; - - layout.data_head_room = - tot_size - DPAA2_FD_PTA_SIZE - DPAA2_MBUF_HW_ANNOTATION; + layout.options = DPNI_BUF_LAYOUT_OPT_DATA_HEAD_ROOM | + DPNI_BUF_LAYOUT_OPT_FRAME_STATUS | + DPNI_BUF_LAYOUT_OPT_PARSER_RESULT | + DPNI_BUF_LAYOUT_OPT_DATA_ALIGN | + DPNI_BUF_LAYOUT_OPT_PRIVATE_DATA_SIZE; + + layout.pass_frame_status = 1; + layout.private_data_size = DPAA2_FD_PTA_SIZE; + layout.pass_parser_result = 1; + layout.data_align = DPAA2_PACKET_LAYOUT_ALIGN; + layout.data_head_room = tot_size - DPAA2_FD_PTA_SIZE - + DPAA2_MBUF_HW_ANNOTATION; retcode = dpni_set_buffer_layout(dpni, CMD_PRI_LOW, priv->token, DPNI_QUEUE_RX, &layout); if (retcode) { @@ -327,9 +336,8 @@ dpaa2_attach_bp_list(struct dpaa2_dev_priv *priv, bpool_cfg.num_dpbp = 1; bpool_cfg.pools[0].dpbp_id = bp_list->buf_pool.dpbp_node->dpbp_id; bpool_cfg.pools[0].backup_pool = 0; - bpool_cfg.pools[0].buffer_size = - RTE_ALIGN_CEIL(bp_list->buf_pool.size, - 256 /*DPAA2_PACKET_LAYOUT_ALIGN*/); + bpool_cfg.pools[0].buffer_size = RTE_ALIGN_CEIL(bp_list->buf_pool.size, + DPAA2_PACKET_LAYOUT_ALIGN); retcode = dpni_set_pools(dpni, CMD_PRI_LOW, priv->token, &bpool_cfg); if (retcode != 0) {