lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090902120107.15146e4e@nehalam>
Date:	Wed, 2 Sep 2009 12:01:07 -0700
From:	Stephen Hemminger <shemminger@...tta.com>
To:	Eric Dumazet <eric.dumazet@...il.com>
Cc:	Brian Haley <brian.haley@...com>,
	David Miller <davem@...emloft.net>,
	Patrick McHardy <kaber@...sh.net>, jarkao2@...il.com,
	netdev@...r.kernel.org
Subject: Re: [PATCH net-next-2.6] vlan: multiqueue vlan devices

On Wed, 02 Sep 2009 20:55:24 +0200
Eric Dumazet <eric.dumazet@...il.com> wrote:

> Brian Haley a écrit :
> > Eric Dumazet wrote:
> >> diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h
> >> index 3c1895e..0525a1d 100644
> >> --- a/include/net/rtnetlink.h
> >> +++ b/include/net/rtnetlink.h
> >> @@ -70,6 +70,8 @@ struct rtnl_link_ops {
> >>  	size_t			(*get_xstats_size)(const struct net_device *dev);
> >>  	int			(*fill_xstats)(struct sk_buff *skb,
> >>  					       const struct net_device *dev);
> >> +	int			(*get_tx_queues)(struct net*, struct nlattr *tb[],
> >> +						 int *tx_queues, int *real_tx_queues);
> > 
> > 	int			(*get_tx_queues)(struct net *net, struct nlattr *tb[],
> > 
> > Total nitpick, but tbird highlighted it because of the missing "net".
> > 
> 
> Thats right, and I believe some gcc versions could complain
> 
> Thanks Brian
> 
> [PATCH net-next-2.6] vlan: multiqueue vlan device
> 
> vlan devices are currently not multi-queue capable.
> 
> We can do that with a new rtnl_link_ops method,
> get_tx_queues(), called from rtnl_create_link()
> 
> This new method gets num_tx_queues/real_num_tx_queues
> from real device.
> 
> register_vlan_device() is also handled.
> 
> Signed-off-by: Eric Dumazet <eric.dumazet@...il.com>
> ---
>  include/net/rtnetlink.h  |    2 ++
>  net/8021q/vlan.c         |    5 +++--
>  net/8021q/vlan_netlink.c |   20 ++++++++++++++++++++
>  net/core/rtnetlink.c     |   10 +++++++++-
>  4 files changed, 34 insertions(+), 3 deletions(-)
> 
> diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h
> index 3c1895e..3f4ab54 100644
> --- a/include/net/rtnetlink.h
> +++ b/include/net/rtnetlink.h
> @@ -70,6 +70,8 @@ struct rtnl_link_ops {
>  	size_t			(*get_xstats_size)(const struct net_device *dev);
>  	int			(*fill_xstats)(struct sk_buff *skb,
>  					       const struct net_device *dev);
> +	int			(*get_tx_queues)(struct net *net, struct nlattr *tb[],
> +						 int *tx_queues, int *real_tx_queues);
>  };
>  
>  extern int	__rtnl_link_register(struct rtnl_link_ops *ops);
> diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
> index e814794..8836575 100644
> --- a/net/8021q/vlan.c
> +++ b/net/8021q/vlan.c
> @@ -330,12 +330,13 @@ static int register_vlan_device(struct net_device *real_dev, u16 vlan_id)
>  		snprintf(name, IFNAMSIZ, "vlan%.4i", vlan_id);
>  	}
>  
> -	new_dev = alloc_netdev(sizeof(struct vlan_dev_info), name,
> -			       vlan_setup);
> +	new_dev = alloc_netdev_mq(sizeof(struct vlan_dev_info), name,
> +				  vlan_setup, real_dev->num_tx_queues);
>  
>  	if (new_dev == NULL)
>  		return -ENOBUFS;
>  
> +	new_dev->real_num_tx_queues = real_dev->real_num_tx_queues;
>  	dev_net_set(new_dev, net);
>  	/* need 4 bytes for extra VLAN header info,
>  	 * hope the underlying device can handle it.
> diff --git a/net/8021q/vlan_netlink.c b/net/8021q/vlan_netlink.c
> index e9c91dc..8ce4122 100644
> --- a/net/8021q/vlan_netlink.c
> +++ b/net/8021q/vlan_netlink.c
> @@ -100,6 +100,25 @@ static int vlan_changelink(struct net_device *dev,
>  	return 0;
>  }
>  
> +static int vlan_get_tx_queues(struct net *net, 
> +			      struct nlattr *tb[],
> +			      int *num_tx_queues,
> +			      int *real_num_tx_queues)


Nitpick again.  use unsigned unless you have some reason
to allow -1.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