X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fice%2Fice_ethdev.c;h=c699f3ef0316c1a791f18475299f62c99feac2ce;hb=ca041cd44fcc8b22c0e84460254596096e8fe914;hp=17867b9693a817f7f57cc2f742a70dce25d751cf;hpb=9039c8125730adfd46b8c891e7f205eb4ac43c67;p=dpdk.git diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index 17867b9693..c699f3ef03 100644 --- a/drivers/net/ice/ice_ethdev.c +++ b/drivers/net/ice/ice_ethdev.c @@ -69,8 +69,8 @@ static int ice_rss_hash_conf_get(struct rte_eth_dev *dev, struct rte_eth_rss_conf *rss_conf); static int ice_promisc_enable(struct rte_eth_dev *dev); static int ice_promisc_disable(struct rte_eth_dev *dev); -static void ice_allmulti_enable(struct rte_eth_dev *dev); -static void ice_allmulti_disable(struct rte_eth_dev *dev); +static int ice_allmulti_enable(struct rte_eth_dev *dev); +static int ice_allmulti_disable(struct rte_eth_dev *dev); static int ice_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on); @@ -94,7 +94,7 @@ static int ice_get_eeprom(struct rte_eth_dev *dev, struct rte_dev_eeprom_info *eeprom); static int ice_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats); -static void ice_stats_reset(struct rte_eth_dev *dev); +static int ice_stats_reset(struct rte_eth_dev *dev); static int ice_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats, unsigned int n); static int ice_xstats_get_names(struct rte_eth_dev *dev, @@ -3152,7 +3152,7 @@ ice_promisc_disable(struct rte_eth_dev *dev) return ret; } -static void +static int ice_allmulti_enable(struct rte_eth_dev *dev) { struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private); @@ -3160,15 +3160,26 @@ ice_allmulti_enable(struct rte_eth_dev *dev) struct ice_vsi *vsi = pf->main_vsi; enum ice_status status; uint8_t pmask; + int ret = 0; pmask = ICE_PROMISC_MCAST_RX | ICE_PROMISC_MCAST_TX; status = ice_set_vsi_promisc(hw, vsi->idx, pmask, 0); - if (status != ICE_SUCCESS) + + switch (status) { + case ICE_ERR_ALREADY_EXISTS: + PMD_DRV_LOG(DEBUG, "Allmulti has already been enabled"); + case ICE_SUCCESS: + break; + default: PMD_DRV_LOG(ERR, "Failed to enable allmulti, err=%d", status); + ret = -EAGAIN; + } + + return ret; } -static void +static int ice_allmulti_disable(struct rte_eth_dev *dev) { struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private); @@ -3176,15 +3187,20 @@ ice_allmulti_disable(struct rte_eth_dev *dev) struct ice_vsi *vsi = pf->main_vsi; enum ice_status status; uint8_t pmask; + int ret = 0; if (dev->data->promiscuous == 1) - return; /* must remain in all_multicast mode */ + return 0; /* must remain in all_multicast mode */ pmask = ICE_PROMISC_MCAST_RX | ICE_PROMISC_MCAST_TX; status = ice_clear_vsi_promisc(hw, vsi->idx, pmask, 0); - if (status != ICE_SUCCESS) + if (status != ICE_SUCCESS) { PMD_DRV_LOG(ERR, "Failed to clear allmulti, err=%d", status); + ret = -EAGAIN; + } + + return ret; } static int ice_rx_queue_intr_enable(struct rte_eth_dev *dev, @@ -3750,7 +3766,7 @@ ice_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) } /* Reset the statistics */ -static void +static int ice_stats_reset(struct rte_eth_dev *dev) { struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private); @@ -3763,6 +3779,8 @@ ice_stats_reset(struct rte_eth_dev *dev) /* read the stats, reading current register values into offset */ ice_read_stats_registers(pf, hw); + + return 0; } static uint32_t