net/iavf: add RSS hash parsing in AVX path
[dpdk.git] / drivers / net / iavf / iavf.h
index 77b7068..78bdaff 100644 (file)
@@ -6,7 +6,11 @@
 #define _IAVF_ETHDEV_H_
 
 #include <rte_kvargs.h>
-#include "base/iavf_type.h"
+#include <iavf_prototype.h>
+#include <iavf_adminq_cmd.h>
+#include <iavf_type.h>
+
+#include "iavf_log.h"
 
 #define IAVF_AQ_LEN               32
 #define IAVF_AQ_BUF_SZ            4096
@@ -63,6 +67,9 @@
 #define IAVF_48_BIT_WIDTH (CHAR_BIT * 6)
 #define IAVF_48_BIT_MASK  RTE_LEN2MASK(IAVF_48_BIT_WIDTH, uint64_t)
 
+#define IAVF_RX_DESC_EXT_STATUS_FLEXBH_MASK  0x03
+#define IAVF_RX_DESC_EXT_STATUS_FLEXBH_FD_ID 0x01
+
 struct iavf_adapter;
 struct iavf_rx_queue;
 struct iavf_tx_queue;
@@ -79,6 +86,12 @@ struct iavf_vsi {
        struct virtchnl_eth_stats eth_stats_offset;
 };
 
+struct rte_flow;
+TAILQ_HEAD(iavf_flow_list, rte_flow);
+
+struct iavf_flow_parser_node;
+TAILQ_HEAD(iavf_parser_list, iavf_flow_parser_node);
+
 /* TODO: is that correct to assume the max number to be 16 ?*/
 #define IAVF_MAX_MSIX_VECTORS   16
 
@@ -93,6 +106,7 @@ struct iavf_info {
        struct virtchnl_version_info virtchnl_version;
        struct virtchnl_vf_resource *vf_res; /* VF resource */
        struct virtchnl_vsi_resource *vsi_res; /* LAN VSI */
+       uint64_t supported_rxdid;
 
        volatile enum virtchnl_ops pend_cmd; /* pending command not finished */
        uint32_t cmd_retval; /* return value of the cmd response from PF */
@@ -113,9 +127,13 @@ struct iavf_info {
        uint16_t msix_base; /* msix vector base from */
        /* queue bitmask for each vector */
        uint16_t rxq_map[IAVF_MAX_MSIX_VECTORS];
+       struct iavf_flow_list flow_list;
+       rte_spinlock_t flow_ops_lock;
+       struct iavf_parser_list rss_parser_list;
+       struct iavf_parser_list dist_parser_list;
 };
 
-#define IAVF_MAX_PKT_TYPE 256
+#define IAVF_MAX_PKT_TYPE 1024
 
 /* Structure to store private data for each VF instance. */
 struct iavf_adapter {
@@ -127,7 +145,9 @@ struct iavf_adapter {
        /* For vector PMD */
        bool rx_vec_allowed;
        bool tx_vec_allowed;
+       const uint32_t *ptype_tbl;
        bool stopped;
+       uint16_t fdir_ref_cnt;
 };
 
 /* IAVF_DEV_PRIVATE_TO */
@@ -174,6 +194,17 @@ struct iavf_cmd_info {
        uint32_t out_size;      /* buffer size for response */
 };
 
+/* notify current command done. Only call in case execute
+ * _atomic_set_cmd successfully.
+ */
+static inline void
+_notify_cmd(struct iavf_info *vf, uint32_t msg_ret)
+{
+       vf->cmd_retval = msg_ret;
+       rte_wmb();
+       vf->pend_cmd = VIRTCHNL_OP_UNKNOWN;
+}
+
 /* clear current command. Only call in case execute
  * _atomic_set_cmd successfully.
  */
@@ -209,6 +240,7 @@ int iavf_disable_queues(struct iavf_adapter *adapter);
 int iavf_configure_rss_lut(struct iavf_adapter *adapter);
 int iavf_configure_rss_key(struct iavf_adapter *adapter);
 int iavf_configure_queues(struct iavf_adapter *adapter);
+int iavf_get_supported_rxdid(struct iavf_adapter *adapter);
 int iavf_config_irq_map(struct iavf_adapter *adapter);
 void iavf_add_del_all_mac_addr(struct iavf_adapter *adapter, bool add);
 int iavf_dev_link_update(struct rte_eth_dev *dev,