net/sfc: move RxQ state to multi-process shared location
[dpdk.git] / drivers / net / sfc / sfc.h
index 9c76d7f..f04127b 100644 (file)
@@ -27,9 +27,6 @@
 extern "C" {
 #endif
 
-/** RSS hash offloads mask */
-#define SFC_RSS_OFFLOADS       (ETH_RSS_IP | ETH_RSS_TCP)
-
 /*
  * +---------------+
  * | UNINITIALIZED |<-----------+
@@ -152,19 +149,53 @@ struct sfc_port {
        uint64_t                        mac_stats_last_request_timestamp;
 
        uint32_t                mac_stats_mask[EFX_MAC_STATS_MASK_NPAGES];
+
+       uint64_t                        ipackets;
+};
+
+struct sfc_rss_hf_rte_to_efx {
+       uint64_t                        rte;
+       efx_rx_hash_type_t              efx;
 };
 
 struct sfc_rss {
        unsigned int                    channels;
        efx_rx_scale_context_type_t     context_type;
        efx_rx_hash_support_t           hash_support;
+       efx_rx_hash_alg_t               hash_alg;
+       unsigned int                    hf_map_nb_entries;
+       struct sfc_rss_hf_rte_to_efx    *hf_map;
+
        efx_rx_hash_type_t              hash_types;
        unsigned int                    tbl[EFX_RSS_TBL_SIZE];
        uint8_t                         key[EFX_RSS_KEY_SIZE];
 };
 
+/* Adapter process private data */
+struct sfc_adapter_priv {
+       const struct sfc_dp_rx          *dp_rx;
+       const struct sfc_dp_tx          *dp_tx;
+       uint32_t                        logtype_main;
+};
+
+static inline struct sfc_adapter_priv *
+sfc_adapter_priv_by_eth_dev(struct rte_eth_dev *eth_dev)
+{
+       struct sfc_adapter_priv *sap = eth_dev->process_private;
+
+       SFC_ASSERT(sap != NULL);
+       return sap;
+}
+
 /* Adapter private data */
 struct sfc_adapter {
+       /*
+        * It must be the first field of the sfc_adapter structure since
+        * sfc_adapter is the primary process private data (i.e.  process
+        * private data plus additional primary process specific data).
+        */
+       struct sfc_adapter_priv         priv;
+
        /*
         * PMD setup and configuration is not thread safe. Since it is not
         * performance sensitive, it is better to guarantee thread-safety
@@ -177,7 +208,6 @@ struct sfc_adapter {
        uint16_t                        port_id;
        struct rte_eth_dev              *eth_dev;
        struct rte_kvargs               *kvargs;
-       uint32_t                        logtype_main;
        int                             socket_id;
        efsys_bar_t                     mem_bar;
        efx_family_t                    family;
@@ -232,6 +262,8 @@ struct sfc_adapter {
 
        boolean_t                       tso;
 
+       uint32_t                        rxd_wait_timeout_ns;
+
        struct sfc_rss                  rss;
 
        /*
@@ -239,14 +271,12 @@ struct sfc_adapter {
         * the secondary process to find Rx datapath to be used.
         */
        char                            *dp_rx_name;
-       const struct sfc_dp_rx          *dp_rx;
 
        /*
         * Shared memory copy of the Tx datapath name to be used by
-        * the secondary process to find Rx datapath to be used.
+        * the secondary process to find Tx datapath to be used.
         */
        char                            *dp_tx_name;
-       const struct sfc_dp_tx          *dp_tx;
 };
 
 /*
@@ -301,7 +331,7 @@ int sfc_dma_alloc(const struct sfc_adapter *sa, const char *name, uint16_t id,
                  size_t len, int socket_id, efsys_mem_t *esmp);
 void sfc_dma_free(const struct sfc_adapter *sa, efsys_mem_t *esmp);
 
-uint32_t sfc_register_logtype(struct sfc_adapter *sa,
+uint32_t sfc_register_logtype(const struct rte_pci_addr *pci_addr,
                              const char *lt_prefix_str,
                              uint32_t ll_default);