bool promisc_unicast_enabled;
bool promisc_multicast_enabled;
+ rte_spinlock_t cmd_send_lock;
uint32_t version_major; /* Major version number */
uint32_t version_minor; /* Minor version number */
uint16_t promisc_flags; /* Promiscuous setting */
#define ASQ_DELAY_MS 10
static int
-i40evf_execute_vf_cmd(struct rte_eth_dev *dev, struct vf_cmd_info *args)
+_i40evf_execute_vf_cmd(struct rte_eth_dev *dev, struct vf_cmd_info *args)
{
struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
return err | vf->cmd_retval;
}
+static int
+i40evf_execute_vf_cmd(struct rte_eth_dev *dev, struct vf_cmd_info *args)
+{
+ struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
+ int err;
+
+ while (!rte_spinlock_trylock(&vf->cmd_send_lock))
+ rte_delay_us_sleep(50);
+ err = _i40evf_execute_vf_cmd(dev, args);
+ rte_spinlock_unlock(&vf->cmd_send_lock);
+ return err;
+}
+
/*
* Check API version with sync wait until version read or fail from admin queue
*/
vf->adapter = I40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
vf->dev_data = dev->data;
+ rte_spinlock_init(&vf->cmd_send_lock);
err = i40e_set_mac_type(hw);
if (err) {
PMD_INIT_LOG(ERR, "set_mac_type failed: %d", err);