]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/net/ethernet/intel/i40e/i40e.h
i40e: Look up MAC address in Open Firmware or IDPROM
[karo-tx-linux.git] / drivers / net / ethernet / intel / i40e / i40e.h
index f6b747cf94d6ee07b744a94551f3918b46c2a2dd..68f2204ec6f3aa712ad8768f2985c46c9268df0c 100644 (file)
@@ -42,7 +42,6 @@
 #include <linux/string.h>
 #include <linux/in.h>
 #include <linux/ip.h>
-#include <linux/tcp.h>
 #include <linux/sctp.h>
 #include <linux/pkt_sched.h>
 #include <linux/ipv6.h>
 #define I40E_PRIV_FLAGS_LINKPOLL_FLAG  BIT(1)
 #define I40E_PRIV_FLAGS_FD_ATR         BIT(2)
 #define I40E_PRIV_FLAGS_VEB_STATS      BIT(3)
+#define I40E_PRIV_FLAGS_PS             BIT(4)
 
 #define I40E_NVM_VERSION_LO_SHIFT  0
 #define I40E_NVM_VERSION_LO_MASK   (0xff << I40E_NVM_VERSION_LO_SHIFT)
@@ -245,6 +245,11 @@ struct i40e_tc_configuration {
        struct i40e_tc_info tc_info[I40E_MAX_TRAFFIC_CLASS];
 };
 
