Re: [PATCH net] tun: remove skb access after netif_receive_skb

2018-11-29 Thread Toshiaki Makita
s a bug by removing skb access after netif_receive_skb() >> - uses xdp data size for accounting bytes ... >> Fixes: 043d222f93ab ("tuntap: accept an array of XDP buffs through >> sendmsg()") >> Reviewed-by: Toshiaki Makita >> Signed-off-by: Prashant Bhole &

Re: consistency for statistics with XDP mode

2018-11-27 Thread Toshiaki Makita
On 2018/11/28 13:03, Jason Wang wrote: > On 2018/11/27 下午3:04, Toshiaki Makita wrote: >> On 2018/11/26 10:37, Toshiaki Makita wrote: >>> On 2018/11/23 1:43, David Ahern wrote: >>>> On 11/21/18 5:53 PM, Toshiaki Makita wrote: >>>>>> We really need con

Re: consistency for statistics with XDP mode

2018-11-26 Thread Toshiaki Makita
On 2018/11/26 10:37, Toshiaki Makita wrote: > On 2018/11/23 1:43, David Ahern wrote: >> On 11/21/18 5:53 PM, Toshiaki Makita wrote: >>>> We really need consistency in the counters and at a minimum, users >>>> should be able to track packet and byte counters for

Re: consistency for statistics with XDP mode

2018-11-25 Thread Toshiaki Makita
On 2018/11/23 1:43, David Ahern wrote: > On 11/21/18 5:53 PM, Toshiaki Makita wrote: >>> We really need consistency in the counters and at a minimum, users >>> should be able to track packet and byte counters for both Rx and Tx >>> including XDP. >>> >&g

Re: consistency for statistics with XDP mode

2018-11-21 Thread Toshiaki Makita
rs returned > for the standard device stats (/proc/net/dev, ip -s li show, ...) should > include all packets managed by the driver regardless of whether they are > forwarded / dropped in XDP or go up the Linux stack. This also aligns Agreed. When I introduced virtio_net XDP counters, I j

Re: [PATCH net-next 1/3] veth: Account for packet drops in ndo_xdp_xmit

2018-10-13 Thread Toshiaki Makita
On 18/10/13 (土) 16:48, Jesper Dangaard Brouer wrote: On Thu, 11 Oct 2018 18:36:48 +0900 Toshiaki Makita wrote: Use existing atomic drop counter. Since drop path is really an exceptional case here, I'm thinking atomic ops would not hurt the performance. Hmm... we try very hard not to add

[PATCH net-next 3/3] veth: Add ethtool statistics support for XDP

2018-10-11 Thread Toshiaki Makita
rx_queue_0_xdp_drops: 28601434 rx_queue_1_xdp_packets: 17873050 rx_queue_1_xdp_bytes: 1072383000 rx_queue_1_xdp_drops: 17873050 Signed-off-by: Toshiaki Makita --- drivers/net/veth.c | 48 ++-- 1 file changed, 46 insertions(+), 2

[PATCH net-next 2/3] veth: Account for XDP packet statistics on rx side

2018-10-11 Thread Toshiaki Makita
ct for XDP. Signed-off-by: Toshiaki Makita --- drivers/net/veth.c | 97 -- 1 file changed, 79 insertions(+), 18 deletions(-) diff --git a/drivers/net/veth.c b/drivers/net/veth.c index 452193f2..68bb93d 100644 --- a/drivers/net/veth.c +++ b/drivers/

[PATCH net-next 1/3] veth: Account for packet drops in ndo_xdp_xmit

2018-10-11 Thread Toshiaki Makita
Use existing atomic drop counter. Since drop path is really an exceptional case here, I'm thinking atomic ops would not hurt the performance. XDP packets and bytes are not counted in ndo_xdp_xmit, but will be accounted on rx side by the following commit. Signed-off-by: Toshiaki Makita

[PATCH net-next 0/3] veth: XDP stats improvement

2018-10-11 Thread Toshiaki Makita
update per-queue stats on rx for XDP packets, and use them to calculate tx counters as well, contrary to the existing non-XDP counters. [1] https://patchwork.ozlabs.org/cover/953071/#1967449 Signed-off-by: Toshiaki Makita Toshiaki Makita (3): veth: Account for packet drops in ndo_xdp_xmit

[PATCH net] veth: Orphan skb before GRO

2018-09-13 Thread Toshiaki Makita
70712260 In order to avoid this, orphan the skb before entering GRO. Fixes: 948d4f214fde ("veth: Add driver XDP") Reported-by: Paolo Abeni Signed-off-by: Toshiaki Makita --- drivers/net/veth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/veth.

Re: unexpected GRO/veth behavior

2018-09-13 Thread Toshiaki Makita
On 2018/09/11 20:07, Toshiaki Makita wrote: > On 2018/09/11 19:27, Eric Dumazet wrote: > ... >> Fix would probably be : >> >> diff --git a/drivers/net/veth.c b/drivers/net/veth.c >> index >> 8d679c8b7f25c753d77cfb8821d9d2528c9c9048..96bd94480942b46

Re: unexpected GRO/veth behavior

2018-09-11 Thread Toshiaki Makita
we should unconditionally orphan the skb here. I was thinking I should call netif_receive_skb() for such packets instead of napi_gro_receive(). -- Toshiaki Makita

Re: [net-next, PATCH 2/2, v1] net: socionext: add AF_XDP support

