| 2877 | } |
| 2878 | |
| 2879 | int |
| 2880 | rte_eth_promiscuous_disable(uint16_t port_id) |
| 2881 | { |
| 2882 | struct rte_eth_dev *dev; |
| 2883 | int diag = 0; |
| 2884 | |
| 2885 | RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); |
| 2886 | dev = &rte_eth_devices[port_id]; |
| 2887 | |
| 2888 | if (dev->data->promiscuous == 0) |
| 2889 | return 0; |
| 2890 | |
| 2891 | if (*dev->dev_ops->promiscuous_disable == NULL) |
| 2892 | return -ENOTSUP; |
| 2893 | |
| 2894 | diag = (*dev->dev_ops->promiscuous_disable)(dev); |
| 2895 | if (diag == 0) |
| 2896 | dev->data->promiscuous = 0; |
| 2897 | |
| 2898 | diag = eth_err(port_id, diag); |
| 2899 | |
| 2900 | rte_eth_trace_promiscuous_disable(port_id, dev->data->promiscuous, |
| 2901 | diag); |
| 2902 | |
| 2903 | return diag; |
| 2904 | } |
| 2905 | |
| 2906 | int |
| 2907 | rte_eth_promiscuous_get(uint16_t port_id) |