int mask = 0;
int cur, org = 0;
uint64_t orig_offloads;
- uint64_t *dev_offloads;
+ uint64_t dev_offloads;
RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
dev = &rte_eth_devices[port_id];
/* save original values in case of failure */
orig_offloads = dev->data->dev_conf.rxmode.offloads;
- dev_offloads = &dev->data->dev_conf.rxmode.offloads;
+ dev_offloads = orig_offloads;
/*check which option changed by application*/
cur = !!(offload_mask & ETH_VLAN_STRIP_OFFLOAD);
- org = !!(*dev_offloads & DEV_RX_OFFLOAD_VLAN_STRIP);
+ org = !!(dev_offloads & DEV_RX_OFFLOAD_VLAN_STRIP);
if (cur != org) {
if (cur)
- *dev_offloads |= DEV_RX_OFFLOAD_VLAN_STRIP;
+ dev_offloads |= DEV_RX_OFFLOAD_VLAN_STRIP;
else
- *dev_offloads &= ~DEV_RX_OFFLOAD_VLAN_STRIP;
+ dev_offloads &= ~DEV_RX_OFFLOAD_VLAN_STRIP;
mask |= ETH_VLAN_STRIP_MASK;
}
cur = !!(offload_mask & ETH_VLAN_FILTER_OFFLOAD);
- org = !!(*dev_offloads & DEV_RX_OFFLOAD_VLAN_FILTER);
+ org = !!(dev_offloads & DEV_RX_OFFLOAD_VLAN_FILTER);
if (cur != org) {
if (cur)
- *dev_offloads |= DEV_RX_OFFLOAD_VLAN_FILTER;
+ dev_offloads |= DEV_RX_OFFLOAD_VLAN_FILTER;
else
- *dev_offloads &= ~DEV_RX_OFFLOAD_VLAN_FILTER;
+ dev_offloads &= ~DEV_RX_OFFLOAD_VLAN_FILTER;
mask |= ETH_VLAN_FILTER_MASK;
}
cur = !!(offload_mask & ETH_VLAN_EXTEND_OFFLOAD);
- org = !!(*dev_offloads & DEV_RX_OFFLOAD_VLAN_EXTEND);
+ org = !!(dev_offloads & DEV_RX_OFFLOAD_VLAN_EXTEND);
if (cur != org) {
if (cur)
- *dev_offloads |= DEV_RX_OFFLOAD_VLAN_EXTEND;
+ dev_offloads |= DEV_RX_OFFLOAD_VLAN_EXTEND;
else
- *dev_offloads &= ~DEV_RX_OFFLOAD_VLAN_EXTEND;
+ dev_offloads &= ~DEV_RX_OFFLOAD_VLAN_EXTEND;
mask |= ETH_VLAN_EXTEND_MASK;
}
cur = !!(offload_mask & ETH_QINQ_STRIP_OFFLOAD);
- org = !!(*dev_offloads & DEV_RX_OFFLOAD_QINQ_STRIP);
+ org = !!(dev_offloads & DEV_RX_OFFLOAD_QINQ_STRIP);
if (cur != org) {
if (cur)
- *dev_offloads |= DEV_RX_OFFLOAD_QINQ_STRIP;
+ dev_offloads |= DEV_RX_OFFLOAD_QINQ_STRIP;
else
- *dev_offloads &= ~DEV_RX_OFFLOAD_QINQ_STRIP;
+ dev_offloads &= ~DEV_RX_OFFLOAD_QINQ_STRIP;
mask |= ETH_QINQ_STRIP_MASK;
}
return ret;
RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->vlan_offload_set, -ENOTSUP);
+ dev->data->dev_conf.rxmode.offloads = dev_offloads;
ret = (*dev->dev_ops->vlan_offload_set)(dev, mask);
if (ret) {
/* hit an error restore original values */
- *dev_offloads = orig_offloads;
+ dev->data->dev_conf.rxmode.offloads = orig_offloads;
}
return eth_err(port_id, ret);