#define DRIVER_LOOPBACK_MODE "drv_loopback"
#define DRIVER_NO_PREFETCH_MODE "drv_no_prefetch"
+#define DRIVER_TX_CONF "drv_tx_conf"
#define CHECK_INTERVAL 100 /* 100ms */
#define MAX_REPEAT_TIME 90 /* 9s (90 * 100ms) in total */
PMD_INIT_FUNC_TRACE();
num_rxqueue_per_tc = (priv->nb_rx_queues / priv->num_rx_tc);
- if (priv->tx_conf_en)
+ if (priv->flags & DPAA2_TX_CONF_ENABLE)
tot_queues = priv->nb_rx_queues + 2 * priv->nb_tx_queues;
else
tot_queues = priv->nb_rx_queues + priv->nb_tx_queues;
goto fail_tx;
}
- if (priv->tx_conf_en) {
+ if (priv->flags & DPAA2_TX_CONF_ENABLE) {
/*Setup tx confirmation queues*/
for (i = 0; i < priv->nb_tx_queues; i++) {
mc_q->eth_data = dev->data;
dpaa2_q = (struct dpaa2_queue *)priv->tx_vq[i];
rte_free(dpaa2_q->cscn);
}
- if (priv->tx_conf_en) {
+ if (priv->flags & DPAA2_TX_CONF_ENABLE) {
/* cleanup tx conf queue storage */
for (i = 0; i < priv->nb_tx_queues; i++) {
dpaa2_q = (struct dpaa2_queue *)
if (tx_queue_id == 0) {
/*Set tx-conf and error configuration*/
- if (priv->tx_conf_en)
+ if (priv->flags & DPAA2_TX_CONF_ENABLE)
ret = dpni_set_tx_confirmation_mode(dpni, CMD_PRI_LOW,
priv->token,
DPNI_CONF_AFFINE);
dpaa2_q->cb_eqresp_free = dpaa2_dev_free_eqresp_buf;
dev->data->tx_queues[tx_queue_id] = dpaa2_q;
- if (priv->tx_conf_en) {
+ if (priv->flags & DPAA2_TX_CONF_ENABLE) {
dpaa2_q->tx_conf_queue = dpaa2_tx_conf_q;
options = options | DPNI_QUEUE_OPT_USER_CTX;
tx_conf_cfg.user_context = (size_t)(dpaa2_q);
priv->max_vlan_filters = attr.vlan_filter_entries;
priv->flags = 0;
#if defined(RTE_LIBRTE_IEEE1588)
- priv->tx_conf_en = 1;
-#else
- priv->tx_conf_en = 0;
+ printf("DPDK IEEE1588 is enabled\n");
+ priv->flags |= DPAA2_TX_CONF_ENABLE;
#endif
+ /* Used with ``fslmc:dpni.1,drv_tx_conf=1`` */
+ if (dpaa2_get_devargs(dev->devargs, DRIVER_TX_CONF)) {
+ priv->flags |= DPAA2_TX_CONF_ENABLE;
+ DPAA2_PMD_INFO("TX_CONF Enabled");
+ }
/* Allocate memory for hardware structure for queues */
ret = dpaa2_alloc_rx_tx_queues(eth_dev);
/* ... tx buffer layout ... */
memset(&layout, 0, sizeof(struct dpni_buffer_layout));
- if (priv->tx_conf_en) {
+ if (priv->flags & DPAA2_TX_CONF_ENABLE) {
layout.options = DPNI_BUF_LAYOUT_OPT_FRAME_STATUS |
DPNI_BUF_LAYOUT_OPT_TIMESTAMP;
layout.pass_timestamp = true;
/* ... tx-conf and error buffer layout ... */
memset(&layout, 0, sizeof(struct dpni_buffer_layout));
- if (priv->tx_conf_en) {
- layout.options = DPNI_BUF_LAYOUT_OPT_FRAME_STATUS |
- DPNI_BUF_LAYOUT_OPT_TIMESTAMP;
+ if (priv->flags & DPAA2_TX_CONF_ENABLE) {
+ layout.options = DPNI_BUF_LAYOUT_OPT_TIMESTAMP;
layout.pass_timestamp = true;
- } else {
- layout.options = DPNI_BUF_LAYOUT_OPT_FRAME_STATUS;
}
+ layout.options |= DPNI_BUF_LAYOUT_OPT_FRAME_STATUS;
layout.pass_frame_status = 1;
ret = dpni_set_buffer_layout(dpni_dev, CMD_PRI_LOW, priv->token,
DPNI_QUEUE_TX_CONFIRM, &layout);
eth_dev->data->dev_private = (void *)dev_priv;
/* Store a pointer to eth_dev in dev_private */
dev_priv->eth_dev = eth_dev;
- dev_priv->tx_conf_en = 0;
} else {
eth_dev = rte_eth_dev_attach_secondary(dpaa2_dev->device.name);
if (!eth_dev) {
RTE_PMD_REGISTER_DPAA2(net_dpaa2, rte_dpaa2_pmd);
RTE_PMD_REGISTER_PARAM_STRING(net_dpaa2,
DRIVER_LOOPBACK_MODE "=<int> "
- DRIVER_NO_PREFETCH_MODE "=<int>");
+ DRIVER_NO_PREFETCH_MODE "=<int>"
+ DRIVER_TX_CONF "=<int>");
RTE_LOG_REGISTER(dpaa2_logtype_pmd, pmd.net.dpaa2, NOTICE);