blob: db9a321de0873dc4b40bace7c32cff9dec721b81 [file] [log] [blame]
Björn Töpelc0c77d82018-05-02 13:01:23 +02001/* SPDX-License-Identifier: GPL-2.0
2 * AF_XDP internal functions
3 * Copyright(c) 2018 Intel Corporation.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 */
14
15#ifndef _LINUX_XDP_SOCK_H
16#define _LINUX_XDP_SOCK_H
17
18#include <linux/mutex.h>
19#include <net/sock.h>
20
Björn Töpelb9b6b682018-05-02 13:01:25 +020021struct net_device;
22struct xsk_queue;
Björn Töpelc0c77d82018-05-02 13:01:23 +020023struct xdp_umem;
24
25struct xdp_sock {
26 /* struct sock must be the first member of struct xdp_sock */
27 struct sock sk;
Björn Töpelb9b6b682018-05-02 13:01:25 +020028 struct xsk_queue *rx;
29 struct net_device *dev;
Björn Töpelc0c77d82018-05-02 13:01:23 +020030 struct xdp_umem *umem;
31 /* Protects multiple processes in the control path */
32 struct mutex mutex;
33};
34
35#endif /* _LINUX_XDP_SOCK_H */