X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fngbe%2Fngbe_ethdev.h;h=1b9bec50b7ebf41733acfce6d507a31cfd251e81;hb=0779d7f6199143c6103609f8a4359e6920c96897;hp=7fb72f3f1f8c5068e9f9b84057eb6ec9a5cd29f5;hpb=cc63194e89cb342abc7d273a84887e1715bdbd08;p=dpdk.git diff --git a/drivers/net/ngbe/ngbe_ethdev.h b/drivers/net/ngbe/ngbe_ethdev.h index 7fb72f3f1f..1b9bec50b7 100644 --- a/drivers/net/ngbe/ngbe_ethdev.h +++ b/drivers/net/ngbe/ngbe_ethdev.h @@ -6,6 +6,8 @@ #ifndef _NGBE_ETHDEV_H_ #define _NGBE_ETHDEV_H_ +#include "ngbe_ptypes.h" + /* need update link, bit flag */ #define NGBE_FLAG_NEED_LINK_UPDATE ((uint32_t)(1 << 0)) #define NGBE_FLAG_MAILBOX ((uint32_t)(1 << 1)) @@ -13,8 +15,34 @@ #define NGBE_FLAG_MACSEC ((uint32_t)(1 << 3)) #define NGBE_FLAG_NEED_LINK_CONFIG ((uint32_t)(1 << 4)) +#define NGBE_VFTA_SIZE 128 +#define NGBE_VLAN_TAG_SIZE 4 +#define NGBE_HKEY_MAX_INDEX 10 +/*Default value of Max Rx Queue*/ +#define NGBE_MAX_RX_QUEUE_NUM 8 + +#ifndef NBBY +#define NBBY 8 /* number of bits in a byte */ +#endif +#define NGBE_HWSTRIP_BITMAP_SIZE \ + (NGBE_MAX_RX_QUEUE_NUM / (sizeof(uint32_t) * NBBY)) + #define NGBE_QUEUE_ITR_INTERVAL_DEFAULT 500 /* 500us */ +/* The overhead from MTU to max frame size. */ +#define NGBE_ETH_OVERHEAD (RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN) + +#define NGBE_RSS_OFFLOAD_ALL ( \ + RTE_ETH_RSS_IPV4 | \ + RTE_ETH_RSS_NONFRAG_IPV4_TCP | \ + RTE_ETH_RSS_NONFRAG_IPV4_UDP | \ + RTE_ETH_RSS_IPV6 | \ + RTE_ETH_RSS_NONFRAG_IPV6_TCP | \ + RTE_ETH_RSS_NONFRAG_IPV6_UDP | \ + RTE_ETH_RSS_IPV6_EX | \ + RTE_ETH_RSS_IPV6_TCP_EX | \ + RTE_ETH_RSS_IPV6_UDP_EX) + #define NGBE_MISC_VEC_ID RTE_INTR_VEC_ZERO_OFFSET #define NGBE_RX_VEC_START RTE_INTR_VEC_RXTX_OFFSET @@ -27,13 +55,43 @@ struct ngbe_interrupt { uint64_t mask_orig; /* save mask during delayed handler */ }; +#define NGBE_NB_STAT_MAPPING 32 +#define NB_QMAP_FIELDS_PER_QSM_REG 4 +#define QMAP_FIELD_RESERVED_BITS_MASK 0x0f +struct ngbe_stat_mappings { + uint32_t tqsm[NGBE_NB_STAT_MAPPING]; + uint32_t rqsm[NGBE_NB_STAT_MAPPING]; +}; + +struct ngbe_vfta { + uint32_t vfta[NGBE_VFTA_SIZE]; +}; + +struct ngbe_hwstrip { + uint32_t bitmap[NGBE_HWSTRIP_BITMAP_SIZE]; +}; + +struct ngbe_uta_info { + uint8_t uc_filter_type; + uint16_t uta_in_use; + uint32_t uta_shadow[NGBE_MAX_UTA]; +}; + /* * Structure to store private data for each driver instance (for each port). */ struct ngbe_adapter { struct ngbe_hw hw; + struct ngbe_hw_stats stats; struct ngbe_interrupt intr; + struct ngbe_stat_mappings stat_mappings; + struct ngbe_vfta shadow_vfta; + struct ngbe_hwstrip hwstrip; + struct ngbe_uta_info uta_info; bool rx_bulk_alloc_allowed; + + /* For RSS reta table update */ + uint8_t rss_reta_updated; }; static inline struct ngbe_adapter * @@ -53,6 +111,9 @@ ngbe_dev_hw(struct rte_eth_dev *dev) return hw; } +#define NGBE_DEV_STATS(dev) \ + (&((struct ngbe_adapter *)(dev)->data->dev_private)->stats) + static inline struct ngbe_interrupt * ngbe_dev_intr(struct rte_eth_dev *dev) { @@ -62,6 +123,17 @@ ngbe_dev_intr(struct rte_eth_dev *dev) return intr; } +#define NGBE_DEV_STAT_MAPPINGS(dev) \ + (&((struct ngbe_adapter *)(dev)->data->dev_private)->stat_mappings) + +#define NGBE_DEV_VFTA(dev) \ + (&((struct ngbe_adapter *)(dev)->data->dev_private)->shadow_vfta) + +#define NGBE_DEV_HWSTRIP(dev) \ + (&((struct ngbe_adapter *)(dev)->data->dev_private)->hwstrip) +#define NGBE_DEV_UTA_INFO(dev) \ + (&((struct ngbe_adapter *)(dev)->data->dev_private)->uta_info) + /* * Rx/Tx function prototypes */ @@ -69,9 +141,9 @@ void ngbe_dev_clear_queues(struct rte_eth_dev *dev); void ngbe_dev_free_queues(struct rte_eth_dev *dev); -void ngbe_dev_rx_queue_release(void *rxq); +void ngbe_dev_rx_queue_release(struct rte_eth_dev *dev, uint16_t qid); -void ngbe_dev_tx_queue_release(void *txq); +void ngbe_dev_tx_queue_release(struct rte_eth_dev *dev, uint16_t qid); int ngbe_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id, uint16_t nb_rx_desc, unsigned int socket_id, @@ -101,19 +173,57 @@ int ngbe_dev_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id); int ngbe_dev_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id); +int +ngbe_rx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id, + struct rte_eth_burst_mode *mode); +int +ngbe_tx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id, + struct rte_eth_burst_mode *mode); + uint16_t ngbe_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts); +uint16_t ngbe_recv_pkts_bulk_alloc(void *rx_queue, struct rte_mbuf **rx_pkts, + uint16_t nb_pkts); + +uint16_t ngbe_recv_pkts_sc_single_alloc(void *rx_queue, + struct rte_mbuf **rx_pkts, uint16_t nb_pkts); +uint16_t ngbe_recv_pkts_sc_bulk_alloc(void *rx_queue, + struct rte_mbuf **rx_pkts, uint16_t nb_pkts); + +uint16_t ngbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, + uint16_t nb_pkts); + uint16_t ngbe_xmit_pkts_simple(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts); +uint16_t ngbe_prep_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, + uint16_t nb_pkts); + +int ngbe_dev_rss_hash_update(struct rte_eth_dev *dev, + struct rte_eth_rss_conf *rss_conf); + +int ngbe_dev_rss_hash_conf_get(struct rte_eth_dev *dev, + struct rte_eth_rss_conf *rss_conf); + void ngbe_set_ivar_map(struct ngbe_hw *hw, int8_t direction, uint8_t queue, uint8_t msix_vector); +void ngbe_configure_port(struct rte_eth_dev *dev); + int ngbe_dev_link_update_share(struct rte_eth_dev *dev, int wait_to_complete); +/* + * misc function prototypes + */ +void ngbe_vlan_hw_filter_enable(struct rte_eth_dev *dev); + +void ngbe_vlan_hw_filter_disable(struct rte_eth_dev *dev); + +void ngbe_vlan_hw_strip_config(struct rte_eth_dev *dev); + #define NGBE_LINK_DOWN_CHECK_TIMEOUT 4000 /* ms */ #define NGBE_LINK_UP_CHECK_TIMEOUT 1000 /* ms */ #define NGBE_VMDQ_NUM_UC_MAC 4096 /* Maximum nb. of UC MAC addr. */ @@ -131,4 +241,27 @@ ngbe_dev_link_update_share(struct rte_eth_dev *dev, #define NGBE_DEFAULT_TX_HTHRESH 0 #define NGBE_DEFAULT_TX_WTHRESH 0 +/* store statistics names and its offset in stats structure */ +struct rte_ngbe_xstats_name_off { + char name[RTE_ETH_XSTATS_NAME_SIZE]; + unsigned int offset; +}; + +const uint32_t *ngbe_dev_supported_ptypes_get(struct rte_eth_dev *dev); +int ngbe_dev_set_mc_addr_list(struct rte_eth_dev *dev, + struct rte_ether_addr *mc_addr_set, + uint32_t nb_mc_addr); +int ngbe_dev_rss_reta_update(struct rte_eth_dev *dev, + struct rte_eth_rss_reta_entry64 *reta_conf, + uint16_t reta_size); +int ngbe_dev_rss_reta_query(struct rte_eth_dev *dev, + struct rte_eth_rss_reta_entry64 *reta_conf, + uint16_t reta_size); +void ngbe_vlan_hw_strip_bitmap_set(struct rte_eth_dev *dev, + uint16_t queue, bool on); +void ngbe_config_vlan_strip_on_all_queues(struct rte_eth_dev *dev, + int mask); +void ngbe_read_stats_registers(struct ngbe_hw *hw, + struct ngbe_hw_stats *hw_stats); + #endif /* _NGBE_ETHDEV_H_ */