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

Function tap_nl_send

dpdk/drivers/net/tap/tap_netlink.c:117–136  ·  view source on GitHub ↗

* Send a message to the kernel on the netlink socket. * * @param[in] nlsk_fd * The netlink socket file descriptor used for communication. * @param[in] nh * The netlink message send to the kernel. * * @return * the number of sent bytes on success, -1 otherwise. */

Source from the content-addressed store, hash-verified

115 * the number of sent bytes on success, -1 otherwise.
116 */
117int
118tap_nl_send(int nlsk_fd, struct nlmsghdr *nh)
119{
120 int send_bytes;
121
122 nh->nlmsg_pid = 0; /* communication with the kernel uses pid 0 */
123 nh->nlmsg_seq = (uint32_t)rte_rand();
124
125retry:
126 send_bytes = send(nlsk_fd, nh, nh->nlmsg_len, 0);
127 if (send_bytes < 0) {
128 if (errno == EINTR)
129 goto retry;
130
131 TAP_LOG(ERR, "Failed to send netlink message: %s (%d)",
132 strerror(errno), errno);
133 return -1;
134 }
135 return send_bytes;
136}
137
138#ifdef NETLINK_EXT_ACK
139static const struct nlattr *

Callers 8

qdisc_delFunction · 0.85
qdisc_add_multiqFunction · 0.85
qdisc_add_ingressFunction · 0.85
qdisc_iterateFunction · 0.85
tap_flow_createFunction · 0.85
tap_flow_destroy_pmdFunction · 0.85
tap_flow_implicit_createFunction · 0.85
rss_enableFunction · 0.85

Calls 2

rte_randFunction · 0.85
sendFunction · 0.50

Tested by

no test coverage detected