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

Function mlx4_ifreq

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

* Perform ifreq ioctl() on associated Ethernet device. * * @param[in] priv * Pointer to private structure. * @param req * Request number to pass to ioctl(). * @param[out] ifr * Interface request structure output buffer. * * @return * 0 on success, negative errno value otherwise and rte_errno is set. */

Source from the content-addressed store, hash-verified

145 * 0 on success, negative errno value otherwise and rte_errno is set.
146 */
147static int
148mlx4_ifreq(const struct mlx4_priv *priv, int req, struct ifreq *ifr)
149{
150 int sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_IP);
151 int ret;
152
153 if (sock == -1) {
154 rte_errno = errno;
155 return -rte_errno;
156 }
157 ret = mlx4_get_ifname(priv, &ifr->ifr_name);
158 if (!ret && ioctl(sock, req, ifr) == -1) {
159 rte_errno = errno;
160 ret = -rte_errno;
161 }
162 close(sock);
163 return ret;
164}
165
166/**
167 * Get MAC address by querying netdevice.

Callers 7

mlx4_get_macFunction · 0.85
mlx4_mtu_getFunction · 0.85
mlx4_mtu_setFunction · 0.85
mlx4_set_flagsFunction · 0.85
mlx4_link_updateFunction · 0.85
mlx4_flow_ctrl_getFunction · 0.85
mlx4_flow_ctrl_setFunction · 0.85

Calls 4

mlx4_get_ifnameFunction · 0.85
socketClass · 0.50
ioctlFunction · 0.50
closeFunction · 0.50

Tested by

no test coverage detected