* [dpdk-dev] [PATCH 01/10] bus/dpaa: fix phandle support for kernel 4.16 @ 2018-06-21 9:43 Hemant Agrawal 2018-06-21 9:43 ` [dpdk-dev] [PATCH 02/10] bus/dpaa: fix svr id fetch location Hemant Agrawal ` (9 more replies) 0 siblings, 10 replies; 62+ messages in thread From: Hemant Agrawal @ 2018-06-21 9:43 UTC (permalink / raw) To: dev; +Cc: ferruh.yigit, Alok Makhariya, Shreyansh Jain, stable From: Alok Makhariya <alok.makhariya@nxp.com> Fixes: 2183c6f69d7e ("bus/dpaa: add OF parser for device scanning") Cc: Shreyansh Jain <shreyansh.jain@nxp.com> Cc: stable@dpdk.org Signed-off-by: Alok Makhariya <alok.makhariya@nxp.com> --- drivers/bus/dpaa/base/fman/of.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/bus/dpaa/base/fman/of.c b/drivers/bus/dpaa/base/fman/of.c index 1b2dbe2..eb55cb9 100644 --- a/drivers/bus/dpaa/base/fman/of.c +++ b/drivers/bus/dpaa/base/fman/of.c @@ -182,6 +182,11 @@ linear_dir(struct dt_dir *d) DPAA_BUS_LOG(DEBUG, "Duplicate lphandle in %s", d->node.node.full_name); d->lphandle = f; + } else if (!strcmp(f->node.node.name, "phandle")) { + if (d->lphandle) + DPAA_BUS_LOG(DEBUG, "Duplicate lphandle in %s", + d->node.node.full_name); + d->lphandle = f; } else if (!strcmp(f->node.node.name, "#address-cells")) { if (d->a_cells) DPAA_BUS_LOG(DEBUG, "Duplicate a_cells in %s", -- 2.7.4 ^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH 02/10] bus/dpaa: fix svr id fetch location 2018-06-21 9:43 [dpdk-dev] [PATCH 01/10] bus/dpaa: fix phandle support for kernel 4.16 Hemant Agrawal @ 2018-06-21 9:43 ` Hemant Agrawal 2018-06-21 9:43 ` [dpdk-dev] [PATCH 03/10] bus/dpaa: optimize the fq callback routine Hemant Agrawal ` (8 subsequent siblings) 9 siblings, 0 replies; 62+ messages in thread From: Hemant Agrawal @ 2018-06-21 9:43 UTC (permalink / raw) To: dev; +Cc: ferruh.yigit, stable Otherwise the SVR may not be avilable for dpaa init. Fixes: 3b59b73dea08 ("bus/dpaa: update platform SoC value register routines") Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> --- drivers/bus/dpaa/dpaa_bus.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c index 2046206..7956bd0 100644 --- a/drivers/bus/dpaa/dpaa_bus.c +++ b/drivers/bus/dpaa/dpaa_bus.c @@ -539,6 +539,13 @@ rte_dpaa_bus_probe(void) unsigned int svr_ver; int probe_all = rte_dpaa_bus.bus.conf.scan_mode != RTE_BUS_SCAN_WHITELIST; + svr_file = fopen(DPAA_SOC_ID_FILE, "r"); + if (svr_file) { + if (fscanf(svr_file, "svr:%x", &svr_ver) > 0) + dpaa_svr_family = svr_ver & SVR_MASK; + fclose(svr_file); + } + /* For each registered driver, and device, call the driver->probe */ TAILQ_FOREACH(dev, &rte_dpaa_bus.device_list, next) { TAILQ_FOREACH(drv, &rte_dpaa_bus.driver_list, next) { @@ -569,13 +576,6 @@ rte_dpaa_bus_probe(void) if (!TAILQ_EMPTY(&rte_dpaa_bus.device_list)) rte_mbuf_set_platform_mempool_ops(DPAA_MEMPOOL_OPS_NAME); - svr_file = fopen(DPAA_SOC_ID_FILE, "r"); - if (svr_file) { - if (fscanf(svr_file, "svr:%x", &svr_ver) > 0) - dpaa_svr_family = svr_ver & SVR_MASK; - fclose(svr_file); - } - return 0; } -- 2.7.4 ^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH 03/10] bus/dpaa: optimize the fq callback routine 2018-06-21 9:43 [dpdk-dev] [PATCH 01/10] bus/dpaa: fix phandle support for kernel 4.16 Hemant Agrawal 2018-06-21 9:43 ` [dpdk-dev] [PATCH 02/10] bus/dpaa: fix svr id fetch location Hemant Agrawal @ 2018-06-21 9:43 ` Hemant Agrawal 2018-06-21 9:43 ` [dpdk-dev] [PATCH 04/10] bus/dpaa: implement new of API to get MAC address Hemant Agrawal ` (7 subsequent siblings) 9 siblings, 0 replies; 62+ messages in thread From: Hemant Agrawal @ 2018-06-21 9:43 UTC (permalink / raw) To: dev; +Cc: ferruh.yigit, Sunil Kumar Kori Avoid array of fq as packets are dq only from a single q. Signed-off-by: Sunil Kumar Kori <sunil.kori@nxp.com> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> --- drivers/bus/dpaa/base/qbman/qman.c | 15 +++++++-------- drivers/net/dpaa/dpaa_rxtx.c | 2 +- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/bus/dpaa/base/qbman/qman.c b/drivers/bus/dpaa/base/qbman/qman.c index 27d98cc..13c4315 100644 --- a/drivers/bus/dpaa/base/qbman/qman.c +++ b/drivers/bus/dpaa/base/qbman/qman.c @@ -1058,7 +1058,7 @@ unsigned int qman_portal_poll_rx(unsigned int poll_limit, struct qm_portal *portal = &p->p; register struct qm_dqrr *dqrr = &portal->dqrr; struct qm_dqrr_entry *dq[QM_DQRR_SIZE], *shadow[QM_DQRR_SIZE]; - struct qman_fq *fq[QM_DQRR_SIZE]; + struct qman_fq *fq; unsigned int limit = 0, rx_number = 0; uint32_t consume = 0; @@ -1092,14 +1092,13 @@ unsigned int qman_portal_poll_rx(unsigned int poll_limit, /* SDQCR: context_b points to the FQ */ #ifdef CONFIG_FSL_QMAN_FQ_LOOKUP - fq[rx_number] = qman_fq_lookup_table[be32_to_cpu( - dq[rx_number]->contextB)]; + fq = qman_fq_lookup_table[be32_to_cpu(dq[rx_number]->contextB)]; #else - fq[rx_number] = (void *)be32_to_cpu( - dq[rx_number]->contextB); + fq = (void *)be32_to_cpu(dq[rx_number]->contextB); #endif - fq[rx_number]->cb.dqrr_prepare(shadow[rx_number], - &bufs[rx_number]); + if (fq->cb.dqrr_prepare) + fq->cb.dqrr_prepare(shadow[rx_number], + &bufs[rx_number]); consume |= (1 << (31 - DQRR_PTR2IDX(shadow[rx_number]))); rx_number++; @@ -1107,7 +1106,7 @@ unsigned int qman_portal_poll_rx(unsigned int poll_limit, } while (++limit < poll_limit); if (rx_number) - fq[0]->cb.dqrr_dpdk_pull_cb(fq, shadow, bufs, rx_number); + fq->cb.dqrr_dpdk_pull_cb(&fq, shadow, bufs, rx_number); /* Consume all the DQRR enries together */ qm_out(DQRR_DCAP, (1 << 8) | consume); diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c index 1316d2a..805bc30 100644 --- a/drivers/net/dpaa/dpaa_rxtx.c +++ b/drivers/net/dpaa/dpaa_rxtx.c @@ -431,7 +431,7 @@ dpaa_rx_cb(struct qman_fq **fq, struct qm_dqrr_entry **dqrr, } fd = &dqrr[i]->fd; - dpaa_intf = fq[i]->dpaa_intf; + dpaa_intf = fq[0]->dpaa_intf; format = (fd->opaque & DPAA_FD_FORMAT_MASK) >> DPAA_FD_FORMAT_SHIFT; -- 2.7.4 ^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH 04/10] bus/dpaa: implement new of API to get MAC address 2018-06-21 9:43 [dpdk-dev] [PATCH 01/10] bus/dpaa: fix phandle support for kernel 4.16 Hemant Agrawal 2018-06-21 9:43 ` [dpdk-dev] [PATCH 02/10] bus/dpaa: fix svr id fetch location Hemant Agrawal 2018-06-21 9:43 ` [dpdk-dev] [PATCH 03/10] bus/dpaa: optimize the fq callback routine Hemant Agrawal @ 2018-06-21 9:43 ` Hemant Agrawal 2018-06-21 9:43 ` [dpdk-dev] [PATCH 05/10] bus/dpaa: make vdqcr configurable Hemant Agrawal ` (6 subsequent siblings) 9 siblings, 0 replies; 62+ messages in thread From: Hemant Agrawal @ 2018-06-21 9:43 UTC (permalink / raw) To: dev; +Cc: ferruh.yigit, Akhil Goyal From: Akhil Goyal <akhil.goyal@nxp.com> Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com> --- drivers/bus/dpaa/base/fman/of.c | 39 +++++++++++++++++++++++++++++++ drivers/bus/dpaa/include/of.h | 2 ++ drivers/bus/dpaa/rte_bus_dpaa_version.map | 8 +++++++ 3 files changed, 49 insertions(+) diff --git a/drivers/bus/dpaa/base/fman/of.c b/drivers/bus/dpaa/base/fman/of.c index eb55cb9..a7f3174 100644 --- a/drivers/bus/dpaa/base/fman/of.c +++ b/drivers/bus/dpaa/base/fman/of.c @@ -546,3 +546,42 @@ of_device_is_compatible(const struct device_node *dev_node, return true; return false; } + +static const void *of_get_mac_addr(const struct device_node *np, + const char *name) +{ + return of_get_property(np, name, NULL); +} + +/** + * Search the device tree for the best MAC address to use. 'mac-address' is + * checked first, because that is supposed to contain to "most recent" MAC + * address. If that isn't set, then 'local-mac-address' is checked next, + * because that is the default address. If that isn't set, then the obsolete + * 'address' is checked, just in case we're using an old device tree. + * + * Note that the 'address' property is supposed to contain a virtual address of + * the register set, but some DTS files have redefined that property to be the + * MAC address. + * + * All-zero MAC addresses are rejected, because those could be properties that + * exist in the device tree, but were not set by U-Boot. For example, the + * DTS could define 'mac-address' and 'local-mac-address', with zero MAC + * addresses. Some older U-Boots only initialized 'local-mac-address'. In + * this case, the real MAC is in 'local-mac-address', and 'mac-address' exists + * but is all zeros. + */ +const void *of_get_mac_address(const struct device_node *np) +{ + const void *addr; + + addr = of_get_mac_addr(np, "mac-address"); + if (addr) + return addr; + + addr = of_get_mac_addr(np, "local-mac-address"); + if (addr) + return addr; + + return of_get_mac_addr(np, "address"); +} diff --git a/drivers/bus/dpaa/include/of.h b/drivers/bus/dpaa/include/of.h index 151be5a..7ea7608 100644 --- a/drivers/bus/dpaa/include/of.h +++ b/drivers/bus/dpaa/include/of.h @@ -109,6 +109,8 @@ const struct device_node *of_get_parent(const struct device_node *dev_node); const struct device_node *of_get_next_child(const struct device_node *dev_node, const struct device_node *prev); +const void *of_get_mac_address(const struct device_node *np); + #define for_each_child_node(parent, child) \ for (child = of_get_next_child(parent, NULL); child != NULL; \ child = of_get_next_child(parent, child)) diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map b/drivers/bus/dpaa/rte_bus_dpaa_version.map index 8d90285..e00c911 100644 --- a/drivers/bus/dpaa/rte_bus_dpaa_version.map +++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map @@ -92,3 +92,11 @@ DPDK_18.02 { local: *; } DPDK_17.11; + +DPDK_18.08 { + global: + + of_get_mac_address; + + local: *; +} DPDK_18.02; -- 2.7.4 ^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH 05/10] bus/dpaa: make vdqcr configurable 2018-06-21 9:43 [dpdk-dev] [PATCH 01/10] bus/dpaa: fix phandle support for kernel 4.16 Hemant Agrawal ` (2 preceding siblings ...) 2018-06-21 9:43 ` [dpdk-dev] [PATCH 04/10] bus/dpaa: implement new of API to get MAC address Hemant Agrawal @ 2018-06-21 9:43 ` Hemant Agrawal 2018-06-21 9:44 ` [dpdk-dev] [PATCH 06/10] net/dpaa: support default queue mode Hemant Agrawal ` (5 subsequent siblings) 9 siblings, 0 replies; 62+ messages in thread From: Hemant Agrawal @ 2018-06-21 9:43 UTC (permalink / raw) To: dev; +Cc: ferruh.yigit, Nipun Gupta From: Nipun Gupta <nipun.gupta@nxp.com> This patch add support for configurable vdqcr exact flag. This boost the performance, however this can give side effects for some extra packet fetch. Which has been taken care in the patch as well. Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com> --- drivers/bus/dpaa/base/qbman/qman.c | 4 ++-- drivers/bus/dpaa/include/fsl_qman.h | 3 ++- drivers/crypto/dpaa_sec/dpaa_sec.c | 19 ++++++++++++++++--- drivers/net/dpaa/dpaa_rxtx.c | 18 +++++++++++++++--- 4 files changed, 35 insertions(+), 9 deletions(-) diff --git a/drivers/bus/dpaa/base/qbman/qman.c b/drivers/bus/dpaa/base/qbman/qman.c index 13c4315..f5fe5ef 100644 --- a/drivers/bus/dpaa/base/qbman/qman.c +++ b/drivers/bus/dpaa/base/qbman/qman.c @@ -2002,13 +2002,13 @@ int qman_query_congestion(struct qm_mcr_querycongestion *congestion) return 0; } -int qman_set_vdq(struct qman_fq *fq, u16 num) +int qman_set_vdq(struct qman_fq *fq, u16 num, uint32_t vdqcr_flags) { struct qman_portal *p = get_affine_portal(); uint32_t vdqcr; int ret = -EBUSY; - vdqcr = QM_VDQCR_EXACT; + vdqcr = vdqcr_flags; vdqcr |= QM_VDQCR_NUMFRAMES_SET(num); if ((fq->state != qman_fq_state_parked) && diff --git a/drivers/bus/dpaa/include/fsl_qman.h b/drivers/bus/dpaa/include/fsl_qman.h index e4ad7ae..b18cf03 100644 --- a/drivers/bus/dpaa/include/fsl_qman.h +++ b/drivers/bus/dpaa/include/fsl_qman.h @@ -1332,10 +1332,11 @@ unsigned int qman_portal_poll_rx(unsigned int poll_limit, * qman_set_vdq - Issue a volatile dequeue command * @fq: Frame Queue on which the volatile dequeue command is issued * @num: Number of Frames requested for volatile dequeue + * @vdqcr_flags: QM_VDQCR_EXACT flag to for VDQCR command * * This function will issue a volatile dequeue command to the QMAN. */ -int qman_set_vdq(struct qman_fq *fq, u16 num); +int qman_set_vdq(struct qman_fq *fq, u16 num, uint32_t vdqcr_flags); /** * qman_dequeue - Get the DQRR entry after volatile dequeue command diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index 06f7e43..a07869f 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -526,12 +526,25 @@ dpaa_sec_deq(struct dpaa_sec_qp *qp, struct rte_crypto_op **ops, int nb_ops) { struct qman_fq *fq; unsigned int pkts = 0; - int ret; + int num_rx_bufs, ret; struct qm_dqrr_entry *dq; + uint32_t vdqcr_flags = 0; fq = &qp->outq; - ret = qman_set_vdq(fq, (nb_ops > DPAA_MAX_DEQUEUE_NUM_FRAMES) ? - DPAA_MAX_DEQUEUE_NUM_FRAMES : nb_ops); + /* + * Until request for four buffers, we provide exact number of buffers. + * Otherwise we do not set the QM_VDQCR_EXACT flag. + * Not setting QM_VDQCR_EXACT flag can provide two more buffers than + * requested, so we request two less in this case. + */ + if (nb_ops < 4) { + vdqcr_flags = QM_VDQCR_EXACT; + num_rx_bufs = nb_ops; + } else { + num_rx_bufs = nb_ops > DPAA_MAX_DEQUEUE_NUM_FRAMES ? + (DPAA_MAX_DEQUEUE_NUM_FRAMES - 2) : (nb_ops - 2); + } + ret = qman_set_vdq(fq, num_rx_bufs, vdqcr_flags); if (ret) return 0; diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c index 805bc30..168b77e 100644 --- a/drivers/net/dpaa/dpaa_rxtx.c +++ b/drivers/net/dpaa/dpaa_rxtx.c @@ -560,7 +560,8 @@ uint16_t dpaa_eth_queue_rx(void *q, struct qman_fq *fq = q; struct qm_dqrr_entry *dq; uint32_t num_rx = 0, ifid = ((struct dpaa_if *)fq->dpaa_intf)->ifid; - int ret; + int num_rx_bufs, ret; + uint32_t vdqcr_flags = 0; if (likely(fq->is_static)) return dpaa_eth_queue_portal_rx(fq, bufs, nb_bufs); @@ -573,8 +574,19 @@ uint16_t dpaa_eth_queue_rx(void *q, } } - ret = qman_set_vdq(fq, (nb_bufs > DPAA_MAX_DEQUEUE_NUM_FRAMES) ? - DPAA_MAX_DEQUEUE_NUM_FRAMES : nb_bufs); + /* Until request for four buffers, we provide exact number of buffers. + * Otherwise we do not set the QM_VDQCR_EXACT flag. + * Not setting QM_VDQCR_EXACT flag can provide two more buffers than + * requested, so we request two less in this case. + */ + if (nb_bufs < 4) { + vdqcr_flags = QM_VDQCR_EXACT; + num_rx_bufs = nb_bufs; + } else { + num_rx_bufs = nb_bufs > DPAA_MAX_DEQUEUE_NUM_FRAMES ? + (DPAA_MAX_DEQUEUE_NUM_FRAMES - 2) : (nb_bufs - 2); + } + ret = qman_set_vdq(fq, num_rx_bufs, vdqcr_flags); if (ret) return 0; -- 2.7.4 ^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH 06/10] net/dpaa: support default queue mode 2018-06-21 9:43 [dpdk-dev] [PATCH 01/10] bus/dpaa: fix phandle support for kernel 4.16 Hemant Agrawal ` (3 preceding siblings ...) 2018-06-21 9:43 ` [dpdk-dev] [PATCH 05/10] bus/dpaa: make vdqcr configurable Hemant Agrawal @ 2018-06-21 9:44 ` Hemant Agrawal 2018-06-21 9:44 ` [dpdk-dev] [PATCH 07/10] net/dpaa: remove experimental tag from PMD APIs Hemant Agrawal ` (4 subsequent siblings) 9 siblings, 0 replies; 62+ messages in thread From: Hemant Agrawal @ 2018-06-21 9:44 UTC (permalink / raw) To: dev; +Cc: ferruh.yigit In case DPAA FMAN configuration tool (FMC) is not available. System can still work with default queue. (1 queue per port). Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> --- drivers/net/dpaa/dpaa_ethdev.c | 43 +++++++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index d014a11..cf07d25 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -74,6 +74,7 @@ static uint64_t dev_tx_offloads_nodis = /* Keep track of whether QMAN and BMAN have been globally initialized */ static int is_global_init; +static int default_q; /* use default queue - FMC is not executed*/ /* At present we only allow up to 4 push mode queues as default - as each of * this queue need dedicated portal and we are short of portals. */ @@ -516,7 +517,8 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, PMD_INIT_FUNC_TRACE(); - DPAA_PMD_INFO("Rx queue setup for queue index: %d", queue_idx); + DPAA_PMD_INFO("Rx queue setup for queue index: %d fq_id (0x%x)", + queue_idx, rxq->fqid); if (!dpaa_intf->bp_info || dpaa_intf->bp_info->mp != mp) { struct fman_if_ic_params icp; @@ -715,7 +717,8 @@ int dpaa_eth_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, PMD_INIT_FUNC_TRACE(); - DPAA_PMD_INFO("Tx queue setup for queue index: %d", queue_idx); + DPAA_PMD_INFO("Tx queue setup for queue index: %d fq_id (0x%x)", + queue_idx, dpaa_intf->tx_queues[queue_idx].fqid); dev->data->tx_queues[queue_idx] = &dpaa_intf->tx_queues[queue_idx]; return 0; } @@ -1008,12 +1011,12 @@ static int dpaa_rx_queue_init(struct qman_fq *fq, struct qman_cgr *cgr_rx, ret = qman_reserve_fqid(fqid); if (ret) { - DPAA_PMD_ERR("reserve rx fqid %d failed with ret: %d", + DPAA_PMD_ERR("reserve rx fqid 0x%x failed with ret: %d", fqid, ret); return -EINVAL; } - DPAA_PMD_DEBUG("creating rx fq %p, fqid %d", fq, fqid); + DPAA_PMD_DEBUG("creating rx fq %p, fqid 0x%x", fq, fqid); ret = qman_create_fq(fqid, QMAN_FQ_FLAG_NO_ENQUEUE, fq); if (ret) { DPAA_PMD_ERR("create rx fqid %d failed with ret: %d", @@ -1032,7 +1035,7 @@ static int dpaa_rx_queue_init(struct qman_fq *fq, struct qman_cgr *cgr_rx, &cgr_opts); if (ret) { DPAA_PMD_WARN( - "rx taildrop init fail on rx fqid %d (ret=%d)", + "rx taildrop init fail on rx fqid 0x%x(ret=%d)", fqid, ret); goto without_cgr; } @@ -1043,7 +1046,7 @@ static int dpaa_rx_queue_init(struct qman_fq *fq, struct qman_cgr *cgr_rx, without_cgr: ret = qman_init_fq(fq, flags, &opts); if (ret) - DPAA_PMD_ERR("init rx fqid %d failed with ret: %d", fqid, ret); + DPAA_PMD_ERR("init rx fqid 0x%x failed with ret:%d", fqid, ret); return ret; } @@ -1071,10 +1074,10 @@ static int dpaa_tx_queue_init(struct qman_fq *fq, /* no tx-confirmation */ opts.fqd.context_a.hi = 0x80000000 | fman_dealloc_bufs_mask_hi; opts.fqd.context_a.lo = 0 | fman_dealloc_bufs_mask_lo; - DPAA_PMD_DEBUG("init tx fq %p, fqid %d", fq, fq->fqid); + DPAA_PMD_DEBUG("init tx fq %p, fqid 0x%x", fq, fq->fqid); ret = qman_init_fq(fq, QMAN_INITFQ_FLAG_SCHED, &opts); if (ret) - DPAA_PMD_ERR("init tx fqid %d failed %d", fq->fqid, ret); + DPAA_PMD_ERR("init tx fqid 0x%x failed %d", fq->fqid, ret); return ret; } @@ -1145,10 +1148,15 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev) dpaa_intf->cfg = cfg; /* Initialize Rx FQ's */ - if (getenv("DPAA_NUM_RX_QUEUES")) - num_rx_fqs = atoi(getenv("DPAA_NUM_RX_QUEUES")); - else + if (default_q) { num_rx_fqs = DPAA_DEFAULT_NUM_PCD_QUEUES; + } else { + if (getenv("DPAA_NUM_RX_QUEUES")) + num_rx_fqs = atoi(getenv("DPAA_NUM_RX_QUEUES")); + else + num_rx_fqs = DPAA_DEFAULT_NUM_PCD_QUEUES; + } + /* if push mode queues to be enabled. Currenly we are allowing only * one queue per thread. @@ -1196,8 +1204,11 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev) } for (loop = 0; loop < num_rx_fqs; loop++) { - fqid = DPAA_PCD_FQID_START + dpaa_intf->ifid * - DPAA_PCD_FQID_MULTIPLIER + loop; + if (default_q) + fqid = cfg->rx_def; + else + fqid = DPAA_PCD_FQID_START + dpaa_intf->ifid * + DPAA_PCD_FQID_MULTIPLIER + loop; if (dpaa_intf->cgr_rx) dpaa_intf->cgr_rx[loop].cgrid = cgrid[loop]; @@ -1391,6 +1402,12 @@ rte_dpaa_probe(struct rte_dpaa_driver *dpaa_drv, return ret; } + if (access("/tmp/fmc.bin", F_OK) == -1) { + RTE_LOG(INFO, PMD, + "* FMC not configured.Enabling default mode\n"); + default_q = 1; + } + is_global_init = 1; } -- 2.7.4 ^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH 07/10] net/dpaa: remove experimental tag from PMD APIs 2018-06-21 9:43 [dpdk-dev] [PATCH 01/10] bus/dpaa: fix phandle support for kernel 4.16 Hemant Agrawal ` (4 preceding siblings ...) 2018-06-21 9:44 ` [dpdk-dev] [PATCH 06/10] net/dpaa: support default queue mode Hemant Agrawal @ 2018-06-21 9:44 ` Hemant Agrawal 2018-06-21 9:44 ` [dpdk-dev] [PATCH 08/10] net/dpaa2: fix the prefetch Rx to honor nb pkts Hemant Agrawal ` (3 subsequent siblings) 9 siblings, 0 replies; 62+ messages in thread From: Hemant Agrawal @ 2018-06-21 9:44 UTC (permalink / raw) To: dev; +Cc: ferruh.yigit Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> --- drivers/net/dpaa/dpaa_ethdev.c | 6 +++--- drivers/net/dpaa/dpaa_ethdev.h | 8 +++++--- drivers/net/dpaa/rte_pmd_dpaa.h | 5 +---- drivers/net/dpaa/rte_pmd_dpaa_version.map | 4 ++-- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index cf07d25..ba269a8 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -608,7 +608,7 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, return 0; } -int __rte_experimental +int dpaa_eth_eventq_attach(const struct rte_eth_dev *dev, int eth_rx_queue_id, u16 ch_id, @@ -671,7 +671,7 @@ dpaa_eth_eventq_attach(const struct rte_eth_dev *dev, return ret; } -int __rte_experimental +int dpaa_eth_eventq_detach(const struct rte_eth_dev *dev, int eth_rx_queue_id) { @@ -940,7 +940,7 @@ is_dpaa_supported(struct rte_eth_dev *dev) return is_device_supported(dev, &rte_dpaa_pmd); } -int __rte_experimental +int rte_pmd_dpaa_set_tx_loopback(uint8_t port, uint8_t on) { struct rte_eth_dev *dev; diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h index 1897b9e..c79b9f8 100644 --- a/drivers/net/dpaa/dpaa_ethdev.h +++ b/drivers/net/dpaa/dpaa_ethdev.h @@ -160,12 +160,14 @@ struct dpaa_if_stats { uint64_t tund; /**<Tx Undersized */ }; -int __rte_experimental dpaa_eth_eventq_attach(const struct rte_eth_dev *dev, - int eth_rx_queue_id, +int +dpaa_eth_eventq_attach(const struct rte_eth_dev *dev, + int eth_rx_queue_id, u16 ch_id, const struct rte_event_eth_rx_adapter_queue_conf *queue_conf); -int __rte_experimental dpaa_eth_eventq_detach(const struct rte_eth_dev *dev, +int +dpaa_eth_eventq_detach(const struct rte_eth_dev *dev, int eth_rx_queue_id); enum qman_cb_dqrr_result diff --git a/drivers/net/dpaa/rte_pmd_dpaa.h b/drivers/net/dpaa/rte_pmd_dpaa.h index 38405ec..37eea9b 100644 --- a/drivers/net/dpaa/rte_pmd_dpaa.h +++ b/drivers/net/dpaa/rte_pmd_dpaa.h @@ -18,9 +18,6 @@ #include <rte_ethdev_driver.h> /** - * @warning - * @b EXPERIMENTAL: this API may change, or be removed, without prior notice - * * Enable/Disable TX loopback * * @param port @@ -33,7 +30,7 @@ * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int __rte_experimental +int rte_pmd_dpaa_set_tx_loopback(uint8_t port, uint8_t on); #endif /* _PMD_DPAA_H_ */ diff --git a/drivers/net/dpaa/rte_pmd_dpaa_version.map b/drivers/net/dpaa/rte_pmd_dpaa_version.map index c7ad403..8cb4500 100644 --- a/drivers/net/dpaa/rte_pmd_dpaa_version.map +++ b/drivers/net/dpaa/rte_pmd_dpaa_version.map @@ -3,10 +3,10 @@ DPDK_17.11 { local: *; }; -EXPERIMENTAL { +DPDK_18.08 { global: dpaa_eth_eventq_attach; dpaa_eth_eventq_detach; rte_pmd_dpaa_set_tx_loopback; -}; +} DPDK_17.11; -- 2.7.4 ^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH 08/10] net/dpaa2: fix the prefetch Rx to honor nb pkts 2018-06-21 9:43 [dpdk-dev] [PATCH 01/10] bus/dpaa: fix phandle support for kernel 4.16 Hemant Agrawal ` (5 preceding siblings ...) 2018-06-21 9:44 ` [dpdk-dev] [PATCH 07/10] net/dpaa: remove experimental tag from PMD APIs Hemant Agrawal @ 2018-06-21 9:44 ` Hemant Agrawal 2018-06-21 9:44 ` [dpdk-dev] [PATCH 09/10] bus/dpaa: cleanup unnecessary global variables Hemant Agrawal ` (2 subsequent siblings) 9 siblings, 0 replies; 62+ messages in thread From: Hemant Agrawal @ 2018-06-21 9:44 UTC (permalink / raw) To: dev; +Cc: ferruh.yigit, stable This patch fix the prefetch rx routine to set the next prefetch request to the size of nb_pkts. This will assume that next request will ideally will be of same size. Fixes: 4bc5ab88dbd6 ("net/dpaa2: fix Tx only mode") Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> --- drivers/net/dpaa2/dpaa2_rxtx.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c index dac086d..311861c 100644 --- a/drivers/net/dpaa2/dpaa2_rxtx.c +++ b/drivers/net/dpaa2/dpaa2_rxtx.c @@ -447,6 +447,12 @@ eth_copy_mbuf_to_fd(struct rte_mbuf *mbuf, return 0; } +/* This function assumes that you will be keeping the same value for nb_pkts + * across calls per queue, if that is not the case, better use non-prefetch + * version of rx call. + * It will return the packets as request in the previous call without honoring + * the current nb_pkts or bufs space. + */ uint16_t dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) { @@ -454,7 +460,7 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) struct dpaa2_queue *dpaa2_q = (struct dpaa2_queue *)queue; struct qbman_result *dq_storage, *dq_storage1 = NULL; uint32_t fqid = dpaa2_q->fqid; - int ret, num_rx = 0; + int ret, num_rx = 0, pull_size; uint8_t pending, status; struct qbman_swp *swp; const struct qbman_fd *fd, *next_fd; @@ -470,12 +476,12 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) } } swp = DPAA2_PER_LCORE_ETHRX_PORTAL; - + pull_size = (nb_pkts > DPAA2_DQRR_RING_SIZE) ? + DPAA2_DQRR_RING_SIZE : nb_pkts; if (unlikely(!q_storage->active_dqs)) { q_storage->toggle = 0; dq_storage = q_storage->dq_storage[q_storage->toggle]; - q_storage->last_num_pkts = (nb_pkts > DPAA2_DQRR_RING_SIZE) ? - DPAA2_DQRR_RING_SIZE : nb_pkts; + q_storage->last_num_pkts = pull_size; qbman_pull_desc_clear(&pulldesc); qbman_pull_desc_set_numframes(&pulldesc, q_storage->last_num_pkts); @@ -514,7 +520,7 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) q_storage->toggle ^= 1; dq_storage1 = q_storage->dq_storage[q_storage->toggle]; qbman_pull_desc_clear(&pulldesc); - qbman_pull_desc_set_numframes(&pulldesc, DPAA2_DQRR_RING_SIZE); + qbman_pull_desc_set_numframes(&pulldesc, pull_size); qbman_pull_desc_set_fq(&pulldesc, fqid); qbman_pull_desc_set_storage(&pulldesc, dq_storage1, (uint64_t)(DPAA2_VADDR_TO_IOVA(dq_storage1)), 1); -- 2.7.4 ^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH 09/10] bus/dpaa: cleanup unnecessary global variables 2018-06-21 9:43 [dpdk-dev] [PATCH 01/10] bus/dpaa: fix phandle support for kernel 4.16 Hemant Agrawal ` (6 preceding siblings ...) 2018-06-21 9:44 ` [dpdk-dev] [PATCH 08/10] net/dpaa2: fix the prefetch Rx to honor nb pkts Hemant Agrawal @ 2018-06-21 9:44 ` Hemant Agrawal 2018-06-21 9:44 ` [dpdk-dev] [PATCH 10/10] bus/fslmc: " Hemant Agrawal 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 01/16] bus/dpaa: fix phandle support for kernel 4.16 Hemant Agrawal 9 siblings, 0 replies; 62+ messages in thread From: Hemant Agrawal @ 2018-06-21 9:44 UTC (permalink / raw) To: dev; +Cc: ferruh.yigit, Pavan Nikhilesh Changes originally in the patch "drivers: cleanup unnecessary global variables" by Pavan. Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> --- drivers/bus/dpaa/base/fman/netcfg_layer.c | 5 ----- drivers/bus/dpaa/base/qbman/bman_driver.c | 4 ++-- drivers/bus/dpaa/base/qbman/qman.c | 2 +- drivers/bus/dpaa/base/qbman/qman_driver.c | 4 ++-- drivers/bus/dpaa/base/qbman/qman_priv.h | 1 - drivers/bus/dpaa/dpaa_bus.c | 2 +- 6 files changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/bus/dpaa/base/fman/netcfg_layer.c b/drivers/bus/dpaa/base/fman/netcfg_layer.c index 3e956ce..031c6f1 100644 --- a/drivers/bus/dpaa/base/fman/netcfg_layer.c +++ b/drivers/bus/dpaa/base/fman/netcfg_layer.c @@ -18,11 +18,6 @@ #include <rte_dpaa_logs.h> #include <netcfg.h> -/* Structure contains information about all the interfaces given by user - * on command line. - */ -struct netcfg_interface *netcfg_interface; - /* This data structure contaings all configurations information * related to usages of DPA devices. */ diff --git a/drivers/bus/dpaa/base/qbman/bman_driver.c b/drivers/bus/dpaa/base/qbman/bman_driver.c index 1381da3..b14b590 100644 --- a/drivers/bus/dpaa/base/qbman/bman_driver.c +++ b/drivers/bus/dpaa/base/qbman/bman_driver.c @@ -15,9 +15,9 @@ /* * Global variables of the max portal/pool number this bman version supported */ -u16 bman_ip_rev; +static u16 bman_ip_rev; u16 bman_pool_max; -void *bman_ccsr_map; +static void *bman_ccsr_map; /*****************/ /* Portal driver */ diff --git a/drivers/bus/dpaa/base/qbman/qman.c b/drivers/bus/dpaa/base/qbman/qman.c index f5fe5ef..7c17027 100644 --- a/drivers/bus/dpaa/base/qbman/qman.c +++ b/drivers/bus/dpaa/base/qbman/qman.c @@ -625,7 +625,7 @@ struct qman_portal *qman_create_portal( #define MAX_GLOBAL_PORTALS 8 static struct qman_portal global_portals[MAX_GLOBAL_PORTALS]; -rte_atomic16_t global_portals_used[MAX_GLOBAL_PORTALS]; +static rte_atomic16_t global_portals_used[MAX_GLOBAL_PORTALS]; static struct qman_portal * qman_alloc_global_portal(void) diff --git a/drivers/bus/dpaa/base/qbman/qman_driver.c b/drivers/bus/dpaa/base/qbman/qman_driver.c index 07b29d5..f6ecd6b 100644 --- a/drivers/bus/dpaa/base/qbman/qman_driver.c +++ b/drivers/bus/dpaa/base/qbman/qman_driver.c @@ -20,9 +20,9 @@ u16 qm_channel_caam = QMAN_CHANNEL_CAAM; u16 qm_channel_pme = QMAN_CHANNEL_PME; /* Ccsr map address to access ccsrbased register */ -void *qman_ccsr_map; +static void *qman_ccsr_map; /* The qman clock frequency */ -u32 qman_clk; +static u32 qman_clk; static __thread int qmfd = -1; static __thread struct qm_portal_config qpcfg; diff --git a/drivers/bus/dpaa/base/qbman/qman_priv.h b/drivers/bus/dpaa/base/qbman/qman_priv.h index 9e4471e..02f6301 100644 --- a/drivers/bus/dpaa/base/qbman/qman_priv.h +++ b/drivers/bus/dpaa/base/qbman/qman_priv.h @@ -139,7 +139,6 @@ struct qm_portal_config { #define QMAN_REV31 0x0301 #define QMAN_REV32 0x0302 extern u16 qman_ip_rev; /* 0 if uninitialised, otherwise QMAN_REVx */ -extern u32 qman_clk; int qm_set_wpm(int wpm); int qm_get_wpm(int *wpm); diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c index 7956bd0..5ba3d28 100644 --- a/drivers/bus/dpaa/dpaa_bus.c +++ b/drivers/bus/dpaa/dpaa_bus.c @@ -50,7 +50,7 @@ struct rte_dpaa_bus rte_dpaa_bus; struct netcfg_info *dpaa_netcfg; /* define a variable to hold the portal_key, once created.*/ -pthread_key_t dpaa_portal_key; +static pthread_key_t dpaa_portal_key; unsigned int dpaa_svr_family; -- 2.7.4 ^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH 10/10] bus/fslmc: cleanup unnecessary global variables 2018-06-21 9:43 [dpdk-dev] [PATCH 01/10] bus/dpaa: fix phandle support for kernel 4.16 Hemant Agrawal ` (7 preceding siblings ...) 2018-06-21 9:44 ` [dpdk-dev] [PATCH 09/10] bus/dpaa: cleanup unnecessary global variables Hemant Agrawal @ 2018-06-21 9:44 ` Hemant Agrawal 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 01/16] bus/dpaa: fix phandle support for kernel 4.16 Hemant Agrawal 9 siblings, 0 replies; 62+ messages in thread From: Hemant Agrawal @ 2018-06-21 9:44 UTC (permalink / raw) To: dev; +Cc: ferruh.yigit, Pavan Nikhilesh Changes originally in the patch "drivers: cleanup unnecessary global variables" by Pavan. Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> --- drivers/bus/fslmc/qbman/qbman_portal.c | 3 +-- drivers/bus/fslmc/qbman/qbman_portal.h | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/bus/fslmc/qbman/qbman_portal.c b/drivers/bus/fslmc/qbman/qbman_portal.c index 713ec96..0714500 100644 --- a/drivers/bus/fslmc/qbman/qbman_portal.c +++ b/drivers/bus/fslmc/qbman/qbman_portal.c @@ -122,8 +122,7 @@ struct qbman_swp *qbman_swp_init(const struct qbman_swp_desc *d) p->vdq.valid_bit = QB_VALID_BIT; p->dqrr.next_idx = 0; p->dqrr.valid_bit = QB_VALID_BIT; - qman_version = p->desc.qman_version; - if ((qman_version & 0xFFFF0000) < QMAN_REV_4100) { + if ((p->desc.qman_version & 0xFFFF0000) < QMAN_REV_4100) { p->dqrr.dqrr_size = 4; p->dqrr.reset_bug = 1; } else { diff --git a/drivers/bus/fslmc/qbman/qbman_portal.h b/drivers/bus/fslmc/qbman/qbman_portal.h index 8bff0b4..dbea22a 100644 --- a/drivers/bus/fslmc/qbman/qbman_portal.h +++ b/drivers/bus/fslmc/qbman/qbman_portal.h @@ -7,7 +7,6 @@ #include "qbman_sys.h" #include <fsl_qbman_portal.h> -uint32_t qman_version; #define QMAN_REV_4000 0x04000000 #define QMAN_REV_4100 0x04010000 #define QMAN_REV_4101 0x04010001 -- 2.7.4 ^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH v2 01/16] bus/dpaa: fix phandle support for kernel 4.16 2018-06-21 9:43 [dpdk-dev] [PATCH 01/10] bus/dpaa: fix phandle support for kernel 4.16 Hemant Agrawal ` (8 preceding siblings ...) 2018-06-21 9:44 ` [dpdk-dev] [PATCH 10/10] bus/fslmc: " Hemant Agrawal @ 2018-07-04 9:43 ` Hemant Agrawal 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 02/16] bus/dpaa: fix svr id fetch location Hemant Agrawal ` (16 more replies) 9 siblings, 17 replies; 62+ messages in thread From: Hemant Agrawal @ 2018-07-04 9:43 UTC (permalink / raw) To: dev; +Cc: Alok Makhariya, Shreyansh Jain, stable From: Alok Makhariya <alok.makhariya@nxp.com> Fixes: 2183c6f69d7e ("bus/dpaa: add OF parser for device scanning") Cc: Shreyansh Jain <shreyansh.jain@nxp.com> Cc: stable@dpdk.org Signed-off-by: Alok Makhariya <alok.makhariya@nxp.com> --- drivers/bus/dpaa/base/fman/of.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/bus/dpaa/base/fman/of.c b/drivers/bus/dpaa/base/fman/of.c index 1b2dbe2..eb55cb9 100644 --- a/drivers/bus/dpaa/base/fman/of.c +++ b/drivers/bus/dpaa/base/fman/of.c @@ -182,6 +182,11 @@ linear_dir(struct dt_dir *d) DPAA_BUS_LOG(DEBUG, "Duplicate lphandle in %s", d->node.node.full_name); d->lphandle = f; + } else if (!strcmp(f->node.node.name, "phandle")) { + if (d->lphandle) + DPAA_BUS_LOG(DEBUG, "Duplicate lphandle in %s", + d->node.node.full_name); + d->lphandle = f; } else if (!strcmp(f->node.node.name, "#address-cells")) { if (d->a_cells) DPAA_BUS_LOG(DEBUG, "Duplicate a_cells in %s", -- 2.7.4 ^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH v2 02/16] bus/dpaa: fix svr id fetch location 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 01/16] bus/dpaa: fix phandle support for kernel 4.16 Hemant Agrawal @ 2018-07-04 9:43 ` Hemant Agrawal 2018-07-06 4:44 ` Shreyansh Jain 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 03/16] bus/dpaa: fix the buffer offset setting in FMAN Hemant Agrawal ` (15 subsequent siblings) 16 siblings, 1 reply; 62+ messages in thread From: Hemant Agrawal @ 2018-07-04 9:43 UTC (permalink / raw) To: dev; +Cc: stable Otherwise the SVR may not be avilable for dpaa init. Fixes: 3b59b73dea08 ("bus/dpaa: update platform SoC value register routines") Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> --- drivers/bus/dpaa/dpaa_bus.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c index 2046206..7956bd0 100644 --- a/drivers/bus/dpaa/dpaa_bus.c +++ b/drivers/bus/dpaa/dpaa_bus.c @@ -539,6 +539,13 @@ rte_dpaa_bus_probe(void) unsigned int svr_ver; int probe_all = rte_dpaa_bus.bus.conf.scan_mode != RTE_BUS_SCAN_WHITELIST; + svr_file = fopen(DPAA_SOC_ID_FILE, "r"); + if (svr_file) { + if (fscanf(svr_file, "svr:%x", &svr_ver) > 0) + dpaa_svr_family = svr_ver & SVR_MASK; + fclose(svr_file); + } + /* For each registered driver, and device, call the driver->probe */ TAILQ_FOREACH(dev, &rte_dpaa_bus.device_list, next) { TAILQ_FOREACH(drv, &rte_dpaa_bus.driver_list, next) { @@ -569,13 +576,6 @@ rte_dpaa_bus_probe(void) if (!TAILQ_EMPTY(&rte_dpaa_bus.device_list)) rte_mbuf_set_platform_mempool_ops(DPAA_MEMPOOL_OPS_NAME); - svr_file = fopen(DPAA_SOC_ID_FILE, "r"); - if (svr_file) { - if (fscanf(svr_file, "svr:%x", &svr_ver) > 0) - dpaa_svr_family = svr_ver & SVR_MASK; - fclose(svr_file); - } - return 0; } -- 2.7.4 ^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [dpdk-dev] [PATCH v2 02/16] bus/dpaa: fix svr id fetch location 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 02/16] bus/dpaa: fix svr id fetch location Hemant Agrawal @ 2018-07-06 4:44 ` Shreyansh Jain 0 siblings, 0 replies; 62+ messages in thread From: Shreyansh Jain @ 2018-07-06 4:44 UTC (permalink / raw) To: Hemant Agrawal, dev; +Cc: stable On Wednesday 04 July 2018 03:13 PM, Hemant Agrawal wrote: > Otherwise the SVR may not be avilable for dpaa init. > > Fixes: 3b59b73dea08 ("bus/dpaa: update platform SoC value register routines") > Cc: stable@dpdk.org > > Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> > --- Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com> ^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH v2 03/16] bus/dpaa: fix the buffer offset setting in FMAN 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 01/16] bus/dpaa: fix phandle support for kernel 4.16 Hemant Agrawal 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 02/16] bus/dpaa: fix svr id fetch location Hemant Agrawal @ 2018-07-04 9:43 ` Hemant Agrawal 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 04/16] net/dpaa: fix the queue err handling and logs Hemant Agrawal ` (14 subsequent siblings) 16 siblings, 0 replies; 62+ messages in thread From: Hemant Agrawal @ 2018-07-04 9:43 UTC (permalink / raw) To: dev; +Cc: stable The buffer offset was incorrectly being set at 64, thus not honoring the packet headroom. Fixes: 6d6b4f49a155 (bus/dpaa: add FMAN hardware operations") Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> --- drivers/bus/dpaa/base/fman/fman_hw.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/drivers/bus/dpaa/base/fman/fman_hw.c b/drivers/bus/dpaa/base/fman/fman_hw.c index 0148b98..7ada7fa 100644 --- a/drivers/bus/dpaa/base/fman/fman_hw.c +++ b/drivers/bus/dpaa/base/fman/fman_hw.c @@ -16,6 +16,8 @@ #include <fsl_fman_crc64.h> #include <fsl_bman.h> +#define FMAN_SP_EXT_BUF_MARG_START_SHIFT 16 + /* Instantiate the global variable that the inline CRC64 implementation (in * <fsl_fman.h>) depends on. */ @@ -422,20 +424,16 @@ fman_if_set_fc_quanta(struct fman_if *fm_if, u16 pause_quanta) int fman_if_get_fdoff(struct fman_if *fm_if) { - u32 fmbm_ricp; + u32 fmbm_rebm; int fdoff; - int iceof_mask = 0x001f0000; - int icsz_mask = 0x0000001f; struct __fman_if *__if = container_of(fm_if, struct __fman_if, __if); assert(fman_ccsr_map_fd != -1); - fmbm_ricp = - in_be32(&((struct rx_bmi_regs *)__if->bmi_map)->fmbm_ricp); - /*iceof + icsz*/ - fdoff = ((fmbm_ricp & iceof_mask) >> 16) * 16 + - (fmbm_ricp & icsz_mask) * 16; + fmbm_rebm = in_be32(&((struct rx_bmi_regs *)__if->bmi_map)->fmbm_rebm); + + fdoff = (fmbm_rebm >> FMAN_SP_EXT_BUF_MARG_START_SHIFT) & 0x1ff; return fdoff; } @@ -502,12 +500,16 @@ fman_if_set_fdoff(struct fman_if *fm_if, uint32_t fd_offset) { struct __fman_if *__if = container_of(fm_if, struct __fman_if, __if); unsigned int *fmbm_rebm; + int val = 0; + int fmbm_mask = 0x01ff0000; + + val = fd_offset << FMAN_SP_EXT_BUF_MARG_START_SHIFT; assert(fman_ccsr_map_fd != -1); fmbm_rebm = &((struct rx_bmi_regs *)__if->bmi_map)->fmbm_rebm; - out_be32(fmbm_rebm, in_be32(fmbm_rebm) | (fd_offset << 16)); + out_be32(fmbm_rebm, (in_be32(fmbm_rebm) & ~fmbm_mask) | val); } void -- 2.7.4 ^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH v2 04/16] net/dpaa: fix the queue err handling and logs 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 01/16] bus/dpaa: fix phandle support for kernel 4.16 Hemant Agrawal 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 02/16] bus/dpaa: fix svr id fetch location Hemant Agrawal 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 03/16] bus/dpaa: fix the buffer offset setting in FMAN Hemant Agrawal @ 2018-07-04 9:43 ` Hemant Agrawal 2018-07-06 4:56 ` Shreyansh Jain 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 05/16] net/dpaa2: fix the prefetch Rx to honor nb pkts Hemant Agrawal ` (13 subsequent siblings) 16 siblings, 1 reply; 62+ messages in thread From: Hemant Agrawal @ 2018-07-04 9:43 UTC (permalink / raw) To: dev; +Cc: stable Fixes: 5e7455931442 ("net/dpaa: support Rx queue configurations with eventdev") Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> --- drivers/net/dpaa/dpaa_ethdev.c | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index d014a11..79ba6bd 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -516,7 +516,15 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, PMD_INIT_FUNC_TRACE(); - DPAA_PMD_INFO("Rx queue setup for queue index: %d", queue_idx); + if (queue_idx >= dev->data->nb_rx_queues) { + rte_errno = EOVERFLOW; + DPAA_PMD_ERR("%p: queue index out of range (%u >= %u)", + (void *)dev, queue_idx, dev->data->nb_rx_queues); + return -rte_errno; + } + + DPAA_PMD_INFO("Rx queue setup for queue index: %d fq_id (0x%x)", + queue_idx, rxq->fqid); if (!dpaa_intf->bp_info || dpaa_intf->bp_info->mp != mp) { struct fman_if_ic_params icp; @@ -580,9 +588,11 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, opts.fqd.fq_ctrl |= QM_FQCTRL_CGE; } ret = qman_init_fq(rxq, flags, &opts); - if (ret) - DPAA_PMD_ERR("Channel/Queue association failed. fqid %d" - " ret: %d", rxq->fqid, ret); + if (ret) { + DPAA_PMD_ERR("Channel/Q association failed. fqid 0x%x " + "ret:%d(%s)", rxq->fqid, ret, strerror(ret)); + return ret; + } rxq->cb.dqrr_dpdk_pull_cb = dpaa_rx_cb; rxq->cb.dqrr_prepare = dpaa_rx_cb_prepare; rxq->is_static = true; @@ -657,8 +667,8 @@ dpaa_eth_eventq_attach(const struct rte_eth_dev *dev, ret = qman_init_fq(rxq, flags, &opts); if (ret) { - DPAA_PMD_ERR("Channel/Queue association failed. fqid %d ret:%d", - rxq->fqid, ret); + DPAA_PMD_ERR("Ev-Channel/Q association failed. fqid 0x%x " + "ret:%d(%s)", rxq->fqid, ret, strerror(ret)); return ret; } @@ -715,7 +725,15 @@ int dpaa_eth_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, PMD_INIT_FUNC_TRACE(); - DPAA_PMD_INFO("Tx queue setup for queue index: %d", queue_idx); + if (queue_idx >= dev->data->nb_tx_queues) { + rte_errno = EOVERFLOW; + DPAA_PMD_ERR("%p: queue index out of range (%u >= %u)", + (void *)dev, queue_idx, dev->data->nb_tx_queues); + return -rte_errno; + } + + DPAA_PMD_INFO("Tx queue setup for queue index: %d fq_id (0x%x)", + queue_idx, dpaa_intf->tx_queues[queue_idx].fqid); dev->data->tx_queues[queue_idx] = &dpaa_intf->tx_queues[queue_idx]; return 0; } @@ -1016,7 +1034,7 @@ static int dpaa_rx_queue_init(struct qman_fq *fq, struct qman_cgr *cgr_rx, DPAA_PMD_DEBUG("creating rx fq %p, fqid %d", fq, fqid); ret = qman_create_fq(fqid, QMAN_FQ_FLAG_NO_ENQUEUE, fq); if (ret) { - DPAA_PMD_ERR("create rx fqid %d failed with ret: %d", + DPAA_PMD_ERR("create rx fqid 0x%x failed with ret: %d", fqid, ret); return ret; } -- 2.7.4 ^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [dpdk-dev] [PATCH v2 04/16] net/dpaa: fix the queue err handling and logs 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 04/16] net/dpaa: fix the queue err handling and logs Hemant Agrawal @ 2018-07-06 4:56 ` Shreyansh Jain 0 siblings, 0 replies; 62+ messages in thread From: Shreyansh Jain @ 2018-07-06 4:56 UTC (permalink / raw) To: Hemant Agrawal, dev; +Cc: stable On Wednesday 04 July 2018 03:13 PM, Hemant Agrawal wrote: > Fixes: 5e7455931442 ("net/dpaa: support Rx queue configurations with eventdev") > Cc: stable@dpdk.org > > Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> > --- Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com> ^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH v2 05/16] net/dpaa2: fix the prefetch Rx to honor nb pkts 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 01/16] bus/dpaa: fix phandle support for kernel 4.16 Hemant Agrawal ` (2 preceding siblings ...) 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 04/16] net/dpaa: fix the queue err handling and logs Hemant Agrawal @ 2018-07-04 9:43 ` Hemant Agrawal 2018-07-06 5:01 ` Shreyansh Jain 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 06/16] bus/dpaa: optimize the fq callback routine Hemant Agrawal ` (12 subsequent siblings) 16 siblings, 1 reply; 62+ messages in thread From: Hemant Agrawal @ 2018-07-04 9:43 UTC (permalink / raw) To: dev; +Cc: stable This patch fix the prefetch rx routine to set the next prefetch request to the size of nb_pkts. This will assume that next request will ideally will be of same size. Fixes: 4bc5ab88dbd6 ("net/dpaa2: fix Tx only mode") Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> --- drivers/net/dpaa2/dpaa2_rxtx.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c index dac086d..311861c 100644 --- a/drivers/net/dpaa2/dpaa2_rxtx.c +++ b/drivers/net/dpaa2/dpaa2_rxtx.c @@ -447,6 +447,12 @@ eth_copy_mbuf_to_fd(struct rte_mbuf *mbuf, return 0; } +/* This function assumes that you will be keeping the same value for nb_pkts + * across calls per queue, if that is not the case, better use non-prefetch + * version of rx call. + * It will return the packets as request in the previous call without honoring + * the current nb_pkts or bufs space. + */ uint16_t dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) { @@ -454,7 +460,7 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) struct dpaa2_queue *dpaa2_q = (struct dpaa2_queue *)queue; struct qbman_result *dq_storage, *dq_storage1 = NULL; uint32_t fqid = dpaa2_q->fqid; - int ret, num_rx = 0; + int ret, num_rx = 0, pull_size; uint8_t pending, status; struct qbman_swp *swp; const struct qbman_fd *fd, *next_fd; @@ -470,12 +476,12 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) } } swp = DPAA2_PER_LCORE_ETHRX_PORTAL; - + pull_size = (nb_pkts > DPAA2_DQRR_RING_SIZE) ? + DPAA2_DQRR_RING_SIZE : nb_pkts; if (unlikely(!q_storage->active_dqs)) { q_storage->toggle = 0; dq_storage = q_storage->dq_storage[q_storage->toggle]; - q_storage->last_num_pkts = (nb_pkts > DPAA2_DQRR_RING_SIZE) ? - DPAA2_DQRR_RING_SIZE : nb_pkts; + q_storage->last_num_pkts = pull_size; qbman_pull_desc_clear(&pulldesc); qbman_pull_desc_set_numframes(&pulldesc, q_storage->last_num_pkts); @@ -514,7 +520,7 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) q_storage->toggle ^= 1; dq_storage1 = q_storage->dq_storage[q_storage->toggle]; qbman_pull_desc_clear(&pulldesc); - qbman_pull_desc_set_numframes(&pulldesc, DPAA2_DQRR_RING_SIZE); + qbman_pull_desc_set_numframes(&pulldesc, pull_size); qbman_pull_desc_set_fq(&pulldesc, fqid); qbman_pull_desc_set_storage(&pulldesc, dq_storage1, (uint64_t)(DPAA2_VADDR_TO_IOVA(dq_storage1)), 1); -- 2.7.4 ^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [dpdk-dev] [PATCH v2 05/16] net/dpaa2: fix the prefetch Rx to honor nb pkts 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 05/16] net/dpaa2: fix the prefetch Rx to honor nb pkts Hemant Agrawal @ 2018-07-06 5:01 ` Shreyansh Jain 2018-07-06 8:13 ` Hemant Agrawal 0 siblings, 1 reply; 62+ messages in thread From: Shreyansh Jain @ 2018-07-06 5:01 UTC (permalink / raw) To: Hemant Agrawal, dev; +Cc: stable On Wednesday 04 July 2018 03:13 PM, Hemant Agrawal wrote: > This patch fix the prefetch rx routine to ^^^^^ fixes > set the next prefetch request to the size of nb_pkts. > This will assume that next request will ideally will be > of same size. Incorrect wording. Maybe: "It assumes that next request would ideally be of same size" > > Fixes: 4bc5ab88dbd6 ("net/dpaa2: fix Tx only mode") > Cc: stable@dpdk.org > > Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> > --- > drivers/net/dpaa2/dpaa2_rxtx.c | 16 +++++++++++----- > 1 file changed, 11 insertions(+), 5 deletions(-) > > diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c > index dac086d..311861c 100644 > --- a/drivers/net/dpaa2/dpaa2_rxtx.c > +++ b/drivers/net/dpaa2/dpaa2_rxtx.c > @@ -447,6 +447,12 @@ eth_copy_mbuf_to_fd(struct rte_mbuf *mbuf, > return 0; > } > > +/* This function assumes that you will be keeping the same value for nb_pkts ^^^^^^^^^^ Ideally commit messages shouldn't have personifications 'you/your' etc But, it is a trivial thing and I leave at your discretion. > + * across calls per queue, if that is not the case, better use non-prefetch > + * version of rx call. > + * It will return the packets as request in the previous call without honoring ^^^^^^^^^ requested [...] Being very trivial comments, if you send the next version, please use: Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com> ^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [dpdk-dev] [PATCH v2 05/16] net/dpaa2: fix the prefetch Rx to honor nb pkts 2018-07-06 5:01 ` Shreyansh Jain @ 2018-07-06 8:13 ` Hemant Agrawal 0 siblings, 0 replies; 62+ messages in thread From: Hemant Agrawal @ 2018-07-06 8:13 UTC (permalink / raw) To: Shreyansh Jain, dev; +Cc: stable On Wednesday 04 July 2018 03:13 PM, Hemant Agrawal wrote: > This patch fix the prefetch rx routine to ^^^^^ fixes > set the next prefetch request to the size of nb_pkts. > This will assume that next request will ideally will be of same size. Incorrect wording. Maybe: "It assumes that next request would ideally be of same size" [Hemant] I have taken care of it in v3. ^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH v2 06/16] bus/dpaa: optimize the fq callback routine 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 01/16] bus/dpaa: fix phandle support for kernel 4.16 Hemant Agrawal ` (3 preceding siblings ...) 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 05/16] net/dpaa2: fix the prefetch Rx to honor nb pkts Hemant Agrawal @ 2018-07-04 9:43 ` Hemant Agrawal 2018-07-06 5:07 ` Shreyansh Jain 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 07/16] bus/dpaa: implement new of API to get MAC address Hemant Agrawal ` (11 subsequent siblings) 16 siblings, 1 reply; 62+ messages in thread From: Hemant Agrawal @ 2018-07-04 9:43 UTC (permalink / raw) To: dev; +Cc: Sunil Kumar Kori Avoid array of fq as packets are dq only from a single q. Signed-off-by: Sunil Kumar Kori <sunil.kori@nxp.com> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> --- drivers/bus/dpaa/base/qbman/qman.c | 15 +++++++-------- drivers/net/dpaa/dpaa_rxtx.c | 2 +- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/bus/dpaa/base/qbman/qman.c b/drivers/bus/dpaa/base/qbman/qman.c index 27d98cc..13c4315 100644 --- a/drivers/bus/dpaa/base/qbman/qman.c +++ b/drivers/bus/dpaa/base/qbman/qman.c @@ -1058,7 +1058,7 @@ unsigned int qman_portal_poll_rx(unsigned int poll_limit, struct qm_portal *portal = &p->p; register struct qm_dqrr *dqrr = &portal->dqrr; struct qm_dqrr_entry *dq[QM_DQRR_SIZE], *shadow[QM_DQRR_SIZE]; - struct qman_fq *fq[QM_DQRR_SIZE]; + struct qman_fq *fq; unsigned int limit = 0, rx_number = 0; uint32_t consume = 0; @@ -1092,14 +1092,13 @@ unsigned int qman_portal_poll_rx(unsigned int poll_limit, /* SDQCR: context_b points to the FQ */ #ifdef CONFIG_FSL_QMAN_FQ_LOOKUP - fq[rx_number] = qman_fq_lookup_table[be32_to_cpu( - dq[rx_number]->contextB)]; + fq = qman_fq_lookup_table[be32_to_cpu(dq[rx_number]->contextB)]; #else - fq[rx_number] = (void *)be32_to_cpu( - dq[rx_number]->contextB); + fq = (void *)be32_to_cpu(dq[rx_number]->contextB); #endif - fq[rx_number]->cb.dqrr_prepare(shadow[rx_number], - &bufs[rx_number]); + if (fq->cb.dqrr_prepare) + fq->cb.dqrr_prepare(shadow[rx_number], + &bufs[rx_number]); consume |= (1 << (31 - DQRR_PTR2IDX(shadow[rx_number]))); rx_number++; @@ -1107,7 +1106,7 @@ unsigned int qman_portal_poll_rx(unsigned int poll_limit, } while (++limit < poll_limit); if (rx_number) - fq[0]->cb.dqrr_dpdk_pull_cb(fq, shadow, bufs, rx_number); + fq->cb.dqrr_dpdk_pull_cb(&fq, shadow, bufs, rx_number); /* Consume all the DQRR enries together */ qm_out(DQRR_DCAP, (1 << 8) | consume); diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c index 1316d2a..805bc30 100644 --- a/drivers/net/dpaa/dpaa_rxtx.c +++ b/drivers/net/dpaa/dpaa_rxtx.c @@ -431,7 +431,7 @@ dpaa_rx_cb(struct qman_fq **fq, struct qm_dqrr_entry **dqrr, } fd = &dqrr[i]->fd; - dpaa_intf = fq[i]->dpaa_intf; + dpaa_intf = fq[0]->dpaa_intf; format = (fd->opaque & DPAA_FD_FORMAT_MASK) >> DPAA_FD_FORMAT_SHIFT; -- 2.7.4 ^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [dpdk-dev] [PATCH v2 06/16] bus/dpaa: optimize the fq callback routine 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 06/16] bus/dpaa: optimize the fq callback routine Hemant Agrawal @ 2018-07-06 5:07 ` Shreyansh Jain 0 siblings, 0 replies; 62+ messages in thread From: Shreyansh Jain @ 2018-07-06 5:07 UTC (permalink / raw) To: Hemant Agrawal, dev; +Cc: Sunil Kumar Kori On Wednesday 04 July 2018 03:13 PM, Hemant Agrawal wrote: > Avoid array of fq as packets are dq only from a single q. > > Signed-off-by: Sunil Kumar Kori <sunil.kori@nxp.com> > Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> > --- > drivers/bus/dpaa/base/qbman/qman.c | 15 +++++++-------- > drivers/net/dpaa/dpaa_rxtx.c | 2 +- > 2 files changed, 8 insertions(+), 9 deletions(-) > Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com> ^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH v2 07/16] bus/dpaa: implement new of API to get MAC address 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 01/16] bus/dpaa: fix phandle support for kernel 4.16 Hemant Agrawal ` (4 preceding siblings ...) 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 06/16] bus/dpaa: optimize the fq callback routine Hemant Agrawal @ 2018-07-04 9:43 ` Hemant Agrawal 2018-07-06 5:24 ` Shreyansh Jain 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 08/16] bus/dpaa: make vdqcr configurable Hemant Agrawal ` (10 subsequent siblings) 16 siblings, 1 reply; 62+ messages in thread From: Hemant Agrawal @ 2018-07-04 9:43 UTC (permalink / raw) To: dev; +Cc: Akhil Goyal From: Akhil Goyal <akhil.goyal@nxp.com> Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com> --- drivers/bus/dpaa/base/fman/of.c | 39 +++++++++++++++++++++++++++++++ drivers/bus/dpaa/include/of.h | 2 ++ drivers/bus/dpaa/rte_bus_dpaa_version.map | 8 +++++++ 3 files changed, 49 insertions(+) diff --git a/drivers/bus/dpaa/base/fman/of.c b/drivers/bus/dpaa/base/fman/of.c index eb55cb9..a7f3174 100644 --- a/drivers/bus/dpaa/base/fman/of.c +++ b/drivers/bus/dpaa/base/fman/of.c @@ -546,3 +546,42 @@ of_device_is_compatible(const struct device_node *dev_node, return true; return false; } + +static const void *of_get_mac_addr(const struct device_node *np, + const char *name) +{ + return of_get_property(np, name, NULL); +} + +/** + * Search the device tree for the best MAC address to use. 'mac-address' is + * checked first, because that is supposed to contain to "most recent" MAC + * address. If that isn't set, then 'local-mac-address' is checked next, + * because that is the default address. If that isn't set, then the obsolete + * 'address' is checked, just in case we're using an old device tree. + * + * Note that the 'address' property is supposed to contain a virtual address of + * the register set, but some DTS files have redefined that property to be the + * MAC address. + * + * All-zero MAC addresses are rejected, because those could be properties that + * exist in the device tree, but were not set by U-Boot. For example, the + * DTS could define 'mac-address' and 'local-mac-address', with zero MAC + * addresses. Some older U-Boots only initialized 'local-mac-address'. In + * this case, the real MAC is in 'local-mac-address', and 'mac-address' exists + * but is all zeros. + */ +const void *of_get_mac_address(const struct device_node *np) +{ + const void *addr; + + addr = of_get_mac_addr(np, "mac-address"); + if (addr) + return addr; + + addr = of_get_mac_addr(np, "local-mac-address"); + if (addr) + return addr; + + return of_get_mac_addr(np, "address"); +} diff --git a/drivers/bus/dpaa/include/of.h b/drivers/bus/dpaa/include/of.h index 151be5a..7ea7608 100644 --- a/drivers/bus/dpaa/include/of.h +++ b/drivers/bus/dpaa/include/of.h @@ -109,6 +109,8 @@ const struct device_node *of_get_parent(const struct device_node *dev_node); const struct device_node *of_get_next_child(const struct device_node *dev_node, const struct device_node *prev); +const void *of_get_mac_address(const struct device_node *np); + #define for_each_child_node(parent, child) \ for (child = of_get_next_child(parent, NULL); child != NULL; \ child = of_get_next_child(parent, child)) diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map b/drivers/bus/dpaa/rte_bus_dpaa_version.map index 8d90285..e00c911 100644 --- a/drivers/bus/dpaa/rte_bus_dpaa_version.map +++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map @@ -92,3 +92,11 @@ DPDK_18.02 { local: *; } DPDK_17.11; + +DPDK_18.08 { + global: + + of_get_mac_address; + + local: *; +} DPDK_18.02; -- 2.7.4 ^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [dpdk-dev] [PATCH v2 07/16] bus/dpaa: implement new of API to get MAC address 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 07/16] bus/dpaa: implement new of API to get MAC address Hemant Agrawal @ 2018-07-06 5:24 ` Shreyansh Jain 0 siblings, 0 replies; 62+ messages in thread From: Shreyansh Jain @ 2018-07-06 5:24 UTC (permalink / raw) To: Hemant Agrawal, dev; +Cc: Akhil Goyal On Wednesday 04 July 2018 03:13 PM, Hemant Agrawal wrote: > From: Akhil Goyal <akhil.goyal@nxp.com> > > Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com> > --- > drivers/bus/dpaa/base/fman/of.c | 39 +++++++++++++++++++++++++++++++ > drivers/bus/dpaa/include/of.h | 2 ++ > drivers/bus/dpaa/rte_bus_dpaa_version.map | 8 +++++++ > 3 files changed, 49 insertions(+) > Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com> ^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH v2 08/16] bus/dpaa: make vdqcr configurable 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 01/16] bus/dpaa: fix phandle support for kernel 4.16 Hemant Agrawal ` (5 preceding siblings ...) 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 07/16] bus/dpaa: implement new of API to get MAC address Hemant Agrawal @ 2018-07-04 9:43 ` Hemant Agrawal 2018-07-06 5:24 ` Shreyansh Jain 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 09/16] net/dpaa: support default queue mode Hemant Agrawal ` (9 subsequent siblings) 16 siblings, 1 reply; 62+ messages in thread From: Hemant Agrawal @ 2018-07-04 9:43 UTC (permalink / raw) To: dev; +Cc: Nipun Gupta From: Nipun Gupta <nipun.gupta@nxp.com> This patch add support for configurable vdqcr exact flag. This boost the performance, however this can give side effects for some extra packet fetch. Which has been taken care in the patch as well. Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com> --- drivers/bus/dpaa/base/qbman/qman.c | 4 ++-- drivers/bus/dpaa/include/fsl_qman.h | 3 ++- drivers/crypto/dpaa_sec/dpaa_sec.c | 19 ++++++++++++++++--- drivers/net/dpaa/dpaa_rxtx.c | 18 +++++++++++++++--- 4 files changed, 35 insertions(+), 9 deletions(-) diff --git a/drivers/bus/dpaa/base/qbman/qman.c b/drivers/bus/dpaa/base/qbman/qman.c index 13c4315..f5fe5ef 100644 --- a/drivers/bus/dpaa/base/qbman/qman.c +++ b/drivers/bus/dpaa/base/qbman/qman.c @@ -2002,13 +2002,13 @@ int qman_query_congestion(struct qm_mcr_querycongestion *congestion) return 0; } -int qman_set_vdq(struct qman_fq *fq, u16 num) +int qman_set_vdq(struct qman_fq *fq, u16 num, uint32_t vdqcr_flags) { struct qman_portal *p = get_affine_portal(); uint32_t vdqcr; int ret = -EBUSY; - vdqcr = QM_VDQCR_EXACT; + vdqcr = vdqcr_flags; vdqcr |= QM_VDQCR_NUMFRAMES_SET(num); if ((fq->state != qman_fq_state_parked) && diff --git a/drivers/bus/dpaa/include/fsl_qman.h b/drivers/bus/dpaa/include/fsl_qman.h index e4ad7ae..b18cf03 100644 --- a/drivers/bus/dpaa/include/fsl_qman.h +++ b/drivers/bus/dpaa/include/fsl_qman.h @@ -1332,10 +1332,11 @@ unsigned int qman_portal_poll_rx(unsigned int poll_limit, * qman_set_vdq - Issue a volatile dequeue command * @fq: Frame Queue on which the volatile dequeue command is issued * @num: Number of Frames requested for volatile dequeue + * @vdqcr_flags: QM_VDQCR_EXACT flag to for VDQCR command * * This function will issue a volatile dequeue command to the QMAN. */ -int qman_set_vdq(struct qman_fq *fq, u16 num); +int qman_set_vdq(struct qman_fq *fq, u16 num, uint32_t vdqcr_flags); /** * qman_dequeue - Get the DQRR entry after volatile dequeue command diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index 06f7e43..a07869f 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -526,12 +526,25 @@ dpaa_sec_deq(struct dpaa_sec_qp *qp, struct rte_crypto_op **ops, int nb_ops) { struct qman_fq *fq; unsigned int pkts = 0; - int ret; + int num_rx_bufs, ret; struct qm_dqrr_entry *dq; + uint32_t vdqcr_flags = 0; fq = &qp->outq; - ret = qman_set_vdq(fq, (nb_ops > DPAA_MAX_DEQUEUE_NUM_FRAMES) ? - DPAA_MAX_DEQUEUE_NUM_FRAMES : nb_ops); + /* + * Until request for four buffers, we provide exact number of buffers. + * Otherwise we do not set the QM_VDQCR_EXACT flag. + * Not setting QM_VDQCR_EXACT flag can provide two more buffers than + * requested, so we request two less in this case. + */ + if (nb_ops < 4) { + vdqcr_flags = QM_VDQCR_EXACT; + num_rx_bufs = nb_ops; + } else { + num_rx_bufs = nb_ops > DPAA_MAX_DEQUEUE_NUM_FRAMES ? + (DPAA_MAX_DEQUEUE_NUM_FRAMES - 2) : (nb_ops - 2); + } + ret = qman_set_vdq(fq, num_rx_bufs, vdqcr_flags); if (ret) return 0; diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c index 805bc30..168b77e 100644 --- a/drivers/net/dpaa/dpaa_rxtx.c +++ b/drivers/net/dpaa/dpaa_rxtx.c @@ -560,7 +560,8 @@ uint16_t dpaa_eth_queue_rx(void *q, struct qman_fq *fq = q; struct qm_dqrr_entry *dq; uint32_t num_rx = 0, ifid = ((struct dpaa_if *)fq->dpaa_intf)->ifid; - int ret; + int num_rx_bufs, ret; + uint32_t vdqcr_flags = 0; if (likely(fq->is_static)) return dpaa_eth_queue_portal_rx(fq, bufs, nb_bufs); @@ -573,8 +574,19 @@ uint16_t dpaa_eth_queue_rx(void *q, } } - ret = qman_set_vdq(fq, (nb_bufs > DPAA_MAX_DEQUEUE_NUM_FRAMES) ? - DPAA_MAX_DEQUEUE_NUM_FRAMES : nb_bufs); + /* Until request for four buffers, we provide exact number of buffers. + * Otherwise we do not set the QM_VDQCR_EXACT flag. + * Not setting QM_VDQCR_EXACT flag can provide two more buffers than + * requested, so we request two less in this case. + */ + if (nb_bufs < 4) { + vdqcr_flags = QM_VDQCR_EXACT; + num_rx_bufs = nb_bufs; + } else { + num_rx_bufs = nb_bufs > DPAA_MAX_DEQUEUE_NUM_FRAMES ? + (DPAA_MAX_DEQUEUE_NUM_FRAMES - 2) : (nb_bufs - 2); + } + ret = qman_set_vdq(fq, num_rx_bufs, vdqcr_flags); if (ret) return 0; -- 2.7.4 ^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [dpdk-dev] [PATCH v2 08/16] bus/dpaa: make vdqcr configurable 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 08/16] bus/dpaa: make vdqcr configurable Hemant Agrawal @ 2018-07-06 5:24 ` Shreyansh Jain 0 siblings, 0 replies; 62+ messages in thread From: Shreyansh Jain @ 2018-07-06 5:24 UTC (permalink / raw) To: Hemant Agrawal, dev; +Cc: Nipun Gupta On Wednesday 04 July 2018 03:13 PM, Hemant Agrawal wrote: > From: Nipun Gupta <nipun.gupta@nxp.com> > > This patch add support for configurable vdqcr exact flag. > This boost the performance, however this can give > side effects for some extra packet fetch. Which has been > taken care in the patch as well. > > Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com> > --- > drivers/bus/dpaa/base/qbman/qman.c | 4 ++-- > drivers/bus/dpaa/include/fsl_qman.h | 3 ++- > drivers/crypto/dpaa_sec/dpaa_sec.c | 19 ++++++++++++++++--- > drivers/net/dpaa/dpaa_rxtx.c | 18 +++++++++++++++--- > 4 files changed, 35 insertions(+), 9 deletions(-) > Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com> ^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH v2 09/16] net/dpaa: support default queue mode 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 01/16] bus/dpaa: fix phandle support for kernel 4.16 Hemant Agrawal ` (6 preceding siblings ...) 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 08/16] bus/dpaa: make vdqcr configurable Hemant Agrawal @ 2018-07-04 9:43 ` Hemant Agrawal 2018-07-06 5:28 ` Shreyansh Jain 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 10/16] net/dpaa: remove experimental tag from PMD APIs Hemant Agrawal ` (8 subsequent siblings) 16 siblings, 1 reply; 62+ messages in thread From: Hemant Agrawal @ 2018-07-04 9:43 UTC (permalink / raw) To: dev In case DPAA FMAN configuration tool (FMC) is not available. System can still work with default queue. (1 queue per port). Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> --- drivers/net/dpaa/dpaa_ethdev.c | 37 ++++++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 79ba6bd..def9483 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -74,6 +74,7 @@ static uint64_t dev_tx_offloads_nodis = /* Keep track of whether QMAN and BMAN have been globally initialized */ static int is_global_init; +static int default_q; /* use default queue - FMC is not executed*/ /* At present we only allow up to 4 push mode queues as default - as each of * this queue need dedicated portal and we are short of portals. */ @@ -1026,12 +1027,12 @@ static int dpaa_rx_queue_init(struct qman_fq *fq, struct qman_cgr *cgr_rx, ret = qman_reserve_fqid(fqid); if (ret) { - DPAA_PMD_ERR("reserve rx fqid %d failed with ret: %d", + DPAA_PMD_ERR("reserve rx fqid 0x%x failed with ret: %d", fqid, ret); return -EINVAL; } - DPAA_PMD_DEBUG("creating rx fq %p, fqid %d", fq, fqid); + DPAA_PMD_DEBUG("creating rx fq %p, fqid 0x%x", fq, fqid); ret = qman_create_fq(fqid, QMAN_FQ_FLAG_NO_ENQUEUE, fq); if (ret) { DPAA_PMD_ERR("create rx fqid 0x%x failed with ret: %d", @@ -1050,7 +1051,7 @@ static int dpaa_rx_queue_init(struct qman_fq *fq, struct qman_cgr *cgr_rx, &cgr_opts); if (ret) { DPAA_PMD_WARN( - "rx taildrop init fail on rx fqid %d (ret=%d)", + "rx taildrop init fail on rx fqid 0x%x(ret=%d)", fqid, ret); goto without_cgr; } @@ -1061,7 +1062,7 @@ static int dpaa_rx_queue_init(struct qman_fq *fq, struct qman_cgr *cgr_rx, without_cgr: ret = qman_init_fq(fq, flags, &opts); if (ret) - DPAA_PMD_ERR("init rx fqid %d failed with ret: %d", fqid, ret); + DPAA_PMD_ERR("init rx fqid 0x%x failed with ret:%d", fqid, ret); return ret; } @@ -1089,10 +1090,10 @@ static int dpaa_tx_queue_init(struct qman_fq *fq, /* no tx-confirmation */ opts.fqd.context_a.hi = 0x80000000 | fman_dealloc_bufs_mask_hi; opts.fqd.context_a.lo = 0 | fman_dealloc_bufs_mask_lo; - DPAA_PMD_DEBUG("init tx fq %p, fqid %d", fq, fq->fqid); + DPAA_PMD_DEBUG("init tx fq %p, fqid 0x%x", fq, fq->fqid); ret = qman_init_fq(fq, QMAN_INITFQ_FLAG_SCHED, &opts); if (ret) - DPAA_PMD_ERR("init tx fqid %d failed %d", fq->fqid, ret); + DPAA_PMD_ERR("init tx fqid 0x%x failed %d", fq->fqid, ret); return ret; } @@ -1163,10 +1164,15 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev) dpaa_intf->cfg = cfg; /* Initialize Rx FQ's */ - if (getenv("DPAA_NUM_RX_QUEUES")) - num_rx_fqs = atoi(getenv("DPAA_NUM_RX_QUEUES")); - else + if (default_q) { num_rx_fqs = DPAA_DEFAULT_NUM_PCD_QUEUES; + } else { + if (getenv("DPAA_NUM_RX_QUEUES")) + num_rx_fqs = atoi(getenv("DPAA_NUM_RX_QUEUES")); + else + num_rx_fqs = DPAA_DEFAULT_NUM_PCD_QUEUES; + } + /* if push mode queues to be enabled. Currenly we are allowing only * one queue per thread. @@ -1214,8 +1220,11 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev) } for (loop = 0; loop < num_rx_fqs; loop++) { - fqid = DPAA_PCD_FQID_START + dpaa_intf->ifid * - DPAA_PCD_FQID_MULTIPLIER + loop; + if (default_q) + fqid = cfg->rx_def; + else + fqid = DPAA_PCD_FQID_START + dpaa_intf->ifid * + DPAA_PCD_FQID_MULTIPLIER + loop; if (dpaa_intf->cgr_rx) dpaa_intf->cgr_rx[loop].cgrid = cgrid[loop]; @@ -1409,6 +1418,12 @@ rte_dpaa_probe(struct rte_dpaa_driver *dpaa_drv, return ret; } + if (access("/tmp/fmc.bin", F_OK) == -1) { + RTE_LOG(INFO, PMD, + "* FMC not configured.Enabling default mode\n"); + default_q = 1; + } + is_global_init = 1; } -- 2.7.4 ^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [dpdk-dev] [PATCH v2 09/16] net/dpaa: support default queue mode 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 09/16] net/dpaa: support default queue mode Hemant Agrawal @ 2018-07-06 5:28 ` Shreyansh Jain 2018-07-06 8:13 ` Hemant Agrawal 0 siblings, 1 reply; 62+ messages in thread From: Shreyansh Jain @ 2018-07-06 5:28 UTC (permalink / raw) To: Hemant Agrawal, dev On Wednesday 04 July 2018 03:13 PM, Hemant Agrawal wrote: > In case DPAA FMAN configuration tool (FMC) is not available. > System can still work with default queue. (1 queue per port). The commit message needs to reflect the fact this patch is also fixing some debugging logs which has not relation with default queue. Or, the patch should be split. Also, the commit message can be rephrased for grammatical correctness: "In case DPAA FMAN configuration tool is not availble, the system can still work with default queues (1 queue per port)." > > Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> > --- > drivers/net/dpaa/dpaa_ethdev.c | 37 ++++++++++++++++++++++++++----------- > 1 file changed, 26 insertions(+), 11 deletions(-) > > diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c > index 79ba6bd..def9483 100644 > --- a/drivers/net/dpaa/dpaa_ethdev.c > +++ b/drivers/net/dpaa/dpaa_ethdev.c > @@ -74,6 +74,7 @@ static uint64_t dev_tx_offloads_nodis = > > /* Keep track of whether QMAN and BMAN have been globally initialized */ > static int is_global_init; > +static int default_q; /* use default queue - FMC is not executed*/ > /* At present we only allow up to 4 push mode queues as default - as each of > * this queue need dedicated portal and we are short of portals. > */ > @@ -1026,12 +1027,12 @@ static int dpaa_rx_queue_init(struct qman_fq *fq, struct qman_cgr *cgr_rx, > > ret = qman_reserve_fqid(fqid); > if (ret) { > - DPAA_PMD_ERR("reserve rx fqid %d failed with ret: %d", > + DPAA_PMD_ERR("reserve rx fqid 0x%x failed with ret: %d", > fqid, ret); > return -EINVAL; > } > > - DPAA_PMD_DEBUG("creating rx fq %p, fqid %d", fq, fqid); > + DPAA_PMD_DEBUG("creating rx fq %p, fqid 0x%x", fq, fqid); > ret = qman_create_fq(fqid, QMAN_FQ_FLAG_NO_ENQUEUE, fq); > if (ret) { > DPAA_PMD_ERR("create rx fqid 0x%x failed with ret: %d", > @@ -1050,7 +1051,7 @@ static int dpaa_rx_queue_init(struct qman_fq *fq, struct qman_cgr *cgr_rx, > &cgr_opts); > if (ret) { > DPAA_PMD_WARN( > - "rx taildrop init fail on rx fqid %d (ret=%d)", > + "rx taildrop init fail on rx fqid 0x%x(ret=%d)", > fqid, ret); > goto without_cgr; > } > @@ -1061,7 +1062,7 @@ static int dpaa_rx_queue_init(struct qman_fq *fq, struct qman_cgr *cgr_rx, > without_cgr: > ret = qman_init_fq(fq, flags, &opts); > if (ret) > - DPAA_PMD_ERR("init rx fqid %d failed with ret: %d", fqid, ret); > + DPAA_PMD_ERR("init rx fqid 0x%x failed with ret:%d", fqid, ret); > return ret; > } > > @@ -1089,10 +1090,10 @@ static int dpaa_tx_queue_init(struct qman_fq *fq, > /* no tx-confirmation */ > opts.fqd.context_a.hi = 0x80000000 | fman_dealloc_bufs_mask_hi; > opts.fqd.context_a.lo = 0 | fman_dealloc_bufs_mask_lo; > - DPAA_PMD_DEBUG("init tx fq %p, fqid %d", fq, fq->fqid); > + DPAA_PMD_DEBUG("init tx fq %p, fqid 0x%x", fq, fq->fqid); > ret = qman_init_fq(fq, QMAN_INITFQ_FLAG_SCHED, &opts); > if (ret) > - DPAA_PMD_ERR("init tx fqid %d failed %d", fq->fqid, ret); > + DPAA_PMD_ERR("init tx fqid 0x%x failed %d", fq->fqid, ret); > return ret; > } > All the above are not linked to default queue mode changes. [...] ^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [dpdk-dev] [PATCH v2 09/16] net/dpaa: support default queue mode 2018-07-06 5:28 ` Shreyansh Jain @ 2018-07-06 8:13 ` Hemant Agrawal 0 siblings, 0 replies; 62+ messages in thread From: Hemant Agrawal @ 2018-07-06 8:13 UTC (permalink / raw) To: Shreyansh Jain, dev On Wednesday 04 July 2018 03:13 PM, Hemant Agrawal wrote: > In case DPAA FMAN configuration tool (FMC) is not available. > System can still work with default queue. (1 queue per port). The commit message needs to reflect the fact this patch is also fixing some debugging logs which has not relation with default queue. Or, the patch should be split. Also, the commit message can be rephrased for grammatical correctness: "In case DPAA FMAN configuration tool is not availble, the system can still work with default queues (1 queue per port)." [Hemant] OK ^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH v2 10/16] net/dpaa: remove experimental tag from PMD APIs 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 01/16] bus/dpaa: fix phandle support for kernel 4.16 Hemant Agrawal ` (7 preceding siblings ...) 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 09/16] net/dpaa: support default queue mode Hemant Agrawal @ 2018-07-04 9:43 ` Hemant Agrawal 2018-07-06 5:29 ` Shreyansh Jain 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 11/16] bus/dpaa: cleanup unnecessary global variables Hemant Agrawal ` (7 subsequent siblings) 16 siblings, 1 reply; 62+ messages in thread From: Hemant Agrawal @ 2018-07-04 9:43 UTC (permalink / raw) To: dev Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> --- drivers/net/dpaa/dpaa_ethdev.c | 6 +++--- drivers/net/dpaa/dpaa_ethdev.h | 8 +++++--- drivers/net/dpaa/rte_pmd_dpaa.h | 5 +---- drivers/net/dpaa/rte_pmd_dpaa_version.map | 4 ++-- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index def9483..00611f8 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -617,7 +617,7 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, return 0; } -int __rte_experimental +int dpaa_eth_eventq_attach(const struct rte_eth_dev *dev, int eth_rx_queue_id, u16 ch_id, @@ -680,7 +680,7 @@ dpaa_eth_eventq_attach(const struct rte_eth_dev *dev, return ret; } -int __rte_experimental +int dpaa_eth_eventq_detach(const struct rte_eth_dev *dev, int eth_rx_queue_id) { @@ -956,7 +956,7 @@ is_dpaa_supported(struct rte_eth_dev *dev) return is_device_supported(dev, &rte_dpaa_pmd); } -int __rte_experimental +int rte_pmd_dpaa_set_tx_loopback(uint8_t port, uint8_t on) { struct rte_eth_dev *dev; diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h index 1897b9e..c79b9f8 100644 --- a/drivers/net/dpaa/dpaa_ethdev.h +++ b/drivers/net/dpaa/dpaa_ethdev.h @@ -160,12 +160,14 @@ struct dpaa_if_stats { uint64_t tund; /**<Tx Undersized */ }; -int __rte_experimental dpaa_eth_eventq_attach(const struct rte_eth_dev *dev, - int eth_rx_queue_id, +int +dpaa_eth_eventq_attach(const struct rte_eth_dev *dev, + int eth_rx_queue_id, u16 ch_id, const struct rte_event_eth_rx_adapter_queue_conf *queue_conf); -int __rte_experimental dpaa_eth_eventq_detach(const struct rte_eth_dev *dev, +int +dpaa_eth_eventq_detach(const struct rte_eth_dev *dev, int eth_rx_queue_id); enum qman_cb_dqrr_result diff --git a/drivers/net/dpaa/rte_pmd_dpaa.h b/drivers/net/dpaa/rte_pmd_dpaa.h index 38405ec..37eea9b 100644 --- a/drivers/net/dpaa/rte_pmd_dpaa.h +++ b/drivers/net/dpaa/rte_pmd_dpaa.h @@ -18,9 +18,6 @@ #include <rte_ethdev_driver.h> /** - * @warning - * @b EXPERIMENTAL: this API may change, or be removed, without prior notice - * * Enable/Disable TX loopback * * @param port @@ -33,7 +30,7 @@ * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int __rte_experimental +int rte_pmd_dpaa_set_tx_loopback(uint8_t port, uint8_t on); #endif /* _PMD_DPAA_H_ */ diff --git a/drivers/net/dpaa/rte_pmd_dpaa_version.map b/drivers/net/dpaa/rte_pmd_dpaa_version.map index c7ad403..8cb4500 100644 --- a/drivers/net/dpaa/rte_pmd_dpaa_version.map +++ b/drivers/net/dpaa/rte_pmd_dpaa_version.map @@ -3,10 +3,10 @@ DPDK_17.11 { local: *; }; -EXPERIMENTAL { +DPDK_18.08 { global: dpaa_eth_eventq_attach; dpaa_eth_eventq_detach; rte_pmd_dpaa_set_tx_loopback; -}; +} DPDK_17.11; -- 2.7.4 ^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [dpdk-dev] [PATCH v2 10/16] net/dpaa: remove experimental tag from PMD APIs 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 10/16] net/dpaa: remove experimental tag from PMD APIs Hemant Agrawal @ 2018-07-06 5:29 ` Shreyansh Jain 0 siblings, 0 replies; 62+ messages in thread From: Shreyansh Jain @ 2018-07-06 5:29 UTC (permalink / raw) To: Hemant Agrawal, dev On Wednesday 04 July 2018 03:13 PM, Hemant Agrawal wrote: > Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> > --- > drivers/net/dpaa/dpaa_ethdev.c | 6 +++--- > drivers/net/dpaa/dpaa_ethdev.h | 8 +++++--- > drivers/net/dpaa/rte_pmd_dpaa.h | 5 +---- > drivers/net/dpaa/rte_pmd_dpaa_version.map | 4 ++-- > 4 files changed, 11 insertions(+), 12 deletions(-) > Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com> ^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH v2 11/16] bus/dpaa: cleanup unnecessary global variables 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 01/16] bus/dpaa: fix phandle support for kernel 4.16 Hemant Agrawal ` (8 preceding siblings ...) 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 10/16] net/dpaa: remove experimental tag from PMD APIs Hemant Agrawal @ 2018-07-04 9:43 ` Hemant Agrawal 2018-07-06 4:36 ` Shreyansh Jain 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 12/16] bus/fslmc: " Hemant Agrawal ` (6 subsequent siblings) 16 siblings, 1 reply; 62+ messages in thread From: Hemant Agrawal @ 2018-07-04 9:43 UTC (permalink / raw) To: dev; +Cc: Pavan Nikhilesh Changes originally in the patch "drivers: cleanup unnecessary global variables" by Pavan. Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> --- drivers/bus/dpaa/base/fman/netcfg_layer.c | 5 ----- drivers/bus/dpaa/base/qbman/bman_driver.c | 4 ++-- drivers/bus/dpaa/base/qbman/qman.c | 2 +- drivers/bus/dpaa/base/qbman/qman_driver.c | 4 ++-- drivers/bus/dpaa/base/qbman/qman_priv.h | 1 - drivers/bus/dpaa/dpaa_bus.c | 2 +- 6 files changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/bus/dpaa/base/fman/netcfg_layer.c b/drivers/bus/dpaa/base/fman/netcfg_layer.c index 3e956ce..031c6f1 100644 --- a/drivers/bus/dpaa/base/fman/netcfg_layer.c +++ b/drivers/bus/dpaa/base/fman/netcfg_layer.c @@ -18,11 +18,6 @@ #include <rte_dpaa_logs.h> #include <netcfg.h> -/* Structure contains information about all the interfaces given by user - * on command line. - */ -struct netcfg_interface *netcfg_interface; - /* This data structure contaings all configurations information * related to usages of DPA devices. */ diff --git a/drivers/bus/dpaa/base/qbman/bman_driver.c b/drivers/bus/dpaa/base/qbman/bman_driver.c index 1381da3..b14b590 100644 --- a/drivers/bus/dpaa/base/qbman/bman_driver.c +++ b/drivers/bus/dpaa/base/qbman/bman_driver.c @@ -15,9 +15,9 @@ /* * Global variables of the max portal/pool number this bman version supported */ -u16 bman_ip_rev; +static u16 bman_ip_rev; u16 bman_pool_max; -void *bman_ccsr_map; +static void *bman_ccsr_map; /*****************/ /* Portal driver */ diff --git a/drivers/bus/dpaa/base/qbman/qman.c b/drivers/bus/dpaa/base/qbman/qman.c index f5fe5ef..7c17027 100644 --- a/drivers/bus/dpaa/base/qbman/qman.c +++ b/drivers/bus/dpaa/base/qbman/qman.c @@ -625,7 +625,7 @@ struct qman_portal *qman_create_portal( #define MAX_GLOBAL_PORTALS 8 static struct qman_portal global_portals[MAX_GLOBAL_PORTALS]; -rte_atomic16_t global_portals_used[MAX_GLOBAL_PORTALS]; +static rte_atomic16_t global_portals_used[MAX_GLOBAL_PORTALS]; static struct qman_portal * qman_alloc_global_portal(void) diff --git a/drivers/bus/dpaa/base/qbman/qman_driver.c b/drivers/bus/dpaa/base/qbman/qman_driver.c index 07b29d5..f6ecd6b 100644 --- a/drivers/bus/dpaa/base/qbman/qman_driver.c +++ b/drivers/bus/dpaa/base/qbman/qman_driver.c @@ -20,9 +20,9 @@ u16 qm_channel_caam = QMAN_CHANNEL_CAAM; u16 qm_channel_pme = QMAN_CHANNEL_PME; /* Ccsr map address to access ccsrbased register */ -void *qman_ccsr_map; +static void *qman_ccsr_map; /* The qman clock frequency */ -u32 qman_clk; +static u32 qman_clk; static __thread int qmfd = -1; static __thread struct qm_portal_config qpcfg; diff --git a/drivers/bus/dpaa/base/qbman/qman_priv.h b/drivers/bus/dpaa/base/qbman/qman_priv.h index 9e4471e..02f6301 100644 --- a/drivers/bus/dpaa/base/qbman/qman_priv.h +++ b/drivers/bus/dpaa/base/qbman/qman_priv.h @@ -139,7 +139,6 @@ struct qm_portal_config { #define QMAN_REV31 0x0301 #define QMAN_REV32 0x0302 extern u16 qman_ip_rev; /* 0 if uninitialised, otherwise QMAN_REVx */ -extern u32 qman_clk; int qm_set_wpm(int wpm); int qm_get_wpm(int *wpm); diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c index 7956bd0..5ba3d28 100644 --- a/drivers/bus/dpaa/dpaa_bus.c +++ b/drivers/bus/dpaa/dpaa_bus.c @@ -50,7 +50,7 @@ struct rte_dpaa_bus rte_dpaa_bus; struct netcfg_info *dpaa_netcfg; /* define a variable to hold the portal_key, once created.*/ -pthread_key_t dpaa_portal_key; +static pthread_key_t dpaa_portal_key; unsigned int dpaa_svr_family; -- 2.7.4 ^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [dpdk-dev] [PATCH v2 11/16] bus/dpaa: cleanup unnecessary global variables 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 11/16] bus/dpaa: cleanup unnecessary global variables Hemant Agrawal @ 2018-07-06 4:36 ` Shreyansh Jain 0 siblings, 0 replies; 62+ messages in thread From: Shreyansh Jain @ 2018-07-06 4:36 UTC (permalink / raw) To: Hemant Agrawal, dev; +Cc: Pavan Nikhilesh On Wednesday 04 July 2018 03:13 PM, Hemant Agrawal wrote: > Changes originally in the patch > "drivers: cleanup unnecessary global variables" by Pavan. The commit message above is not required. It doesn't add much value to the patch itself. > > Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com> > Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> > --- [...] ^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH v2 12/16] bus/fslmc: cleanup unnecessary global variables 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 01/16] bus/dpaa: fix phandle support for kernel 4.16 Hemant Agrawal ` (9 preceding siblings ...) 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 11/16] bus/dpaa: cleanup unnecessary global variables Hemant Agrawal @ 2018-07-04 9:43 ` Hemant Agrawal 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 13/16] drivers: support function name in logs trace Hemant Agrawal ` (5 subsequent siblings) 16 siblings, 0 replies; 62+ messages in thread From: Hemant Agrawal @ 2018-07-04 9:43 UTC (permalink / raw) To: dev; +Cc: Pavan Nikhilesh Changes originally in the patch "drivers: cleanup unnecessary global variables" by Pavan. Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> --- drivers/bus/fslmc/qbman/qbman_portal.c | 3 +-- drivers/bus/fslmc/qbman/qbman_portal.h | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/bus/fslmc/qbman/qbman_portal.c b/drivers/bus/fslmc/qbman/qbman_portal.c index 713ec96..0714500 100644 --- a/drivers/bus/fslmc/qbman/qbman_portal.c +++ b/drivers/bus/fslmc/qbman/qbman_portal.c @@ -122,8 +122,7 @@ struct qbman_swp *qbman_swp_init(const struct qbman_swp_desc *d) p->vdq.valid_bit = QB_VALID_BIT; p->dqrr.next_idx = 0; p->dqrr.valid_bit = QB_VALID_BIT; - qman_version = p->desc.qman_version; - if ((qman_version & 0xFFFF0000) < QMAN_REV_4100) { + if ((p->desc.qman_version & 0xFFFF0000) < QMAN_REV_4100) { p->dqrr.dqrr_size = 4; p->dqrr.reset_bug = 1; } else { diff --git a/drivers/bus/fslmc/qbman/qbman_portal.h b/drivers/bus/fslmc/qbman/qbman_portal.h index 8bff0b4..dbea22a 100644 --- a/drivers/bus/fslmc/qbman/qbman_portal.h +++ b/drivers/bus/fslmc/qbman/qbman_portal.h @@ -7,7 +7,6 @@ #include "qbman_sys.h" #include <fsl_qbman_portal.h> -uint32_t qman_version; #define QMAN_REV_4000 0x04000000 #define QMAN_REV_4100 0x04010000 #define QMAN_REV_4101 0x04010001 -- 2.7.4 ^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH v2 13/16] drivers: support function name in logs trace 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 01/16] bus/dpaa: fix phandle support for kernel 4.16 Hemant Agrawal ` (10 preceding siblings ...) 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 12/16] bus/fslmc: " Hemant Agrawal @ 2018-07-04 9:43 ` Hemant Agrawal 2018-07-06 6:34 ` Shreyansh Jain 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 14/16] net/dpaa: move the push queue set to global init Hemant Agrawal ` (4 subsequent siblings) 16 siblings, 1 reply; 62+ messages in thread From: Hemant Agrawal @ 2018-07-04 9:43 UTC (permalink / raw) To: dev Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> --- drivers/bus/fslmc/fslmc_logs.h | 2 +- drivers/crypto/dpaa2_sec/dpaa2_sec_logs.h | 2 +- drivers/crypto/dpaa_sec/dpaa_sec_log.h | 2 +- drivers/event/dpaa2/dpaa2_eventdev_logs.h | 2 +- drivers/net/dpaa2/dpaa2_pmd_logs.h | 2 +- drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h | 2 +- drivers/raw/dpaa2_qdma/dpaa2_qdma_logs.h | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/bus/fslmc/fslmc_logs.h b/drivers/bus/fslmc/fslmc_logs.h index 9750b8c..dd74cb7 100644 --- a/drivers/bus/fslmc/fslmc_logs.h +++ b/drivers/bus/fslmc/fslmc_logs.h @@ -18,7 +18,7 @@ extern int dpaa2_logtype_bus; rte_log(RTE_LOG_DEBUG, dpaa2_logtype_bus, "fslmc: %s(): " fmt "\n", \ __func__, ##args) -#define BUS_INIT_FUNC_TRACE() DPAA2_BUS_LOG(DEBUG, " >>") +#define BUS_INIT_FUNC_TRACE() DPAA2_BUS_DEBUG(" >>") #define DPAA2_BUS_INFO(fmt, args...) \ DPAA2_BUS_LOG(INFO, fmt, ## args) diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_logs.h b/drivers/crypto/dpaa2_sec/dpaa2_sec_logs.h index 7c1f5e7..8a99044 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_logs.h +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_logs.h @@ -18,7 +18,7 @@ extern int dpaa2_logtype_sec; rte_log(RTE_LOG_DEBUG, dpaa2_logtype_sec, "dpaa2_sec: %s(): " \ fmt "\n", __func__, ##args) -#define PMD_INIT_FUNC_TRACE() DPAA2_SEC_LOG(DEBUG, " >>") +#define PMD_INIT_FUNC_TRACE() DPAA2_SEC_DEBUG(">>") #define DPAA2_SEC_INFO(fmt, args...) \ DPAA2_SEC_LOG(INFO, fmt, ## args) diff --git a/drivers/crypto/dpaa_sec/dpaa_sec_log.h b/drivers/crypto/dpaa_sec/dpaa_sec_log.h index 9784fcb..fb895a8 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec_log.h +++ b/drivers/crypto/dpaa_sec/dpaa_sec_log.h @@ -18,7 +18,7 @@ extern int dpaa_logtype_sec; rte_log(RTE_LOG_DEBUG, dpaa_logtype_sec, "dpaa_sec: %s(): " \ fmt "\n", __func__, ##args) -#define PMD_INIT_FUNC_TRACE() DPAA_SEC_LOG(DEBUG, " >>") +#define PMD_INIT_FUNC_TRACE() DPAA_SEC_DEBUG(" >>") #define DPAA_SEC_INFO(fmt, args...) \ DPAA_SEC_LOG(INFO, fmt, ## args) diff --git a/drivers/event/dpaa2/dpaa2_eventdev_logs.h b/drivers/event/dpaa2/dpaa2_eventdev_logs.h index 48f1abd..a2c2060 100644 --- a/drivers/event/dpaa2/dpaa2_eventdev_logs.h +++ b/drivers/event/dpaa2/dpaa2_eventdev_logs.h @@ -16,7 +16,7 @@ extern int dpaa2_logtype_event; rte_log(RTE_LOG_DEBUG, dpaa2_logtype_event, "dpaa2_event: %s(): " \ fmt "\n", __func__, ##args) -#define EVENTDEV_INIT_FUNC_TRACE() DPAA2_EVENTDEV_LOG(DEBUG, " >>") +#define EVENTDEV_INIT_FUNC_TRACE() DPAA2_EVENTDEV_DEBUG(" >>") #define DPAA2_EVENTDEV_INFO(fmt, args...) \ DPAA2_EVENTDEV_LOG(INFO, fmt, ## args) diff --git a/drivers/net/dpaa2/dpaa2_pmd_logs.h b/drivers/net/dpaa2/dpaa2_pmd_logs.h index 98a4896..c04babd 100644 --- a/drivers/net/dpaa2/dpaa2_pmd_logs.h +++ b/drivers/net/dpaa2/dpaa2_pmd_logs.h @@ -16,7 +16,7 @@ extern int dpaa2_logtype_pmd; rte_log(RTE_LOG_DEBUG, dpaa2_logtype_pmd, "dpaa2_net: %s(): "\ fmt "\n", __func__, ##args) -#define PMD_INIT_FUNC_TRACE() DPAA2_PMD_LOG(DEBUG, " >>") +#define PMD_INIT_FUNC_TRACE() DPAA2_PMD_DEBUG(">>") #define DPAA2_PMD_CRIT(fmt, args...) \ DPAA2_PMD_LOG(CRIT, fmt, ## args) diff --git a/drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h b/drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h index 598a621..8991e83 100644 --- a/drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h +++ b/drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h @@ -19,7 +19,7 @@ extern int dpaa2_cmdif_logtype; rte_log(RTE_LOG_DEBUG, dpaa2_cmdif_logtype, "dpaa2_cmdif: %s(): " \ fmt "\n", __func__, ## args) -#define DPAA2_CMDIF_FUNC_TRACE() DPAA2_CMDIF_LOG(DEBUG, ">>") +#define DPAA2_CMDIF_FUNC_TRACE() DPAA2_CMDIF_DEBUG(">>") #define DPAA2_CMDIF_INFO(fmt, args...) \ DPAA2_CMDIF_LOG(INFO, fmt, ## args) diff --git a/drivers/raw/dpaa2_qdma/dpaa2_qdma_logs.h b/drivers/raw/dpaa2_qdma/dpaa2_qdma_logs.h index fafe352..4779e4c 100644 --- a/drivers/raw/dpaa2_qdma/dpaa2_qdma_logs.h +++ b/drivers/raw/dpaa2_qdma/dpaa2_qdma_logs.h @@ -19,7 +19,7 @@ extern int dpaa2_qdma_logtype; rte_log(RTE_LOG_DEBUG, dpaa2_qdma_logtype, "dpaa2_qdma: %s(): " \ fmt "\n", __func__, ## args) -#define DPAA2_QDMA_FUNC_TRACE() DPAA2_QDMA_LOG(DEBUG, ">>") +#define DPAA2_QDMA_FUNC_TRACE() DPAA2_QDMA_DEBUG(">>") #define DPAA2_QDMA_INFO(fmt, args...) \ DPAA2_QDMA_LOG(INFO, fmt, ## args) -- 2.7.4 ^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [dpdk-dev] [PATCH v2 13/16] drivers: support function name in logs trace 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 13/16] drivers: support function name in logs trace Hemant Agrawal @ 2018-07-06 6:34 ` Shreyansh Jain 0 siblings, 0 replies; 62+ messages in thread From: Shreyansh Jain @ 2018-07-06 6:34 UTC (permalink / raw) To: Hemant Agrawal, dev On Wednesday 04 July 2018 03:13 PM, Hemant Agrawal wrote: > Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> > --- > drivers/bus/fslmc/fslmc_logs.h | 2 +- > drivers/crypto/dpaa2_sec/dpaa2_sec_logs.h | 2 +- > drivers/crypto/dpaa_sec/dpaa_sec_log.h | 2 +- > drivers/event/dpaa2/dpaa2_eventdev_logs.h | 2 +- > drivers/net/dpaa2/dpaa2_pmd_logs.h | 2 +- > drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h | 2 +- > drivers/raw/dpaa2_qdma/dpaa2_qdma_logs.h | 2 +- > 7 files changed, 7 insertions(+), 7 deletions(-) > Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com> ^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH v2 14/16] net/dpaa: move the push queue set to global init 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 01/16] bus/dpaa: fix phandle support for kernel 4.16 Hemant Agrawal ` (11 preceding siblings ...) 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 13/16] drivers: support function name in logs trace Hemant Agrawal @ 2018-07-04 9:43 ` Hemant Agrawal 2018-07-06 6:35 ` Shreyansh Jain 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 15/16] bus/dpaa: add support for SG config Hemant Agrawal ` (3 subsequent siblings) 16 siblings, 1 reply; 62+ messages in thread From: Hemant Agrawal @ 2018-07-04 9:43 UTC (permalink / raw) To: dev Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> --- drivers/net/dpaa/dpaa_ethdev.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 00611f8..5c0aafb 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -1174,16 +1174,6 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev) } - /* if push mode queues to be enabled. Currenly we are allowing only - * one queue per thread. - */ - if (getenv("DPAA_PUSH_QUEUES_NUMBER")) { - dpaa_push_mode_max_queue = - atoi(getenv("DPAA_PUSH_QUEUES_NUMBER")); - if (dpaa_push_mode_max_queue > DPAA_MAX_PUSH_MODE_QUEUE) - dpaa_push_mode_max_queue = DPAA_MAX_PUSH_MODE_QUEUE; - } - /* Each device can not have more than DPAA_MAX_NUM_PCD_QUEUES RX * queues. */ @@ -1424,6 +1414,20 @@ rte_dpaa_probe(struct rte_dpaa_driver *dpaa_drv, default_q = 1; } + /* disabling the default push mode for LS1043 */ + if (dpaa_svr_family == SVR_LS1043A_FAMILY) + dpaa_push_mode_max_queue = 0; + + /* if push mode queues to be enabled. Currenly we are allowing + * only one queue per thread. + */ + if (getenv("DPAA_PUSH_QUEUES_NUMBER")) { + dpaa_push_mode_max_queue = + atoi(getenv("DPAA_PUSH_QUEUES_NUMBER")); + if (dpaa_push_mode_max_queue > DPAA_MAX_PUSH_MODE_QUEUE) + dpaa_push_mode_max_queue = DPAA_MAX_PUSH_MODE_QUEUE; + } + is_global_init = 1; } -- 2.7.4 ^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [dpdk-dev] [PATCH v2 14/16] net/dpaa: move the push queue set to global init 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 14/16] net/dpaa: move the push queue set to global init Hemant Agrawal @ 2018-07-06 6:35 ` Shreyansh Jain 0 siblings, 0 replies; 62+ messages in thread From: Shreyansh Jain @ 2018-07-06 6:35 UTC (permalink / raw) To: Hemant Agrawal; +Cc: dev On Wednesday 04 July 2018 03:13 PM, Hemant Agrawal wrote: > Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> > --- > drivers/net/dpaa/dpaa_ethdev.c | 24 ++++++++++++++---------- > 1 file changed, 14 insertions(+), 10 deletions(-) Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com> ^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH v2 15/16] bus/dpaa: add support for SG config 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 01/16] bus/dpaa: fix phandle support for kernel 4.16 Hemant Agrawal ` (12 preceding siblings ...) 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 14/16] net/dpaa: move the push queue set to global init Hemant Agrawal @ 2018-07-04 9:43 ` Hemant Agrawal 2018-07-06 4:38 ` Shreyansh Jain 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 16/16] net/dpaa: implement scatter offload support Hemant Agrawal ` (2 subsequent siblings) 16 siblings, 1 reply; 62+ messages in thread From: Hemant Agrawal @ 2018-07-04 9:43 UTC (permalink / raw) To: dev Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> --- drivers/bus/dpaa/base/fman/fman_hw.c | 42 +++++++++++++++++++++++++++++++ drivers/bus/dpaa/include/fsl_fman.h | 6 +++++ drivers/bus/dpaa/rte_bus_dpaa_version.map | 2 ++ 3 files changed, 50 insertions(+) diff --git a/drivers/bus/dpaa/base/fman/fman_hw.c b/drivers/bus/dpaa/base/fman/fman_hw.c index 7ada7fa..4ebbc3d 100644 --- a/drivers/bus/dpaa/base/fman/fman_hw.c +++ b/drivers/bus/dpaa/base/fman/fman_hw.c @@ -16,6 +16,7 @@ #include <fsl_fman_crc64.h> #include <fsl_bman.h> +#define FMAN_SP_SG_DISABLE 0x80000000 #define FMAN_SP_EXT_BUF_MARG_START_SHIFT 16 /* Instantiate the global variable that the inline CRC64 implementation (in @@ -538,6 +539,47 @@ fman_if_get_maxfrm(struct fman_if *fm_if) return (in_be32(reg_maxfrm) | 0x0000FFFF); } +/* MSB in fmbm_rebm register + * 0 - If BMI cannot store the frame in a single buffer it may select a buffer + * of smaller size and store the frame in scatter gather (S/G) buffers + * 1 - Scatter gather format is not enabled for frame storage. If BMI cannot + * store the frame in a single buffer, the frame is discarded. + */ + +int +fman_if_get_sg_enable(struct fman_if *fm_if) +{ + u32 fmbm_rebm; + + struct __fman_if *__if = container_of(fm_if, struct __fman_if, __if); + + assert(fman_ccsr_map_fd != -1); + + fmbm_rebm = in_be32(&((struct rx_bmi_regs *)__if->bmi_map)->fmbm_rebm); + + return (fmbm_rebm & FMAN_SP_SG_DISABLE) ? 0 : 1; +} + +void +fman_if_set_sg(struct fman_if *fm_if, int enable) +{ + struct __fman_if *__if = container_of(fm_if, struct __fman_if, __if); + unsigned int *fmbm_rebm; + int val; + int fmbm_mask = FMAN_SP_SG_DISABLE; + + if (enable) + val = 0; + else + val = FMAN_SP_SG_DISABLE; + + assert(fman_ccsr_map_fd != -1); + + fmbm_rebm = &((struct rx_bmi_regs *)__if->bmi_map)->fmbm_rebm; + + out_be32(fmbm_rebm, (in_be32(fmbm_rebm) & ~fmbm_mask) | val); +} + void fman_if_set_dnia(struct fman_if *fm_if, uint32_t nia) { diff --git a/drivers/bus/dpaa/include/fsl_fman.h b/drivers/bus/dpaa/include/fsl_fman.h index c0ef1bf..1d1ce86 100644 --- a/drivers/bus/dpaa/include/fsl_fman.h +++ b/drivers/bus/dpaa/include/fsl_fman.h @@ -108,6 +108,12 @@ int fman_if_get_fdoff(struct fman_if *fm_if); /* Set interface fd->offset value */ void fman_if_set_fdoff(struct fman_if *fm_if, uint32_t fd_offset); +/* Get interface SG enable status value */ +int fman_if_get_sg_enable(struct fman_if *fm_if); + +/* Set interface SG support mode */ +void fman_if_set_sg(struct fman_if *fm_if, int enable); + /* Get interface Max Frame length (MTU) */ uint16_t fman_if_get_maxfrm(struct fman_if *fm_if); diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map b/drivers/bus/dpaa/rte_bus_dpaa_version.map index e00c911..fcfbb47 100644 --- a/drivers/bus/dpaa/rte_bus_dpaa_version.map +++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map @@ -70,6 +70,8 @@ DPDK_18.02 { dpaa_logtype_eventdev; dpaa_svr_family; + fman_if_get_sg_enable; + fman_if_set_sg; per_lcore_dpaa_io; per_lcore_held_bufs; qm_channel_pool1; -- 2.7.4 ^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [dpdk-dev] [PATCH v2 15/16] bus/dpaa: add support for SG config 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 15/16] bus/dpaa: add support for SG config Hemant Agrawal @ 2018-07-06 4:38 ` Shreyansh Jain 0 siblings, 0 replies; 62+ messages in thread From: Shreyansh Jain @ 2018-07-06 4:38 UTC (permalink / raw) To: Hemant Agrawal; +Cc: dev On Wednesday 04 July 2018 03:13 PM, Hemant Agrawal wrote: > Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> > --- > drivers/bus/dpaa/base/fman/fman_hw.c | 42 +++++++++++++++++++++++++++++++ > drivers/bus/dpaa/include/fsl_fman.h | 6 +++++ > drivers/bus/dpaa/rte_bus_dpaa_version.map | 2 ++ > 3 files changed, 50 insertions(+) > [...] > > diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map b/drivers/bus/dpaa/rte_bus_dpaa_version.map > index e00c911..fcfbb47 100644 > --- a/drivers/bus/dpaa/rte_bus_dpaa_version.map > +++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map > @@ -70,6 +70,8 @@ DPDK_18.02 { > > dpaa_logtype_eventdev; > dpaa_svr_family; > + fman_if_get_sg_enable; > + fman_if_set_sg; These should be added to a new version block for 18.08 > per_lcore_dpaa_io; > per_lcore_held_bufs; > qm_channel_pool1; > ^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH v2 16/16] net/dpaa: implement scatter offload support 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 01/16] bus/dpaa: fix phandle support for kernel 4.16 Hemant Agrawal ` (13 preceding siblings ...) 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 15/16] bus/dpaa: add support for SG config Hemant Agrawal @ 2018-07-04 9:43 ` Hemant Agrawal 2018-07-06 6:41 ` Shreyansh Jain 2018-07-04 10:59 ` [dpdk-dev] [PATCH v2 01/16] bus/dpaa: fix phandle support for kernel 4.16 Shreyansh Jain 2018-07-06 8:09 ` [dpdk-dev] [PATCH v3 " Hemant Agrawal 16 siblings, 1 reply; 62+ messages in thread From: Hemant Agrawal @ 2018-07-04 9:43 UTC (permalink / raw) To: dev Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> --- drivers/net/dpaa/dpaa_ethdev.c | 75 +++++++++++++++++++++++++++++++++++++----- drivers/net/dpaa/dpaa_ethdev.h | 3 +- drivers/net/dpaa/dpaa_rxtx.c | 4 +-- drivers/net/dpaa/dpaa_rxtx.h | 2 -- 4 files changed, 70 insertions(+), 14 deletions(-) diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 5c0aafb..c49d3a5 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -47,7 +47,8 @@ /* Supported Rx offloads */ static uint64_t dev_rx_offloads_sup = - DEV_RX_OFFLOAD_JUMBO_FRAME; + DEV_RX_OFFLOAD_JUMBO_FRAME | + DEV_RX_OFFLOAD_SCATTER; /* Rx offloads which cannot be disabled */ static uint64_t dev_rx_offloads_nodis = @@ -55,8 +56,7 @@ static uint64_t dev_rx_offloads_nodis = DEV_RX_OFFLOAD_UDP_CKSUM | DEV_RX_OFFLOAD_TCP_CKSUM | DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM | - DEV_RX_OFFLOAD_CRC_STRIP | - DEV_RX_OFFLOAD_SCATTER; + DEV_RX_OFFLOAD_CRC_STRIP; /* Supported Tx offloads */ static uint64_t dev_tx_offloads_sup; @@ -148,11 +148,30 @@ dpaa_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) struct dpaa_if *dpaa_intf = dev->data->dev_private; uint32_t frame_size = mtu + ETHER_HDR_LEN + ETHER_CRC_LEN + VLAN_TAG_SIZE; + uint32_t buffsz = dev->data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM; PMD_INIT_FUNC_TRACE(); if (mtu < ETHER_MIN_MTU || frame_size > DPAA_MAX_RX_PKT_LEN) return -EINVAL; + /* + * Refuse mtu that requires the support of scattered packets + * when this feature has not been enabled before. + */ + if (dev->data->min_rx_buf_size && + !dev->data->scattered_rx && frame_size > buffsz) { + DPAA_PMD_ERR("SG not enabled, will not fit in one buffer"); + return -EINVAL; + } + + /* check <seg size> * <max_seg> >= max_frame */ + if (dev->data->min_rx_buf_size && dev->data->scattered_rx && + (frame_size > buffsz * DPAA_SGT_MAX_ENTRIES)) { + DPAA_PMD_ERR("Too big to fit for Max SG list %d", + buffsz * DPAA_SGT_MAX_ENTRIES); + return -EINVAL; + } + if (frame_size > ETHER_MAX_LEN) dev->data->dev_conf.rxmode.offloads &= DEV_RX_OFFLOAD_JUMBO_FRAME; @@ -196,13 +215,24 @@ dpaa_eth_dev_configure(struct rte_eth_dev *dev) if (rx_offloads & DEV_RX_OFFLOAD_JUMBO_FRAME) { if (dev->data->dev_conf.rxmode.max_rx_pkt_len <= DPAA_MAX_RX_PKT_LEN) { + DPAA_PMD_DEBUG("enabling jumbo"); fman_if_set_maxfrm(dpaa_intf->fif, dev->data->dev_conf.rxmode.max_rx_pkt_len); - return 0; + dev->data->mtu = + dev->data->dev_conf.rxmode.max_rx_pkt_len - + ETHER_HDR_LEN - ETHER_CRC_LEN - VLAN_TAG_SIZE; } else { - return -1; + DPAA_PMD_ERR("enabling jumbo err conf max len=%d " + "supported is %d", + dev->data->dev_conf.rxmode.max_rx_pkt_len, + DPAA_MAX_RX_PKT_LEN); } } + if (rx_offloads & DEV_RX_OFFLOAD_JUMBO_FRAME) { + DPAA_PMD_DEBUG("enabling scatter mode"); + fman_if_set_sg(dpaa_intf->fif, 1); + dev->data->scattered_rx = 1; + } return 0; } @@ -300,7 +330,6 @@ static void dpaa_eth_dev_info(struct rte_eth_dev *dev, dev_info->max_rx_queues = dpaa_intf->nb_rx_queues; dev_info->max_tx_queues = dpaa_intf->nb_tx_queues; - dev_info->min_rx_bufsize = DPAA_MIN_RX_BUF_SIZE; dev_info->max_rx_pktlen = DPAA_MAX_RX_PKT_LEN; dev_info->max_mac_addrs = DPAA_MAX_MAC_FILTER; dev_info->max_hash_mac_addrs = 0; @@ -514,6 +543,7 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, struct qm_mcc_initfq opts = {0}; u32 flags = 0; int ret; + u32 buffsz = rte_pktmbuf_data_room_size(mp) - RTE_PKTMBUF_HEADROOM; PMD_INIT_FUNC_TRACE(); @@ -527,6 +557,27 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, DPAA_PMD_INFO("Rx queue setup for queue index: %d fq_id (0x%x)", queue_idx, rxq->fqid); + /* Max packet can fit in single buffer */ + if (dev->data->dev_conf.rxmode.max_rx_pkt_len <= buffsz) { + ; + } else if (dev->data->dev_conf.rxmode.enable_scatter) { + if (dev->data->dev_conf.rxmode.max_rx_pkt_len > + buffsz * DPAA_SGT_MAX_ENTRIES) { + DPAA_PMD_ERR("max RxPkt size %d too big to fit " + "MaxSGlist %d", + dev->data->dev_conf.rxmode.max_rx_pkt_len, + buffsz * DPAA_SGT_MAX_ENTRIES); + rte_errno = EOVERFLOW; + return -rte_errno; + } + } else { + DPAA_PMD_WARN("The requested maximum Rx packet size (%u) is" + " larger than a single mbuf (%u) and scattered" + " mode has not been requested", + dev->data->dev_conf.rxmode.max_rx_pkt_len, + buffsz - RTE_PKTMBUF_HEADROOM); + } + if (!dpaa_intf->bp_info || dpaa_intf->bp_info->mp != mp) { struct fman_if_ic_params icp; uint32_t fd_offset; @@ -553,10 +604,13 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, fman_if_set_bp(dpaa_intf->fif, mp->size, dpaa_intf->bp_info->bpid, bp_size); dpaa_intf->valid = 1; - DPAA_PMD_INFO("if =%s - fd_offset = %d offset = %d", - dpaa_intf->name, fd_offset, - fman_if_get_fdoff(dpaa_intf->fif)); + DPAA_PMD_DEBUG("if:%s fd_offset = %d offset = %d", + dpaa_intf->name, fd_offset, + fman_if_get_fdoff(dpaa_intf->fif)); } + DPAA_PMD_DEBUG("if:%s sg_on = %d, max_frm =%d", dpaa_intf->name, + fman_if_get_sg_enable(dpaa_intf->fif), + dev->data->dev_conf.rxmode.max_rx_pkt_len); /* checking if push mode only, no error check for now */ if (dpaa_push_mode_max_queue > dpaa_push_queue_idx) { dpaa_push_queue_idx++; @@ -1304,6 +1358,9 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev) fman_if_reset_mcast_filter_table(fman_intf); /* Reset interface statistics */ fman_if_stats_reset(fman_intf); + /* Disable SG by default */ + fman_if_set_sg(fman_intf, 0); + fman_if_set_maxfrm(fman_intf, ETHER_MAX_LEN + VLAN_TAG_SIZE); return 0; diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h index c79b9f8..1e7a656 100644 --- a/drivers/net/dpaa/dpaa_ethdev.h +++ b/drivers/net/dpaa/dpaa_ethdev.h @@ -39,9 +39,10 @@ /* Alignment to use for cpu-local structs to avoid coherency problems. */ #define MAX_CACHELINE 64 -#define DPAA_MIN_RX_BUF_SIZE 512 #define DPAA_MAX_RX_PKT_LEN 10240 +#define DPAA_SGT_MAX_ENTRIES 16 /* maximum number of entries in SG Table */ + /* RX queue tail drop threshold (CGR Based) in frame count */ #define CGR_RX_PERFQ_THRESH 256 diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c index 168b77e..6e96a80 100644 --- a/drivers/net/dpaa/dpaa_rxtx.c +++ b/drivers/net/dpaa/dpaa_rxtx.c @@ -306,8 +306,6 @@ dpaa_eth_sg_to_mbuf(const struct qm_fd *fd, uint32_t ifid) int i = 0; uint8_t fd_offset = fd->offset; - DPAA_DP_LOG(DEBUG, "Received an SG frame"); - vaddr = DPAA_MEMPOOL_PTOV(bp_info, qm_fd_addr(fd)); if (!vaddr) { DPAA_PMD_ERR("unable to convert physical address"); @@ -349,6 +347,8 @@ dpaa_eth_sg_to_mbuf(const struct qm_fd *fd, uint32_t ifid) } prev_seg = cur_seg; } + DPAA_DP_LOG(DEBUG, "Received an SG frame len =%d, num_sg =%d", + first_seg->pkt_len, first_seg->nb_segs); dpaa_eth_packet_info(first_seg, vaddr); rte_pktmbuf_free_seg(temp); diff --git a/drivers/net/dpaa/dpaa_rxtx.h b/drivers/net/dpaa/dpaa_rxtx.h index d3e6351..6de70a7 100644 --- a/drivers/net/dpaa/dpaa_rxtx.h +++ b/drivers/net/dpaa/dpaa_rxtx.h @@ -32,8 +32,6 @@ /* L4 Type field: TCP */ #define DPAA_L4_PARSE_RESULT_TCP 0x20 -#define DPAA_SGT_MAX_ENTRIES 16 /* maximum number of entries in SG Table */ - #define DPAA_MAX_DEQUEUE_NUM_FRAMES 63 /** <Maximum number of frames to be dequeued in a single rx call*/ -- 2.7.4 ^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [dpdk-dev] [PATCH v2 16/16] net/dpaa: implement scatter offload support 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 16/16] net/dpaa: implement scatter offload support Hemant Agrawal @ 2018-07-06 6:41 ` Shreyansh Jain 0 siblings, 0 replies; 62+ messages in thread From: Shreyansh Jain @ 2018-07-06 6:41 UTC (permalink / raw) To: Hemant Agrawal; +Cc: dev On Wednesday 04 July 2018 03:13 PM, Hemant Agrawal wrote: > Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> > --- > drivers/net/dpaa/dpaa_ethdev.c | 75 +++++++++++++++++++++++++++++++++++++----- > drivers/net/dpaa/dpaa_ethdev.h | 3 +- > drivers/net/dpaa/dpaa_rxtx.c | 4 +-- > drivers/net/dpaa/dpaa_rxtx.h | 2 -- > 4 files changed, 70 insertions(+), 14 deletions(-) > Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com> ^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [dpdk-dev] [PATCH v2 01/16] bus/dpaa: fix phandle support for kernel 4.16 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 01/16] bus/dpaa: fix phandle support for kernel 4.16 Hemant Agrawal ` (14 preceding siblings ...) 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 16/16] net/dpaa: implement scatter offload support Hemant Agrawal @ 2018-07-04 10:59 ` Shreyansh Jain 2018-07-06 8:09 ` [dpdk-dev] [PATCH v3 " Hemant Agrawal 16 siblings, 0 replies; 62+ messages in thread From: Shreyansh Jain @ 2018-07-04 10:59 UTC (permalink / raw) To: Hemant Agrawal, dev; +Cc: Alok Makhariya, stable > -----Original Message----- > From: Hemant Agrawal > Sent: Wednesday, July 4, 2018 3:14 PM > To: dev@dpdk.org > Cc: Alok Makhariya <alok.makhariya@nxp.com>; Shreyansh Jain > <shreyansh.jain@nxp.com>; stable@dpdk.org > Subject: [PATCH v2 01/16] bus/dpaa: fix phandle support for kernel 4.16 > > From: Alok Makhariya <alok.makhariya@nxp.com> > > Fixes: 2183c6f69d7e ("bus/dpaa: add OF parser for device scanning") > Cc: Shreyansh Jain <shreyansh.jain@nxp.com> > Cc: stable@dpdk.org > > Signed-off-by: Alok Makhariya <alok.makhariya@nxp.com> > --- > drivers/bus/dpaa/base/fman/of.c | 5 +++++ > 1 file changed, 5 insertions(+) > Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com> ^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH v3 01/16] bus/dpaa: fix phandle support for kernel 4.16 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 01/16] bus/dpaa: fix phandle support for kernel 4.16 Hemant Agrawal ` (15 preceding siblings ...) 2018-07-04 10:59 ` [dpdk-dev] [PATCH v2 01/16] bus/dpaa: fix phandle support for kernel 4.16 Shreyansh Jain @ 2018-07-06 8:09 ` Hemant Agrawal 2018-07-06 8:09 ` [dpdk-dev] [PATCH v3 02/16] bus/dpaa: fix svr id fetch location Hemant Agrawal ` (15 more replies) 16 siblings, 16 replies; 62+ messages in thread From: Hemant Agrawal @ 2018-07-06 8:09 UTC (permalink / raw) To: dev; +Cc: shreyansh.jain, Alok Makhariya, stable From: Alok Makhariya <alok.makhariya@nxp.com> Fixes: 2183c6f69d7e ("bus/dpaa: add OF parser for device scanning") Cc: Shreyansh Jain <shreyansh.jain@nxp.com> Cc: stable@dpdk.org Signed-off-by: Alok Makhariya <alok.makhariya@nxp.com> Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com> --- drivers/bus/dpaa/base/fman/of.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/bus/dpaa/base/fman/of.c b/drivers/bus/dpaa/base/fman/of.c index 1b2dbe2..eb55cb9 100644 --- a/drivers/bus/dpaa/base/fman/of.c +++ b/drivers/bus/dpaa/base/fman/of.c @@ -182,6 +182,11 @@ linear_dir(struct dt_dir *d) DPAA_BUS_LOG(DEBUG, "Duplicate lphandle in %s", d->node.node.full_name); d->lphandle = f; + } else if (!strcmp(f->node.node.name, "phandle")) { + if (d->lphandle) + DPAA_BUS_LOG(DEBUG, "Duplicate lphandle in %s", + d->node.node.full_name); + d->lphandle = f; } else if (!strcmp(f->node.node.name, "#address-cells")) { if (d->a_cells) DPAA_BUS_LOG(DEBUG, "Duplicate a_cells in %s", -- 2.7.4 ^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH v3 02/16] bus/dpaa: fix svr id fetch location 2018-07-06 8:09 ` [dpdk-dev] [PATCH v3 " Hemant Agrawal @ 2018-07-06 8:09 ` Hemant Agrawal 2018-07-06 8:10 ` [dpdk-dev] [PATCH v3 03/16] bus/dpaa: fix the buffer offset setting in FMAN Hemant Agrawal ` (14 subsequent siblings) 15 siblings, 0 replies; 62+ messages in thread From: Hemant Agrawal @ 2018-07-06 8:09 UTC (permalink / raw) To: dev; +Cc: shreyansh.jain, stable Otherwise the SVR may not be avilable for dpaa init. Fixes: 3b59b73dea08 ("bus/dpaa: update platform SoC value register routines") Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com> --- drivers/bus/dpaa/dpaa_bus.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c index 2046206..7956bd0 100644 --- a/drivers/bus/dpaa/dpaa_bus.c +++ b/drivers/bus/dpaa/dpaa_bus.c @@ -539,6 +539,13 @@ rte_dpaa_bus_probe(void) unsigned int svr_ver; int probe_all = rte_dpaa_bus.bus.conf.scan_mode != RTE_BUS_SCAN_WHITELIST; + svr_file = fopen(DPAA_SOC_ID_FILE, "r"); + if (svr_file) { + if (fscanf(svr_file, "svr:%x", &svr_ver) > 0) + dpaa_svr_family = svr_ver & SVR_MASK; + fclose(svr_file); + } + /* For each registered driver, and device, call the driver->probe */ TAILQ_FOREACH(dev, &rte_dpaa_bus.device_list, next) { TAILQ_FOREACH(drv, &rte_dpaa_bus.driver_list, next) { @@ -569,13 +576,6 @@ rte_dpaa_bus_probe(void) if (!TAILQ_EMPTY(&rte_dpaa_bus.device_list)) rte_mbuf_set_platform_mempool_ops(DPAA_MEMPOOL_OPS_NAME); - svr_file = fopen(DPAA_SOC_ID_FILE, "r"); - if (svr_file) { - if (fscanf(svr_file, "svr:%x", &svr_ver) > 0) - dpaa_svr_family = svr_ver & SVR_MASK; - fclose(svr_file); - } - return 0; } -- 2.7.4 ^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH v3 03/16] bus/dpaa: fix the buffer offset setting in FMAN 2018-07-06 8:09 ` [dpdk-dev] [PATCH v3 " Hemant Agrawal 2018-07-06 8:09 ` [dpdk-dev] [PATCH v3 02/16] bus/dpaa: fix svr id fetch location Hemant Agrawal @ 2018-07-06 8:10 ` Hemant Agrawal 2018-07-06 12:28 ` Shreyansh Jain 2018-07-06 8:10 ` [dpdk-dev] [PATCH v3 04/16] net/dpaa: fix the queue err handling and logs Hemant Agrawal ` (13 subsequent siblings) 15 siblings, 1 reply; 62+ messages in thread From: Hemant Agrawal @ 2018-07-06 8:10 UTC (permalink / raw) To: dev; +Cc: shreyansh.jain, stable The buffer offset was incorrectly being set at 64, thus not honoring the packet headroom. Fixes: 6d6b4f49a155 (bus/dpaa: add FMAN hardware operations") Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> --- drivers/bus/dpaa/base/fman/fman_hw.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/drivers/bus/dpaa/base/fman/fman_hw.c b/drivers/bus/dpaa/base/fman/fman_hw.c index 0148b98..7ada7fa 100644 --- a/drivers/bus/dpaa/base/fman/fman_hw.c +++ b/drivers/bus/dpaa/base/fman/fman_hw.c @@ -16,6 +16,8 @@ #include <fsl_fman_crc64.h> #include <fsl_bman.h> +#define FMAN_SP_EXT_BUF_MARG_START_SHIFT 16 + /* Instantiate the global variable that the inline CRC64 implementation (in * <fsl_fman.h>) depends on. */ @@ -422,20 +424,16 @@ fman_if_set_fc_quanta(struct fman_if *fm_if, u16 pause_quanta) int fman_if_get_fdoff(struct fman_if *fm_if) { - u32 fmbm_ricp; + u32 fmbm_rebm; int fdoff; - int iceof_mask = 0x001f0000; - int icsz_mask = 0x0000001f; struct __fman_if *__if = container_of(fm_if, struct __fman_if, __if); assert(fman_ccsr_map_fd != -1); - fmbm_ricp = - in_be32(&((struct rx_bmi_regs *)__if->bmi_map)->fmbm_ricp); - /*iceof + icsz*/ - fdoff = ((fmbm_ricp & iceof_mask) >> 16) * 16 + - (fmbm_ricp & icsz_mask) * 16; + fmbm_rebm = in_be32(&((struct rx_bmi_regs *)__if->bmi_map)->fmbm_rebm); + + fdoff = (fmbm_rebm >> FMAN_SP_EXT_BUF_MARG_START_SHIFT) & 0x1ff; return fdoff; } @@ -502,12 +500,16 @@ fman_if_set_fdoff(struct fman_if *fm_if, uint32_t fd_offset) { struct __fman_if *__if = container_of(fm_if, struct __fman_if, __if); unsigned int *fmbm_rebm; + int val = 0; + int fmbm_mask = 0x01ff0000; + + val = fd_offset << FMAN_SP_EXT_BUF_MARG_START_SHIFT; assert(fman_ccsr_map_fd != -1); fmbm_rebm = &((struct rx_bmi_regs *)__if->bmi_map)->fmbm_rebm; - out_be32(fmbm_rebm, in_be32(fmbm_rebm) | (fd_offset << 16)); + out_be32(fmbm_rebm, (in_be32(fmbm_rebm) & ~fmbm_mask) | val); } void -- 2.7.4 ^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [dpdk-dev] [PATCH v3 03/16] bus/dpaa: fix the buffer offset setting in FMAN 2018-07-06 8:10 ` [dpdk-dev] [PATCH v3 03/16] bus/dpaa: fix the buffer offset setting in FMAN Hemant Agrawal @ 2018-07-06 12:28 ` Shreyansh Jain 0 siblings, 0 replies; 62+ messages in thread From: Shreyansh Jain @ 2018-07-06 12:28 UTC (permalink / raw) To: Hemant Agrawal, dev; +Cc: stable On Friday 06 July 2018 01:40 PM, Hemant Agrawal wrote: > The buffer offset was incorrectly being set at 64, > thus not honoring the packet headroom. > > Fixes: 6d6b4f49a155 (bus/dpaa: add FMAN hardware operations") > Cc: stable@dpdk.org > > Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> > --- Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com> ^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH v3 04/16] net/dpaa: fix the queue err handling and logs 2018-07-06 8:09 ` [dpdk-dev] [PATCH v3 " Hemant Agrawal 2018-07-06 8:09 ` [dpdk-dev] [PATCH v3 02/16] bus/dpaa: fix svr id fetch location Hemant Agrawal 2018-07-06 8:10 ` [dpdk-dev] [PATCH v3 03/16] bus/dpaa: fix the buffer offset setting in FMAN Hemant Agrawal @ 2018-07-06 8:10 ` Hemant Agrawal 2018-07-06 8:10 ` [dpdk-dev] [PATCH v3 05/16] net/dpaa2: fix the prefetch Rx to honor nb pkts Hemant Agrawal ` (12 subsequent siblings) 15 siblings, 0 replies; 62+ messages in thread From: Hemant Agrawal @ 2018-07-06 8:10 UTC (permalink / raw) To: dev; +Cc: shreyansh.jain, stable Fixes: 5e7455931442 ("net/dpaa: support Rx queue configurations with eventdev") Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com> --- drivers/net/dpaa/dpaa_ethdev.c | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index d014a11..79ba6bd 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -516,7 +516,15 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, PMD_INIT_FUNC_TRACE(); - DPAA_PMD_INFO("Rx queue setup for queue index: %d", queue_idx); + if (queue_idx >= dev->data->nb_rx_queues) { + rte_errno = EOVERFLOW; + DPAA_PMD_ERR("%p: queue index out of range (%u >= %u)", + (void *)dev, queue_idx, dev->data->nb_rx_queues); + return -rte_errno; + } + + DPAA_PMD_INFO("Rx queue setup for queue index: %d fq_id (0x%x)", + queue_idx, rxq->fqid); if (!dpaa_intf->bp_info || dpaa_intf->bp_info->mp != mp) { struct fman_if_ic_params icp; @@ -580,9 +588,11 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, opts.fqd.fq_ctrl |= QM_FQCTRL_CGE; } ret = qman_init_fq(rxq, flags, &opts); - if (ret) - DPAA_PMD_ERR("Channel/Queue association failed. fqid %d" - " ret: %d", rxq->fqid, ret); + if (ret) { + DPAA_PMD_ERR("Channel/Q association failed. fqid 0x%x " + "ret:%d(%s)", rxq->fqid, ret, strerror(ret)); + return ret; + } rxq->cb.dqrr_dpdk_pull_cb = dpaa_rx_cb; rxq->cb.dqrr_prepare = dpaa_rx_cb_prepare; rxq->is_static = true; @@ -657,8 +667,8 @@ dpaa_eth_eventq_attach(const struct rte_eth_dev *dev, ret = qman_init_fq(rxq, flags, &opts); if (ret) { - DPAA_PMD_ERR("Channel/Queue association failed. fqid %d ret:%d", - rxq->fqid, ret); + DPAA_PMD_ERR("Ev-Channel/Q association failed. fqid 0x%x " + "ret:%d(%s)", rxq->fqid, ret, strerror(ret)); return ret; } @@ -715,7 +725,15 @@ int dpaa_eth_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, PMD_INIT_FUNC_TRACE(); - DPAA_PMD_INFO("Tx queue setup for queue index: %d", queue_idx); + if (queue_idx >= dev->data->nb_tx_queues) { + rte_errno = EOVERFLOW; + DPAA_PMD_ERR("%p: queue index out of range (%u >= %u)", + (void *)dev, queue_idx, dev->data->nb_tx_queues); + return -rte_errno; + } + + DPAA_PMD_INFO("Tx queue setup for queue index: %d fq_id (0x%x)", + queue_idx, dpaa_intf->tx_queues[queue_idx].fqid); dev->data->tx_queues[queue_idx] = &dpaa_intf->tx_queues[queue_idx]; return 0; } @@ -1016,7 +1034,7 @@ static int dpaa_rx_queue_init(struct qman_fq *fq, struct qman_cgr *cgr_rx, DPAA_PMD_DEBUG("creating rx fq %p, fqid %d", fq, fqid); ret = qman_create_fq(fqid, QMAN_FQ_FLAG_NO_ENQUEUE, fq); if (ret) { - DPAA_PMD_ERR("create rx fqid %d failed with ret: %d", + DPAA_PMD_ERR("create rx fqid 0x%x failed with ret: %d", fqid, ret); return ret; } -- 2.7.4 ^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH v3 05/16] net/dpaa2: fix the prefetch Rx to honor nb pkts 2018-07-06 8:09 ` [dpdk-dev] [PATCH v3 " Hemant Agrawal ` (2 preceding siblings ...) 2018-07-06 8:10 ` [dpdk-dev] [PATCH v3 04/16] net/dpaa: fix the queue err handling and logs Hemant Agrawal @ 2018-07-06 8:10 ` Hemant Agrawal 2018-07-06 8:10 ` [dpdk-dev] [PATCH v3 06/16] bus/dpaa: optimize the fq callback routine Hemant Agrawal ` (11 subsequent siblings) 15 siblings, 0 replies; 62+ messages in thread From: Hemant Agrawal @ 2018-07-06 8:10 UTC (permalink / raw) To: dev; +Cc: shreyansh.jain, stable This patch fixes prefetch rx routine to set the next prefetch request to the size of nb_pkts. It assumes that next request would ideally be of same size. Fixes: 4bc5ab88dbd6 ("net/dpaa2: fix Tx only mode") Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com> --- drivers/net/dpaa2/dpaa2_rxtx.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c index dac086d..ef109a6 100644 --- a/drivers/net/dpaa2/dpaa2_rxtx.c +++ b/drivers/net/dpaa2/dpaa2_rxtx.c @@ -447,6 +447,12 @@ eth_copy_mbuf_to_fd(struct rte_mbuf *mbuf, return 0; } +/* This function assumes that caller will be keep the same value for nb_pkts + * across calls per queue, if that is not the case, better use non-prefetch + * version of rx call. + * It will return the packets as requested in previous call without honoring + * the current nb_pkts or bufs space. + */ uint16_t dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) { @@ -454,7 +460,7 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) struct dpaa2_queue *dpaa2_q = (struct dpaa2_queue *)queue; struct qbman_result *dq_storage, *dq_storage1 = NULL; uint32_t fqid = dpaa2_q->fqid; - int ret, num_rx = 0; + int ret, num_rx = 0, pull_size; uint8_t pending, status; struct qbman_swp *swp; const struct qbman_fd *fd, *next_fd; @@ -470,12 +476,12 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) } } swp = DPAA2_PER_LCORE_ETHRX_PORTAL; - + pull_size = (nb_pkts > DPAA2_DQRR_RING_SIZE) ? + DPAA2_DQRR_RING_SIZE : nb_pkts; if (unlikely(!q_storage->active_dqs)) { q_storage->toggle = 0; dq_storage = q_storage->dq_storage[q_storage->toggle]; - q_storage->last_num_pkts = (nb_pkts > DPAA2_DQRR_RING_SIZE) ? - DPAA2_DQRR_RING_SIZE : nb_pkts; + q_storage->last_num_pkts = pull_size; qbman_pull_desc_clear(&pulldesc); qbman_pull_desc_set_numframes(&pulldesc, q_storage->last_num_pkts); @@ -514,7 +520,7 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) q_storage->toggle ^= 1; dq_storage1 = q_storage->dq_storage[q_storage->toggle]; qbman_pull_desc_clear(&pulldesc); - qbman_pull_desc_set_numframes(&pulldesc, DPAA2_DQRR_RING_SIZE); + qbman_pull_desc_set_numframes(&pulldesc, pull_size); qbman_pull_desc_set_fq(&pulldesc, fqid); qbman_pull_desc_set_storage(&pulldesc, dq_storage1, (uint64_t)(DPAA2_VADDR_TO_IOVA(dq_storage1)), 1); -- 2.7.4 ^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH v3 06/16] bus/dpaa: optimize the fq callback routine 2018-07-06 8:09 ` [dpdk-dev] [PATCH v3 " Hemant Agrawal ` (3 preceding siblings ...) 2018-07-06 8:10 ` [dpdk-dev] [PATCH v3 05/16] net/dpaa2: fix the prefetch Rx to honor nb pkts Hemant Agrawal @ 2018-07-06 8:10 ` Hemant Agrawal 2018-07-06 8:10 ` [dpdk-dev] [PATCH v3 07/16] bus/dpaa: implement new of API to get MAC address Hemant Agrawal ` (10 subsequent siblings) 15 siblings, 0 replies; 62+ messages in thread From: Hemant Agrawal @ 2018-07-06 8:10 UTC (permalink / raw) To: dev; +Cc: shreyansh.jain, Sunil Kumar Kori Avoid array of fq as packets are dq only from a single q. Signed-off-by: Sunil Kumar Kori <sunil.kori@nxp.com> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com> --- drivers/bus/dpaa/base/qbman/qman.c | 15 +++++++-------- drivers/net/dpaa/dpaa_rxtx.c | 2 +- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/bus/dpaa/base/qbman/qman.c b/drivers/bus/dpaa/base/qbman/qman.c index 27d98cc..13c4315 100644 --- a/drivers/bus/dpaa/base/qbman/qman.c +++ b/drivers/bus/dpaa/base/qbman/qman.c @@ -1058,7 +1058,7 @@ unsigned int qman_portal_poll_rx(unsigned int poll_limit, struct qm_portal *portal = &p->p; register struct qm_dqrr *dqrr = &portal->dqrr; struct qm_dqrr_entry *dq[QM_DQRR_SIZE], *shadow[QM_DQRR_SIZE]; - struct qman_fq *fq[QM_DQRR_SIZE]; + struct qman_fq *fq; unsigned int limit = 0, rx_number = 0; uint32_t consume = 0; @@ -1092,14 +1092,13 @@ unsigned int qman_portal_poll_rx(unsigned int poll_limit, /* SDQCR: context_b points to the FQ */ #ifdef CONFIG_FSL_QMAN_FQ_LOOKUP - fq[rx_number] = qman_fq_lookup_table[be32_to_cpu( - dq[rx_number]->contextB)]; + fq = qman_fq_lookup_table[be32_to_cpu(dq[rx_number]->contextB)]; #else - fq[rx_number] = (void *)be32_to_cpu( - dq[rx_number]->contextB); + fq = (void *)be32_to_cpu(dq[rx_number]->contextB); #endif - fq[rx_number]->cb.dqrr_prepare(shadow[rx_number], - &bufs[rx_number]); + if (fq->cb.dqrr_prepare) + fq->cb.dqrr_prepare(shadow[rx_number], + &bufs[rx_number]); consume |= (1 << (31 - DQRR_PTR2IDX(shadow[rx_number]))); rx_number++; @@ -1107,7 +1106,7 @@ unsigned int qman_portal_poll_rx(unsigned int poll_limit, } while (++limit < poll_limit); if (rx_number) - fq[0]->cb.dqrr_dpdk_pull_cb(fq, shadow, bufs, rx_number); + fq->cb.dqrr_dpdk_pull_cb(&fq, shadow, bufs, rx_number); /* Consume all the DQRR enries together */ qm_out(DQRR_DCAP, (1 << 8) | consume); diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c index 1316d2a..805bc30 100644 --- a/drivers/net/dpaa/dpaa_rxtx.c +++ b/drivers/net/dpaa/dpaa_rxtx.c @@ -431,7 +431,7 @@ dpaa_rx_cb(struct qman_fq **fq, struct qm_dqrr_entry **dqrr, } fd = &dqrr[i]->fd; - dpaa_intf = fq[i]->dpaa_intf; + dpaa_intf = fq[0]->dpaa_intf; format = (fd->opaque & DPAA_FD_FORMAT_MASK) >> DPAA_FD_FORMAT_SHIFT; -- 2.7.4 ^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH v3 07/16] bus/dpaa: implement new of API to get MAC address 2018-07-06 8:09 ` [dpdk-dev] [PATCH v3 " Hemant Agrawal ` (4 preceding siblings ...) 2018-07-06 8:10 ` [dpdk-dev] [PATCH v3 06/16] bus/dpaa: optimize the fq callback routine Hemant Agrawal @ 2018-07-06 8:10 ` Hemant Agrawal 2018-07-06 8:10 ` [dpdk-dev] [PATCH v3 08/16] bus/dpaa: make vdqcr configurable Hemant Agrawal ` (9 subsequent siblings) 15 siblings, 0 replies; 62+ messages in thread From: Hemant Agrawal @ 2018-07-06 8:10 UTC (permalink / raw) To: dev; +Cc: shreyansh.jain, Akhil Goyal From: Akhil Goyal <akhil.goyal@nxp.com> Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com> Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com> --- drivers/bus/dpaa/base/fman/of.c | 39 +++++++++++++++++++++++++++++++ drivers/bus/dpaa/include/of.h | 2 ++ drivers/bus/dpaa/rte_bus_dpaa_version.map | 8 +++++++ 3 files changed, 49 insertions(+) diff --git a/drivers/bus/dpaa/base/fman/of.c b/drivers/bus/dpaa/base/fman/of.c index eb55cb9..a7f3174 100644 --- a/drivers/bus/dpaa/base/fman/of.c +++ b/drivers/bus/dpaa/base/fman/of.c @@ -546,3 +546,42 @@ of_device_is_compatible(const struct device_node *dev_node, return true; return false; } + +static const void *of_get_mac_addr(const struct device_node *np, + const char *name) +{ + return of_get_property(np, name, NULL); +} + +/** + * Search the device tree for the best MAC address to use. 'mac-address' is + * checked first, because that is supposed to contain to "most recent" MAC + * address. If that isn't set, then 'local-mac-address' is checked next, + * because that is the default address. If that isn't set, then the obsolete + * 'address' is checked, just in case we're using an old device tree. + * + * Note that the 'address' property is supposed to contain a virtual address of + * the register set, but some DTS files have redefined that property to be the + * MAC address. + * + * All-zero MAC addresses are rejected, because those could be properties that + * exist in the device tree, but were not set by U-Boot. For example, the + * DTS could define 'mac-address' and 'local-mac-address', with zero MAC + * addresses. Some older U-Boots only initialized 'local-mac-address'. In + * this case, the real MAC is in 'local-mac-address', and 'mac-address' exists + * but is all zeros. + */ +const void *of_get_mac_address(const struct device_node *np) +{ + const void *addr; + + addr = of_get_mac_addr(np, "mac-address"); + if (addr) + return addr; + + addr = of_get_mac_addr(np, "local-mac-address"); + if (addr) + return addr; + + return of_get_mac_addr(np, "address"); +} diff --git a/drivers/bus/dpaa/include/of.h b/drivers/bus/dpaa/include/of.h index 151be5a..7ea7608 100644 --- a/drivers/bus/dpaa/include/of.h +++ b/drivers/bus/dpaa/include/of.h @@ -109,6 +109,8 @@ const struct device_node *of_get_parent(const struct device_node *dev_node); const struct device_node *of_get_next_child(const struct device_node *dev_node, const struct device_node *prev); +const void *of_get_mac_address(const struct device_node *np); + #define for_each_child_node(parent, child) \ for (child = of_get_next_child(parent, NULL); child != NULL; \ child = of_get_next_child(parent, child)) diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map b/drivers/bus/dpaa/rte_bus_dpaa_version.map index 8d90285..e00c911 100644 --- a/drivers/bus/dpaa/rte_bus_dpaa_version.map +++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map @@ -92,3 +92,11 @@ DPDK_18.02 { local: *; } DPDK_17.11; + +DPDK_18.08 { + global: + + of_get_mac_address; + + local: *; +} DPDK_18.02; -- 2.7.4 ^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH v3 08/16] bus/dpaa: make vdqcr configurable 2018-07-06 8:09 ` [dpdk-dev] [PATCH v3 " Hemant Agrawal ` (5 preceding siblings ...) 2018-07-06 8:10 ` [dpdk-dev] [PATCH v3 07/16] bus/dpaa: implement new of API to get MAC address Hemant Agrawal @ 2018-07-06 8:10 ` Hemant Agrawal 2018-07-06 8:10 ` [dpdk-dev] [PATCH v3 09/16] net/dpaa: support default queue mode Hemant Agrawal ` (8 subsequent siblings) 15 siblings, 0 replies; 62+ messages in thread From: Hemant Agrawal @ 2018-07-06 8:10 UTC (permalink / raw) To: dev; +Cc: shreyansh.jain, Nipun Gupta From: Nipun Gupta <nipun.gupta@nxp.com> This patch add support for configurable vdqcr exact flag. This boost the performance, however this can give side effects for some extra packet fetch. Which has been taken care in the patch as well. Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com> Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com> --- drivers/bus/dpaa/base/qbman/qman.c | 4 ++-- drivers/bus/dpaa/include/fsl_qman.h | 3 ++- drivers/crypto/dpaa_sec/dpaa_sec.c | 19 ++++++++++++++++--- drivers/net/dpaa/dpaa_rxtx.c | 18 +++++++++++++++--- 4 files changed, 35 insertions(+), 9 deletions(-) diff --git a/drivers/bus/dpaa/base/qbman/qman.c b/drivers/bus/dpaa/base/qbman/qman.c index 13c4315..f5fe5ef 100644 --- a/drivers/bus/dpaa/base/qbman/qman.c +++ b/drivers/bus/dpaa/base/qbman/qman.c @@ -2002,13 +2002,13 @@ int qman_query_congestion(struct qm_mcr_querycongestion *congestion) return 0; } -int qman_set_vdq(struct qman_fq *fq, u16 num) +int qman_set_vdq(struct qman_fq *fq, u16 num, uint32_t vdqcr_flags) { struct qman_portal *p = get_affine_portal(); uint32_t vdqcr; int ret = -EBUSY; - vdqcr = QM_VDQCR_EXACT; + vdqcr = vdqcr_flags; vdqcr |= QM_VDQCR_NUMFRAMES_SET(num); if ((fq->state != qman_fq_state_parked) && diff --git a/drivers/bus/dpaa/include/fsl_qman.h b/drivers/bus/dpaa/include/fsl_qman.h index e4ad7ae..b18cf03 100644 --- a/drivers/bus/dpaa/include/fsl_qman.h +++ b/drivers/bus/dpaa/include/fsl_qman.h @@ -1332,10 +1332,11 @@ unsigned int qman_portal_poll_rx(unsigned int poll_limit, * qman_set_vdq - Issue a volatile dequeue command * @fq: Frame Queue on which the volatile dequeue command is issued * @num: Number of Frames requested for volatile dequeue + * @vdqcr_flags: QM_VDQCR_EXACT flag to for VDQCR command * * This function will issue a volatile dequeue command to the QMAN. */ -int qman_set_vdq(struct qman_fq *fq, u16 num); +int qman_set_vdq(struct qman_fq *fq, u16 num, uint32_t vdqcr_flags); /** * qman_dequeue - Get the DQRR entry after volatile dequeue command diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index 06f7e43..a07869f 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -526,12 +526,25 @@ dpaa_sec_deq(struct dpaa_sec_qp *qp, struct rte_crypto_op **ops, int nb_ops) { struct qman_fq *fq; unsigned int pkts = 0; - int ret; + int num_rx_bufs, ret; struct qm_dqrr_entry *dq; + uint32_t vdqcr_flags = 0; fq = &qp->outq; - ret = qman_set_vdq(fq, (nb_ops > DPAA_MAX_DEQUEUE_NUM_FRAMES) ? - DPAA_MAX_DEQUEUE_NUM_FRAMES : nb_ops); + /* + * Until request for four buffers, we provide exact number of buffers. + * Otherwise we do not set the QM_VDQCR_EXACT flag. + * Not setting QM_VDQCR_EXACT flag can provide two more buffers than + * requested, so we request two less in this case. + */ + if (nb_ops < 4) { + vdqcr_flags = QM_VDQCR_EXACT; + num_rx_bufs = nb_ops; + } else { + num_rx_bufs = nb_ops > DPAA_MAX_DEQUEUE_NUM_FRAMES ? + (DPAA_MAX_DEQUEUE_NUM_FRAMES - 2) : (nb_ops - 2); + } + ret = qman_set_vdq(fq, num_rx_bufs, vdqcr_flags); if (ret) return 0; diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c index 805bc30..168b77e 100644 --- a/drivers/net/dpaa/dpaa_rxtx.c +++ b/drivers/net/dpaa/dpaa_rxtx.c @@ -560,7 +560,8 @@ uint16_t dpaa_eth_queue_rx(void *q, struct qman_fq *fq = q; struct qm_dqrr_entry *dq; uint32_t num_rx = 0, ifid = ((struct dpaa_if *)fq->dpaa_intf)->ifid; - int ret; + int num_rx_bufs, ret; + uint32_t vdqcr_flags = 0; if (likely(fq->is_static)) return dpaa_eth_queue_portal_rx(fq, bufs, nb_bufs); @@ -573,8 +574,19 @@ uint16_t dpaa_eth_queue_rx(void *q, } } - ret = qman_set_vdq(fq, (nb_bufs > DPAA_MAX_DEQUEUE_NUM_FRAMES) ? - DPAA_MAX_DEQUEUE_NUM_FRAMES : nb_bufs); + /* Until request for four buffers, we provide exact number of buffers. + * Otherwise we do not set the QM_VDQCR_EXACT flag. + * Not setting QM_VDQCR_EXACT flag can provide two more buffers than + * requested, so we request two less in this case. + */ + if (nb_bufs < 4) { + vdqcr_flags = QM_VDQCR_EXACT; + num_rx_bufs = nb_bufs; + } else { + num_rx_bufs = nb_bufs > DPAA_MAX_DEQUEUE_NUM_FRAMES ? + (DPAA_MAX_DEQUEUE_NUM_FRAMES - 2) : (nb_bufs - 2); + } + ret = qman_set_vdq(fq, num_rx_bufs, vdqcr_flags); if (ret) return 0; -- 2.7.4 ^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH v3 09/16] net/dpaa: support default queue mode 2018-07-06 8:09 ` [dpdk-dev] [PATCH v3 " Hemant Agrawal ` (6 preceding siblings ...) 2018-07-06 8:10 ` [dpdk-dev] [PATCH v3 08/16] bus/dpaa: make vdqcr configurable Hemant Agrawal @ 2018-07-06 8:10 ` Hemant Agrawal 2018-07-06 8:10 ` [dpdk-dev] [PATCH v3 10/16] net/dpaa: remove experimental tag from PMD APIs Hemant Agrawal ` (7 subsequent siblings) 15 siblings, 0 replies; 62+ messages in thread From: Hemant Agrawal @ 2018-07-06 8:10 UTC (permalink / raw) To: dev; +Cc: shreyansh.jain In case DPAA FMAN configuration tool (FMC) is not available, the system can still work with default queue(1 queue per port). This patch also fixes some logs related to FQ ids, which were idetified while testing this support. Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> --- drivers/net/dpaa/dpaa_ethdev.c | 37 ++++++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 79ba6bd..def9483 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -74,6 +74,7 @@ static uint64_t dev_tx_offloads_nodis = /* Keep track of whether QMAN and BMAN have been globally initialized */ static int is_global_init; +static int default_q; /* use default queue - FMC is not executed*/ /* At present we only allow up to 4 push mode queues as default - as each of * this queue need dedicated portal and we are short of portals. */ @@ -1026,12 +1027,12 @@ static int dpaa_rx_queue_init(struct qman_fq *fq, struct qman_cgr *cgr_rx, ret = qman_reserve_fqid(fqid); if (ret) { - DPAA_PMD_ERR("reserve rx fqid %d failed with ret: %d", + DPAA_PMD_ERR("reserve rx fqid 0x%x failed with ret: %d", fqid, ret); return -EINVAL; } - DPAA_PMD_DEBUG("creating rx fq %p, fqid %d", fq, fqid); + DPAA_PMD_DEBUG("creating rx fq %p, fqid 0x%x", fq, fqid); ret = qman_create_fq(fqid, QMAN_FQ_FLAG_NO_ENQUEUE, fq); if (ret) { DPAA_PMD_ERR("create rx fqid 0x%x failed with ret: %d", @@ -1050,7 +1051,7 @@ static int dpaa_rx_queue_init(struct qman_fq *fq, struct qman_cgr *cgr_rx, &cgr_opts); if (ret) { DPAA_PMD_WARN( - "rx taildrop init fail on rx fqid %d (ret=%d)", + "rx taildrop init fail on rx fqid 0x%x(ret=%d)", fqid, ret); goto without_cgr; } @@ -1061,7 +1062,7 @@ static int dpaa_rx_queue_init(struct qman_fq *fq, struct qman_cgr *cgr_rx, without_cgr: ret = qman_init_fq(fq, flags, &opts); if (ret) - DPAA_PMD_ERR("init rx fqid %d failed with ret: %d", fqid, ret); + DPAA_PMD_ERR("init rx fqid 0x%x failed with ret:%d", fqid, ret); return ret; } @@ -1089,10 +1090,10 @@ static int dpaa_tx_queue_init(struct qman_fq *fq, /* no tx-confirmation */ opts.fqd.context_a.hi = 0x80000000 | fman_dealloc_bufs_mask_hi; opts.fqd.context_a.lo = 0 | fman_dealloc_bufs_mask_lo; - DPAA_PMD_DEBUG("init tx fq %p, fqid %d", fq, fq->fqid); + DPAA_PMD_DEBUG("init tx fq %p, fqid 0x%x", fq, fq->fqid); ret = qman_init_fq(fq, QMAN_INITFQ_FLAG_SCHED, &opts); if (ret) - DPAA_PMD_ERR("init tx fqid %d failed %d", fq->fqid, ret); + DPAA_PMD_ERR("init tx fqid 0x%x failed %d", fq->fqid, ret); return ret; } @@ -1163,10 +1164,15 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev) dpaa_intf->cfg = cfg; /* Initialize Rx FQ's */ - if (getenv("DPAA_NUM_RX_QUEUES")) - num_rx_fqs = atoi(getenv("DPAA_NUM_RX_QUEUES")); - else + if (default_q) { num_rx_fqs = DPAA_DEFAULT_NUM_PCD_QUEUES; + } else { + if (getenv("DPAA_NUM_RX_QUEUES")) + num_rx_fqs = atoi(getenv("DPAA_NUM_RX_QUEUES")); + else + num_rx_fqs = DPAA_DEFAULT_NUM_PCD_QUEUES; + } + /* if push mode queues to be enabled. Currenly we are allowing only * one queue per thread. @@ -1214,8 +1220,11 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev) } for (loop = 0; loop < num_rx_fqs; loop++) { - fqid = DPAA_PCD_FQID_START + dpaa_intf->ifid * - DPAA_PCD_FQID_MULTIPLIER + loop; + if (default_q) + fqid = cfg->rx_def; + else + fqid = DPAA_PCD_FQID_START + dpaa_intf->ifid * + DPAA_PCD_FQID_MULTIPLIER + loop; if (dpaa_intf->cgr_rx) dpaa_intf->cgr_rx[loop].cgrid = cgrid[loop]; @@ -1409,6 +1418,12 @@ rte_dpaa_probe(struct rte_dpaa_driver *dpaa_drv, return ret; } + if (access("/tmp/fmc.bin", F_OK) == -1) { + RTE_LOG(INFO, PMD, + "* FMC not configured.Enabling default mode\n"); + default_q = 1; + } + is_global_init = 1; } -- 2.7.4 ^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH v3 10/16] net/dpaa: remove experimental tag from PMD APIs 2018-07-06 8:09 ` [dpdk-dev] [PATCH v3 " Hemant Agrawal ` (7 preceding siblings ...) 2018-07-06 8:10 ` [dpdk-dev] [PATCH v3 09/16] net/dpaa: support default queue mode Hemant Agrawal @ 2018-07-06 8:10 ` Hemant Agrawal 2018-07-06 8:10 ` [dpdk-dev] [PATCH v3 11/16] bus/dpaa: cleanup unnecessary global variables Hemant Agrawal ` (6 subsequent siblings) 15 siblings, 0 replies; 62+ messages in thread From: Hemant Agrawal @ 2018-07-06 8:10 UTC (permalink / raw) To: dev; +Cc: shreyansh.jain Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com> --- drivers/net/dpaa/dpaa_ethdev.c | 6 +++--- drivers/net/dpaa/dpaa_ethdev.h | 8 +++++--- drivers/net/dpaa/rte_pmd_dpaa.h | 5 +---- drivers/net/dpaa/rte_pmd_dpaa_version.map | 4 ++-- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index def9483..00611f8 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -617,7 +617,7 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, return 0; } -int __rte_experimental +int dpaa_eth_eventq_attach(const struct rte_eth_dev *dev, int eth_rx_queue_id, u16 ch_id, @@ -680,7 +680,7 @@ dpaa_eth_eventq_attach(const struct rte_eth_dev *dev, return ret; } -int __rte_experimental +int dpaa_eth_eventq_detach(const struct rte_eth_dev *dev, int eth_rx_queue_id) { @@ -956,7 +956,7 @@ is_dpaa_supported(struct rte_eth_dev *dev) return is_device_supported(dev, &rte_dpaa_pmd); } -int __rte_experimental +int rte_pmd_dpaa_set_tx_loopback(uint8_t port, uint8_t on) { struct rte_eth_dev *dev; diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h index 1897b9e..c79b9f8 100644 --- a/drivers/net/dpaa/dpaa_ethdev.h +++ b/drivers/net/dpaa/dpaa_ethdev.h @@ -160,12 +160,14 @@ struct dpaa_if_stats { uint64_t tund; /**<Tx Undersized */ }; -int __rte_experimental dpaa_eth_eventq_attach(const struct rte_eth_dev *dev, - int eth_rx_queue_id, +int +dpaa_eth_eventq_attach(const struct rte_eth_dev *dev, + int eth_rx_queue_id, u16 ch_id, const struct rte_event_eth_rx_adapter_queue_conf *queue_conf); -int __rte_experimental dpaa_eth_eventq_detach(const struct rte_eth_dev *dev, +int +dpaa_eth_eventq_detach(const struct rte_eth_dev *dev, int eth_rx_queue_id); enum qman_cb_dqrr_result diff --git a/drivers/net/dpaa/rte_pmd_dpaa.h b/drivers/net/dpaa/rte_pmd_dpaa.h index 38405ec..37eea9b 100644 --- a/drivers/net/dpaa/rte_pmd_dpaa.h +++ b/drivers/net/dpaa/rte_pmd_dpaa.h @@ -18,9 +18,6 @@ #include <rte_ethdev_driver.h> /** - * @warning - * @b EXPERIMENTAL: this API may change, or be removed, without prior notice - * * Enable/Disable TX loopback * * @param port @@ -33,7 +30,7 @@ * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int __rte_experimental +int rte_pmd_dpaa_set_tx_loopback(uint8_t port, uint8_t on); #endif /* _PMD_DPAA_H_ */ diff --git a/drivers/net/dpaa/rte_pmd_dpaa_version.map b/drivers/net/dpaa/rte_pmd_dpaa_version.map index c7ad403..8cb4500 100644 --- a/drivers/net/dpaa/rte_pmd_dpaa_version.map +++ b/drivers/net/dpaa/rte_pmd_dpaa_version.map @@ -3,10 +3,10 @@ DPDK_17.11 { local: *; }; -EXPERIMENTAL { +DPDK_18.08 { global: dpaa_eth_eventq_attach; dpaa_eth_eventq_detach; rte_pmd_dpaa_set_tx_loopback; -}; +} DPDK_17.11; -- 2.7.4 ^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH v3 11/16] bus/dpaa: cleanup unnecessary global variables 2018-07-06 8:09 ` [dpdk-dev] [PATCH v3 " Hemant Agrawal ` (8 preceding siblings ...) 2018-07-06 8:10 ` [dpdk-dev] [PATCH v3 10/16] net/dpaa: remove experimental tag from PMD APIs Hemant Agrawal @ 2018-07-06 8:10 ` Hemant Agrawal 2018-07-06 8:10 ` [dpdk-dev] [PATCH v3 12/16] bus/fslmc: " Hemant Agrawal ` (5 subsequent siblings) 15 siblings, 0 replies; 62+ messages in thread From: Hemant Agrawal @ 2018-07-06 8:10 UTC (permalink / raw) To: dev; +Cc: shreyansh.jain, Pavan Nikhilesh Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> --- drivers/bus/dpaa/base/fman/netcfg_layer.c | 5 ----- drivers/bus/dpaa/base/qbman/bman_driver.c | 4 ++-- drivers/bus/dpaa/base/qbman/qman.c | 2 +- drivers/bus/dpaa/base/qbman/qman_driver.c | 4 ++-- drivers/bus/dpaa/base/qbman/qman_priv.h | 1 - drivers/bus/dpaa/dpaa_bus.c | 2 +- 6 files changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/bus/dpaa/base/fman/netcfg_layer.c b/drivers/bus/dpaa/base/fman/netcfg_layer.c index 3e956ce..031c6f1 100644 --- a/drivers/bus/dpaa/base/fman/netcfg_layer.c +++ b/drivers/bus/dpaa/base/fman/netcfg_layer.c @@ -18,11 +18,6 @@ #include <rte_dpaa_logs.h> #include <netcfg.h> -/* Structure contains information about all the interfaces given by user - * on command line. - */ -struct netcfg_interface *netcfg_interface; - /* This data structure contaings all configurations information * related to usages of DPA devices. */ diff --git a/drivers/bus/dpaa/base/qbman/bman_driver.c b/drivers/bus/dpaa/base/qbman/bman_driver.c index 1381da3..b14b590 100644 --- a/drivers/bus/dpaa/base/qbman/bman_driver.c +++ b/drivers/bus/dpaa/base/qbman/bman_driver.c @@ -15,9 +15,9 @@ /* * Global variables of the max portal/pool number this bman version supported */ -u16 bman_ip_rev; +static u16 bman_ip_rev; u16 bman_pool_max; -void *bman_ccsr_map; +static void *bman_ccsr_map; /*****************/ /* Portal driver */ diff --git a/drivers/bus/dpaa/base/qbman/qman.c b/drivers/bus/dpaa/base/qbman/qman.c index f5fe5ef..7c17027 100644 --- a/drivers/bus/dpaa/base/qbman/qman.c +++ b/drivers/bus/dpaa/base/qbman/qman.c @@ -625,7 +625,7 @@ struct qman_portal *qman_create_portal( #define MAX_GLOBAL_PORTALS 8 static struct qman_portal global_portals[MAX_GLOBAL_PORTALS]; -rte_atomic16_t global_portals_used[MAX_GLOBAL_PORTALS]; +static rte_atomic16_t global_portals_used[MAX_GLOBAL_PORTALS]; static struct qman_portal * qman_alloc_global_portal(void) diff --git a/drivers/bus/dpaa/base/qbman/qman_driver.c b/drivers/bus/dpaa/base/qbman/qman_driver.c index 07b29d5..f6ecd6b 100644 --- a/drivers/bus/dpaa/base/qbman/qman_driver.c +++ b/drivers/bus/dpaa/base/qbman/qman_driver.c @@ -20,9 +20,9 @@ u16 qm_channel_caam = QMAN_CHANNEL_CAAM; u16 qm_channel_pme = QMAN_CHANNEL_PME; /* Ccsr map address to access ccsrbased register */ -void *qman_ccsr_map; +static void *qman_ccsr_map; /* The qman clock frequency */ -u32 qman_clk; +static u32 qman_clk; static __thread int qmfd = -1; static __thread struct qm_portal_config qpcfg; diff --git a/drivers/bus/dpaa/base/qbman/qman_priv.h b/drivers/bus/dpaa/base/qbman/qman_priv.h index 9e4471e..02f6301 100644 --- a/drivers/bus/dpaa/base/qbman/qman_priv.h +++ b/drivers/bus/dpaa/base/qbman/qman_priv.h @@ -139,7 +139,6 @@ struct qm_portal_config { #define QMAN_REV31 0x0301 #define QMAN_REV32 0x0302 extern u16 qman_ip_rev; /* 0 if uninitialised, otherwise QMAN_REVx */ -extern u32 qman_clk; int qm_set_wpm(int wpm); int qm_get_wpm(int *wpm); diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c index 7956bd0..5ba3d28 100644 --- a/drivers/bus/dpaa/dpaa_bus.c +++ b/drivers/bus/dpaa/dpaa_bus.c @@ -50,7 +50,7 @@ struct rte_dpaa_bus rte_dpaa_bus; struct netcfg_info *dpaa_netcfg; /* define a variable to hold the portal_key, once created.*/ -pthread_key_t dpaa_portal_key; +static pthread_key_t dpaa_portal_key; unsigned int dpaa_svr_family; -- 2.7.4 ^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH v3 12/16] bus/fslmc: cleanup unnecessary global variables 2018-07-06 8:09 ` [dpdk-dev] [PATCH v3 " Hemant Agrawal ` (9 preceding siblings ...) 2018-07-06 8:10 ` [dpdk-dev] [PATCH v3 11/16] bus/dpaa: cleanup unnecessary global variables Hemant Agrawal @ 2018-07-06 8:10 ` Hemant Agrawal 2018-07-06 8:10 ` [dpdk-dev] [PATCH v3 13/16] drivers: support function name in logs trace Hemant Agrawal ` (4 subsequent siblings) 15 siblings, 0 replies; 62+ messages in thread From: Hemant Agrawal @ 2018-07-06 8:10 UTC (permalink / raw) To: dev; +Cc: shreyansh.jain, Pavan Nikhilesh Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> --- drivers/bus/fslmc/qbman/qbman_portal.c | 3 +-- drivers/bus/fslmc/qbman/qbman_portal.h | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/bus/fslmc/qbman/qbman_portal.c b/drivers/bus/fslmc/qbman/qbman_portal.c index 713ec96..0714500 100644 --- a/drivers/bus/fslmc/qbman/qbman_portal.c +++ b/drivers/bus/fslmc/qbman/qbman_portal.c @@ -122,8 +122,7 @@ struct qbman_swp *qbman_swp_init(const struct qbman_swp_desc *d) p->vdq.valid_bit = QB_VALID_BIT; p->dqrr.next_idx = 0; p->dqrr.valid_bit = QB_VALID_BIT; - qman_version = p->desc.qman_version; - if ((qman_version & 0xFFFF0000) < QMAN_REV_4100) { + if ((p->desc.qman_version & 0xFFFF0000) < QMAN_REV_4100) { p->dqrr.dqrr_size = 4; p->dqrr.reset_bug = 1; } else { diff --git a/drivers/bus/fslmc/qbman/qbman_portal.h b/drivers/bus/fslmc/qbman/qbman_portal.h index 8bff0b4..dbea22a 100644 --- a/drivers/bus/fslmc/qbman/qbman_portal.h +++ b/drivers/bus/fslmc/qbman/qbman_portal.h @@ -7,7 +7,6 @@ #include "qbman_sys.h" #include <fsl_qbman_portal.h> -uint32_t qman_version; #define QMAN_REV_4000 0x04000000 #define QMAN_REV_4100 0x04010000 #define QMAN_REV_4101 0x04010001 -- 2.7.4 ^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH v3 13/16] drivers: support function name in logs trace 2018-07-06 8:09 ` [dpdk-dev] [PATCH v3 " Hemant Agrawal ` (10 preceding siblings ...) 2018-07-06 8:10 ` [dpdk-dev] [PATCH v3 12/16] bus/fslmc: " Hemant Agrawal @ 2018-07-06 8:10 ` Hemant Agrawal 2018-07-06 8:10 ` [dpdk-dev] [PATCH v3 14/16] net/dpaa: move the push queue set to global init Hemant Agrawal ` (3 subsequent siblings) 15 siblings, 0 replies; 62+ messages in thread From: Hemant Agrawal @ 2018-07-06 8:10 UTC (permalink / raw) To: dev; +Cc: shreyansh.jain Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com> --- drivers/bus/fslmc/fslmc_logs.h | 2 +- drivers/crypto/dpaa2_sec/dpaa2_sec_logs.h | 2 +- drivers/crypto/dpaa_sec/dpaa_sec_log.h | 2 +- drivers/event/dpaa2/dpaa2_eventdev_logs.h | 2 +- drivers/net/dpaa2/dpaa2_pmd_logs.h | 2 +- drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h | 2 +- drivers/raw/dpaa2_qdma/dpaa2_qdma_logs.h | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/bus/fslmc/fslmc_logs.h b/drivers/bus/fslmc/fslmc_logs.h index 9750b8c..dd74cb7 100644 --- a/drivers/bus/fslmc/fslmc_logs.h +++ b/drivers/bus/fslmc/fslmc_logs.h @@ -18,7 +18,7 @@ extern int dpaa2_logtype_bus; rte_log(RTE_LOG_DEBUG, dpaa2_logtype_bus, "fslmc: %s(): " fmt "\n", \ __func__, ##args) -#define BUS_INIT_FUNC_TRACE() DPAA2_BUS_LOG(DEBUG, " >>") +#define BUS_INIT_FUNC_TRACE() DPAA2_BUS_DEBUG(" >>") #define DPAA2_BUS_INFO(fmt, args...) \ DPAA2_BUS_LOG(INFO, fmt, ## args) diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_logs.h b/drivers/crypto/dpaa2_sec/dpaa2_sec_logs.h index 7c1f5e7..8a99044 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_logs.h +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_logs.h @@ -18,7 +18,7 @@ extern int dpaa2_logtype_sec; rte_log(RTE_LOG_DEBUG, dpaa2_logtype_sec, "dpaa2_sec: %s(): " \ fmt "\n", __func__, ##args) -#define PMD_INIT_FUNC_TRACE() DPAA2_SEC_LOG(DEBUG, " >>") +#define PMD_INIT_FUNC_TRACE() DPAA2_SEC_DEBUG(">>") #define DPAA2_SEC_INFO(fmt, args...) \ DPAA2_SEC_LOG(INFO, fmt, ## args) diff --git a/drivers/crypto/dpaa_sec/dpaa_sec_log.h b/drivers/crypto/dpaa_sec/dpaa_sec_log.h index 9784fcb..fb895a8 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec_log.h +++ b/drivers/crypto/dpaa_sec/dpaa_sec_log.h @@ -18,7 +18,7 @@ extern int dpaa_logtype_sec; rte_log(RTE_LOG_DEBUG, dpaa_logtype_sec, "dpaa_sec: %s(): " \ fmt "\n", __func__, ##args) -#define PMD_INIT_FUNC_TRACE() DPAA_SEC_LOG(DEBUG, " >>") +#define PMD_INIT_FUNC_TRACE() DPAA_SEC_DEBUG(" >>") #define DPAA_SEC_INFO(fmt, args...) \ DPAA_SEC_LOG(INFO, fmt, ## args) diff --git a/drivers/event/dpaa2/dpaa2_eventdev_logs.h b/drivers/event/dpaa2/dpaa2_eventdev_logs.h index 48f1abd..a2c2060 100644 --- a/drivers/event/dpaa2/dpaa2_eventdev_logs.h +++ b/drivers/event/dpaa2/dpaa2_eventdev_logs.h @@ -16,7 +16,7 @@ extern int dpaa2_logtype_event; rte_log(RTE_LOG_DEBUG, dpaa2_logtype_event, "dpaa2_event: %s(): " \ fmt "\n", __func__, ##args) -#define EVENTDEV_INIT_FUNC_TRACE() DPAA2_EVENTDEV_LOG(DEBUG, " >>") +#define EVENTDEV_INIT_FUNC_TRACE() DPAA2_EVENTDEV_DEBUG(" >>") #define DPAA2_EVENTDEV_INFO(fmt, args...) \ DPAA2_EVENTDEV_LOG(INFO, fmt, ## args) diff --git a/drivers/net/dpaa2/dpaa2_pmd_logs.h b/drivers/net/dpaa2/dpaa2_pmd_logs.h index 98a4896..c04babd 100644 --- a/drivers/net/dpaa2/dpaa2_pmd_logs.h +++ b/drivers/net/dpaa2/dpaa2_pmd_logs.h @@ -16,7 +16,7 @@ extern int dpaa2_logtype_pmd; rte_log(RTE_LOG_DEBUG, dpaa2_logtype_pmd, "dpaa2_net: %s(): "\ fmt "\n", __func__, ##args) -#define PMD_INIT_FUNC_TRACE() DPAA2_PMD_LOG(DEBUG, " >>") +#define PMD_INIT_FUNC_TRACE() DPAA2_PMD_DEBUG(">>") #define DPAA2_PMD_CRIT(fmt, args...) \ DPAA2_PMD_LOG(CRIT, fmt, ## args) diff --git a/drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h b/drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h index 598a621..8991e83 100644 --- a/drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h +++ b/drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h @@ -19,7 +19,7 @@ extern int dpaa2_cmdif_logtype; rte_log(RTE_LOG_DEBUG, dpaa2_cmdif_logtype, "dpaa2_cmdif: %s(): " \ fmt "\n", __func__, ## args) -#define DPAA2_CMDIF_FUNC_TRACE() DPAA2_CMDIF_LOG(DEBUG, ">>") +#define DPAA2_CMDIF_FUNC_TRACE() DPAA2_CMDIF_DEBUG(">>") #define DPAA2_CMDIF_INFO(fmt, args...) \ DPAA2_CMDIF_LOG(INFO, fmt, ## args) diff --git a/drivers/raw/dpaa2_qdma/dpaa2_qdma_logs.h b/drivers/raw/dpaa2_qdma/dpaa2_qdma_logs.h index fafe352..4779e4c 100644 --- a/drivers/raw/dpaa2_qdma/dpaa2_qdma_logs.h +++ b/drivers/raw/dpaa2_qdma/dpaa2_qdma_logs.h @@ -19,7 +19,7 @@ extern int dpaa2_qdma_logtype; rte_log(RTE_LOG_DEBUG, dpaa2_qdma_logtype, "dpaa2_qdma: %s(): " \ fmt "\n", __func__, ## args) -#define DPAA2_QDMA_FUNC_TRACE() DPAA2_QDMA_LOG(DEBUG, ">>") +#define DPAA2_QDMA_FUNC_TRACE() DPAA2_QDMA_DEBUG(">>") #define DPAA2_QDMA_INFO(fmt, args...) \ DPAA2_QDMA_LOG(INFO, fmt, ## args) -- 2.7.4 ^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH v3 14/16] net/dpaa: move the push queue set to global init 2018-07-06 8:09 ` [dpdk-dev] [PATCH v3 " Hemant Agrawal ` (11 preceding siblings ...) 2018-07-06 8:10 ` [dpdk-dev] [PATCH v3 13/16] drivers: support function name in logs trace Hemant Agrawal @ 2018-07-06 8:10 ` Hemant Agrawal 2018-07-06 8:10 ` [dpdk-dev] [PATCH v3 15/16] bus/dpaa: add support for SG config Hemant Agrawal ` (2 subsequent siblings) 15 siblings, 0 replies; 62+ messages in thread From: Hemant Agrawal @ 2018-07-06 8:10 UTC (permalink / raw) To: dev; +Cc: shreyansh.jain Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com> --- drivers/net/dpaa/dpaa_ethdev.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 00611f8..5c0aafb 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -1174,16 +1174,6 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev) } - /* if push mode queues to be enabled. Currenly we are allowing only - * one queue per thread. - */ - if (getenv("DPAA_PUSH_QUEUES_NUMBER")) { - dpaa_push_mode_max_queue = - atoi(getenv("DPAA_PUSH_QUEUES_NUMBER")); - if (dpaa_push_mode_max_queue > DPAA_MAX_PUSH_MODE_QUEUE) - dpaa_push_mode_max_queue = DPAA_MAX_PUSH_MODE_QUEUE; - } - /* Each device can not have more than DPAA_MAX_NUM_PCD_QUEUES RX * queues. */ @@ -1424,6 +1414,20 @@ rte_dpaa_probe(struct rte_dpaa_driver *dpaa_drv, default_q = 1; } + /* disabling the default push mode for LS1043 */ + if (dpaa_svr_family == SVR_LS1043A_FAMILY) + dpaa_push_mode_max_queue = 0; + + /* if push mode queues to be enabled. Currenly we are allowing + * only one queue per thread. + */ + if (getenv("DPAA_PUSH_QUEUES_NUMBER")) { + dpaa_push_mode_max_queue = + atoi(getenv("DPAA_PUSH_QUEUES_NUMBER")); + if (dpaa_push_mode_max_queue > DPAA_MAX_PUSH_MODE_QUEUE) + dpaa_push_mode_max_queue = DPAA_MAX_PUSH_MODE_QUEUE; + } + is_global_init = 1; } -- 2.7.4 ^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH v3 15/16] bus/dpaa: add support for SG config 2018-07-06 8:09 ` [dpdk-dev] [PATCH v3 " Hemant Agrawal ` (12 preceding siblings ...) 2018-07-06 8:10 ` [dpdk-dev] [PATCH v3 14/16] net/dpaa: move the push queue set to global init Hemant Agrawal @ 2018-07-06 8:10 ` Hemant Agrawal 2018-07-06 8:10 ` [dpdk-dev] [PATCH v3 16/16] net/dpaa: implement scatter offload support Hemant Agrawal 2018-07-12 12:49 ` [dpdk-dev] [PATCH v3 01/16] bus/dpaa: fix phandle support for kernel 4.16 Thomas Monjalon 15 siblings, 0 replies; 62+ messages in thread From: Hemant Agrawal @ 2018-07-06 8:10 UTC (permalink / raw) To: dev; +Cc: shreyansh.jain Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> --- drivers/bus/dpaa/base/fman/fman_hw.c | 42 +++++++++++++++++++++++++++++++ drivers/bus/dpaa/include/fsl_fman.h | 6 +++++ drivers/bus/dpaa/rte_bus_dpaa_version.map | 2 ++ 3 files changed, 50 insertions(+) diff --git a/drivers/bus/dpaa/base/fman/fman_hw.c b/drivers/bus/dpaa/base/fman/fman_hw.c index 7ada7fa..4ebbc3d 100644 --- a/drivers/bus/dpaa/base/fman/fman_hw.c +++ b/drivers/bus/dpaa/base/fman/fman_hw.c @@ -16,6 +16,7 @@ #include <fsl_fman_crc64.h> #include <fsl_bman.h> +#define FMAN_SP_SG_DISABLE 0x80000000 #define FMAN_SP_EXT_BUF_MARG_START_SHIFT 16 /* Instantiate the global variable that the inline CRC64 implementation (in @@ -538,6 +539,47 @@ fman_if_get_maxfrm(struct fman_if *fm_if) return (in_be32(reg_maxfrm) | 0x0000FFFF); } +/* MSB in fmbm_rebm register + * 0 - If BMI cannot store the frame in a single buffer it may select a buffer + * of smaller size and store the frame in scatter gather (S/G) buffers + * 1 - Scatter gather format is not enabled for frame storage. If BMI cannot + * store the frame in a single buffer, the frame is discarded. + */ + +int +fman_if_get_sg_enable(struct fman_if *fm_if) +{ + u32 fmbm_rebm; + + struct __fman_if *__if = container_of(fm_if, struct __fman_if, __if); + + assert(fman_ccsr_map_fd != -1); + + fmbm_rebm = in_be32(&((struct rx_bmi_regs *)__if->bmi_map)->fmbm_rebm); + + return (fmbm_rebm & FMAN_SP_SG_DISABLE) ? 0 : 1; +} + +void +fman_if_set_sg(struct fman_if *fm_if, int enable) +{ + struct __fman_if *__if = container_of(fm_if, struct __fman_if, __if); + unsigned int *fmbm_rebm; + int val; + int fmbm_mask = FMAN_SP_SG_DISABLE; + + if (enable) + val = 0; + else + val = FMAN_SP_SG_DISABLE; + + assert(fman_ccsr_map_fd != -1); + + fmbm_rebm = &((struct rx_bmi_regs *)__if->bmi_map)->fmbm_rebm; + + out_be32(fmbm_rebm, (in_be32(fmbm_rebm) & ~fmbm_mask) | val); +} + void fman_if_set_dnia(struct fman_if *fm_if, uint32_t nia) { diff --git a/drivers/bus/dpaa/include/fsl_fman.h b/drivers/bus/dpaa/include/fsl_fman.h index c0ef1bf..1d1ce86 100644 --- a/drivers/bus/dpaa/include/fsl_fman.h +++ b/drivers/bus/dpaa/include/fsl_fman.h @@ -108,6 +108,12 @@ int fman_if_get_fdoff(struct fman_if *fm_if); /* Set interface fd->offset value */ void fman_if_set_fdoff(struct fman_if *fm_if, uint32_t fd_offset); +/* Get interface SG enable status value */ +int fman_if_get_sg_enable(struct fman_if *fm_if); + +/* Set interface SG support mode */ +void fman_if_set_sg(struct fman_if *fm_if, int enable); + /* Get interface Max Frame length (MTU) */ uint16_t fman_if_get_maxfrm(struct fman_if *fm_if); diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map b/drivers/bus/dpaa/rte_bus_dpaa_version.map index e00c911..7d6d624 100644 --- a/drivers/bus/dpaa/rte_bus_dpaa_version.map +++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map @@ -96,6 +96,8 @@ DPDK_18.02 { DPDK_18.08 { global: + fman_if_get_sg_enable; + fman_if_set_sg; of_get_mac_address; local: *; -- 2.7.4 ^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH v3 16/16] net/dpaa: implement scatter offload support 2018-07-06 8:09 ` [dpdk-dev] [PATCH v3 " Hemant Agrawal ` (13 preceding siblings ...) 2018-07-06 8:10 ` [dpdk-dev] [PATCH v3 15/16] bus/dpaa: add support for SG config Hemant Agrawal @ 2018-07-06 8:10 ` Hemant Agrawal 2018-07-12 12:23 ` Thomas Monjalon 2018-07-12 12:49 ` [dpdk-dev] [PATCH v3 01/16] bus/dpaa: fix phandle support for kernel 4.16 Thomas Monjalon 15 siblings, 1 reply; 62+ messages in thread From: Hemant Agrawal @ 2018-07-06 8:10 UTC (permalink / raw) To: dev; +Cc: shreyansh.jain Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com> --- drivers/net/dpaa/dpaa_ethdev.c | 75 +++++++++++++++++++++++++++++++++++++----- drivers/net/dpaa/dpaa_ethdev.h | 3 +- drivers/net/dpaa/dpaa_rxtx.c | 4 +-- drivers/net/dpaa/dpaa_rxtx.h | 2 -- 4 files changed, 70 insertions(+), 14 deletions(-) diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 5c0aafb..c49d3a5 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -47,7 +47,8 @@ /* Supported Rx offloads */ static uint64_t dev_rx_offloads_sup = - DEV_RX_OFFLOAD_JUMBO_FRAME; + DEV_RX_OFFLOAD_JUMBO_FRAME | + DEV_RX_OFFLOAD_SCATTER; /* Rx offloads which cannot be disabled */ static uint64_t dev_rx_offloads_nodis = @@ -55,8 +56,7 @@ static uint64_t dev_rx_offloads_nodis = DEV_RX_OFFLOAD_UDP_CKSUM | DEV_RX_OFFLOAD_TCP_CKSUM | DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM | - DEV_RX_OFFLOAD_CRC_STRIP | - DEV_RX_OFFLOAD_SCATTER; + DEV_RX_OFFLOAD_CRC_STRIP; /* Supported Tx offloads */ static uint64_t dev_tx_offloads_sup; @@ -148,11 +148,30 @@ dpaa_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) struct dpaa_if *dpaa_intf = dev->data->dev_private; uint32_t frame_size = mtu + ETHER_HDR_LEN + ETHER_CRC_LEN + VLAN_TAG_SIZE; + uint32_t buffsz = dev->data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM; PMD_INIT_FUNC_TRACE(); if (mtu < ETHER_MIN_MTU || frame_size > DPAA_MAX_RX_PKT_LEN) return -EINVAL; + /* + * Refuse mtu that requires the support of scattered packets + * when this feature has not been enabled before. + */ + if (dev->data->min_rx_buf_size && + !dev->data->scattered_rx && frame_size > buffsz) { + DPAA_PMD_ERR("SG not enabled, will not fit in one buffer"); + return -EINVAL; + } + + /* check <seg size> * <max_seg> >= max_frame */ + if (dev->data->min_rx_buf_size && dev->data->scattered_rx && + (frame_size > buffsz * DPAA_SGT_MAX_ENTRIES)) { + DPAA_PMD_ERR("Too big to fit for Max SG list %d", + buffsz * DPAA_SGT_MAX_ENTRIES); + return -EINVAL; + } + if (frame_size > ETHER_MAX_LEN) dev->data->dev_conf.rxmode.offloads &= DEV_RX_OFFLOAD_JUMBO_FRAME; @@ -196,13 +215,24 @@ dpaa_eth_dev_configure(struct rte_eth_dev *dev) if (rx_offloads & DEV_RX_OFFLOAD_JUMBO_FRAME) { if (dev->data->dev_conf.rxmode.max_rx_pkt_len <= DPAA_MAX_RX_PKT_LEN) { + DPAA_PMD_DEBUG("enabling jumbo"); fman_if_set_maxfrm(dpaa_intf->fif, dev->data->dev_conf.rxmode.max_rx_pkt_len); - return 0; + dev->data->mtu = + dev->data->dev_conf.rxmode.max_rx_pkt_len - + ETHER_HDR_LEN - ETHER_CRC_LEN - VLAN_TAG_SIZE; } else { - return -1; + DPAA_PMD_ERR("enabling jumbo err conf max len=%d " + "supported is %d", + dev->data->dev_conf.rxmode.max_rx_pkt_len, + DPAA_MAX_RX_PKT_LEN); } } + if (rx_offloads & DEV_RX_OFFLOAD_JUMBO_FRAME) { + DPAA_PMD_DEBUG("enabling scatter mode"); + fman_if_set_sg(dpaa_intf->fif, 1); + dev->data->scattered_rx = 1; + } return 0; } @@ -300,7 +330,6 @@ static void dpaa_eth_dev_info(struct rte_eth_dev *dev, dev_info->max_rx_queues = dpaa_intf->nb_rx_queues; dev_info->max_tx_queues = dpaa_intf->nb_tx_queues; - dev_info->min_rx_bufsize = DPAA_MIN_RX_BUF_SIZE; dev_info->max_rx_pktlen = DPAA_MAX_RX_PKT_LEN; dev_info->max_mac_addrs = DPAA_MAX_MAC_FILTER; dev_info->max_hash_mac_addrs = 0; @@ -514,6 +543,7 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, struct qm_mcc_initfq opts = {0}; u32 flags = 0; int ret; + u32 buffsz = rte_pktmbuf_data_room_size(mp) - RTE_PKTMBUF_HEADROOM; PMD_INIT_FUNC_TRACE(); @@ -527,6 +557,27 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, DPAA_PMD_INFO("Rx queue setup for queue index: %d fq_id (0x%x)", queue_idx, rxq->fqid); + /* Max packet can fit in single buffer */ + if (dev->data->dev_conf.rxmode.max_rx_pkt_len <= buffsz) { + ; + } else if (dev->data->dev_conf.rxmode.enable_scatter) { + if (dev->data->dev_conf.rxmode.max_rx_pkt_len > + buffsz * DPAA_SGT_MAX_ENTRIES) { + DPAA_PMD_ERR("max RxPkt size %d too big to fit " + "MaxSGlist %d", + dev->data->dev_conf.rxmode.max_rx_pkt_len, + buffsz * DPAA_SGT_MAX_ENTRIES); + rte_errno = EOVERFLOW; + return -rte_errno; + } + } else { + DPAA_PMD_WARN("The requested maximum Rx packet size (%u) is" + " larger than a single mbuf (%u) and scattered" + " mode has not been requested", + dev->data->dev_conf.rxmode.max_rx_pkt_len, + buffsz - RTE_PKTMBUF_HEADROOM); + } + if (!dpaa_intf->bp_info || dpaa_intf->bp_info->mp != mp) { struct fman_if_ic_params icp; uint32_t fd_offset; @@ -553,10 +604,13 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, fman_if_set_bp(dpaa_intf->fif, mp->size, dpaa_intf->bp_info->bpid, bp_size); dpaa_intf->valid = 1; - DPAA_PMD_INFO("if =%s - fd_offset = %d offset = %d", - dpaa_intf->name, fd_offset, - fman_if_get_fdoff(dpaa_intf->fif)); + DPAA_PMD_DEBUG("if:%s fd_offset = %d offset = %d", + dpaa_intf->name, fd_offset, + fman_if_get_fdoff(dpaa_intf->fif)); } + DPAA_PMD_DEBUG("if:%s sg_on = %d, max_frm =%d", dpaa_intf->name, + fman_if_get_sg_enable(dpaa_intf->fif), + dev->data->dev_conf.rxmode.max_rx_pkt_len); /* checking if push mode only, no error check for now */ if (dpaa_push_mode_max_queue > dpaa_push_queue_idx) { dpaa_push_queue_idx++; @@ -1304,6 +1358,9 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev) fman_if_reset_mcast_filter_table(fman_intf); /* Reset interface statistics */ fman_if_stats_reset(fman_intf); + /* Disable SG by default */ + fman_if_set_sg(fman_intf, 0); + fman_if_set_maxfrm(fman_intf, ETHER_MAX_LEN + VLAN_TAG_SIZE); return 0; diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h index c79b9f8..1e7a656 100644 --- a/drivers/net/dpaa/dpaa_ethdev.h +++ b/drivers/net/dpaa/dpaa_ethdev.h @@ -39,9 +39,10 @@ /* Alignment to use for cpu-local structs to avoid coherency problems. */ #define MAX_CACHELINE 64 -#define DPAA_MIN_RX_BUF_SIZE 512 #define DPAA_MAX_RX_PKT_LEN 10240 +#define DPAA_SGT_MAX_ENTRIES 16 /* maximum number of entries in SG Table */ + /* RX queue tail drop threshold (CGR Based) in frame count */ #define CGR_RX_PERFQ_THRESH 256 diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c index 168b77e..6e96a80 100644 --- a/drivers/net/dpaa/dpaa_rxtx.c +++ b/drivers/net/dpaa/dpaa_rxtx.c @@ -306,8 +306,6 @@ dpaa_eth_sg_to_mbuf(const struct qm_fd *fd, uint32_t ifid) int i = 0; uint8_t fd_offset = fd->offset; - DPAA_DP_LOG(DEBUG, "Received an SG frame"); - vaddr = DPAA_MEMPOOL_PTOV(bp_info, qm_fd_addr(fd)); if (!vaddr) { DPAA_PMD_ERR("unable to convert physical address"); @@ -349,6 +347,8 @@ dpaa_eth_sg_to_mbuf(const struct qm_fd *fd, uint32_t ifid) } prev_seg = cur_seg; } + DPAA_DP_LOG(DEBUG, "Received an SG frame len =%d, num_sg =%d", + first_seg->pkt_len, first_seg->nb_segs); dpaa_eth_packet_info(first_seg, vaddr); rte_pktmbuf_free_seg(temp); diff --git a/drivers/net/dpaa/dpaa_rxtx.h b/drivers/net/dpaa/dpaa_rxtx.h index d3e6351..6de70a7 100644 --- a/drivers/net/dpaa/dpaa_rxtx.h +++ b/drivers/net/dpaa/dpaa_rxtx.h @@ -32,8 +32,6 @@ /* L4 Type field: TCP */ #define DPAA_L4_PARSE_RESULT_TCP 0x20 -#define DPAA_SGT_MAX_ENTRIES 16 /* maximum number of entries in SG Table */ - #define DPAA_MAX_DEQUEUE_NUM_FRAMES 63 /** <Maximum number of frames to be dequeued in a single rx call*/ -- 2.7.4 ^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [dpdk-dev] [PATCH v3 16/16] net/dpaa: implement scatter offload support 2018-07-06 8:10 ` [dpdk-dev] [PATCH v3 16/16] net/dpaa: implement scatter offload support Hemant Agrawal @ 2018-07-12 12:23 ` Thomas Monjalon 2018-07-13 6:32 ` Shreyansh Jain 0 siblings, 1 reply; 62+ messages in thread From: Thomas Monjalon @ 2018-07-12 12:23 UTC (permalink / raw) To: Hemant Agrawal; +Cc: dev, shreyansh.jain Title can be "net/dpaa: support scatter offload" 06/07/2018 10:10, Hemant Agrawal: > + /* Max packet can fit in single buffer */ > + if (dev->data->dev_conf.rxmode.max_rx_pkt_len <= buffsz) { > + ; Why an empty statement? > + } else if (dev->data->dev_conf.rxmode.enable_scatter) { error: ‘struct rte_eth_rxmode’ has no member named ‘enable_scatter’ ^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [dpdk-dev] [PATCH v3 16/16] net/dpaa: implement scatter offload support 2018-07-12 12:23 ` Thomas Monjalon @ 2018-07-13 6:32 ` Shreyansh Jain 0 siblings, 0 replies; 62+ messages in thread From: Shreyansh Jain @ 2018-07-13 6:32 UTC (permalink / raw) To: Thomas Monjalon, Hemant Agrawal; +Cc: dev On Thursday 12 July 2018 05:53 PM, Thomas Monjalon wrote: > Title can be "net/dpaa: support scatter offload" > > 06/07/2018 10:10, Hemant Agrawal: >> + /* Max packet can fit in single buffer */ >> + if (dev->data->dev_conf.rxmode.max_rx_pkt_len <= buffsz) { >> + ; > > Why an empty statement? Its just a way of collating the cases without deep cascade. If we don't do this, it would just mean having multiple if cases - either cascading or segregated (non if-else). Either way achieves same result. > >> + } else if (dev->data->dev_conf.rxmode.enable_scatter) { > > error: ‘struct rte_eth_rxmode’ has no member named ‘enable_scatter’ > As for this, it would be because of another patch on master: ab3ce1e0c19 which was not factored when the tree was reviewed. So, this is a merge conflict. Or, maybe a rebase on an old tree before posting patches. Also, for your comment in [1] - this patch doesn't really need a context - it is a feature and the headline is self-explanatory for that. [1] https://mails.dpdk.org/archives/dev/2018-July/107793.html ^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [dpdk-dev] [PATCH v3 01/16] bus/dpaa: fix phandle support for kernel 4.16 2018-07-06 8:09 ` [dpdk-dev] [PATCH v3 " Hemant Agrawal ` (14 preceding siblings ...) 2018-07-06 8:10 ` [dpdk-dev] [PATCH v3 16/16] net/dpaa: implement scatter offload support Hemant Agrawal @ 2018-07-12 12:49 ` Thomas Monjalon 15 siblings, 0 replies; 62+ messages in thread From: Thomas Monjalon @ 2018-07-12 12:49 UTC (permalink / raw) To: Hemant Agrawal, shreyansh.jain, Akhil Goyal; +Cc: dev, Alok Makhariya, stable 06/07/2018 10:09, Hemant Agrawal: > From: Alok Makhariya <alok.makhariya@nxp.com> > > Fixes: 2183c6f69d7e ("bus/dpaa: add OF parser for device scanning") > Cc: Shreyansh Jain <shreyansh.jain@nxp.com> > Cc: stable@dpdk.org > > Signed-off-by: Alok Makhariya <alok.makhariya@nxp.com> > Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com> Series applied without last patch (because must be reworked). This series has a lot of cleanups. Starting from now, I will consider NXP drivers as mature enough. I won't accept anymore such patch without (or not enough) explanation. For your users and readers, please start considering to explain what was wrong and what needs to be changed. Thanks ^ permalink raw reply [flat|nested] 62+ messages in thread
end of thread, other threads:[~2018-07-13 6:32 UTC | newest] Thread overview: 62+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2018-06-21 9:43 [dpdk-dev] [PATCH 01/10] bus/dpaa: fix phandle support for kernel 4.16 Hemant Agrawal 2018-06-21 9:43 ` [dpdk-dev] [PATCH 02/10] bus/dpaa: fix svr id fetch location Hemant Agrawal 2018-06-21 9:43 ` [dpdk-dev] [PATCH 03/10] bus/dpaa: optimize the fq callback routine Hemant Agrawal 2018-06-21 9:43 ` [dpdk-dev] [PATCH 04/10] bus/dpaa: implement new of API to get MAC address Hemant Agrawal 2018-06-21 9:43 ` [dpdk-dev] [PATCH 05/10] bus/dpaa: make vdqcr configurable Hemant Agrawal 2018-06-21 9:44 ` [dpdk-dev] [PATCH 06/10] net/dpaa: support default queue mode Hemant Agrawal 2018-06-21 9:44 ` [dpdk-dev] [PATCH 07/10] net/dpaa: remove experimental tag from PMD APIs Hemant Agrawal 2018-06-21 9:44 ` [dpdk-dev] [PATCH 08/10] net/dpaa2: fix the prefetch Rx to honor nb pkts Hemant Agrawal 2018-06-21 9:44 ` [dpdk-dev] [PATCH 09/10] bus/dpaa: cleanup unnecessary global variables Hemant Agrawal 2018-06-21 9:44 ` [dpdk-dev] [PATCH 10/10] bus/fslmc: " Hemant Agrawal 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 01/16] bus/dpaa: fix phandle support for kernel 4.16 Hemant Agrawal 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 02/16] bus/dpaa: fix svr id fetch location Hemant Agrawal 2018-07-06 4:44 ` Shreyansh Jain 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 03/16] bus/dpaa: fix the buffer offset setting in FMAN Hemant Agrawal 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 04/16] net/dpaa: fix the queue err handling and logs Hemant Agrawal 2018-07-06 4:56 ` Shreyansh Jain 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 05/16] net/dpaa2: fix the prefetch Rx to honor nb pkts Hemant Agrawal 2018-07-06 5:01 ` Shreyansh Jain 2018-07-06 8:13 ` Hemant Agrawal 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 06/16] bus/dpaa: optimize the fq callback routine Hemant Agrawal 2018-07-06 5:07 ` Shreyansh Jain 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 07/16] bus/dpaa: implement new of API to get MAC address Hemant Agrawal 2018-07-06 5:24 ` Shreyansh Jain 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 08/16] bus/dpaa: make vdqcr configurable Hemant Agrawal 2018-07-06 5:24 ` Shreyansh Jain 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 09/16] net/dpaa: support default queue mode Hemant Agrawal 2018-07-06 5:28 ` Shreyansh Jain 2018-07-06 8:13 ` Hemant Agrawal 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 10/16] net/dpaa: remove experimental tag from PMD APIs Hemant Agrawal 2018-07-06 5:29 ` Shreyansh Jain 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 11/16] bus/dpaa: cleanup unnecessary global variables Hemant Agrawal 2018-07-06 4:36 ` Shreyansh Jain 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 12/16] bus/fslmc: " Hemant Agrawal 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 13/16] drivers: support function name in logs trace Hemant Agrawal 2018-07-06 6:34 ` Shreyansh Jain 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 14/16] net/dpaa: move the push queue set to global init Hemant Agrawal 2018-07-06 6:35 ` Shreyansh Jain 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 15/16] bus/dpaa: add support for SG config Hemant Agrawal 2018-07-06 4:38 ` Shreyansh Jain 2018-07-04 9:43 ` [dpdk-dev] [PATCH v2 16/16] net/dpaa: implement scatter offload support Hemant Agrawal 2018-07-06 6:41 ` Shreyansh Jain 2018-07-04 10:59 ` [dpdk-dev] [PATCH v2 01/16] bus/dpaa: fix phandle support for kernel 4.16 Shreyansh Jain 2018-07-06 8:09 ` [dpdk-dev] [PATCH v3 " Hemant Agrawal 2018-07-06 8:09 ` [dpdk-dev] [PATCH v3 02/16] bus/dpaa: fix svr id fetch location Hemant Agrawal 2018-07-06 8:10 ` [dpdk-dev] [PATCH v3 03/16] bus/dpaa: fix the buffer offset setting in FMAN Hemant Agrawal 2018-07-06 12:28 ` Shreyansh Jain 2018-07-06 8:10 ` [dpdk-dev] [PATCH v3 04/16] net/dpaa: fix the queue err handling and logs Hemant Agrawal 2018-07-06 8:10 ` [dpdk-dev] [PATCH v3 05/16] net/dpaa2: fix the prefetch Rx to honor nb pkts Hemant Agrawal 2018-07-06 8:10 ` [dpdk-dev] [PATCH v3 06/16] bus/dpaa: optimize the fq callback routine Hemant Agrawal 2018-07-06 8:10 ` [dpdk-dev] [PATCH v3 07/16] bus/dpaa: implement new of API to get MAC address Hemant Agrawal 2018-07-06 8:10 ` [dpdk-dev] [PATCH v3 08/16] bus/dpaa: make vdqcr configurable Hemant Agrawal 2018-07-06 8:10 ` [dpdk-dev] [PATCH v3 09/16] net/dpaa: support default queue mode Hemant Agrawal 2018-07-06 8:10 ` [dpdk-dev] [PATCH v3 10/16] net/dpaa: remove experimental tag from PMD APIs Hemant Agrawal 2018-07-06 8:10 ` [dpdk-dev] [PATCH v3 11/16] bus/dpaa: cleanup unnecessary global variables Hemant Agrawal 2018-07-06 8:10 ` [dpdk-dev] [PATCH v3 12/16] bus/fslmc: " Hemant Agrawal 2018-07-06 8:10 ` [dpdk-dev] [PATCH v3 13/16] drivers: support function name in logs trace Hemant Agrawal 2018-07-06 8:10 ` [dpdk-dev] [PATCH v3 14/16] net/dpaa: move the push queue set to global init Hemant Agrawal 2018-07-06 8:10 ` [dpdk-dev] [PATCH v3 15/16] bus/dpaa: add support for SG config Hemant Agrawal 2018-07-06 8:10 ` [dpdk-dev] [PATCH v3 16/16] net/dpaa: implement scatter offload support Hemant Agrawal 2018-07-12 12:23 ` Thomas Monjalon 2018-07-13 6:32 ` Shreyansh Jain 2018-07-12 12:49 ` [dpdk-dev] [PATCH v3 01/16] bus/dpaa: fix phandle support for kernel 4.16 Thomas Monjalon
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).