MCPcopy Create free account
hub / github.com/F-Stack/f-stack / virtio_dev_promiscuous_enable

Function virtio_dev_promiscuous_enable

dpdk/drivers/net/virtio/virtio_ethdev.c:385–410  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

383}
384
385static int
386virtio_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
412static int
413virtio_dev_promiscuous_disable(struct rte_eth_dev *dev)

Callers

nothing calls this directly

Calls 2

virtio_with_featureFunction · 0.85
virtio_send_commandFunction · 0.85

Tested by

no test coverage detected