Subject: Re: [PATCH] [NET 2.6.26]: Add per-connection option to set max TSO frame size

From: Jarek Poplawski <[email-masked]>
Date: Thu, 28 Feb 2008 08:07:46 +0000

On 27-02-2008 18:26, PJ Waskiewicz wrote:
...
> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> index a2f0032..3bf825b 100644
> --- a/include/linux/netdevice.h
> +++ b/include/linux/netdevice.h
> @@ -620,6 +620,7 @@ struct net_device
>  
>  	/* Partially transmitted GSO packet. */
>  	struct sk_buff		*gso_skb;
> +	u16			max_gso_frame_size;
...
> +static inline void netif_set_max_gso_size(struct net_device *dev, u16 size)
> +	__u16			sk_gso_max_size;
>  	int			sk_rcvlowat;
>  	unsigned long 		sk_flags;
>  	unsigned long	        sk_lingertime;
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 908f07c..689a678 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -4021,6 +4021,7 @@ struct net_device *alloc_netdev_mq(int sizeof_priv, const char *name,
>  	}
>  
>  	dev->egress_subqueue_count = queue_count;
> +	dev->max_gso_frame_size = 65536;

Does it fit into u16?

Isn't it "nicer" with some constant (#define MAX_GSO_FRAME_SIZE ...)?

Why not more consistent names, e.g.:
dev->gso_max_size;
sk_gso_max_size;
netif_set_gso_max_size()
(GSO_MAX_SIZE)
or
dev->max_gso_frame_size;
sk_max_gso_frame_size;
netif_set_max_gso_frame_size()
(MAX_GSO_FRAME_SIZE)
etc.?

Regards,
Jarek P.