| 383 | } |
| 384 | |
| 385 | static int |
| 386 | virtio_dev_promiscuous_enable(struct rte_eth_dev *dev) |
| 387 | { |
| 388 | struct virtio_hw *hw = dev->data->dev_private; |
| 389 | struct virtio_pmd_ctrl ctrl; |
| 390 | int dlen[1]; |
| 391 | int ret; |
| 392 | |
| 393 | if (!virtio_with_feature(hw, VIRTIO_NET_F_CTRL_RX)) { |
| 394 | PMD_INIT_LOG(INFO, "host does not support rx control"); |
| 395 | return -ENOTSUP; |
| 396 | } |
| 397 | |
| 398 | ctrl.hdr.class = VIRTIO_NET_CTRL_RX; |
| 399 | ctrl.hdr.cmd = VIRTIO_NET_CTRL_RX_PROMISC; |
| 400 | ctrl.data[0] = 1; |
| 401 | dlen[0] = 1; |
| 402 | |
| 403 | ret = virtio_send_command(hw->cvq, &ctrl, dlen, 1); |
| 404 | if (ret) { |
| 405 | PMD_INIT_LOG(ERR, "Failed to enable promisc"); |
| 406 | return -EAGAIN; |
| 407 | } |
| 408 | |
| 409 | return 0; |
| 410 | } |
| 411 | |
| 412 | static int |
| 413 | virtio_dev_promiscuous_disable(struct rte_eth_dev *dev) |
nothing calls this directly
no test coverage detected