/* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2015-2020
+ * Copyright(c) 2015-2020 Beijing WangXun Technology Co., Ltd.
+ * Copyright(c) 2010-2017 Intel Corporation
*/
#include <sys/queue.h>
return err;
}
hw->mac.get_link_status = true;
+ hw->dev_start = true;
/* negotiate mailbox API version to use with the PF. */
txgbevf_negotiate_api(hw);
}
adapter->rss_reta_updated = 0;
+ hw->dev_start = false;
return 0;
}
mask = 1;
for (j = 0; j < 32; j++) {
if (vfta & mask)
- txgbe_set_vfta(hw, (i << 5) + j, 0,
+ hw->mac.set_vfta(hw, (i << 5) + j, 0,
on, false);
mask <<= 1;
}
{
struct txgbe_hw *hw;
uint32_t max_frame = mtu + RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN;
- struct rte_eth_rxmode *rx_conf = &dev->data->dev_conf.rxmode;
+ struct rte_eth_dev_data *dev_data = dev->data;
hw = TXGBE_DEV_HW(dev);
max_frame > RTE_ETHER_MAX_JUMBO_FRAME_LEN)
return -EINVAL;
- /* refuse mtu that requires the support of scattered packets when this
- * feature has not been enabled before.
+ /* If device is started, refuse mtu that requires the support of
+ * scattered packets when this feature has not been enabled before.
*/
- if (!(rx_conf->offloads & DEV_RX_OFFLOAD_SCATTER) &&
+ if (dev_data->dev_started && !dev_data->scattered_rx &&
(max_frame + 2 * TXGBE_VLAN_TAG_SIZE >
- dev->data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM))
+ dev->data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM)) {
+ PMD_INIT_LOG(ERR, "Stop port first.");
return -EINVAL;
+ }
/*
* When supported by the underlying PF driver, use the TXGBE_VF_SET_MTU