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

Function virtio_mac_table_set

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

Source from the content-addressed store, hash-verified

859}
860
861static int
862virtio_mac_table_set(struct virtio_hw *hw,
863 const struct virtio_net_ctrl_mac *uc,
864 const struct virtio_net_ctrl_mac *mc)
865{
866 struct virtio_pmd_ctrl ctrl;
867 int err, len[2];
868
869 if (!virtio_with_feature(hw, VIRTIO_NET_F_CTRL_MAC_ADDR)) {
870 PMD_DRV_LOG(INFO, "host does not support mac table");
871 return -1;
872 }
873
874 ctrl.hdr.class = VIRTIO_NET_CTRL_MAC;
875 ctrl.hdr.cmd = VIRTIO_NET_CTRL_MAC_TABLE_SET;
876
877 len[0] = uc->entries * RTE_ETHER_ADDR_LEN + sizeof(uc->entries);
878 memcpy(ctrl.data, uc, len[0]);
879
880 len[1] = mc->entries * RTE_ETHER_ADDR_LEN + sizeof(mc->entries);
881 memcpy(ctrl.data + len[0], mc, len[1]);
882
883 err = virtio_send_command(hw->cvq, &ctrl, len, 2);
884 if (err != 0)
885 PMD_DRV_LOG(NOTICE, "mac table set failed: %d", err);
886 return err;
887}
888
889static int
890virtio_mac_addr_add(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr,

Callers 2

virtio_mac_addr_addFunction · 0.85
virtio_mac_addr_removeFunction · 0.85

Calls 3

virtio_with_featureFunction · 0.85
virtio_send_commandFunction · 0.85
memcpyFunction · 0.50

Tested by

no test coverage detected