MCPcopy Index your code
hub / github.com/F-Stack/f-stack / rte_eth_dev_set_mtu

Function rte_eth_dev_set_mtu

dpdk/lib/ethdev/rte_ethdev.c:4069–4113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4067}
4068
4069int
4070rte_eth_dev_set_mtu(uint16_t port_id, uint16_t mtu)
4071{
4072 int ret;
4073 struct rte_eth_dev_info dev_info;
4074 struct rte_eth_dev *dev;
4075
4076 RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
4077 dev = &rte_eth_devices[port_id];
4078 if (*dev->dev_ops->mtu_set == NULL)
4079 return -ENOTSUP;
4080
4081 /*
4082 * Check if the device supports dev_infos_get, if it does not
4083 * skip min_mtu/max_mtu validation here as this requires values
4084 * that are populated within the call to rte_eth_dev_info_get()
4085 * which relies on dev->dev_ops->dev_infos_get.
4086 */
4087 if (*dev->dev_ops->dev_infos_get != NULL) {
4088 ret = rte_eth_dev_info_get(port_id, &dev_info);
4089 if (ret != 0)
4090 return ret;
4091
4092 ret = eth_dev_validate_mtu(port_id, &dev_info, mtu);
4093 if (ret != 0)
4094 return ret;
4095 }
4096
4097 if (dev->data->dev_configured == 0) {
4098 RTE_ETHDEV_LOG(ERR,
4099 "Port %u must be configured before MTU set\n",
4100 port_id);
4101 return -EINVAL;
4102 }
4103
4104 ret = (*dev->dev_ops->mtu_set)(dev, mtu);
4105 if (ret == 0)
4106 dev->data->mtu = mtu;
4107
4108 ret = eth_err(port_id, ret);
4109
4110 rte_ethdev_trace_set_mtu(port_id, mtu, ret);
4111
4112 return ret;
4113}
4114
4115int
4116rte_eth_dev_vlan_filter(uint16_t port_id, uint16_t vlan_id, int on)

Callers 13

member_configureFunction · 0.85
bond_ethdev_mtu_setFunction · 0.85
fs_mtu_setFunction · 0.85
fs_eth_dev_conf_applyFunction · 0.85
hn_vf_addFunction · 0.85
hn_vf_mtu_setFunction · 0.85
configure_ethdevFunction · 0.85
configure_ethdevFunction · 0.85
port_mtu_setFunction · 0.85
eth_dev_set_mtu_mpFunction · 0.85
ethdev_mtu_configFunction · 0.85

Calls 3

rte_eth_dev_info_getFunction · 0.85
eth_errFunction · 0.85
eth_dev_validate_mtuFunction · 0.70

Tested by 3

configure_ethdevFunction · 0.68
configure_ethdevFunction · 0.68
eth_dev_set_mtu_mpFunction · 0.68