Lines Matching refs:nlskb
17 static int xsk_diag_put_info(const struct xdp_sock *xs, struct sk_buff *nlskb) in xsk_diag_put_info() argument
23 return nla_put(nlskb, XDP_DIAG_INFO, sizeof(di), &di); in xsk_diag_put_info()
27 struct sk_buff *nlskb) in xsk_diag_put_ring() argument
32 return nla_put(nlskb, nl_type, sizeof(dr), &dr); in xsk_diag_put_ring()
36 struct sk_buff *nlskb) in xsk_diag_put_rings_cfg() argument
41 err = xsk_diag_put_ring(xs->rx, XDP_DIAG_RX_RING, nlskb); in xsk_diag_put_rings_cfg()
43 err = xsk_diag_put_ring(xs->tx, XDP_DIAG_TX_RING, nlskb); in xsk_diag_put_rings_cfg()
47 static int xsk_diag_put_umem(const struct xdp_sock *xs, struct sk_buff *nlskb) in xsk_diag_put_umem() argument
69 err = nla_put(nlskb, XDP_DIAG_UMEM, sizeof(du), &du); in xsk_diag_put_umem()
72 XDP_DIAG_UMEM_FILL_RING, nlskb); in xsk_diag_put_umem()
75 XDP_DIAG_UMEM_COMPLETION_RING, nlskb); in xsk_diag_put_umem()
79 static int xsk_diag_put_stats(const struct xdp_sock *xs, struct sk_buff *nlskb) in xsk_diag_put_stats() argument
89 return nla_put(nlskb, XDP_DIAG_STATS, sizeof(du), &du); in xsk_diag_put_stats()
92 static int xsk_diag_fill(struct sock *sk, struct sk_buff *nlskb, in xsk_diag_fill() argument
101 nlh = nlmsg_put(nlskb, portid, seq, SOCK_DIAG_BY_FAMILY, sizeof(*msg), in xsk_diag_fill()
117 if ((req->xdiag_show & XDP_SHOW_INFO) && xsk_diag_put_info(xs, nlskb)) in xsk_diag_fill()
121 nla_put_u32(nlskb, XDP_DIAG_UID, in xsk_diag_fill()
126 xsk_diag_put_rings_cfg(xs, nlskb)) in xsk_diag_fill()
130 xsk_diag_put_umem(xs, nlskb)) in xsk_diag_fill()
134 sock_diag_put_meminfo(sk, nlskb, XDP_DIAG_MEMINFO)) in xsk_diag_fill()
138 xsk_diag_put_stats(xs, nlskb)) in xsk_diag_fill()
142 nlmsg_end(nlskb, nlh); in xsk_diag_fill()
147 nlmsg_cancel(nlskb, nlh); in xsk_diag_fill()
151 static int xsk_diag_dump(struct sk_buff *nlskb, struct netlink_callback *cb) in xsk_diag_dump() argument
154 struct net *net = sock_net(nlskb->sk); in xsk_diag_dump()
166 if (xsk_diag_fill(sk, nlskb, req, in xsk_diag_dump()
178 return nlskb->len; in xsk_diag_dump()
181 static int xsk_diag_handler_dump(struct sk_buff *nlskb, struct nlmsghdr *hdr) in xsk_diag_handler_dump() argument
185 struct net *net = sock_net(nlskb->sk); in xsk_diag_handler_dump()
193 return netlink_dump_start(net->diag_nlsk, nlskb, hdr, &c); in xsk_diag_handler_dump()