net/ice/base: fix reference count on VSI list update
[dpdk.git] / drivers / net / netvsc / hn_var.h
index b4c6171..881832d 100644 (file)
@@ -40,6 +40,7 @@ struct hn_stats {
        uint64_t        bytes;
        uint64_t        errors;
        uint64_t        ring_full;
+       uint64_t        channel_full;
        uint64_t        multicast;
        uint64_t        broadcast;
        /* Size bins in array as RFC 2819, undersized [0], 64 [1], etc */
@@ -98,7 +99,7 @@ struct hn_rx_bufinfo {
 struct hn_data {
        struct rte_vmbus_device *vmbus;
        struct hn_rx_queue *primary;
-       rte_spinlock_t  vf_lock;
+       rte_rwlock_t    vf_lock;
        uint16_t        port_id;
        uint16_t        vf_port;
 
@@ -140,7 +141,6 @@ struct hn_data {
        uint16_t        rss_ind[128];
 
        struct rte_eth_dev_owner owner;
-       struct rte_intr_handle vf_intr;
 
        struct vmbus_channel *channels[HN_MAX_CHANNELS];
 };
@@ -169,6 +169,7 @@ void        hn_dev_tx_queue_release(void *arg);
 void   hn_dev_tx_queue_info(struct rte_eth_dev *dev, uint16_t queue_idx,
                             struct rte_eth_txq_info *qinfo);
 int    hn_dev_tx_done_cleanup(void *arg, uint32_t free_cnt);
+int    hn_dev_tx_descriptor_status(void *arg, uint16_t offset);
 
 struct hn_rx_queue *hn_rx_queue_alloc(struct hn_data *hv,
                                      uint16_t queue_id,
@@ -178,7 +179,11 @@ int        hn_dev_rx_queue_setup(struct rte_eth_dev *dev,
                              unsigned int socket_id,
                              const struct rte_eth_rxconf *rx_conf,
                              struct rte_mempool *mp);
+void   hn_dev_rx_queue_info(struct rte_eth_dev *dev, uint16_t queue_id,
+                            struct rte_eth_rxq_info *qinfo);
 void   hn_dev_rx_queue_release(void *arg);
+uint32_t hn_dev_rx_queue_count(struct rte_eth_dev *dev, uint16_t queue_id);
+int    hn_dev_rx_queue_status(void *rxq, uint16_t offset);
 void   hn_dev_free_queues(struct rte_eth_dev *dev);
 
 /* Check if VF is attached */
@@ -188,15 +193,15 @@ hn_vf_attached(const struct hn_data *hv)
        return hv->vf_port != HN_INVALID_PORT;
 }
 
-/* Get VF device for existing netvsc device */
+/*
+ * Get VF device for existing netvsc device
+ * Assumes vf_lock is held.
+ */
 static inline struct rte_eth_dev *
 hn_get_vf_dev(const struct hn_data *hv)
 {
        uint16_t vf_port = hv->vf_port;
 
-       /* make sure vf_port is loaded */
-       rte_smp_rmb();
-
        if (vf_port == HN_INVALID_PORT)
                return NULL;
        else
@@ -222,13 +227,13 @@ int       hn_vf_mc_addr_list(struct rte_eth_dev *dev,
                           struct rte_ether_addr *mc_addr_set,
                           uint32_t nb_mc_addr);
 
-int    hn_vf_link_update(struct rte_eth_dev *dev,
-                         int wait_to_complete);
 int    hn_vf_tx_queue_setup(struct rte_eth_dev *dev,
                             uint16_t queue_idx, uint16_t nb_desc,
                             unsigned int socket_id,
                             const struct rte_eth_txconf *tx_conf);
 void   hn_vf_tx_queue_release(struct hn_data *hv, uint16_t queue_id);
+int    hn_vf_tx_queue_status(struct hn_data *hv, uint16_t queue_id, uint16_t offset);
+
 int    hn_vf_rx_queue_setup(struct rte_eth_dev *dev,
                             uint16_t queue_idx, uint16_t nb_desc,
                             unsigned int socket_id,