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

Function ionic_dev_set_mac

dpdk/drivers/net/ionic/ionic_lif.c:325–349  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

323}
324
325int
326ionic_dev_set_mac(struct rte_eth_dev *eth_dev, struct rte_ether_addr *mac_addr)
327{
328 struct ionic_lif *lif = IONIC_ETH_DEV_TO_LIF(eth_dev);
329
330 IONIC_PRINT_CALL();
331
332 if (mac_addr == NULL) {
333 IONIC_PRINT(NOTICE, "New mac is null");
334 return -1;
335 }
336
337 if (!rte_is_zero_ether_addr((struct rte_ether_addr *)lif->mac_addr)) {
338 IONIC_PRINT(INFO, "Deleting mac addr %pM",
339 lif->mac_addr);
340 ionic_lif_addr_del(lif, lif->mac_addr);
341 memset(lif->mac_addr, 0, RTE_ETHER_ADDR_LEN);
342 }
343
344 IONIC_PRINT(INFO, "Updating mac addr");
345
346 rte_ether_addr_copy(mac_addr, (struct rte_ether_addr *)lif->mac_addr);
347
348 return ionic_lif_addr_add(lif, (const uint8_t *)mac_addr);
349}
350
351static int
352ionic_vlan_rx_add_vid(struct ionic_lif *lif, uint16_t vid)

Callers

nothing calls this directly

Calls 5

rte_is_zero_ether_addrFunction · 0.85
ionic_lif_addr_delFunction · 0.85
memsetFunction · 0.85
rte_ether_addr_copyFunction · 0.85
ionic_lif_addr_addFunction · 0.85

Tested by

no test coverage detected