net/bnxt: fix Rx configuration
[dpdk.git] / drivers / net / ngbe / ngbe_ethdev.h
index 7fbde4e..8d500fd 100644 (file)
@@ -7,6 +7,7 @@
 #define _NGBE_ETHDEV_H_
 
 #include "ngbe_ptypes.h"
+#include <rte_time.h>
 #include <rte_ethdev.h>
 #include <rte_ethdev_core.h>
 
@@ -18,7 +19,6 @@
 #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
@@ -129,6 +129,9 @@ struct ngbe_adapter {
        struct ngbe_vf_info        *vfdata;
        struct ngbe_uta_info       uta_info;
        bool                       rx_bulk_alloc_allowed;
+       struct rte_timecounter     systime_tc;
+       struct rte_timecounter     rx_tstamp_tc;
+       struct rte_timecounter     tx_tstamp_tc;
 
        /* For RSS reta table update */
        uint8_t rss_reta_updated;
@@ -198,6 +201,11 @@ int  ngbe_dev_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id,
                uint16_t nb_tx_desc, unsigned int socket_id,
                const struct rte_eth_txconf *tx_conf);
 
+uint32_t ngbe_dev_rx_queue_count(void *rx_queue);
+
+int ngbe_dev_rx_descriptor_status(void *rx_queue, uint16_t offset);
+int ngbe_dev_tx_descriptor_status(void *tx_queue, uint16_t offset);
+
 int ngbe_dev_rx_init(struct rte_eth_dev *dev);
 
 void ngbe_dev_tx_init(struct rte_eth_dev *dev);
@@ -217,6 +225,12 @@ 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);
 
+void ngbe_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+       struct rte_eth_rxq_info *qinfo);
+
+void ngbe_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+       struct rte_eth_txq_info *qinfo);
+
 int
 ngbe_rx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id,
                      struct rte_eth_burst_mode *mode);
@@ -276,6 +290,14 @@ void ngbe_pf_mbx_process(struct rte_eth_dev *eth_dev);
 
 int ngbe_pf_host_configure(struct rte_eth_dev *eth_dev);
 
+/* High threshold controlling when to start sending XOFF frames. */
+#define NGBE_FC_XOFF_HITH              128 /*KB*/
+/* Low threshold controlling when to start sending XON frames. */
+#define NGBE_FC_XON_LOTH               64 /*KB*/
+
+/* Timer value included in XOFF frames. */
+#define NGBE_FC_PAUSE_TIME 0x680
+
 #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. */
@@ -293,6 +315,12 @@ int ngbe_pf_host_configure(struct rte_eth_dev *eth_dev);
 #define NGBE_DEFAULT_TX_HTHRESH      0
 #define NGBE_DEFAULT_TX_WTHRESH      0
 
+/* Additional timesync values. */
+#define NGBE_INCVAL_1GB         0x2000000 /* all speed is same in Emerald */
+#define NGBE_INCVAL_SHIFT_1GB   22 /* all speed is same in Emerald */
+
+#define NGBE_CYCLECOUNTER_MASK   0xffffffffffffffffULL
+
 /* store statistics names and its offset in stats structure */
 struct rte_ngbe_xstats_name_off {
        char name[RTE_ETH_XSTATS_NAME_SIZE];
@@ -313,6 +341,7 @@ 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_dev_setup_link_alarm_handler(void *param);
 void ngbe_read_stats_registers(struct ngbe_hw *hw,
                           struct ngbe_hw_stats *hw_stats);