2018-09-10 Thread Toshiaki Makita
>> >> Also seems there is no handling of adjust_head/tail for XDP_PASS case. >> > A question on this. Should XDP related frames be allocated using 1 page > per packet? AFAIK there is no such constraint, e.g. i40e allocates 1 page per 2 packets. -- Toshiaki Makita

Re: unexpected GRO/veth behavior

2018-09-10 Thread Toshiaki Makita
NIC ---(XDP_REDIRECT)---> veth===veth (XDP_PASS) GRO seems to work and improves TCP throughput in this case. Now I noticed I did not test: netperf -> veth===veth (XDP_PASS) -> netserver which I think is the case where Paolo faces a problem. I think it is not the case XDP can improve performance. I think I can disable GRO for packets with skb->sk != NULL in veth. -- Toshiaki Makita

Re: [net-next, PATCH 2/2, v1] net: socionext: add AF_XDP support

2018-09-10 Thread Toshiaki Makita
g *prog) > +{ > + struct net_device *dev = priv->ndev; > + struct bpf_prog *old_prog; > + > + /* For now just support only the usual MTU sized frames */ > + if (prog && dev->mtu > 1500) { > + netdev_warn(dev, "Jumbo frames not yet supported with XDP\n"); Why not using extack? > + return -EOPNOTSUPP; > + } > + -- Toshiaki Makita

[PATCH v3 net-next] veth: Free queues on link delete

2018-08-15 Thread Toshiaki Makita
264dc90227 ("veth: Support per queue XDP ring") Reported-by: David Ahern Signed-off-by: Toshiaki Makita --- This is a fix for a bug which exists only in net-next. Let me know if I should wait for -next merging into net or reopen of -next. drivers/net/veth.c | 70 +

Re: [PATCH v2 net-next] veth: Free queues on link delete

2018-08-14 Thread Toshiaki Makita
On 2018/08/15 10:29, David Ahern wrote: > On 8/14/18 7:16 PM, Toshiaki Makita wrote: >> Hmm, on second thought this queues need to be freed after veth_close() >> to make sure no packet will reference them. That means we need to free >> them in .ndo_uninit() or destructor.

Re: [PATCH v2 net-next] veth: Free queues on link delete

2018-08-14 Thread Toshiaki Makita
L); > unregister_netdevice_queue(peer, head); Hmm, on second thought this queues need to be freed after veth_close() to make sure no packet will reference them. That means we need to free them in .ndo_uninit() or destructor. (rtnl_delete_link() calls dellink() before unregister_netdevice_many() which calls dev_close_many() through rollback_registered_many()) Currently veth has destructor veth_dev_free() for vstats, so we can free queues in the function. To be in line with vstats, allocation also should be moved to veth_dev_init(). -- Toshiaki Makita

Re: [PATCH net] veth: Free queues on link delete

2018-08-14 Thread Toshiaki Makita
*peer; > > + veth_free_queues(dev); > priv = netdev_priv(dev); > peer = rtnl_dereference(priv->peer); We need to free up peer queues as well. Also isn't this for net-next though it is now closed? -- Toshiaki Makita

Re: [PATCH v8 bpf-next 02/10] veth: Add driver XDP

