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

Function virtio_mac_addr_remove

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

Source from the content-addressed store, hash-verified

922}
923
924static void
925virtio_mac_addr_remove(struct rte_eth_dev *dev, uint32_t index)
926{
927 struct virtio_hw *hw = dev->data->dev_private;
928 struct rte_ether_addr *addrs = dev->data->mac_addrs;
929 struct virtio_net_ctrl_mac *uc, *mc;
930 unsigned int i;
931
932 if (index >= VIRTIO_MAX_MAC_ADDRS) {
933 PMD_DRV_LOG(ERR, "mac address index %u out of range", index);
934 return;
935 }
936
937 uc = alloca(VIRTIO_MAX_MAC_ADDRS * RTE_ETHER_ADDR_LEN +
938 sizeof(uc->entries));
939 uc->entries = 0;
940 mc = alloca(VIRTIO_MAX_MAC_ADDRS * RTE_ETHER_ADDR_LEN +
941 sizeof(mc->entries));
942 mc->entries = 0;
943
944 for (i = 0; i < VIRTIO_MAX_MAC_ADDRS; i++) {
945 struct virtio_net_ctrl_mac *tbl;
946
947 if (i == index || rte_is_zero_ether_addr(addrs + i))
948 continue;
949
950 tbl = rte_is_multicast_ether_addr(addrs + i) ? mc : uc;
951 memcpy(&tbl->macs[tbl->entries++], addrs + i,
952 RTE_ETHER_ADDR_LEN);
953 }
954
955 virtio_mac_table_set(hw, uc, mc);
956}
957
958static int
959virtio_mac_addr_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr)

Callers

nothing calls this directly

Calls 4

rte_is_zero_ether_addrFunction · 0.85
virtio_mac_table_setFunction · 0.85
memcpyFunction · 0.50

Tested by

no test coverage detected