| 2851 | } |
| 2852 | |
| 2853 | int |
| 2854 | rte_eth_promiscuous_enable(uint16_t port_id) |
| 2855 | { |
| 2856 | struct rte_eth_dev *dev; |
| 2857 | int diag = 0; |
| 2858 | |
| 2859 | RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); |
| 2860 | dev = &rte_eth_devices[port_id]; |
| 2861 | |
| 2862 | if (dev->data->promiscuous == 1) |
| 2863 | return 0; |
| 2864 | |
| 2865 | if (*dev->dev_ops->promiscuous_enable == NULL) |
| 2866 | return -ENOTSUP; |
| 2867 | |
| 2868 | diag = (*dev->dev_ops->promiscuous_enable)(dev); |
| 2869 | dev->data->promiscuous = (diag == 0) ? 1 : 0; |
| 2870 | |
| 2871 | diag = eth_err(port_id, diag); |
| 2872 | |
| 2873 | rte_eth_trace_promiscuous_enable(port_id, dev->data->promiscuous, |
| 2874 | diag); |
| 2875 | |
| 2876 | return diag; |
| 2877 | } |
| 2878 | |
| 2879 | int |
| 2880 | rte_eth_promiscuous_disable(uint16_t port_id) |