+struct i40e_udp_port_config {
+       __be16 index;
+       u8 type;
+};
+
 /* struct that defines the Ethernet device */
 struct i40e_pf {
        struct pci_dev *pdev;
@@ -266,7 +271,7 @@ struct i40e_pf {
        u16 num_lan_qps;           /* num lan queues this PF has set up */
        u16 num_lan_msix;          /* num queue vectors for the base PF vsi */
        int queues_left;           /* queues left unclaimed */
-       u16 rss_size;              /* num queues in the RSS array */
+       u16 alloc_rss_size;        /* allocated RSS queues */
        u16 rss_size_max;          /* HW defined max RSS queues */
        u16 fdir_pf_filter_count;  /* num of guaranteed filters for this PF */
        u16 num_alloc_vsi;         /* num VSIs this driver supports */
@@ -281,11 +286,9 @@ struct i40e_pf {
        u32 fd_atr_cnt;
        u32 fd_tcp_rule;
 
-#ifdef CONFIG_I40E_VXLAN
-       __be16  vxlan_ports[I40E_MAX_PF_UDP_OFFLOAD_PORTS];
-       u16 pending_vxlan_bitmap;
+       struct i40e_udp_port_config udp_ports[I40E_MAX_PF_UDP_OFFLOAD_PORTS];
+       u16 pending_udp_bitmap;
 
-#endif
        enum i40e_interrupt_policy int_policy;
        u16 rx_itr_default;
        u16 tx_itr_default;
@@ -322,9 +325,7 @@ struct i40e_pf {
 #define I40E_FLAG_FD_ATR_ENABLED               BIT_ULL(22)
 #define I40E_FLAG_PTP                          BIT_ULL(25)
 #define I40E_FLAG_MFP_ENABLED                  BIT_ULL(26)
-#ifdef CONFIG_I40E_VXLAN
-#define I40E_FLAG_VXLAN_FILTER_SYNC            BIT_ULL(27)
-#endif
+#define I40E_FLAG_UDP_FILTER_SYNC              BIT_ULL(27)
 #define I40E_FLAG_PORT_ID_VALID                        BIT_ULL(28)
 #define I40E_FLAG_DCB_CAPABLE                  BIT_ULL(29)
 #define I40E_FLAG_RSS_AQ_CAPABLE               BIT_ULL(31)
@@ -336,7 +337,9 @@ struct i40e_pf {
 #define I40E_FLAG_MULTIPLE_TCP_UDP_RSS_PCTYPE  BIT_ULL(38)
 #define I40E_FLAG_LINK_POLLING_ENABLED         BIT_ULL(39)
 #define I40E_FLAG_VEB_MODE_ENABLED             BIT_ULL(40)
+#define I40E_FLAG_GENEVE_OFFLOAD_CAPABLE       BIT_ULL(41)
 #define I40E_FLAG_NO_PCI_LINK_CHECK            BIT_ULL(42)
+#define I40E_FLAG_PF_MAC                       BIT_ULL(50)
 
        /* tracks features that get auto disabled by errors */
        u64 auto_disable_flags;
@@ -413,7 +416,7 @@ struct i40e_pf {
        u32 rx_hwtstamp_cleared;
        bool ptp_tx;
        bool ptp_rx;
-       u16 rss_table_size;
+       u16 rss_table_size; /* HW RSS table size */
        /* These are only valid in NPAR modes */
        u32 npar_max_bw;
        u32 npar_min_bw;
@@ -506,8 +509,10 @@ struct i40e_vsi {
        u16 tx_itr_setting;
        u16 int_rate_limit;  /* value in usecs */
 
-       u16 rss_table_size;
-       u16 rss_size;
+       u16 rss_table_size; /* HW RSS table size */
+       u16 rss_size;       /* Allocated RSS queues */
+       u8  *rss_hkey_user; /* User configured hash keys */
+       u8  *rss_lut_user;  /* User configured lookup table entries */
 
        u16 max_frame;
        u16 rx_hdr_len;
@@ -577,6 +582,9 @@ struct i40e_q_vector {
 
        u8 num_ringpairs;       /* total number of ring pairs in vector */
 
+#define I40E_Q_VECTOR_HUNG_DETECT 0 /* Bit Index for hung detection logic */
+       unsigned long hung_detected; /* Set/Reset for hung_detection logic */
+
        cpumask_t affinity_mask;
        struct rcu_head rcu;    /* to avoid race with update stats on free */
        char name[I40E_INT_NAME_STR_LEN];
@@ -604,8 +612,8 @@ static inline char *i40e_nvm_version_str(struct i40e_hw *hw)
 
        full_ver = hw->nvm.oem_ver;
        ver = (u8)(full_ver >> I40E_OEM_VER_SHIFT);
-       build = (u16)((full_ver >> I40E_OEM_VER_BUILD_SHIFT)
-                I40E_OEM_VER_BUILD_MASK);
+       build = (u16)((full_ver >> I40E_OEM_VER_BUILD_SHIFT) &
+                I40E_OEM_VER_BUILD_MASK);
        patch = (u8)(full_ver & I40E_OEM_VER_PATCH_MASK);
 
        snprintf(buf, sizeof(buf),
@@ -670,6 +678,8 @@ extern const char i40e_driver_name[];
 extern const char i40e_driver_version_str[];
 void i40e_do_reset_safe(struct i40e_pf *pf, u32 reset_flags);
 void i40e_do_reset(struct i40e_pf *pf, u32 reset_flags);
+int i40e_config_rss(struct i40e_vsi *vsi, u8 *seed, u8 *lut, u16 lut_size);
+int i40e_get_rss(struct i40e_vsi *vsi, u8 *seed, u8 *lut, u16 lut_size);
 struct i40e_vsi *i40e_find_vsi_from_id(struct i40e_pf *pf, u16 id);
 void i40e_update_stats(struct i40e_vsi *vsi);
 void i40e_update_eth_stats(struct i40e_vsi *vsi);
@@ -693,7 +703,7 @@ struct i40e_mac_filter *i40e_add_filter(struct i40e_vsi *vsi,
                                        bool is_vf, bool is_netdev);
 void i40e_del_filter(struct i40e_vsi *vsi, u8 *macaddr, s16 vlan,
                     bool is_vf, bool is_netdev);
-int i40e_sync_vsi_filters(struct i40e_vsi *vsi, bool grab_rtnl);
+int i40e_sync_vsi_filters(struct i40e_vsi *vsi);
 struct i40e_vsi *i40e_vsi_setup(struct i40e_pf *pf, u8 type,
                                u16 uplink, u32 param1);
 int i40e_vsi_release(struct i40e_vsi *vsi);
@@ -711,7 +721,7 @@ struct i40e_veb *i40e_veb_setup(struct i40e_pf *pf, u16 flags, u16 uplink_seid,
 void i40e_veb_release(struct i40e_veb *veb);
 
 int i40e_veb_config_tc(struct i40e_veb *veb, u8 enabled_tc);
-i40e_status i40e_vsi_add_pvid(struct i40e_vsi *vsi, u16 vid);
+int i40e_vsi_add_pvid(struct i40e_vsi *vsi, u16 vid);
 void i40e_vsi_remove_pvid(struct i40e_vsi *vsi);
 void i40e_vsi_reset_stats(struct i40e_vsi *vsi);
 void i40e_pf_reset_stats(struct i40e_pf *pf);
@@ -769,6 +779,8 @@ int i40e_vsi_add_vlan(struct i40e_vsi *vsi, s16 vid);
 int i40e_vsi_kill_vlan(struct i40e_vsi *vsi, s16 vid);
 struct i40e_mac_filter *i40e_put_mac_in_vlan(struct i40e_vsi *vsi, u8 *macaddr,
                                             bool is_vf, bool is_netdev);
+int i40e_del_mac_all_vlan(struct i40e_vsi *vsi, u8 *macaddr,
+                         bool is_vf, bool is_netdev);
 bool i40e_is_vsi_in_vlan(struct i40e_vsi *vsi);
 struct i40e_mac_filter *i40e_find_mac(struct i40e_vsi *vsi, u8 *macaddr,
                                      bool is_vf, bool is_netdev);