net/qede: add fastpath support for VXLAN tunneling
[dpdk.git] / drivers / net / qede / qede_ethdev.h
index ed2d41c..d736246 100644 (file)
@@ -15,6 +15,7 @@
 #include <rte_ether.h>
 #include <rte_ethdev.h>
 #include <rte_dev.h>
+#include <rte_ip.h>
 
 /* ecore includes */
 #include "base/bcm_osal.h"
 #include "base/ecore_hsi_eth.h"
 #include "base/ecore_dev_api.h"
 #include "base/ecore_iov_api.h"
+#include "base/ecore_cxt.h"
+#include "base/nvm_cfg.h"
+#include "base/ecore_iov_api.h"
+#include "base/ecore_sp_commands.h"
 
 #include "qede_logs.h"
 #include "qede_if.h"
 /* Driver versions */
 #define QEDE_PMD_VER_PREFIX            "QEDE PMD"
 #define QEDE_PMD_VERSION_MAJOR         1
-#define QEDE_PMD_VERSION_MINOR         1
+#define QEDE_PMD_VERSION_MINOR         2
 #define QEDE_PMD_VERSION_REVISION       0
 #define QEDE_PMD_VERSION_PATCH         1
 
-#define QEDE_MAJOR_VERSION             8
-#define QEDE_MINOR_VERSION             7
-#define QEDE_REVISION_VERSION          9
-#define QEDE_ENGINEERING_VERSION       0
+#define QEDE_PMD_VERSION qede_stringify(QEDE_PMD_VERSION_MAJOR) "."     \
+                        qede_stringify(QEDE_PMD_VERSION_MINOR) "."     \
+                        qede_stringify(QEDE_PMD_VERSION_REVISION) "."  \
+                        qede_stringify(QEDE_PMD_VERSION_PATCH)
+
+#define QEDE_PMD_DRV_VER_STR_SIZE NAME_SIZE
+#define QEDE_PMD_VER_PREFIX "QEDE PMD"
 
-#define QEDE_DRV_MODULE_VERSION qede_stringify(QEDE_MAJOR_VERSION) "." \
-               qede_stringify(QEDE_MINOR_VERSION) "."                  \
-               qede_stringify(QEDE_REVISION_VERSION) "."               \
-               qede_stringify(QEDE_ENGINEERING_VERSION)
 
 #define QEDE_RSS_INDIR_INITED     (1 << 0)
 #define QEDE_RSS_KEY_INITED       (1 << 1)
 #define QEDE_MAX_TSS_CNT(edev)  ((edev)->dev_info.num_queues * \
                                        (edev)->dev_info.num_tc)
 
-#define QEDE_RSS_CNT(edev)     ((edev)->fp_num_rx)
-#define QEDE_TSS_CNT(edev)     ((edev)->fp_num_rx * (edev)->num_tc)
+#define QEDE_QUEUE_CNT(qdev) ((qdev)->num_queues)
+#define QEDE_RSS_COUNT(qdev) ((qdev)->num_queues - (qdev)->fp_num_tx)
+#define QEDE_TSS_COUNT(qdev) (((qdev)->num_queues - (qdev)->fp_num_rx) * \
+                                       (qdev)->num_tc)
+
+#define QEDE_FASTPATH_TX        (1 << 0)
+#define QEDE_FASTPATH_RX        (1 << 1)
 
 #define QEDE_DUPLEX_FULL       1
 #define QEDE_DUPLEX_HALF       2
 
 #define QEDE_INIT_EDEV(adapter) (&((struct qede_dev *)adapter)->edev)
 
-#define QEDE_QUEUE_CNT(qdev) ((qdev)->num_queues)
-#define QEDE_RSS_COUNT(qdev) ((qdev)->num_queues - (qdev)->fp_num_tx)
-#define QEDE_TSS_COUNT(qdev) (((qdev)->num_queues - (qdev)->fp_num_rx) * \
-               (qdev)->num_tc)
-#define QEDE_TC_IDX(qdev, txqidx) ((txqidx) / QEDE_TSS_COUNT(qdev))
-
 #define QEDE_INIT(eth_dev) {                                   \
        struct qede_dev *qdev = eth_dev->data->dev_private;     \
        struct ecore_dev *edev = &qdev->edev;                   \
 #define PCI_DEVICE_ID_57980S_IOV        CHIP_NUM_57980S_IOV
 #define PCI_DEVICE_ID_57980S_100        CHIP_NUM_57980S_100
 
+#define QEDE_VXLAN_DEF_PORT            8472
+
 extern char fw_file[];
 
 /* Port/function states */
@@ -123,6 +128,18 @@ struct qede_vlan_entry {
        uint16_t vid;
 };
 
+struct qede_mcast_entry {
+       struct ether_addr mac;
+       SLIST_ENTRY(qede_mcast_entry) list;
+};
+
+struct qede_ucast_entry {
+       struct ether_addr mac;
+       uint16_t vlan;
+       uint16_t vni;
+       SLIST_ENTRY(qede_ucast_entry) list;
+};
+
 /*
  *  Structure to store private data for each port.
  */
@@ -133,7 +150,6 @@ struct qede_dev {
        struct qed_dev_eth_info dev_info;
        struct ecore_sb_info *sb_array;
        struct qede_fastpath *fp_array;
-       uint16_t num_rss;
        uint8_t num_tc;
        uint16_t mtu;
        bool rss_enabled;
@@ -148,10 +164,32 @@ struct qede_dev {
        uint16_t configured_vlans;
        bool accept_any_vlan;
        struct ether_addr primary_mac;
+       SLIST_HEAD(mc_list_head, qede_mcast_entry) mc_list_head;
+       uint16_t num_mc_addr;
+       SLIST_HEAD(uc_list_head, qede_ucast_entry) uc_list_head;
+       uint16_t num_uc_addr;
        bool handle_hw_err;
-       char drv_ver[QED_DRV_VER_STR_SIZE];
+       uint16_t num_tunn_filters;
+       uint16_t vxlan_filter_type;
+       char drv_ver[QEDE_PMD_DRV_VER_STR_SIZE];
 };
 
+/* Static functions */
+static int qede_vlan_filter_set(struct rte_eth_dev *eth_dev,
+                               uint16_t vlan_id, int on);
+
+static int qede_rss_hash_update(struct rte_eth_dev *eth_dev,
+                               struct rte_eth_rss_conf *rss_conf);
+
+static int qede_rss_reta_update(struct rte_eth_dev *eth_dev,
+                               struct rte_eth_rss_reta_entry64 *reta_conf,
+                               uint16_t reta_size);
+
+static inline uint32_t qede_rx_cqe_to_pkt_type(uint16_t flags);
+
+/* Non-static functions */
+void qede_init_rss_caps(uint8_t *rss_caps, uint64_t hf);
+
 int qed_fill_eth_dev_info(struct ecore_dev *edev,
                                 struct qed_dev_eth_info *info);
 int qede_dev_set_link_state(struct rte_eth_dev *eth_dev, bool link_up);