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;
uint8_t rss_key[40];
uint16_t rss_ind[128];
- struct rte_ether_addr mac_addr;
-
struct rte_eth_dev_owner owner;
struct rte_intr_handle vf_intr;
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