unsigned int lsc_callback:1;
};
+/*
+ * This is referenced by eth_dev->data->dev_private
+ * This is shared between processes.
+ */
struct fs_priv {
- struct rte_eth_dev *dev;
+ struct rte_eth_dev_data *data; /* backreference to shared data. */
/*
* Set of sub_devices.
* subs[0] is the preferred device
/* RX / TX */
-void set_burst_fn(struct rte_eth_dev *dev, int force_safe);
+void failsafe_set_burst_fn(struct rte_eth_dev *dev, int force_safe);
uint16_t failsafe_rx_burst(void *rxq,
struct rte_mbuf **rx_pkts, uint16_t nb_pkts);
extern const char pmd_failsafe_driver_name[];
extern const struct eth_dev_ops failsafe_ops;
extern const struct rte_flow_ops fs_flow_ops;
-extern uint64_t hotplug_poll;
-extern int mac_from_arg;
+extern uint64_t failsafe_hotplug_poll;
+extern int failsafe_mac_from_arg;
/* HELPERS */
&((struct txq *)((s)->fs_dev->data->tx_queues[i]))->refcnt[(s)->sid] \
)
-#ifdef RTE_EXEC_ENV_BSDAPP
+#ifdef RTE_EXEC_ENV_FREEBSD
#define FS_THREADID_TYPE void*
#define FS_THREADID_FMT "p"
#else
return ret;
}
}
- DEBUG("Hot-plug mutex was locked by thread %" FS_THREADID_FMT "%s",
- (FS_THREADID_TYPE)pthread_self(),
- PRIV(dev)->alarm_lock ? " by the hot-plug alarm" : "");
return ret;
}
fs_unlock(struct rte_eth_dev *dev, unsigned int is_alarm)
{
int ret;
- unsigned int prev_alarm_lock = PRIV(dev)->alarm_lock;
if (is_alarm) {
RTE_ASSERT(PRIV(dev)->alarm_lock == 1);
ret = pthread_mutex_unlock(&PRIV(dev)->hotplug_mutex);
if (ret)
ERROR("Cannot unlock hot-plug mutex(%s)", strerror(ret));
- else
- DEBUG("Hot-plug mutex was unlocked by thread %" FS_THREADID_FMT "%s",
- (FS_THREADID_TYPE)pthread_self(),
- prev_alarm_lock ? " by the hot-plug alarm" : "");
}
/*
} else {
return;
}
- set_burst_fn(dev, 0);
+ failsafe_set_burst_fn(dev, 0);
rte_wmb();
}