net/mlx5: fix handling link status event
[dpdk.git] / drivers / net / failsafe / failsafe_private.h
index d2d92af..54b5b91 100644 (file)
@@ -62,8 +62,8 @@
 struct rxq {
        struct fs_priv *priv;
        uint16_t qid;
-       /* id of last sub_device polled */
-       uint8_t last_polled;
+       /* next sub_device to poll */
+       struct sub_device *sdev;
        unsigned int socket_id;
        struct rte_eth_rxq_info info;
        rte_atomic64_t refcnt[];
@@ -93,8 +93,14 @@ enum dev_state {
        DEV_STARTED,
 };
 
+struct fs_stats {
+       struct rte_eth_stats stats;
+       uint64_t timestamp;
+};
+
 struct sub_device {
        /* Exhaustive DPDK device description */
+       struct sub_device *next;
        struct rte_devargs devargs;
        struct rte_bus *bus;
        struct rte_device *dev;
@@ -103,7 +109,7 @@ struct sub_device {
        /* Device state machine */
        enum dev_state state;
        /* Last stats snapshot passed to user */
-       struct rte_eth_stats stats_snapshot;
+       struct fs_stats stats_snapshot;
        /* Some device are defined as a command line */
        char *cmdline;
        /* fail-safe device backreference */
@@ -185,10 +191,10 @@ int failsafe_eth_dev_state_sync(struct rte_eth_dev *dev);
 void failsafe_dev_remove(struct rte_eth_dev *dev);
 void failsafe_stats_increment(struct rte_eth_stats *to,
                                struct rte_eth_stats *from);
-int failsafe_eth_rmv_event_callback(uint8_t port_id,
+int failsafe_eth_rmv_event_callback(uint16_t port_id,
                                    enum rte_eth_event_type type,
                                    void *arg, void *out);
-int failsafe_eth_lsc_event_callback(uint8_t port_id,
+int failsafe_eth_lsc_event_callback(uint16_t port_id,
                                    enum rte_eth_event_type event,
                                    void *cb_arg, void *out);
 
@@ -264,13 +270,13 @@ extern int mac_from_arg;
  * a: (rte_atomic64_t)
  */
 #define FS_ATOMIC_P(a) \
-       rte_atomic64_add(&(a), 1)
+       rte_atomic64_set(&(a), 1)
 
 /**
  * a: (rte_atomic64_t)
  */
 #define FS_ATOMIC_V(a) \
-       rte_atomic64_sub(&(a), 1)
+       rte_atomic64_set(&(a), 0)
 
 /**
  * s: (struct sub_device *)