From: "Björn Töpel" <bjorn.topel@gmail.com>
To: bjorn.topel@gmail.com, magnus.karlsson@intel.com,
magnus.karlsson@gmail.com, alexander.h.duyck@intel.com,
alexander.duyck@gmail.com, ast@fb.com, brouer@redhat.com,
daniel@iogearbox.net, netdev@vger.kernel.org,
mykyta.iziumtsev@linaro.org
Cc: "Björn Töpel" <bjorn.topel@intel.com>,
john.fastabend@gmail.com, willemdebruijn.kernel@gmail.com,
mst@redhat.com, michael.lundkvist@ericsson.com,
jesse.brandeburg@intel.com, anjali.singhai@intel.com,
qi.z.zhang@intel.com, francois.ozog@linaro.org,
ilias.apalodimas@linaro.org, brian.brooks@linaro.org,
andy@greyhouse.net, michael.chan@broadcom.com,
intel-wired-lan@lists.osuosl.org
Subject: [PATCH bpf-next 01/11] xsk: moved struct xdp_umem definition
Date: Mon, 4 Jun 2018 14:05:51 +0200 [thread overview]
Message-ID: <20180604120601.18123-2-bjorn.topel@gmail.com> (raw)
In-Reply-To: <20180604120601.18123-1-bjorn.topel@gmail.com>
From: Björn Töpel <bjorn.topel@intel.com>
Moved struct xdp_umem to xdp_sock.h, in order to prepare for zero-copy
support.
Signed-off-by: Björn Töpel <bjorn.topel@intel.com>
---
include/net/xdp_sock.h | 24 +++++++++++++++++++++++-
net/xdp/xdp_umem.c | 1 +
net/xdp/xdp_umem.h | 22 +---------------------
net/xdp/xsk_queue.h | 3 +--
4 files changed, 26 insertions(+), 24 deletions(-)
diff --git a/include/net/xdp_sock.h b/include/net/xdp_sock.h
index 7a647c56ec15..3a6cd88f179d 100644
--- a/include/net/xdp_sock.h
+++ b/include/net/xdp_sock.h
@@ -6,12 +6,34 @@
#ifndef _LINUX_XDP_SOCK_H
#define _LINUX_XDP_SOCK_H
+#include <linux/workqueue.h>
+#include <linux/if_xdp.h>
#include <linux/mutex.h>
+#include <linux/mm.h>
#include <net/sock.h>
struct net_device;
struct xsk_queue;
-struct xdp_umem;
+
+struct xdp_umem_props {
+ u64 chunk_mask;
+ u64 size;
+};
+
+struct xdp_umem {
+ struct xsk_queue *fq;
+ struct xsk_queue *cq;
+ struct page **pgs;
+ struct xdp_umem_props props;
+ u32 headroom;
+ u32 chunk_size_nohr;
+ struct user_struct *user;
+ struct pid *pid;
+ unsigned long address;
+ refcount_t users;
+ struct work_struct work;
+ u32 npgs;
+};
struct xdp_sock {
/* struct sock must be the first member of struct xdp_sock */
diff --git a/net/xdp/xdp_umem.c b/net/xdp/xdp_umem.c
index 9ad791ff4739..2793a503223e 100644
--- a/net/xdp/xdp_umem.c
+++ b/net/xdp/xdp_umem.c
@@ -13,6 +13,7 @@
#include <linux/mm.h>
#include "xdp_umem.h"
+#include "xsk_queue.h"
#define XDP_UMEM_MIN_CHUNK_SIZE 2048
diff --git a/net/xdp/xdp_umem.h b/net/xdp/xdp_umem.h
index aeadd1bcb72d..9433e8af650a 100644
--- a/net/xdp/xdp_umem.h
+++ b/net/xdp/xdp_umem.h
@@ -6,27 +6,7 @@
#ifndef XDP_UMEM_H_
#define XDP_UMEM_H_
-#include <linux/mm.h>
-#include <linux/if_xdp.h>
-#include <linux/workqueue.h>
-
-#include "xsk_queue.h"
-#include "xdp_umem_props.h"
-
-struct xdp_umem {
- struct xsk_queue *fq;
- struct xsk_queue *cq;
- struct page **pgs;
- struct xdp_umem_props props;
- u32 headroom;
- u32 chunk_size_nohr;
- struct user_struct *user;
- struct pid *pid;
- unsigned long address;
- refcount_t users;
- struct work_struct work;
- u32 npgs;
-};
+#include <net/xdp_sock.h>
static inline char *xdp_umem_get_data(struct xdp_umem *umem, u64 addr)
{
diff --git a/net/xdp/xsk_queue.h b/net/xdp/xsk_queue.h
index 337e5ad3b10e..5246ed420a16 100644
--- a/net/xdp/xsk_queue.h
+++ b/net/xdp/xsk_queue.h
@@ -8,8 +8,7 @@
#include <linux/types.h>
#include <linux/if_xdp.h>
-
-#include "xdp_umem_props.h"
+#include <net/xdp_sock.h>
#define RX_BATCH_SIZE 16
--
2.14.1
next prev parent reply other threads:[~2018-06-04 12:06 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-04 12:05 [PATCH bpf-next 00/11] AF_XDP: introducing zero-copy support Björn Töpel
2018-06-04 12:05 ` Björn Töpel [this message]
2018-06-04 12:05 ` [PATCH bpf-next 02/11] xsk: introduce xdp_umem_page Björn Töpel
2019-03-13 9:39 ` [bpf-next,02/11] " Jiri Slaby
2019-03-13 11:23 ` Björn Töpel
2018-06-04 12:05 ` [PATCH bpf-next 03/11] net: xdp: added bpf_netdev_command XDP_{QUERY,SETUP}_XSK_UMEM Björn Töpel
2018-06-04 12:05 ` [PATCH bpf-next 04/11] xdp: add MEM_TYPE_ZERO_COPY Björn Töpel
2018-06-04 12:05 ` [PATCH bpf-next 05/11] xsk: add zero-copy support for Rx Björn Töpel
2018-06-04 12:05 ` [PATCH bpf-next 06/11] net: added netdevice operation for Tx Björn Töpel
2018-06-04 12:05 ` [PATCH bpf-next 07/11] xsk: wire upp Tx zero-copy functions Björn Töpel
2018-06-04 12:05 ` [PATCH bpf-next 08/11] i40e: added queue pair disable/enable functions Björn Töpel
2018-06-04 12:05 ` [PATCH bpf-next 09/11] i40e: implement AF_XDP zero-copy support for Rx Björn Töpel
2018-06-04 20:35 ` Alexander Duyck
2018-06-07 7:40 ` Björn Töpel
2018-06-04 12:06 ` [PATCH bpf-next 10/11] i40e: implement AF_XDP zero-copy support for Tx Björn Töpel
2018-06-04 20:53 ` Alexander Duyck
2018-06-05 12:43 ` Jesper Dangaard Brouer
2018-06-05 13:07 ` Björn Töpel
2018-06-04 12:06 ` [PATCH bpf-next 11/11] samples/bpf: xdpsock: use skb Tx path for XDP_SKB Björn Töpel
2018-06-04 16:38 ` [PATCH bpf-next 00/11] AF_XDP: introducing zero-copy support Alexei Starovoitov
2018-06-04 20:29 ` [Intel-wired-lan] " Jeff Kirsher
2018-11-14 8:10 ` af_xdp zero copy ideas Michael S. Tsirkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180604120601.18123-2-bjorn.topel@gmail.com \
--to=bjorn.topel@gmail.com \
--cc=alexander.duyck@gmail.com \
--cc=alexander.h.duyck@intel.com \
--cc=andy@greyhouse.net \
--cc=anjali.singhai@intel.com \
--cc=ast@fb.com \
--cc=bjorn.topel@intel.com \
--cc=brian.brooks@linaro.org \
--cc=brouer@redhat.com \
--cc=daniel@iogearbox.net \
--cc=francois.ozog@linaro.org \
--cc=ilias.apalodimas@linaro.org \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=jesse.brandeburg@intel.com \
--cc=john.fastabend@gmail.com \
--cc=magnus.karlsson@gmail.com \
--cc=magnus.karlsson@intel.com \
--cc=michael.chan@broadcom.com \
--cc=michael.lundkvist@ericsson.com \
--cc=mst@redhat.com \
--cc=mykyta.iziumtsev@linaro.org \
--cc=netdev@vger.kernel.org \
--cc=qi.z.zhang@intel.com \
--cc=willemdebruijn.kernel@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).