Re: NETIF_F_GSO_SOFTWARE vs NETIF_F_GSO

2015-11-06 Thread Jason A. Donenfeld
On Fri, Nov 6, 2015 at 5:58 AM, Herbert Xu wrote: > I don't see anything fundamentally wrong with your idea. After > all what you're describing is the basis of GSO, i.e., letting > data stay in the form of super-packets for as long as we can. > > Of course there's going to be a lot of niggly

Re: NETIF_F_GSO_SOFTWARE vs NETIF_F_GSO

2015-11-06 Thread Jason A. Donenfeld
On Fri, Nov 6, 2015 at 5:58 AM, Herbert Xu wrote: > I don't see anything fundamentally wrong with your idea. After > all what you're describing is the basis of GSO, i.e., letting > data stay in the form of super-packets for as long as we can. > > Of course there's

Re: NETIF_F_GSO_SOFTWARE vs NETIF_F_GSO

2015-11-05 Thread Herbert Xu
On Fri, Nov 06, 2015 at 02:31:59AM +0100, Jason A. Donenfeld wrote: > > So far implementing (3) is failing miserably. Is there anything wrong > with my general idea that might make this a priori impossible? For > example, will udp_tunnel_xmit_skb not accept super-packets? Or, am I > just not

Re: NETIF_F_GSO_SOFTWARE vs NETIF_F_GSO

2015-11-05 Thread Jason A. Donenfeld
Hi folks, I'm still facing some considerable problems. Please see below. On Thu, Nov 5, 2015 at 5:28 PM, Jason A. Donenfeld wrote: > As mentioned, I receive packets on ndo_start_xmit, "do something to > them with function magic()", and then push them out of a UDP socket > using

Re: NETIF_F_GSO_SOFTWARE vs NETIF_F_GSO

2015-11-05 Thread Jason A. Donenfeld
On Thu, Nov 5, 2015 at 4:56 PM, Eric Dumazet wrote: > It is a performance benefit only if you use the helpers from > net/core/tso.c as some drivers already do. > > Otherwise, calling the skb_gso_segment() from your driver has no gain > compared to the one done from core networking stack.

Re: NETIF_F_GSO_SOFTWARE vs NETIF_F_GSO

2015-11-05 Thread Eric Dumazet
On Thu, 2015-11-05 at 16:00 +0100, Jason A. Donenfeld wrote: > Right -- I saw the expansion in the header file -- it gets the various > TSOs plus UFO. So what this means is that the packet hasn't yet been > split up? So were I to add this option, then my driver would have to > be responsible for

Re: NETIF_F_GSO_SOFTWARE vs NETIF_F_GSO

2015-11-05 Thread Jason A. Donenfeld
Hi Herbert, Thanks for your response! On Thu, Nov 5, 2015 at 1:15 PM, Herbert Xu wrote: > The NETIF_F_GSO flag turns on software GSO which should be on > anyway. So that could be why it seems to make no difference. GSO is on by default? That makes sense, okay. > > NETIF_F_GSO_SOFTWARE is

Re: NETIF_F_GSO_SOFTWARE vs NETIF_F_GSO

2015-11-05 Thread Herbert Xu
On Wed, Nov 04, 2015 at 12:24:47PM +0100, Jason A. Donenfeld wrote: > > Strangely, the performance does not change at all regardless of > whether or not NETIF_F_GSO is specified. The NETIF_F_GSO flag turns on software GSO which should be on anyway. So that could be why it seems to make no

Re: NETIF_F_GSO_SOFTWARE vs NETIF_F_GSO

2015-11-05 Thread Herbert Xu
On Wed, Nov 04, 2015 at 12:24:47PM +0100, Jason A. Donenfeld wrote: > > Strangely, the performance does not change at all regardless of > whether or not NETIF_F_GSO is specified. The NETIF_F_GSO flag turns on software GSO which should be on anyway. So that could be why it seems to make no

Re: NETIF_F_GSO_SOFTWARE vs NETIF_F_GSO

2015-11-05 Thread Jason A. Donenfeld
On Thu, Nov 5, 2015 at 4:56 PM, Eric Dumazet wrote: > It is a performance benefit only if you use the helpers from > net/core/tso.c as some drivers already do. > > Otherwise, calling the skb_gso_segment() from your driver has no gain > compared to the one done from core

Re: NETIF_F_GSO_SOFTWARE vs NETIF_F_GSO

2015-11-05 Thread Eric Dumazet
On Thu, 2015-11-05 at 16:00 +0100, Jason A. Donenfeld wrote: > Right -- I saw the expansion in the header file -- it gets the various > TSOs plus UFO. So what this means is that the packet hasn't yet been > split up? So were I to add this option, then my driver would have to > be responsible for

Re: NETIF_F_GSO_SOFTWARE vs NETIF_F_GSO

2015-11-05 Thread Herbert Xu
On Fri, Nov 06, 2015 at 02:31:59AM +0100, Jason A. Donenfeld wrote: > > So far implementing (3) is failing miserably. Is there anything wrong > with my general idea that might make this a priori impossible? For > example, will udp_tunnel_xmit_skb not accept super-packets? Or, am I > just not

Re: NETIF_F_GSO_SOFTWARE vs NETIF_F_GSO

2015-11-05 Thread Jason A. Donenfeld
Hi folks, I'm still facing some considerable problems. Please see below. On Thu, Nov 5, 2015 at 5:28 PM, Jason A. Donenfeld wrote: > As mentioned, I receive packets on ndo_start_xmit, "do something to > them with function magic()", and then push them out of a UDP socket > using

Re: NETIF_F_GSO_SOFTWARE vs NETIF_F_GSO

2015-11-05 Thread Jason A. Donenfeld
Hi Herbert, Thanks for your response! On Thu, Nov 5, 2015 at 1:15 PM, Herbert Xu wrote: > The NETIF_F_GSO flag turns on software GSO which should be on > anyway. So that could be why it seems to make no difference. GSO is on by default? That makes sense, okay. >

NETIF_F_GSO_SOFTWARE vs NETIF_F_GSO

2015-11-04 Thread Jason A. Donenfeld
Hello, I am making a network device driver that receives packets in ndo_start_xmit, "does something to them", and then sends the resultant packet out of a kernelspace UDP socket. The routine looks something along the lines of: size_t outgoing_len = calculate_outgoing_length(skb); struct

NETIF_F_GSO_SOFTWARE vs NETIF_F_GSO

2015-11-04 Thread Jason A. Donenfeld
Hello, I am making a network device driver that receives packets in ndo_start_xmit, "does something to them", and then sends the resultant packet out of a kernelspace UDP socket. The routine looks something along the lines of: size_t outgoing_len = calculate_outgoing_length(skb); struct