2017-12-19 10:14:40 +00:00
|
|
|
/* SPDX-License-Identifier: BSD-3-Clause
|
2017-04-11 13:49:17 +00:00
|
|
|
*
|
|
|
|
* Copyright (c) 2015-2016 Freescale Semiconductor, Inc. All rights reserved.
|
2017-12-19 10:14:40 +00:00
|
|
|
* Copyright 2016 NXP
|
2017-04-11 13:49:17 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _DPAA2_ETHDEV_H
|
|
|
|
#define _DPAA2_ETHDEV_H
|
|
|
|
|
2017-10-23 12:37:03 +00:00
|
|
|
#include <rte_event_eth_rx_adapter.h>
|
|
|
|
|
2017-04-11 13:49:22 +00:00
|
|
|
#include <mc/fsl_dpni.h>
|
|
|
|
#include <mc/fsl_mc_sys.h>
|
|
|
|
|
2017-04-11 13:49:25 +00:00
|
|
|
#define DPAA2_MIN_RX_BUF_SIZE 512
|
|
|
|
#define DPAA2_MAX_RX_PKT_LEN 10240 /*WRIOP support*/
|
|
|
|
|
2017-04-11 13:49:23 +00:00
|
|
|
#define MAX_TCS DPNI_MAX_TC
|
2017-04-11 13:49:22 +00:00
|
|
|
#define MAX_RX_QUEUES 16
|
|
|
|
#define MAX_TX_QUEUES 16
|
|
|
|
|
|
|
|
/*default tc to be used for ,congestion, distribution etc configuration. */
|
|
|
|
#define DPAA2_DEF_TC 0
|
|
|
|
|
2017-06-22 13:57:16 +00:00
|
|
|
/* Threshold for a Tx queue to *Enter* Congestion state.
|
2017-05-26 06:51:13 +00:00
|
|
|
*/
|
2017-06-22 13:57:16 +00:00
|
|
|
#define CONG_ENTER_TX_THRESHOLD 512
|
2017-05-26 06:51:13 +00:00
|
|
|
|
|
|
|
/* Threshold for a queue to *Exit* Congestion state.
|
|
|
|
*/
|
2017-06-22 13:57:16 +00:00
|
|
|
#define CONG_EXIT_TX_THRESHOLD 480
|
2017-05-26 06:51:13 +00:00
|
|
|
|
2017-07-24 07:31:46 +00:00
|
|
|
#define CONG_RETRY_COUNT 18000
|
|
|
|
|
2017-05-26 06:51:14 +00:00
|
|
|
/* RX queue tail drop threshold
|
|
|
|
* currently considering 32 KB packets
|
|
|
|
*/
|
2017-06-22 13:57:16 +00:00
|
|
|
#define CONG_THRESHOLD_RX_Q (64 * 1024)
|
2017-09-16 10:52:25 +00:00
|
|
|
#define CONG_RX_OAL 128
|
2017-05-26 06:51:14 +00:00
|
|
|
|
2017-04-11 13:49:23 +00:00
|
|
|
/* Size of the input SMMU mapped memory required by MC */
|
|
|
|
#define DIST_PARAM_IOVA_SIZE 256
|
|
|
|
|
2017-05-26 06:51:13 +00:00
|
|
|
/* Enable TX Congestion control support
|
|
|
|
* default is disable
|
|
|
|
*/
|
2017-07-24 07:31:46 +00:00
|
|
|
#define DPAA2_TX_CGR_OFF 0x01
|
2017-05-26 06:51:13 +00:00
|
|
|
|
2017-05-26 06:51:14 +00:00
|
|
|
/* Disable RX tail drop, default is enable */
|
|
|
|
#define DPAA2_RX_TAILDROP_OFF 0x04
|
|
|
|
|
2018-05-01 10:44:28 +00:00
|
|
|
#define DPAA2_RSS_OFFLOAD_ALL ( \
|
|
|
|
ETH_RSS_IP | \
|
|
|
|
ETH_RSS_UDP | \
|
|
|
|
ETH_RSS_TCP | \
|
|
|
|
ETH_RSS_SCTP)
|
|
|
|
|
2017-12-08 05:21:24 +00:00
|
|
|
/* LX2 FRC Parsed values (Little Endian) */
|
|
|
|
#define DPAA2_PKT_TYPE_ETHER 0x0060
|
|
|
|
#define DPAA2_PKT_TYPE_IPV4 0x0000
|
|
|
|
#define DPAA2_PKT_TYPE_IPV6 0x0020
|
|
|
|
#define DPAA2_PKT_TYPE_IPV4_EXT \
|
|
|
|
(0x0001 | DPAA2_PKT_TYPE_IPV4)
|
|
|
|
#define DPAA2_PKT_TYPE_IPV6_EXT \
|
|
|
|
(0x0001 | DPAA2_PKT_TYPE_IPV6)
|
|
|
|
#define DPAA2_PKT_TYPE_IPV4_TCP \
|
|
|
|
(0x000e | DPAA2_PKT_TYPE_IPV4)
|
|
|
|
#define DPAA2_PKT_TYPE_IPV6_TCP \
|
|
|
|
(0x000e | DPAA2_PKT_TYPE_IPV6)
|
|
|
|
#define DPAA2_PKT_TYPE_IPV4_UDP \
|
|
|
|
(0x0010 | DPAA2_PKT_TYPE_IPV4)
|
|
|
|
#define DPAA2_PKT_TYPE_IPV6_UDP \
|
|
|
|
(0x0010 | DPAA2_PKT_TYPE_IPV6)
|
|
|
|
#define DPAA2_PKT_TYPE_IPV4_SCTP \
|
|
|
|
(0x000f | DPAA2_PKT_TYPE_IPV4)
|
|
|
|
#define DPAA2_PKT_TYPE_IPV6_SCTP \
|
|
|
|
(0x000f | DPAA2_PKT_TYPE_IPV6)
|
|
|
|
#define DPAA2_PKT_TYPE_IPV4_ICMP \
|
|
|
|
(0x0003 | DPAA2_PKT_TYPE_IPV4_EXT)
|
|
|
|
#define DPAA2_PKT_TYPE_IPV6_ICMP \
|
|
|
|
(0x0003 | DPAA2_PKT_TYPE_IPV6_EXT)
|
|
|
|
#define DPAA2_PKT_TYPE_VLAN_1 0x0160
|
|
|
|
#define DPAA2_PKT_TYPE_VLAN_2 0x0260
|
|
|
|
|
2017-04-11 13:49:17 +00:00
|
|
|
struct dpaa2_dev_priv {
|
|
|
|
void *hw;
|
|
|
|
int32_t hw_id;
|
2017-04-11 13:49:22 +00:00
|
|
|
int32_t qdid;
|
2017-04-11 13:49:17 +00:00
|
|
|
uint16_t token;
|
2017-04-11 13:49:22 +00:00
|
|
|
uint8_t nb_tx_queues;
|
|
|
|
uint8_t nb_rx_queues;
|
|
|
|
void *rx_vq[MAX_RX_QUEUES];
|
|
|
|
void *tx_vq[MAX_TX_QUEUES];
|
2017-04-11 13:49:17 +00:00
|
|
|
|
2017-04-11 13:49:25 +00:00
|
|
|
struct dpaa2_bp_list *bp_list; /**<Attached buffer pool list */
|
2017-04-11 13:49:24 +00:00
|
|
|
uint32_t options;
|
|
|
|
uint8_t max_mac_filters;
|
|
|
|
uint8_t max_vlan_filters;
|
2017-09-16 10:35:49 +00:00
|
|
|
uint8_t num_rx_tc;
|
2017-04-11 13:49:17 +00:00
|
|
|
uint8_t flags; /*dpaa2 config flags */
|
|
|
|
};
|
2017-04-11 13:49:23 +00:00
|
|
|
|
|
|
|
int dpaa2_setup_flow_dist(struct rte_eth_dev *eth_dev,
|
2017-09-16 10:52:32 +00:00
|
|
|
uint64_t req_dist_set);
|
2017-04-11 13:49:23 +00:00
|
|
|
|
|
|
|
int dpaa2_remove_flow_dist(struct rte_eth_dev *eth_dev,
|
|
|
|
uint8_t tc_index);
|
|
|
|
|
2017-04-11 13:49:25 +00:00
|
|
|
int dpaa2_attach_bp_list(struct dpaa2_dev_priv *priv, void *blist);
|
|
|
|
|
2017-10-23 12:37:03 +00:00
|
|
|
int dpaa2_eth_eventq_attach(const struct rte_eth_dev *dev,
|
|
|
|
int eth_rx_queue_id,
|
|
|
|
uint16_t dpcon_id,
|
|
|
|
const struct rte_event_eth_rx_adapter_queue_conf *queue_conf);
|
|
|
|
|
|
|
|
int dpaa2_eth_eventq_detach(const struct rte_eth_dev *dev,
|
|
|
|
int eth_rx_queue_id);
|
|
|
|
|
2017-05-26 06:51:11 +00:00
|
|
|
uint16_t dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs,
|
|
|
|
uint16_t nb_pkts);
|
2017-10-23 12:37:03 +00:00
|
|
|
void dpaa2_dev_process_parallel_event(struct qbman_swp *swp,
|
|
|
|
const struct qbman_fd *fd,
|
|
|
|
const struct qbman_result *dq,
|
|
|
|
struct dpaa2_queue *rxq,
|
|
|
|
struct rte_event *ev);
|
2018-01-17 11:39:14 +00:00
|
|
|
void dpaa2_dev_process_atomic_event(struct qbman_swp *swp,
|
|
|
|
const struct qbman_fd *fd,
|
|
|
|
const struct qbman_result *dq,
|
|
|
|
struct dpaa2_queue *rxq,
|
|
|
|
struct rte_event *ev);
|
2017-04-11 13:49:29 +00:00
|
|
|
uint16_t dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts);
|
2017-05-26 06:51:20 +00:00
|
|
|
uint16_t dummy_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts);
|
2017-04-11 13:49:17 +00:00
|
|
|
#endif /* _DPAA2_ETHDEV_H */
|