1 /* SPDX-License-Identifier: BSD-3-Clause
3 * Copyright (c) 2015-2016 Freescale Semiconductor, Inc. All rights reserved.
8 #ifndef _DPAA2_ETHDEV_H
9 #define _DPAA2_ETHDEV_H
11 #include <rte_event_eth_rx_adapter.h>
13 #include <mc/fsl_dpni.h>
14 #include <mc/fsl_mc_sys.h>
16 #define DPAA2_MIN_RX_BUF_SIZE 512
17 #define DPAA2_MAX_RX_PKT_LEN 10240 /*WRIOP support*/
19 #define MAX_TCS DPNI_MAX_TC
20 #define MAX_RX_QUEUES 16
21 #define MAX_TX_QUEUES 16
23 /*default tc to be used for ,congestion, distribution etc configuration. */
24 #define DPAA2_DEF_TC 0
26 /* Threshold for a Tx queue to *Enter* Congestion state.
28 #define CONG_ENTER_TX_THRESHOLD 512
30 /* Threshold for a queue to *Exit* Congestion state.
32 #define CONG_EXIT_TX_THRESHOLD 480
34 #define CONG_RETRY_COUNT 18000
36 /* RX queue tail drop threshold
37 * currently considering 32 KB packets
39 #define CONG_THRESHOLD_RX_Q (64 * 1024)
40 #define CONG_RX_OAL 128
42 /* Size of the input SMMU mapped memory required by MC */
43 #define DIST_PARAM_IOVA_SIZE 256
45 /* Enable TX Congestion control support
48 #define DPAA2_TX_CGR_OFF 0x01
50 /* Disable RX tail drop, default is enable */
51 #define DPAA2_RX_TAILDROP_OFF 0x04
53 struct dpaa2_dev_priv {
60 void *rx_vq[MAX_RX_QUEUES];
61 void *tx_vq[MAX_TX_QUEUES];
63 struct dpaa2_bp_list *bp_list; /**<Attached buffer pool list */
65 uint8_t max_mac_filters;
66 uint8_t max_vlan_filters;
68 uint8_t flags; /*dpaa2 config flags */
71 int dpaa2_setup_flow_dist(struct rte_eth_dev *eth_dev,
72 uint64_t req_dist_set);
74 int dpaa2_remove_flow_dist(struct rte_eth_dev *eth_dev,
77 int dpaa2_attach_bp_list(struct dpaa2_dev_priv *priv, void *blist);
79 int dpaa2_eth_eventq_attach(const struct rte_eth_dev *dev,
82 const struct rte_event_eth_rx_adapter_queue_conf *queue_conf);
84 int dpaa2_eth_eventq_detach(const struct rte_eth_dev *dev,
87 uint16_t dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs,
89 void dpaa2_dev_process_parallel_event(struct qbman_swp *swp,
90 const struct qbman_fd *fd,
91 const struct qbman_result *dq,
92 struct dpaa2_queue *rxq,
93 struct rte_event *ev);
94 uint16_t dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts);
95 uint16_t dummy_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts);
96 #endif /* _DPAA2_ETHDEV_H */