diff options
author | Luca Boccassi <luca.boccassi@gmail.com> | 2017-08-23 14:47:51 +0100 |
---|---|---|
committer | Luca Boccassi <luca.boccassi@gmail.com> | 2017-08-23 14:48:05 +0100 |
commit | 41921c54b898292b0140d5f322cc8ec5b0642a7e (patch) | |
tree | 70c62f3b26536abf0fa4b347300c78360d4ff546 /drivers/net/dpaa2/base/dpaa2_hw_dpni.c | |
parent | 76f89ef557ff345dfa606e797e1765404babce56 (diff) | |
parent | f239aed5e674965691846e8ce3f187dd47523689 (diff) |
Merge branch 'upstream' into HEAD
Change-Id: Ib9772cbbc33c14a44bd918056b22602ff6891a18
Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
Diffstat (limited to 'drivers/net/dpaa2/base/dpaa2_hw_dpni.c')
-rw-r--r-- | drivers/net/dpaa2/base/dpaa2_hw_dpni.c | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c index 3dc60ccc..4c82aa87 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 @@ -42,7 +42,6 @@ #include <rte_cycles.h> #include <rte_kvargs.h> #include <rte_dev.h> -#include <rte_ethdev.h> #include <fslmc_logs.h> #include <dpaa2_hw_pvt.h> @@ -91,8 +90,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; } @@ -134,8 +134,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 +307,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 +335,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) { |