New upstream version 17.11.1
[deb_dpdk.git] / drivers / net / sfc / sfc.h
index 286d1ac..ef980a4 100644 (file)
@@ -35,6 +35,7 @@
 #include <stdbool.h>
 
 #include <rte_pci.h>
+#include <rte_bus_pci.h>
 #include <rte_ethdev.h>
 #include <rte_kvargs.h>
 #include <rte_spinlock.h>
@@ -48,8 +49,6 @@ extern "C" {
 #endif
 
 #if EFSYS_OPT_RX_SCALE
-/** RSS key length (bytes) */
-#define SFC_RSS_KEY_SIZE       40
 /** RSS hash offloads mask */
 #define SFC_RSS_OFFLOADS       (ETH_RSS_IP | ETH_RSS_TCP)
 #endif
@@ -159,6 +158,8 @@ struct sfc_port {
        boolean_t                       promisc;
        boolean_t                       allmulti;
 
+       struct ether_addr               default_mac_addr;
+
        unsigned int                    max_mcast_addrs;
        unsigned int                    nb_mcast_addrs;
        uint8_t                         *mcast_addrs;
@@ -211,7 +212,29 @@ struct sfc_adapter {
        unsigned int                    evq_count;
 
        unsigned int                    mgmt_evq_index;
+       /*
+        * The lock is used to serialise management event queue polling
+        * which can be done from different context. Also the lock
+        * guarantees that mgmt_evq_running is preserved while the lock
+        * is held. It is used to serialise polling and start/stop
+        * operations.
+        *
+        * Locks which may be held when the lock is acquired:
+        *  - adapter lock, when:
+        *    - device start/stop to change mgmt_evq_running
+        *    - any control operations in client side MCDI proxy handling to
+        *      poll management event queue waiting for proxy response
+        *  - MCDI lock, when:
+        *    - any control operations in client side MCDI proxy handling to
+        *      poll management event queue waiting for proxy response
+        *
+        * Locks which are acquired with the lock held:
+        *  - nic_lock, when:
+        *    - MC event processing on management event queue polling
+        *      (e.g. MC REBOOT or BADASSERT events)
+        */
        rte_spinlock_t                  mgmt_evq_lock;
+       bool                            mgmt_evq_running;
        struct sfc_evq                  *mgmt_evq;
 
        unsigned int                    rxq_count;
@@ -225,11 +248,11 @@ struct sfc_adapter {
        unsigned int                    rss_channels;
 
 #if EFSYS_OPT_RX_SCALE
-       efx_rx_scale_support_t          rss_support;
+       efx_rx_scale_context_type_t     rss_support;
        efx_rx_hash_support_t           hash_support;
        efx_rx_hash_type_t              rss_hash_types;
        unsigned int                    rss_tbl[EFX_RSS_TBL_SIZE];
-       uint8_t                         rss_key[SFC_RSS_KEY_SIZE];
+       uint8_t                         rss_key[EFX_RSS_KEY_SIZE];
 #endif
 
        /*