#include <rte_atomic.h>
#include <rte_eal.h>
#include <rte_ether.h>
-#include <rte_ethdev_driver.h>
-#include <rte_ethdev_pci.h>
+#include <ethdev_driver.h>
+#include <ethdev_pci.h>
#include <rte_malloc.h>
#include <rte_memzone.h>
#include <rte_dev.h>
}
ret = iavf_dev_init_vlan(dev);
- if (ret) {
+ if (ret)
PMD_DRV_LOG(ERR, "configure VLAN failed: %d", ret);
- return -1;
- }
if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_RSS_PF) {
if (iavf_init_rss(ad) != 0) {
* correctly.
*/
if (dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_JUMBO_FRAME) {
- if (max_pkt_len <= RTE_ETHER_MAX_LEN ||
+ if (max_pkt_len <= IAVF_ETH_MAX_LEN ||
max_pkt_len > IAVF_FRAME_SIZE_MAX) {
PMD_DRV_LOG(ERR, "maximum packet length must be "
"larger than %u and smaller than %u, "
"as jumbo frame is enabled",
- (uint32_t)RTE_ETHER_MAX_LEN,
+ (uint32_t)IAVF_ETH_MAX_LEN,
(uint32_t)IAVF_FRAME_SIZE_MAX);
return -EINVAL;
}
} else {
if (max_pkt_len < RTE_ETHER_MIN_LEN ||
- max_pkt_len > RTE_ETHER_MAX_LEN) {
+ max_pkt_len > IAVF_ETH_MAX_LEN) {
PMD_DRV_LOG(ERR, "maximum packet length must be "
"larger than %u and smaller than %u, "
"as jumbo frame is disabled",
(uint32_t)RTE_ETHER_MIN_LEN,
- (uint32_t)RTE_ETHER_MAX_LEN);
+ (uint32_t)IAVF_ETH_MAX_LEN);
return -EINVAL;
}
}
enable = !!(rxmode->offloads & DEV_RX_OFFLOAD_VLAN_STRIP);
err = iavf_config_vlan_strip_v2(adapter, enable);
+ /* If not support, the stripping is already disabled by PF */
+ if (err == -ENOTSUP && !enable)
+ err = 0;
if (err)
return -EIO;
}
if (rss_conf->rss_hf == 0)
return 0;
- /* Overwritten default RSS. */
+ /* Clear existing RSS. */
ret = iavf_set_hena(adapter, 0);
+
+ /* It is a workaround, temporarily allow error to be returned
+ * due to possible lack of PF handling for hena = 0.
+ */
if (ret)
- PMD_DRV_LOG(ERR, "%s Remove rss vsi fail %d",
- __func__, ret);
+ PMD_DRV_LOG(WARNING, "fail to clean existing RSS,"
+ "lack PF support");
/* Set new RSS configuration. */
ret = iavf_rss_hash_set(adapter, rss_conf->rss_hf, true);
return -EBUSY;
}
- if (frame_size > RTE_ETHER_MAX_LEN)
+ if (frame_size > IAVF_ETH_MAX_LEN)
dev->data->dev_conf.rxmode.offloads |=
DEV_RX_OFFLOAD_JUMBO_FRAME;
else
/* Set hena = 0 to ask PF to cleanup all existing RSS. */
ret = iavf_set_hena(adapter, 0);
- if (ret) {
- PMD_DRV_LOG(ERR, "fail to disable default PF RSS");
- return ret;
- }
+ if (ret)
+ /* It is a workaround, temporarily allow error to be returned
+ * due to possible lack of PF handling for hena = 0.
+ */
+ PMD_DRV_LOG(WARNING, "fail to disable default RSS,"
+ "lack PF support");
return 0;
}