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

Function mlx4_get_mac

dpdk/drivers/net/mlx4/mlx4_ethdev.c:177–187  ·  view source on GitHub ↗

* Get MAC address by querying netdevice. * * @param[in] priv * Pointer to private structure. * @param[out] mac * MAC address output buffer. * * @return * 0 on success, negative errno value otherwise and rte_errno is set. */

Source from the content-addressed store, hash-verified

175 * 0 on success, negative errno value otherwise and rte_errno is set.
176 */
177int
178mlx4_get_mac(struct mlx4_priv *priv, uint8_t (*mac)[RTE_ETHER_ADDR_LEN])
179{
180 struct ifreq request;
181 int ret = mlx4_ifreq(priv, SIOCGIFHWADDR, &request);
182
183 if (ret)
184 return ret;
185 memcpy(mac, request.ifr_hwaddr.sa_data, RTE_ETHER_ADDR_LEN);
186 return 0;
187}
188
189/**
190 * Get device MTU.

Callers 1

mlx4_pci_probeFunction · 0.85

Calls 2

mlx4_ifreqFunction · 0.85
memcpyFunction · 0.50

Tested by

no test coverage detected