X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fice%2Fice_ethdev.c;h=7233c3e55bf7fb5088c869d8d7ea3c5840abfde4;hb=f2caa921dc03f9486185b6caf09c9fd271f1b86d;hp=a23c63ae59e5a11032b7240f4b5ec3bbca90a7c7;hpb=cb05494d2910ec35005877a79e03b9a791500111;p=dpdk.git diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index a23c63ae59..7233c3e55b 100644 --- a/drivers/net/ice/ice_ethdev.c +++ b/drivers/net/ice/ice_ethdev.c @@ -1741,6 +1741,7 @@ ice_dev_start(struct rte_eth_dev *dev) } ice_set_rx_function(dev); + ice_set_tx_function(dev); mask = ETH_VLAN_STRIP_MASK | ETH_VLAN_FILTER_MASK | ETH_VLAN_EXTEND_MASK; @@ -2814,26 +2815,26 @@ ice_get_eeprom(struct rte_eth_dev *dev, { struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private); uint16_t *data = eeprom->data; - uint16_t offset, length, i; - enum ice_status ret_code = ICE_SUCCESS; + uint16_t first_word, last_word, nwords; + enum ice_status status = ICE_SUCCESS; - offset = eeprom->offset >> 1; - length = eeprom->length >> 1; + first_word = eeprom->offset >> 1; + last_word = (eeprom->offset + eeprom->length - 1) >> 1; + nwords = last_word - first_word + 1; - if (offset > hw->nvm.sr_words || - offset + length > hw->nvm.sr_words) { + if (first_word > hw->nvm.sr_words || + last_word > hw->nvm.sr_words) { PMD_DRV_LOG(ERR, "Requested EEPROM bytes out of range."); return -EINVAL; } eeprom->magic = hw->vendor_id | (hw->device_id << 16); - for (i = 0; i < length; i++) { - ret_code = ice_read_sr_word(hw, offset + i, &data[i]); - if (ret_code != ICE_SUCCESS) { - PMD_DRV_LOG(ERR, "EEPROM read failed."); - return -EIO; - } + status = ice_read_sr_buf(hw, first_word, &nwords, data); + if (status) { + PMD_DRV_LOG(ERR, "EEPROM read failed."); + eeprom->length = sizeof(uint16_t) * nwords; + return -EIO; } return 0;