net/bnxt: switch CFA code to dynamic mbuf field
[dpdk.git] / drivers / net / iavf / iavf_vchnl.c
index a163548..db0b768 100644 (file)
@@ -73,6 +73,9 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args)
        int err = 0;
        int i = 0;
 
+       if (vf->vf_reset)
+               return -EIO;
+
        if (_atomic_set_cmd(vf, args->ops))
                return -1;
 
@@ -186,7 +189,8 @@ iavf_handle_pf_event_msg(struct rte_eth_dev *dev, uint8_t *msg,
        switch (pf_msg->event) {
        case VIRTCHNL_EVENT_RESET_IMPENDING:
                PMD_DRV_LOG(DEBUG, "VIRTCHNL_EVENT_RESET_IMPENDING event");
-               _rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_RESET,
+               vf->vf_reset = true;
+               rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_RESET,
                                              NULL);
                break;
        case VIRTCHNL_EVENT_LINK_CHANGE:
@@ -201,8 +205,7 @@ iavf_handle_pf_event_msg(struct rte_eth_dev *dev, uint8_t *msg,
                        vf->link_speed = iavf_convert_link_speed(speed);
                }
                iavf_dev_link_update(dev, 0);
-               _rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC,
-                                             NULL);
+               rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL);
                break;
        case VIRTCHNL_EVENT_PF_DRIVER_CLOSE:
                PMD_DRV_LOG(DEBUG, "VIRTCHNL_EVENT_PF_DRIVER_CLOSE event");
@@ -268,7 +271,7 @@ iavf_handle_virtchnl_msg(struct rte_eth_dev *dev)
                        }
                        break;
                default:
-                       PMD_DRV_LOG(ERR, "Request %u is not supported yet",
+                       PMD_DRV_LOG(DEBUG, "Request %u is not supported yet",
                                    aq_opc);
                        break;
                }
@@ -839,10 +842,19 @@ iavf_config_promisc(struct iavf_adapter *adapter,
 
        err = iavf_execute_vf_cmd(adapter, &args);
 
-       if (err)
+       if (err) {
                PMD_DRV_LOG(ERR,
                            "fail to execute command CONFIG_PROMISCUOUS_MODE");
-       return err;
+
+               if (err == IAVF_NOT_SUPPORTED)
+                       return -ENOTSUP;
+
+               return -EAGAIN;
+       }
+
+       vf->promisc_unicast_enabled = enable_unicast;
+       vf->promisc_multicast_enabled = enable_multicast;
+       return 0;
 }
 
 int