2018-08-07 Thread Toshiaki Makita
Hi Daniel, Thank you for taking a look! On 2018/08/07 23:26, Daniel Borkmann wrote: > On 08/03/2018 09:58 AM, Toshiaki Makita wrote: > [...] >> + >> +static struct sk_buff *veth_xdp_rcv_skb(struct veth_priv *priv, >> +struct sk_buff

Re: [PATCH v8 bpf-next 00/10] veth: Driver XDP

2018-08-03 Thread Toshiaki Makita
On 18/08/03 (金) 18:45, Jesper Dangaard Brouer wrote: On Fri, 3 Aug 2018 16:58:08 +0900 Toshiaki Makita wrote: This patch set introduces driver XDP for veth. Basically this is used in conjunction with redirect action of another XDP program. NIC ---> veth===veth (XDP) (redir

[PATCH v8 bpf-next 09/10] veth: Add XDP TX and REDIRECT

2018-08-03 Thread Toshiaki Makita
p_buff. v4: - Use xdp_[set|clear]_return_frame_no_direct() instead of a flag in xdp_mem_info. v3: - Fix double free when veth_xdp_tx() returns a positive value. - Convert xdp_xmit and xdp_redir variables into flags. Signed-off-by: Toshiaki Makita --- drivers/net/veth.c

[PATCH v8 bpf-next 10/10] veth: Support per queue XDP ring

2018-08-03 Thread Toshiaki Makita
that the number of rxqs must not less than the number of peer txqs, but leave the possibility to achieve bulk skb xmit in the future because txq lock would make it possible to remove rxq ptr_ring lock. v3: - Add extack messages. - Fix array overrun in veth_xmit. Signed-off-by: Toshiaki Makita

[PATCH v8 bpf-next 06/10] veth: Add ndo_xdp_xmit

2018-08-03 Thread Toshiaki Makita
xdp_frame into skb when XDP is not enabled. - Implement bulk interface of ndo_xdp_xmit. - Implement XDP_XMIT_FLUSH bit and drop ndo_xdp_flush. Signed-off-by: Toshiaki Makita Acked-by: John Fastabend --- drivers/net/veth.c | 51 +++ 1 file changed

[PATCH v8 bpf-next 08/10] xdp: Helpers for disabling napi_direct of xdp_return_frame

2018-08-03 Thread Toshiaki Makita
. v4: - Use bpf_redirect_info for storing the flag instead of xdp_mem_info to avoid per-frame copy cost. Signed-off-by: Toshiaki Makita --- include/linux/filter.h | 25 + net/core/xdp.c | 6 -- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git

[PATCH v8 bpf-next 07/10] bpf: Make redirect_info accessible from modules

2018-08-03 Thread Toshiaki Makita
-off-by: Toshiaki Makita --- include/linux/filter.h | 10 ++ net/core/filter.c | 29 +++-- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/include/linux/filter.h b/include/linux/filter.h index c73dd73..4717af8 100644 --- a/include/linux/filter.h

[PATCH v8 bpf-next 04/10] xdp: Helper function to clear kernel pointers in xdp_frame

2018-08-03 Thread Toshiaki Makita
-by: Toshiaki Makita --- include/net/xdp.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/include/net/xdp.h b/include/net/xdp.h index fcb033f..76b9525 100644 --- a/include/net/xdp.h +++ b/include/net/xdp.h @@ -84,6 +84,13 @@ struct xdp_frame { struct net_device *dev_rx; /* used by cpumap

[PATCH v8 bpf-next 05/10] veth: Handle xdp_frames in xdp napi ring

2018-08-03 Thread Toshiaki Makita
lds in skb->head. - Implement adjust_tail. Signed-off-by: Toshiaki Makita Acked-by: John Fastabend --- drivers/net/veth.c | 89 +++--- 1 file changed, 84 insertions(+), 5 deletions(-) diff --git a/drivers/net/veth.c b/drivers/net/veth.c index 9

[PATCH v8 bpf-next 02/10] veth: Add driver XDP

2018-08-03 Thread Toshiaki Makita
ary. - Register rxq_info on enabling XDP rather than on opening the device. Signed-off-by: Toshiaki Makita --- drivers/net/veth.c | 374 - 1 file changed, 367 insertions(+), 7 deletions(-) diff --git a/drivers/net/veth.c b/drivers/net/veth.c index a69a

[PATCH v8 bpf-next 03/10] veth: Avoid drops by oversized packets when XDP is enabled

2018-08-03 Thread Toshiaki Makita
but cap max MTU. Signed-off-by: Toshiaki Makita --- drivers/net/veth.c | 47 +-- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/drivers/net/veth.c b/drivers/net/veth.c index d3b9f10..9edf104 100644 --- a/drivers/net/veth.c +++ b/drivers/net

[PATCH v8 bpf-next 00/10] veth: Driver XDP

2018-08-03 Thread Toshiaki Makita
ng device. - Add extack messages in ndo_bpf. v2: - Squash NAPI patch with "Add driver XDP" patch. - Remove conversion from xdp_frame to skb when NAPI is not enabled. - Introduce per-queue XDP ring (patch 8). - Introduce bulk skb xmit when XDP is enabled on the peer (patch 9). Signed-off

[PATCH v8 bpf-next 01/10] net: Export skb_headers_offset_update

2018-08-03 Thread Toshiaki Makita
This is needed for veth XDP which does skb_copy_expand()-like operation. v2: - Drop skb_copy_header part because it has already been exported now. Signed-off-by: Toshiaki Makita --- include/linux/skbuff.h | 1 + net/core/skbuff.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion

Re: [PATCH v7 bpf-next 05/10] veth: Handle xdp_frames in xdp napi ring

2018-08-02 Thread Toshiaki Makita
On 18/08/02 (木) 22:53, Jesper Dangaard Brouer wrote: On Thu, 2 Aug 2018 22:17:53 +0900 Toshiaki Makita wrote: On 18/08/02 (木) 20:45, Jesper Dangaard Brouer wrote: On Thu, 2 Aug 2018 19:55:09 +0900 Toshiaki Makita wrote: + headroom = frame->data - delta - (void *)frame; Y

Re: [PATCH v7 bpf-next 05/10] veth: Handle xdp_frames in xdp napi ring

2018-08-02 Thread Toshiaki Makita
On 18/08/02 (木) 20:45, Jesper Dangaard Brouer wrote: On Thu, 2 Aug 2018 19:55:09 +0900 Toshiaki Makita wrote: + headroom = frame->data - delta - (void *)frame; Your calculation of headroom is still adding an assumption that xdp_frame is located in the top of data a

[PATCH v7 bpf-next 10/10] veth: Support per queue XDP ring

2018-08-02 Thread Toshiaki Makita
that the number of rxqs must not less than the number of peer txqs, but leave the possibility to achieve bulk skb xmit in the future because txq lock would make it possible to remove rxq ptr_ring lock. v3: - Add extack messages. - Fix array overrun in veth_xmit. Signed-off-by: Toshiaki Makita

[PATCH v7 bpf-next 06/10] veth: Add ndo_xdp_xmit

2018-08-02 Thread Toshiaki Makita
xdp_frame into skb when XDP is not enabled. - Implement bulk interface of ndo_xdp_xmit. - Implement XDP_XMIT_FLUSH bit and drop ndo_xdp_flush. Signed-off-by: Toshiaki Makita Acked-by: John Fastabend --- drivers/net/veth.c | 51 +++ 1 file changed

[PATCH v7 bpf-next 07/10] bpf: Make redirect_info accessible from modules

2018-08-02 Thread Toshiaki Makita
-off-by: Toshiaki Makita --- include/linux/filter.h | 10 ++ net/core/filter.c | 29 +++-- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/include/linux/filter.h b/include/linux/filter.h index c73dd73..4717af8 100644 --- a/include/linux/filter.h

[PATCH v7 bpf-next 09/10] veth: Add XDP TX and REDIRECT

2018-08-02 Thread Toshiaki Makita
a flag in xdp_mem_info. v3: - Fix double free when veth_xdp_tx() returns a positive value. - Convert xdp_xmit and xdp_redir variables into flags. Signed-off-by: Toshiaki Makita --- drivers/net/veth.c | 119 + 1 file changed, 110 insertions(+), 9 del

[PATCH v7 bpf-next 08/10] xdp: Helpers for disabling napi_direct of xdp_return_frame

2018-08-02 Thread Toshiaki Makita
. v4: - Use bpf_redirect_info for storing the flag instead of xdp_mem_info to avoid per-frame copy cost. Signed-off-by: Toshiaki Makita --- include/linux/filter.h | 25 + net/core/xdp.c | 6 -- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git

[PATCH v7 bpf-next 05/10] veth: Handle xdp_frames in xdp napi ring

2018-08-02 Thread Toshiaki Makita
little performance difference for now. v2: - Use another ring instead of using flag to differentiate skb and xdp_frame. This approach makes bulk skb transmit possible in veth_xmit later. - Clear xdp_frame feilds in skb->head. - Implement adjust_tail. Signed-off-by: Toshiaki Makita Ac

[PATCH v7 bpf-next 03/10] veth: Avoid drops by oversized packets when XDP is enabled

2018-08-02 Thread Toshiaki Makita
but cap max MTU. Signed-off-by: Toshiaki Makita --- drivers/net/veth.c | 47 +-- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/drivers/net/veth.c b/drivers/net/veth.c index d3b9f10..9edf104 100644 --- a/drivers/net/veth.c +++ b/drivers/net

[PATCH v7 bpf-next 04/10] xdp: Helper function to clear kernel pointers in xdp_frame

2018-08-02 Thread Toshiaki Makita
-by: Toshiaki Makita --- include/net/xdp.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/include/net/xdp.h b/include/net/xdp.h index fcb033f..76b9525 100644 --- a/include/net/xdp.h +++ b/include/net/xdp.h @@ -84,6 +84,13 @@ struct xdp_frame { struct net_device *dev_rx; /* used by cpumap

[PATCH v7 bpf-next 02/10] veth: Add driver XDP

2018-08-02 Thread Toshiaki Makita
ary. - Register rxq_info on enabling XDP rather than on opening the device. Signed-off-by: Toshiaki Makita --- drivers/net/veth.c | 374 - 1 file changed, 367 insertions(+), 7 deletions(-) diff --git a/drivers/net/veth.c b/drivers/net/veth.c index a69a

[PATCH v7 bpf-next 01/10] net: Export skb_headers_offset_update

2018-08-02 Thread Toshiaki Makita
This is needed for veth XDP which does skb_copy_expand()-like operation. v2: - Drop skb_copy_header part because it has already been exported now. Signed-off-by: Toshiaki Makita --- include/linux/skbuff.h | 1 + net/core/skbuff.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion

[PATCH v7 bpf-next 00/10] veth: Driver XDP

2018-08-02 Thread Toshiaki Makita
ch. - Remove conversion from xdp_frame to skb when NAPI is not enabled. - Introduce per-queue XDP ring (patch 8). - Introduce bulk skb xmit when XDP is enabled on the peer (patch 9). Signed-off-by: Toshiaki Makita Toshiaki Makita (10): net: Export skb_headers_offset_update veth: Add driver XDP vet

Re: [PATCH v6 bpf-next 4/9] veth: Handle xdp_frames in xdp napi ring

2018-07-31 Thread Toshiaki Makita
On 2018/07/31 21:46, Jesper Dangaard Brouer wrote: > On Tue, 31 Jul 2018 19:40:08 +0900 > Toshiaki Makita wrote: > >> On 2018/07/31 19:26, Jesper Dangaard Brouer wrote: >>> >>> Context needed from: [PATCH v6 bpf-next 2/9] veth: Add driver XDP >>&

Re: [PATCH v6 bpf-next 4/9] veth: Handle xdp_frames in xdp napi ring

2018-07-31 Thread Toshiaki Makita
On 2018/07/31 19:26, Jesper Dangaard Brouer wrote: > > Context needed from: [PATCH v6 bpf-next 2/9] veth: Add driver XDP > > On Mon, 30 Jul 2018 19:43:44 +0900 > Toshiaki Makita wrote: > >> +static struct sk_buff *veth_build_skb(void *hea

[PATCH v6 bpf-next 9/9] veth: Support per queue XDP ring

2018-07-30 Thread Toshiaki Makita
that the number of rxqs must not less than the number of peer txqs, but leave the possibility to achieve bulk skb xmit in the future because txq lock would make it possible to remove rxq ptr_ring lock. v3: - Add extack messages. - Fix array overrun in veth_xmit. Signed-off-by: Toshiaki Makita

[PATCH v6 bpf-next 5/9] veth: Add ndo_xdp_xmit

2018-07-30 Thread Toshiaki Makita
xdp_frame into skb when XDP is not enabled. - Implement bulk interface of ndo_xdp_xmit. - Implement XDP_XMIT_FLUSH bit and drop ndo_xdp_flush. Signed-off-by: Toshiaki Makita Acked-by: John Fastabend --- drivers/net/veth.c | 51 +++ 1 file changed

[PATCH v6 bpf-next 8/9] veth: Add XDP TX and REDIRECT

2018-07-30 Thread Toshiaki Makita
a flag in xdp_mem_info. v3: - Fix double free when veth_xdp_tx() returns a positive value. - Convert xdp_xmit and xdp_redir variables into flags. Signed-off-by: Toshiaki Makita --- drivers/net/veth.c | 119 + 1 file changed, 110 insertions(+), 9 del

[PATCH v6 bpf-next 3/9] veth: Avoid drops by oversized packets when XDP is enabled

2018-07-30 Thread Toshiaki Makita
but cap max MTU. Signed-off-by: Toshiaki Makita --- drivers/net/veth.c | 47 +-- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/drivers/net/veth.c b/drivers/net/veth.c index d3b9f10..9edf104 100644 --- a/drivers/net/veth.c +++ b/drivers/net

[PATCH v6 bpf-next 4/9] veth: Handle xdp_frames in xdp napi ring

2018-07-30 Thread Toshiaki Makita
: - Use another ring instead of using flag to differentiate skb and xdp_frame. This approach makes bulk skb transmit possible in veth_xmit later. - Clear xdp_frame feilds in skb->head. - Implement adjust_tail. Signed-off-by: Toshiaki Makita Acked-by: John Fastabend --- drivers/net/veth.c |

[PATCH v6 bpf-next 7/9] xdp: Helpers for disabling napi_direct of xdp_return_frame

2018-07-30 Thread Toshiaki Makita
. v4: - Use bpf_redirect_info for storing the flag instead of xdp_mem_info to avoid per-frame copy cost. Signed-off-by: Toshiaki Makita --- include/linux/filter.h | 25 + net/core/xdp.c | 6 -- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git

[PATCH v6 bpf-next 6/9] bpf: Make redirect_info accessible from modules

2018-07-30 Thread Toshiaki Makita
-off-by: Toshiaki Makita --- include/linux/filter.h | 10 ++ net/core/filter.c | 29 +++-- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/include/linux/filter.h b/include/linux/filter.h index c73dd73..4717af8 100644 --- a/include/linux/filter.h

[PATCH v6 bpf-next 2/9] veth: Add driver XDP

2018-07-30 Thread Toshiaki Makita
ary. - Register rxq_info on enabling XDP rather than on opening the device. Signed-off-by: Toshiaki Makita --- drivers/net/veth.c | 374 - 1 file changed, 367 insertions(+), 7 deletions(-) diff --git a/drivers/net/veth.c b/drivers/net/veth.c index a69a

[PATCH v6 bpf-next 1/9] net: Export skb_headers_offset_update

2018-07-30 Thread Toshiaki Makita
This is needed for veth XDP which does skb_copy_expand()-like operation. v2: - Drop skb_copy_header part because it has already been exported now. Signed-off-by: Toshiaki Makita --- include/linux/skbuff.h | 1 + net/core/skbuff.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion

[PATCH v6 bpf-next 0/9] veth: Driver XDP

2018-07-30 Thread Toshiaki Makita
patch 8). - Introduce bulk skb xmit when XDP is enabled on the peer (patch 9). Signed-off-by: Toshiaki Makita Toshiaki Makita (9): net: Export skb_headers_offset_update veth: Add driver XDP veth: Avoid drops by oversized packets when XDP is enabled veth: Handle xdp_frames in xdp napi ring veth

Re: [PATCH v5 bpf-next 2/9] veth: Add driver XDP

2018-07-26 Thread Toshiaki Makita
Hi John, On 2018/07/27 12:02, John Fastabend wrote: > On 07/26/2018 07:40 AM, Toshiaki Makita wrote: >> From: Toshiaki Makita >> >> This is the basic implementation of veth driver XDP. >> >> Incoming packets are sent from the peer veth device in the form of s

Re: [PATCH v5 bpf-next 3/9] veth: Avoid drops by oversized packets when XDP is enabled

2018-07-26 Thread Toshiaki Makita
On 2018/07/27 9:51, Jakub Kicinski wrote: > On Thu, 26 Jul 2018 23:40:26 +0900, Toshiaki Makita wrote: >> +max_mtu = PAGE_SIZE - VETH_XDP_HEADROOM - >> + peer->hard_header_len - >> + SKB_DATA_ALIGN(sizeo

[PATCH v5 bpf-next 9/9] veth: Support per queue XDP ring

2018-07-26 Thread Toshiaki Makita
From: Toshiaki Makita Move XDP and napi related fields in veth_priv to newly created veth_rq structure. When xdp_frames are enqueued from ndo_xdp_xmit and XDP_TX, rxq is selected by current cpu. When skbs are enqueued from the peer device, rxq is one to one mapping of its peer txq. This way we

[PATCH v5 bpf-next 6/9] bpf: Make redirect_info accessible from modules

2018-07-26 Thread Toshiaki Makita
From: Toshiaki Makita We are going to add kern_flags field in redirect_info for kernel internal use. In order to avoid function call to access the flags, make redirect_info accessible from modules. Also as it is now non-static, add prefix bpf_ to redirect_info. Signed-off-by: Toshiaki Makita

[PATCH v5 bpf-next 8/9] veth: Add XDP TX and REDIRECT

2018-07-26 Thread Toshiaki Makita
From: Toshiaki Makita This allows further redirection of xdp_frames like NIC -> veth--veth -> veth--veth (XDP) (XDP) (XDP) The intermediate XDP, redirecting packets from NIC to the other veth, reuses xdp_mem_info from NIC so that page recycling of the NIC

[PATCH v5 bpf-next 5/9] veth: Add ndo_xdp_xmit

2018-07-26 Thread Toshiaki Makita
From: Toshiaki Makita This allows NIC's XDP to redirect packets to veth. The destination veth device enqueues redirected packets to the napi ring of its peer, then they are processed by XDP on its peer veth device. This can be thought as calling another XDP program by XDP program using REDIRECT

[PATCH v5 bpf-next 4/9] veth: Handle xdp_frames in xdp napi ring

2018-07-26 Thread Toshiaki Makita
From: Toshiaki Makita This is preparation for XDP TX and ndo_xdp_xmit. This allows napi handler to handle xdp_frames through xdp ring as well as sk_buff. v3: - Revert v2 change around rings and use a flag to differentiate skb and xdp_frame, since bulk skb xmit makes little performance

[PATCH v5 bpf-next 7/9] xdp: Helpers for disabling napi_direct of xdp_return_frame

2018-07-26 Thread Toshiaki Makita
From: Toshiaki Makita We need some mechanism to disable napi_direct on calling xdp_return_frame_rx_napi() from some context. When veth gets support of XDP_REDIRECT, it will redirects packets which are redirected from other devices. On redirection veth will reuse xdp_mem_info of the redirection

[PATCH v5 bpf-next 3/9] veth: Avoid drops by oversized packets when XDP is enabled

2018-07-26 Thread Toshiaki Makita
From: Toshiaki Makita All oversized packets including GSO packets are dropped if XDP is enabled on receiver side, so don't send such packets from peer. Drop TSO and SCTP fragmentation features so that veth devices themselves segment packets with XDP enabled. Also cap MTU accordingly. v4

[PATCH v5 bpf-next 1/9] net: Export skb_headers_offset_update

2018-07-26 Thread Toshiaki Makita
From: Toshiaki Makita This is needed for veth XDP which does skb_copy_expand()-like operation. v2: - Drop skb_copy_header part because it has already been exported now. Signed-off-by: Toshiaki Makita --- include/linux/skbuff.h | 1 + net/core/skbuff.c | 3 ++- 2 files changed, 3

[PATCH v5 bpf-next 2/9] veth: Add driver XDP

2018-07-26 Thread Toshiaki Makita
From: Toshiaki Makita This is the basic implementation of veth driver XDP. Incoming packets are sent from the peer veth device in the form of skb, so this is generally doing the same thing as generic XDP. This itself is not so useful, but a starting point to implement other useful veth XDP

[PATCH v5 bpf-next 0/9] veth: Driver XDP

2018-07-26 Thread Toshiaki Makita
From: Toshiaki Makita This patch set introduces driver XDP for veth. Basically this is used in conjunction with redirect action of another XDP program. NIC ---> veth===veth (XDP) (redirect)(XDP) In this case xdp_frame can be forwarded to the peer veth without modificat

Re: [PATCH v4 bpf-next 1/9] net: Export skb_headers_offset_update

2018-07-26 Thread Toshiaki Makita
On 18/07/26 (木) 23:25, Toshiaki Makita wrote: From: Toshiaki Makita This is needed for veth XDP which does skb_copy_expand()-like operation. v2: - Drop skb_copy_header part because it has already been exported now. Signed-off-by: Toshiaki Makita Signed-off-by: Toshiaki Makita Oops. SOBs

[PATCH v4 bpf-next 5/9] veth: Add ndo_xdp_xmit

2018-07-26 Thread Toshiaki Makita
From: Toshiaki Makita This allows NIC's XDP to redirect packets to veth. The destination veth device enqueues redirected packets to the napi ring of its peer, then they are processed by XDP on its peer veth device. This can be thought as calling another XDP program by XDP program using REDIRECT

[PATCH v4 bpf-next 6/9] bpf: Make redirect_info accessible from modules

2018-07-26 Thread Toshiaki Makita
From: Toshiaki Makita We are going to add kern_flags field in redirect_info for kernel internal use. In order to avoid function call to access the flags, make redirect_info accessible from modules. Also as it is now non-static, add prefix bpf_ to redirect_info. Signed-off-by: Toshiaki Makita

[PATCH v4 bpf-next 4/9] veth: Handle xdp_frames in xdp napi ring

2018-07-26 Thread Toshiaki Makita
From: Toshiaki Makita This is preparation for XDP TX and ndo_xdp_xmit. This allows napi handler to handle xdp_frames through xdp ring as well as sk_buff. v3: - Revert v2 change around rings and use a flag to differentiate skb and xdp_frame, since bulk skb xmit makes little performance

[PATCH v4 bpf-next 9/9] veth: Support per queue XDP ring

2018-07-26 Thread Toshiaki Makita
From: Toshiaki Makita Move XDP and napi related fields in veth_priv to newly created veth_rq structure. When xdp_frames are enqueued from ndo_xdp_xmit and XDP_TX, rxq is selected by current cpu. When skbs are enqueued from the peer device, rxq is one to one mapping of its peer txq. This way we

[PATCH v4 bpf-next 8/9] veth: Add XDP TX and REDIRECT

2018-07-26 Thread Toshiaki Makita
From: Toshiaki Makita This allows further redirection of xdp_frames like NIC -> veth--veth -> veth--veth (XDP) (XDP) (XDP) The intermediate XDP, redirecting packets from NIC to the other veth, reuses xdp_mem_info from NIC so that page recycling of the NIC

[PATCH v4 bpf-next 2/9] veth: Add driver XDP

2018-07-26 Thread Toshiaki Makita
From: Toshiaki Makita This is the basic implementation of veth driver XDP. Incoming packets are sent from the peer veth device in the form of skb, so this is generally doing the same thing as generic XDP. This itself is not so useful, but a starting point to implement other useful veth XDP

[PATCH v4 bpf-next 3/9] veth: Avoid drops by oversized packets when XDP is enabled

2018-07-26 Thread Toshiaki Makita
From: Toshiaki Makita All oversized packets including GSO packets are dropped if XDP is enabled on receiver side, so don't send such packets from peer. Drop TSO and SCTP fragmentation features so that veth devices themselves segment packets with XDP enabled. Also cap MTU accordingly. v4

[PATCH v4 bpf-next 7/9] xdp: Helpers for disabling napi_direct of xdp_return_frame

2018-07-26 Thread Toshiaki Makita
From: Toshiaki Makita We need some mechanism to disable napi_direct on calling xdp_return_frame_rx_napi() from some context. When veth gets support of XDP_REDIRECT, it will redirects packets which are redirected from other devices. On redirection veth will reuse xdp_mem_info of the redirection

[PATCH v4 bpf-next 1/9] net: Export skb_headers_offset_update

2018-07-26 Thread Toshiaki Makita
From: Toshiaki Makita This is needed for veth XDP which does skb_copy_expand()-like operation. v2: - Drop skb_copy_header part because it has already been exported now. Signed-off-by: Toshiaki Makita Signed-off-by: Toshiaki Makita --- include/linux/skbuff.h | 1 + net/core/skbuff.c | 3

[PATCH v4 bpf-next 0/9] veth: Driver XDP

2018-07-26 Thread Toshiaki Makita
From: Toshiaki Makita This patch set introduces driver XDP for veth. Basically this is used in conjunction with redirect action of another XDP program. NIC ---> veth===veth (XDP) (redirect)(XDP) In this case xdp_frame can be forwarded to the peer veth without modificat

Re: [PATCH v3 bpf-next 3/8] veth: Avoid drops by oversized packets when XDP is enabled

2018-07-24 Thread Toshiaki Makita
On 2018/07/25 4:10, Jakub Kicinski wrote: > On Tue, 24 Jul 2018 18:39:09 +0900, Toshiaki Makita wrote: >> On 2018/07/24 10:56, Toshiaki Makita wrote: >>> On 2018/07/24 9:27, Jakub Kicinski wrote: >>>> On Mon, 23 Jul 2018 00:13:03 +0900, Toshiaki Makita wrote:

Re: [PATCH v3 bpf-next 3/8] veth: Avoid drops by oversized packets when XDP is enabled

2018-07-24 Thread Toshiaki Makita
On 2018/07/24 10:56, Toshiaki Makita wrote: > On 2018/07/24 9:27, Jakub Kicinski wrote: >> On Mon, 23 Jul 2018 00:13:03 +0900, Toshiaki Makita wrote: >>> From: Toshiaki Makita >>> >>> All oversized packets including GSO packets are dropped if XDP is >>

Re: [PATCH v3 bpf-next 6/8] xdp: Add a flag for disabling napi_direct of xdp_return_frame in xdp_mem_info

2018-07-23 Thread Toshiaki Makita
On 2018/07/24 12:38, Jakub Kicinski wrote: > On Tue, 24 Jul 2018 11:43:11 +0900, Toshiaki Makita wrote: >> On 2018/07/24 10:22, Jakub Kicinski wrote: >>> On Mon, 23 Jul 2018 00:13:06 +0900, Toshiaki Makita wrote: >>>> From: Toshiaki Makita >>>> >>

Re: [PATCH v3 bpf-next 6/8] xdp: Add a flag for disabling napi_direct of xdp_return_frame in xdp_mem_info

2018-07-23 Thread Toshiaki Makita
On 2018/07/24 10:22, Jakub Kicinski wrote: > On Mon, 23 Jul 2018 00:13:06 +0900, Toshiaki Makita wrote: >> From: Toshiaki Makita >> >> We need some mechanism to disable napi_direct on calling >> xdp_return_frame_rx_napi() from some context. >> When

Re: [PATCH v3 bpf-next 5/8] veth: Add ndo_xdp_xmit

2018-07-23 Thread Toshiaki Makita
On 2018/07/24 10:02, Jakub Kicinski wrote: > On Mon, 23 Jul 2018 00:13:05 +0900, Toshiaki Makita wrote: >> From: Toshiaki Makita >> >> This allows NIC's XDP to redirect packets to veth. The destination veth >> device enqueues redirected packets t

Re: [PATCH v3 bpf-next 5/8] veth: Add ndo_xdp_xmit

2018-07-23 Thread Toshiaki Makita
On 2018/07/24 10:02, Jakub Kicinski wrote: > On Mon, 23 Jul 2018 00:13:05 +0900, Toshiaki Makita wrote: >> From: Toshiaki Makita >> >> This allows NIC's XDP to redirect packets to veth. The destination veth >> device enqueues redirected packets t

Re: [PATCH v3 bpf-next 5/8] veth: Add ndo_xdp_xmit

2018-07-23 Thread Toshiaki Makita
On 2018/07/24 9:19, kbuild test robot wrote: > Hi Toshiaki, > > Thank you for the patch! Yet something to improve: > > [auto build test ERROR on bpf-next/master] > > url: > https://github.com/0day-ci/linux/commits/Toshiaki-Makita/veth-Driver-XDP/2018072

Re: [PATCH v3 bpf-next 3/8] veth: Avoid drops by oversized packets when XDP is enabled

2018-07-23 Thread Toshiaki Makita
On 2018/07/24 9:27, Jakub Kicinski wrote: > On Mon, 23 Jul 2018 00:13:03 +0900, Toshiaki Makita wrote: >> From: Toshiaki Makita >> >> All oversized packets including GSO packets are dropped if XDP is >> enabled on receiver side, so don't send such packets from pe

Re: [PATCH v3 bpf-next 2/8] veth: Add driver XDP

2018-07-23 Thread Toshiaki Makita
Hi Jakub, Thanks for reviewing! On 2018/07/24 9:23, Jakub Kicinski wrote: > On Mon, 23 Jul 2018 00:13:02 +0900, Toshiaki Makita wrote: >> From: Toshiaki Makita >> >> This is the basic implementation of veth driver XDP. >> >> Incoming packets are sent from the pe

[PATCH v3 bpf-next 7/8] veth: Add XDP TX and REDIRECT

2018-07-22 Thread Toshiaki Makita
From: Toshiaki Makita This allows further redirection of xdp_frames like NIC -> veth--veth -> veth--veth (XDP) (XDP) (XDP) The intermediate XDP, redirecting packets from NIC to the other veth, reuses xdp_mem_info from NIC so that page recycling of the NIC

[PATCH v3 bpf-next 4/8] veth: Handle xdp_frames in xdp napi ring

2018-07-22 Thread Toshiaki Makita
From: Toshiaki Makita This is preparation for XDP TX and ndo_xdp_xmit. This allows napi handler to handle xdp_frames through xdp ring as well as sk_buff. v3: - Revert v2 change around rings and use a flag to differentiate skb and xdp_frame, since bulk skb xmit makes little performance

[PATCH v3 bpf-next 5/8] veth: Add ndo_xdp_xmit

2018-07-22 Thread Toshiaki Makita
From: Toshiaki Makita This allows NIC's XDP to redirect packets to veth. The destination veth device enqueues redirected packets to the napi ring of its peer, then they are processed by XDP on its peer veth device. This can be thought as calling another XDP program by XDP program using REDIRECT

[PATCH v3 bpf-next 0/8] veth: Driver XDP

2018-07-22 Thread Toshiaki Makita
From: Toshiaki Makita This patch set introduces driver XDP for veth. Basically this is used in conjunction with redirect action of another XDP program. NIC ---> veth===veth (XDP) (redirect)(XDP) In this case xdp_frame can be forwarded to the peer veth without modificat

[PATCH v3 bpf-next 2/8] veth: Add driver XDP

2018-07-22 Thread Toshiaki Makita
From: Toshiaki Makita This is the basic implementation of veth driver XDP. Incoming packets are sent from the peer veth device in the form of skb, so this is generally doing the same thing as generic XDP. This itself is not so useful, but a starting point to implement other useful veth XDP

[PATCH v3 bpf-next 3/8] veth: Avoid drops by oversized packets when XDP is enabled

2018-07-22 Thread Toshiaki Makita
From: Toshiaki Makita All oversized packets including GSO packets are dropped if XDP is enabled on receiver side, so don't send such packets from peer. Drop TSO and SCTP fragmentation features so that veth devices themselves segment packets with XDP enabled. Also cap MTU accordingly. Signed

[PATCH v3 bpf-next 6/8] xdp: Add a flag for disabling napi_direct of xdp_return_frame in xdp_mem_info

2018-07-22 Thread Toshiaki Makita
From: Toshiaki Makita We need some mechanism to disable napi_direct on calling xdp_return_frame_rx_napi() from some context. When veth gets support of XDP_REDIRECT, it will redirects packets which are redirected from other devices. On redirection veth will reuse xdp_mem_info of the redirection

[PATCH v3 bpf-next 1/8] net: Export skb_headers_offset_update

2018-07-22 Thread Toshiaki Makita
From: Toshiaki Makita This is needed for veth XDP which does skb_copy_expand()-like operation. v2: - Drop skb_copy_header part because it has already been exported now. Signed-off-by: Toshiaki Makita --- include/linux/skbuff.h | 1 + net/core/skbuff.c | 3 ++- 2 files changed, 3

[PATCH v3 bpf-next 8/8] veth: Support per queue XDP ring

2018-07-22 Thread Toshiaki Makita
From: Toshiaki Makita Move XDP and napi related fields in veth_priv to newly created veth_rq structure. When xdp_frames are enqueued from ndo_xdp_xmit and XDP_TX, rxq is selected by current cpu. When skbs are enqueued from the peer device, rxq is one to one mapping of its peer txq. This way we

[PATCH net] tun: Fix use-after-free on XDP_TX

2018-07-12 Thread Toshiaki Makita
t;) Signed-off-by: Toshiaki Makita --- drivers/net/tun.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/tun.c b/drivers/net/tun.c index a192a01..f5727ba 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -1688,7 +1688,7 @@ static struct sk_buff *tun_build_

  1   2   3   >