"diag=%d\n", port_id, on, diag);
}
-void
+int
rx_vft_set(portid_t port_id, uint16_t vlan_id, int on)
{
int diag;
if (port_id_is_invalid(port_id, ENABLED_WARN))
- return;
+ return 1;
if (vlan_id_is_invalid(vlan_id))
- return;
+ return 1;
diag = rte_eth_dev_vlan_filter(port_id, vlan_id, on);
if (diag == 0)
- return;
+ return 0;
printf("rte_eth_dev_vlan_filter(port_pi=%d, vlan_id=%d, on=%d) failed "
"diag=%d\n",
port_id, vlan_id, on, diag);
+ return -1;
}
void
if (port_id_is_invalid(port_id, ENABLED_WARN))
return;
- for (vlan_id = 0; vlan_id < 4096; vlan_id++)
- rx_vft_set(port_id, vlan_id, on);
+ for (vlan_id = 0; vlan_id < 4096; vlan_id++) {
+ if (rx_vft_set(port_id, vlan_id, on))
+ break;
+ }
}
void
void rx_vlan_filter_set(portid_t port_id, int on);
void rx_vlan_all_filter_set(portid_t port_id, int on);
-void rx_vft_set(portid_t port_id, uint16_t vlan_id, int on);
+int rx_vft_set(portid_t port_id, uint16_t vlan_id, int on);
void vlan_extend_set(portid_t port_id, int on);
void vlan_tpid_set(portid_t port_id, uint16_t tp_id);
void tx_vlan_set(portid_t port_id, uint16_t vlan_id);
return (-EINVAL);
}
FUNC_PTR_OR_ERR_RET(*dev->dev_ops->vlan_filter_set, -ENOTSUP);
- (*dev->dev_ops->vlan_filter_set)(dev, vlan_id, on);
- return (0);
+
+ return (*dev->dev_ops->vlan_filter_set)(dev, vlan_id, on);
}
int