Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH] Fix panic in virtnet_remove
From: David Miller @ 2011-07-15 15:19 UTC (permalink / raw)
  To: krkumar2; +Cc: netdev, shemminger
In-Reply-To: <20110715091650.23026.78221.sendpatchset@krkumar2.in.ibm.com>

From: Krishna Kumar <krkumar2@in.ibm.com>
Date: Fri, 15 Jul 2011 14:46:50 +0530

> modprobe -r virtio_net panics in free_netdev() as the
> dev is already freed in the newly introduced virtnet_free
> (commit 3fa2a1df9094). Since virtnet_remove doesn't require
> dev after unregister, I am removing the free_netdev call
> in virtnet_remove instead of in virtnet_free (which seems
> to be the right place to free the dev). Confirmed that
> the panic is fixed with this patch.
> 
> Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>

I guess the virtio NET maintainers don't deserve to get CC:'d on a fix
like this? :-(

Michael Tsirkin is who maintains this driver actively and is the one
who will merge this kind of fix to me, therefore if you don't CC:
him it might not get integrated at all.

^ permalink raw reply

* Re: [PATCH 09/10] nfs: use sk fragment destructors to delay I/O completion until page is released by network stack.
From: Ian Campbell @ 2011-07-15 15:21 UTC (permalink / raw)
  To: Trond Myklebust
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <1310738489.4381.20.camel-SyLVLa/KEI9HwK5hSS5vWB2eb7JE58TQ@public.gmane.org>

On Fri, 2011-07-15 at 15:01 +0100, Trond Myklebust wrote:
> On Fri, 2011-07-15 at 12:07 +0100, Ian Campbell wrote: 
> > Thos prevents an issue where an ACK is delayed, a retransmit is queued (either
> > at the RPC or TCP level) and the ACK arrives before the retransmission hits the
> > wire. If this happens then the write() system call and the userspace process
> > can continue potentially modifying the data before the retransmission occurs.
> > 
> > NB: this only covers the O_DIRECT write() case. I expect other cases to need
> > handling as well.
> 
> That is why this belongs entirely in the RPC layer, and really should
> not touch the NFS layer.
> If you move your callback to the RPC layer and have it notify the
> rpc_task when the pages have been sent, then it should be possible to
> achieve the same thing.
> 
> IOW: Add an extra state machine step after call_decode() which checks if
> all the page data has been transmitted and if not, puts the rpc_task on
> a wait queue, and has it wait for the fragment destructor callback
> before calling rpc_exit_task().

Make sense, I'll do that.

Thanks,
Ian.


--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH v2 1/5] dt: add of_alias_scan and of_alias_get_id
From: Shawn Guo @ 2011-07-15 15:24 UTC (permalink / raw)
  To: Grant Likely
  Cc: patches-QSEj5FYQhm4dnm+yROfE0A, netdev-u79uwXL29TY76Z2rM5mHXA,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-serial-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
In-Reply-To: <20110715025320.GE2927-e0URQFbLeQY2iJbIjFUEsiwD8/FfD2ys@public.gmane.org>

On Thu, Jul 14, 2011 at 08:53:20PM -0600, Grant Likely wrote:
> On Sat, Jun 25, 2011 at 02:04:32AM +0800, Shawn Guo wrote:
> > The patch adds function of_alias_scan to populate a global lookup
> > table with the properties of 'aliases' node and function
> > of_alias_get_id for drivers to find alias id from the lookup table.
> > 
> > Signed-off-by: Shawn Guo <shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> > Cc: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
> 
> Hey Shawn,
> 
> Comments below, but I've gone ahead and fixed them because I'm keen to
> get this patch merged.  I just wanted to let you know what I changed.
> I'll post the modified version so you can test it.
> 
Thanks for doing this.  It makes the wheel spin fast.  I respect
changes you made, and will give it a test once you post it.

Regards,
Shawn

> > ---
> >  drivers/of/base.c  |  181 ++++++++++++++++++++++++++++++++++++++++++++++++++++
> >  drivers/of/fdt.c   |    6 ++
> >  include/linux/of.h |    7 ++
> >  3 files changed, 194 insertions(+), 0 deletions(-)
> > 
> > diff --git a/drivers/of/base.c b/drivers/of/base.c
> > index 632ebae..89efd10 100644
> > --- a/drivers/of/base.c
> > +++ b/drivers/of/base.c
> > @@ -17,14 +17,38 @@
> >   *      as published by the Free Software Foundation; either version
> >   *      2 of the License, or (at your option) any later version.
> >   */
> > +#include <linux/bootmem.h>
> > +#include <linux/ctype.h>
> >  #include <linux/module.h>
> >  #include <linux/of.h>
> >  #include <linux/spinlock.h>
> >  #include <linux/slab.h>
> >  #include <linux/proc_fs.h>
> >  
> > +/**
> > + * struct alias_prop - Alias property in 'aliases' node
> > + * @link:	List node to link the structure in aliases_lookup list
> > + * @alias:	Alias property name
> > + * @np:		Pointer to device_node that the alias stands for
> > + * @alias_id:	Alias id decoded from alias
> > + * @alias_stem:	Alias stem name decoded from alias
> > + *
> > + * The structure represents one alias property of 'aliases' node as
> > + * an entry in aliases_lookup list.
> > + */
> > +struct alias_prop {
> > +	struct list_head link;
> > +	const char *alias;
> > +	struct device_node *np;
> > +	int alias_id;
> > +	char alias_stem[0];
> > +};
> > +
> > +static LIST_HEAD(aliases_lookup);
> > +
> >  struct device_node *allnodes;
> >  struct device_node *of_chosen;
> > +struct device_node *of_aliases;
> >  
> >  /* use when traversing tree through the allnext, child, sibling,
> >   * or parent members of struct device_node.
> > @@ -922,3 +946,160 @@ out_unlock:
> >  }
> >  #endif /* defined(CONFIG_OF_DYNAMIC) */
> >  
> > +/*
> > + * of_alias_find_available_id - Find an available id for the given device_node
> 
> Nit: kerneldoc format is "/**" to start the comment, and function
> names should have '()' on it.
> 
> > + * @np:		Pointer to the given device_node
> > + * @stem:	Alias stem of the given device_node
> > + *
> > + * The function travels the lookup table to find an available id for the
> > + * given device_node with given alias stem.  It returns the id found.
> > + */
> > +static int of_alias_find_available_id(struct device_node *np, const char *stem)
> > +{
> > +	struct alias_prop *app;
> > +	int id = 0;
> > +
> > +	while (1) {
> > +		bool used = false;
> > +		list_for_each_entry(app, &aliases_lookup, link) {
> > +			if (!strcmp(app->alias_stem, stem) &&
> > +			    app->alias_id == id) {
> > +				used = true;
> > +				break;
> > +			}
> > +		}
> > +
> > +		if (used)
> > +			id++;
> > +		else
> > +			return id;
> > +	}
> > +}
> 
> I've simplified this somewhat to do the list_for_each_entry() only
> once, and to bump up the id to +1 the largest entry:
> 
> 	list_for_each_entry(app, &aliases_lookup, link)
> 		if ((strcmp(app->stem, stem) == 0) && id <= app->id)
> 			id = app->id + 1;
> 
> .... actually, after looking further, I've rolled this code into the
> of_alias_get_id() function.
> 
> > +
> > +/**
> > + * of_alias_lookup_add - Add alias into lookup table
> > + * @alias:	Alias name
> > + * @id:		Alias id
> > + * @stem:	Alias stem name
> > + * @np:		Pointer to device_node
> > + *
> > + * The function adds one alias into the lookup table and populate it
> > + * with the info passed in.  It returns 0 in sucess, or error code.
> > + */
> > +static int of_alias_lookup_add(char *alias, int id, const char *stem,
> > +			       struct device_node *np)
> > +{
> > +	struct alias_prop *app;
> > +	size_t sz = sizeof(*app) + strlen(stem) + 1;
> > +
> > +	app = kzalloc(sz, GFP_KERNEL);
> > +	if (!app) {
> > +		/*
> > +		 * It may fail due to being called by boot code,
> > +		 * so try alloc_bootmem before return error.
> > +		 */
> > +		app = alloc_bootmem(sz);
> > +		if (!app)
> > +			return -ENOMEM;
> > +	}
> 
> I'm not too fond of this since we *know* when this is going to be
> called from early boot.  So, instead, I've changed the code to use the
> already existing dt_alloc functions as an argument to of_alias_lookup_add().
> 
> Also, alloc_bootmem() doesn't work on all platforms.
> early_init_dt_alloc_memory_arch() needs to be used instead.
> 
> 
> > +
> > +	app->np = np;
> > +	app->alias = alias;
> > +	app->alias_id = id;
> > +	strcpy(app->alias_stem, stem);
> > +	list_add_tail(&app->link, &aliases_lookup);
> > +
> > +	return 0;
> > +}
> > +
> > +/**
> > + * of_alias_decode - Decode alias stem and id from alias name
> > + * @alias:	Alias name to be decoded
> > + * @stem:	Pointer used to return stem name
> > + *
> > + * The function decodes alias stem name and alias id from the given
> > + * alias name.  It returns stem name via parameter 'stem', and stem id
> > + * via the return value.  If no id is found in alias name, it returns 0
> > + * as the default.
> > + */
> > +static int of_alias_decode(char *alias, char *stem)
> > +{
> > +	int len = strlen(alias);
> > +	char *end = alias + len;
> > +
> > +	while (isdigit(*--end))
> > +		len--;
> 
> Need to protect against len < 0
> 
> > +
> > +	strncpy(stem, alias, len);
> > +	stem[len] = '\0';
> > +
> > +	return strlen(++end) ? simple_strtoul(end, NULL, 10) : 0;
> > +}
> > +
> > +/**
> > + * of_alias_scan - Scan all properties of 'aliases' node
> > + *
> > + * The function scans all the properties of 'aliases' node and populate
> > + * the the global lookup table with the properties.  It returns the
> > + * number of alias_prop found, or error code in error case.
> > + */
> > +int of_alias_scan(void)
> 
> Changed to '__init void of_aliases_scan(void)'.  There is no point in
> returning an error code since it is never checked, and there is no
> point in bailing on an error just in case it is a problem with only
> one alias.
> 
> > +{
> > +	struct property *pp;
> > +	int ret, num = 0;
> > +
> > +	if (!of_aliases)
> > +		return -ENODEV;
> > +
> > +	for_each_property(pp, of_aliases->properties) {
> > +		char stem[32];
> > +		int id = of_alias_decode(pp->name, stem);
> > +
> > +		/* Skip those we do not want to proceed */
> > +		if (!strcmp(pp->name, "name") ||
> > +		    !strcmp(pp->name, "phandle") ||
> > +		    !strcmp(pp->name, "linux,phandle"))
> > +			continue;
> > +
> > +		ret = of_alias_lookup_add(pp->name, id, stem,
> > +					  of_find_node_by_path(pp->value));
> > +		if (ret < 0)
> > +			return ret;
> > +		else
> > +			num++;
> > +	}
> > +
> > +	return num;
> > +}
> > +
> > +/**
> > + * of_alias_get_id - Get alias id for the given device_node
> > + * @np:		Pointer to the given device_node
> > + * @stem:	Alias stem of the given device_node
> > + *
> > + * The function travels the lookup table to get alias id for the given
> > + * device_node and alias stem.  It returns the alias id if find it.
> > + * If not, dynamically creates one in the lookup table and returns it,
> > + * or returns error code if fail to create.
> > + */
> > +int of_alias_get_id(struct device_node *np, const char *stem)
> > +{
> > +	struct alias_prop *app;
> > +	int id = -1;
> > +
> > +	list_for_each_entry(app, &aliases_lookup, link) {
> > +		if (np == app->np) {
> > +			id = app->alias_id;
> > +			break;
> > +		}
> > +	}
> > +
> > +	if (id == -1) {
> > +		id = of_alias_find_available_id(np, stem);
> > +		if (of_alias_lookup_add(NULL, id, stem, np) < 0)
> > +			return -ENODEV;
> > +	}
> > +
> > +	return id;
> > +}
> 
> This whole function needs to be protected by a mutex.
> 
> > +EXPORT_SYMBOL_GPL(of_alias_get_id);
> > diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
> > index 65200af..998dc63 100644
> > --- a/drivers/of/fdt.c
> > +++ b/drivers/of/fdt.c
> > @@ -711,6 +711,12 @@ void __init unflatten_device_tree(void)
> >  	of_chosen = of_find_node_by_path("/chosen");
> >  	if (of_chosen == NULL)
> >  		of_chosen = of_find_node_by_path("/chosen@0");
> > +
> > +	of_aliases = of_find_node_by_path("/aliases");
> > +	if (of_aliases == NULL)
> > +		of_aliases = of_find_node_by_path("/aliases@0");
> 
> I don't think the /aliases@0 variant is necessary.  I've dropped it.
> 
> g.
> 
> > +
> > +	of_alias_scan();
> >  }
> >  
> >  #endif /* CONFIG_OF_EARLY_FLATTREE */
> > diff --git a/include/linux/of.h b/include/linux/of.h
> > index bfc0ed1..c35cc47 100644
> > --- a/include/linux/of.h
> > +++ b/include/linux/of.h
> > @@ -68,6 +68,7 @@ struct device_node {
> >  /* Pointer for first entry in chain of all nodes. */
> >  extern struct device_node *allnodes;
> >  extern struct device_node *of_chosen;
> > +extern struct device_node *of_aliases;
> >  extern rwlock_t devtree_lock;
> >  
> >  static inline bool of_have_populated_dt(void)
> > @@ -201,6 +202,9 @@ extern int of_device_is_available(const struct device_node *device);
> >  extern const void *of_get_property(const struct device_node *node,
> >  				const char *name,
> >  				int *lenp);
> > +#define for_each_property(pp, properties) \
> > +	for (pp = properties; pp != NULL; pp = pp->next)
> > +
> >  extern int of_n_addr_cells(struct device_node *np);
> >  extern int of_n_size_cells(struct device_node *np);
> >  extern const struct of_device_id *of_match_node(
> > @@ -213,6 +217,9 @@ extern int of_parse_phandles_with_args(struct device_node *np,
> >  	const char *list_name, const char *cells_name, int index,
> >  	struct device_node **out_node, const void **out_args);
> >  
> > +extern int of_alias_scan(void);
> > +extern int of_alias_get_id(struct device_node *np, const char *stem);
> > +
> >  extern int of_machine_is_compatible(const char *compat);
> >  
> >  extern int prom_add_property(struct device_node* np, struct property* prop);
> > -- 
> > 1.7.4.1
> > 
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

^ permalink raw reply

* Re: [PATCH 00/14] Swap-over-NBD without deadlocking v5
From: Christoph Hellwig @ 2011-07-15 15:27 UTC (permalink / raw)
  To: Mel Gorman
  Cc: Christoph Hellwig, Andrew Morton, Linux-MM, Linux-Netdev, LKML,
	David Miller, Neil Brown, Peter Zijlstra
In-Reply-To: <20110715141021.GZ7529@suse.de>

On Fri, Jul 15, 2011 at 03:10:21PM +0100, Mel Gorman wrote:
> Any objection to the swap-over-NBD stuff going ahead to get part of the
> complexity out of the way?

Sure, that's what I was advocating for.  The filesystem interfaces in
the current swap over nbd patches on the other hand are complete crap
and need to be redone, but we've already discussed that a lot of times.

^ permalink raw reply

* Re: [PATCH/RFC 0/10] enable SKB paged fragment lifetime visibility
From: Ian Campbell @ 2011-07-15 15:36 UTC (permalink / raw)
  To: David Miller
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <20110715.081735.2057304107637222967.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>

On Fri, 2011-07-15 at 16:17 +0100, David Miller wrote:
> From: Ian Campbell <Ian.Campbell-Sxgqhf6Nn4DQT0dZR+AlfA@public.gmane.org>
> Date: Fri, 15 Jul 2011 12:06:46 +0100
> 
> > What is the general feeling regarding this approach?
> 
> Not bad,

Thanks, I'll continue in this direction then.

>  I like that only the users of destructors pay the price of
> the extra atomics.

Yes, I very much wanted to avoid hitting everyone with extra overhead.

> Like you say in patch #8, I wouldn't bother adding a whole new
> ->sendpage_destructor() OP, just add the new argument to the existing
> method.

Will do.

Ian.

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH] bridge: mask forwarding of IEEE 802 local multicast groups
From: Nick Carter @ 2011-07-15 15:44 UTC (permalink / raw)
  To: David Lamparter
  Cc: Stephen Hemminger, netdev, Michał Mirosław, davem
In-Reply-To: <20110712113643.GC616804@jupiter.n2.diac24.net>

On 12 July 2011 12:36, David Lamparter <equinox@diac24.net> wrote:
> On Mon, Jul 11, 2011 at 08:27:55AM -0700, Stephen Hemminger wrote:
>> On Sun, 10 Jul 2011 17:04:30 +0100
>> Nick Carter <ncarter100@gmail.com> wrote:
>>
>> > Updated diffs so they apply to net-next (Original diffs were based off 2.6.38).
>> >
>> > Any chance of getting these diffs applied?  The default behaviour of
>> > the bridge code is unchanged.  They solve the problem of
>> > authenticating a virtual 802.1x supplicant machine against an external
>> > 802.1X authenticator.  It is also a general solution that allows the
>> > forwarding of any combination of the IEEE 802 local multicast groups.
>> >
>> > Signed-off-by: Nick Carter <ncarter100@gmail.com>
>> > Reviewed-by: David Lamparter <equinox@diac24.net>
>>
>> I am still undecided on this. Understand the need, but don't like idea
>> of bridge behaving in non-conforming manner. Will see if IEEE 802 committee
>> has any input.
>
> The patch doesn't make the bridge behave nonconformant. The default mask
> is 0, which just keeps the old behaviour.
Also as David points out in his review, after these diffs are applied
we will be able to remove this
@@ -166,6 +166,9 @@ struct sk_buff *br_handle_frame(struct sk_buff *skb)
               if (p->br->stp_enabled == BR_NO_STP && dest[5] == 0)
                       goto forward;
Which is non-standard.

So these diffs enable us to change the existing non-conforming
behaviour to a conforming one.
>
> If you set the lowest 3 bits, yes, you can break your network. But so
> does enabling proxy_arp in most cases. And there are reasonable use
> cases for it, both 802.1X forwarding and fully-transparent* packet
> capture bridges benefit from it. And the latter is something I wouldn't
> wish to move to userspace either.
>
> Maybe we should add a warning if the lowest 3 bits are set, like
> "you have enabled forwarding of STP/Pause/Bond frames. This can
> thoroughly break your network."
>
> * excl. pause frames, sadly - those get eaten by hw/driver...
>
>> Also, don't want to build more knobs in with sysfs that are per-bridge.
>> Eventually, the plan is to make all the setting per-port with sysctl's
>> like IPv6.
>
> This setting doesn't make sense per-port IMHO. Also, sysctl?!
I agree this setting should be per-bridge.  Also not taking something
that is needed today, because it will make some possible future change
slightly harder, seems a bit conservative to me.
Nick
>
>
> -David
>
>

^ permalink raw reply

* pull request: wireless-next-2.6 2011-07-15
From: John W. Linville @ 2011-07-15 15:34 UTC (permalink / raw)
  To: davem; +Cc: linux-wireless, netdev

Dave,

Here is yet another batch of wireless networking changes intended
for 3.1, with probably a smidge more yet to come... :-)

This includes another Bluetooth pull, mostly some cleanups,
restructuring, and some minor fixes.  Along with the usual iwlagn and
ath9k updates, mwifiex, wl12xx, ath5k, and b43 all see significant
activity.  Johannes has done some housekeeping in mac80211 as well.

Please let me know if there are problems!

Thanks,

John

---

The following changes since commit ecae42d37045ec71831d0e0e493e00b0e0732edd:

  net/ps3: Fix gelic RX DMA restart (2011-07-14 16:03:29 -0700)

are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6.git for-davem

Amitkumar Karwar (3):
      mwifiex: fix regression in WEP security mode
      mwifiex: fix minor issue in debugfs command 'info'
      mwifiex: 11n specific configuration for transmit

Andre Guedes (7):
      Bluetooth: Add extfeatures to struct hci_dev
      Bluetooth: Write LE Host Supported command
      Bluetooth: Add enable_le module parameter
      Bluetooth: Add lmp_host_le_capable() macro
      Bluetooth: Remove enable_smp parameter
      Bluetooth: Fix potential deadlock in hci_core
      Bluetooth: Fix potential deadlock in mgmt

Arik Nemtsov (7):
      wl12xx: AP mode - support FW TX inactivity triggers
      wl12xx: use 802.11 header location after relocation to frame start
      wl12xx: schedule TX packets according to FW occupancy
      wl12xx: implement Tx watermarks per AC
      wl12xx: initialize max_power levels for 11a channels
      wl12xx: always initialize AP-mode max power level
      wl12xx: start/stop queues according to global per-AC counters

Christian Lamparter (1):
      carl9170: Implement tx_frames_pending mac80211 callback function

Daniel Drake (1):
      libertas: fix handling of command timeout, completion and interruption

Don Fry (1):
      iwlagn: remove iwlagn_hcmd_utils structure and call directly

Eduardo Bacchi Kienetz (1):
      rt2800usb: Add new device ID for Belkin

Eliad Peller (3):
      wl12xx: configure suspend/resume only if associated/started
      wl12xx: add stop_scan command
      wl12xx: implement cancel_hw_scan() callback

Emmanuel Grumbach (7):
      iwlagn: remove the CMD_MAPPED flag
      iwlagn: add an API to free the TX context
      iwlagn: add an API for RX stop
      iwlagn: add an API for TX stop
      iwlagn: remove code duplication
      iwlagn: consolidate the API that sends host commands and move to transport
      iwlagn: provide heplers to access the transport ops

Felix Fietkau (17):
      ath9k_hw: remove hardcoded PLL overrides for AR9280
      ath9k_hw: always enable 5 GHz fast clock for AR9280
      ath9k_hw: fix MAC clock for half/quarter rate
      ath9k_hw: fix MAC clock rate for AR9287 v1.3+
      ath9k_hw: initialize more timing related registers for half/quarter channels
      ath9k_hw: remove ar9287 v1.3+ specific hardcoded register hacks
      ath9k_hw: set 5 GHz half/quarter channels on AR9002 using fractional mode
      ath9k_hw: fix synth delay for half/quarter channels
      ath9k_hw: add a missing delay for an analog register
      ath5k: add missing checks for rfgain probe
      ath5k: apply the synth voltage tweak only on AR5112 rev 2
      ath5k: fix reference clock frequency for spur mitigation on AR2413
      ath5k: initialize common->clockrate
      ath5k: delay full calibration after reset
      ath5k: fix reference clock usec duration setting restore
      ath5k: disable 32KHz sleep clock operation by default
      ath5k: do not call ieee80211_stop_queue for queues not managed by mac80211

Fry, Donald H (3):
      iwlagn: remove the indirection for update_chain_flags
      iwlagn: remove the indirection for iwl_apm_init
      iwlagn: remove indirection for eeprom_query_addr

Gustavo F. Padovan (2):
      Bluetooth: Fix bad locking balance
      Bluetooth: Clean up unused struct hci_conn items

Hauke Mehrtens (1):
      bcma: add check if sprom is available before accessing it.

Ido Yariv (1):
      wl12xx: Increase low & high TX watermarks

Ilia Kolomisnky (1):
      Bluetooth: Fixes l2cap "command reject" reply according to spec

Joe Perches (5):
      Bluetooth: Rename function bt_err to bt_to_errno
      Bluetooth: Add bt_printk
      ath5k: Add missing breaks in switch/case
      iwlegacy: Add missing comma between constant string array
      iwlagn: Add missing comma between constant string array

Johannes Berg (11):
      mac80211: fix TKIP races, make API easier to use
      mac80211: fix CCMP races
      mac80211: fix CMAC races
      mac80211: use AES_BLOCK_SIZE
      mac80211: simplify RX PN/IV handling
      mac80211: allow drivers to access key sequence counter
      mac80211: allow driver to generate P1K for IV32
      cfg80211: fix docbook
      mac80211: fix docbook
      mac80211: allocate only one RX queue
      mac80211: allow driver to disconnect after resume

John W. Linville (4):
      Merge branch 'for-linville' of git://git.kernel.org/.../luca/wl12xx
      Merge branch 'master' of git://git.kernel.org/.../linville/wireless-2.6
      Merge branch 'master' of master.kernel.org:/.../padovan/bluetooth-next-2.6
      Merge branch 'master' of git://git.kernel.org/.../linville/wireless-next-2.6 into for-davem

Larry Finger (1):
      rtlwifi: rtl8192cu: Fix duplicate if test

Luciano Coelho (1):
      cfg80211: return -ENOENT when stopping sched_scan while not running

Mat Martineau (6):
      Bluetooth: Fix indentation whitespace
      Bluetooth: ERTM timeouts need to be converted to jiffies
      Bluetooth: Check earlier for L2CAP ERTM frames to drop
      Bluetooth: Move code for ERTM local busy state to separate functions
      Bluetooth: Use event-driven approach for handling ERTM receive buffer
      Bluetooth: Remove L2CAP busy queue

Meenakshi Venkataraman (2):
      mac80211: add driver RSSI threshold events
      iwlagn: Enable/disable PS poll based on RSSI and BT coex traffic state

Mohammed Shafi Shajakhan (3):
      ath9k_hw: Disable PAPRD based on paprd_ht20_mask for 5GHz
      ath9k: remove an unnecessary function declaration
      mac80211: remove a redundant check

Ohad Ben-Cohen (1):
      wl12xx: one SDIO initialization is enough

Olivier Sobrie (1):
      libertas: fix errors in functions accessing module registers

Oz Krakowski (1):
      wl12xx: fix Tx security sequence number handling

Pavel Roskin (14):
      ath5k: remove PRIV_ENTRY and PRIV_ASSIGN macros, they obfuscate the code
      ath5k: replace spaces with tabs as suggested by checkpatch.pl
      ath5k: remove unneeded parentheses after return
      ath5k: use KERN_WARNING in ATH5K_PRINTF
      ath5k: use DEFINE_PCI_DEVICE_TABLE in led.c, mark users with __devinit
      ath5k: use more readable way to clear MAC address
      ath5k: don't use volatile, it's not needed
      ath5k: use parentheses around macro definitions
      ath5k: fix misplaced or extraneous braces found by checkpatch.pl
      ath5k: fix formatting errors found by checkpatch.pl
      ath5k: use kstrtoint() to parse numbers coming from sysfs
      ath5k: read sc->imask with sc->irqlock held
      ath5k: validate mode in ath5k_ani_init() before trying to set it
      ath5k: fix typos, bad comment formatting and GHz in place of MHz

Rafał Miłecki (13):
      b43: make b43_wireless_init bus generic
      b43: implement BCMA bus ops
      b43: use switches for SSB specific code
      b43: handle BCMA in bus switches
      b43: bus: add helpers for getting/setting wldev from/in bus core
      b43: change selecting ucode for newer cores
      b43: select BLOCKIO for BCMA
      b43: use radio ID reading code to older cores only
      b43: read radio ID on new cores
      b43: LCN-PHY add place for new PHY support
      b43: define firmwares for HT and LCN PHYs
      b43: LCN-PHY: include new PHY in common code
      b43: HT-PHY: define dummy TX power functions

Rajkumar Manoharan (6):
      ath9k_htc: do not configure filter before driver is started
      mac80211: Restart STA timers only on associated state
      ath9k_hw: Update AR9003 interval to improve 5G Tx EVM
      ath9k_hw: Disable power detector calibration for AR9003
      ath9k_hw: Remove read-only registers from AR9003 intervals
      ath9k_htc: Inform stack about tx ack status

Randy Dunlap (1):
      Bluetooth: uses crypto interfaces, select CRYPTO

Sebastian Andrzej Siewior (1):
      net/b43: don't return IRQ_HANDLED if nothing was done

Senthil Balasubramanian (1):
      ath9k_hw: Fix incorrect key_miss handling

Steven.Li (1):
      Bluetooth: Add Atheros AR3012 one PID/VID supported

Vinicius Costa Gomes (12):
      Bluetooth: Add support for SMP phase 3 (key distribution)
      Bluetooth: Add new structures for supporting SM key distribution
      Bluetooth: Add functions to manipulate the link key list for SMP
      Bluetooth: Reject an encryption request when the key isn't found
      Bluetooth: Fix SM pairing parameters negotiation
      Bluetooth: Add support for storing the LTK
      Bluetooth: Use the link key list to temporarily store the STK
      Bluetooth: Use the stored LTK for restabilishing security
      Bluetooth: Remove unused field in hci_conn
      Bluetooth: Add support for communicating keys with userspace
      Bluetooth: Add support for storing the key size
      Bluetooth: Add support for returning the encryption key size

Wey-Yi Guy (9):
      iwlagn: remove the indirection for the dma channel num
      iwlagn: remove double level temperature indirect call
      iwlagn: use bt handler for 2030 and 135 series devices
      iwlagn: declare static
      iwlagn: add CMD_ON_DEMAND flag for host command from testmode
      iwlagn: allow application own the uCode operation
      iwlagn: block regular host commands if driver don't own uCode
      iwlagn: separate and enhance the fixed rate from
      iwlagn: fix warning in testmode attribute table

Yogesh Ashok Powar (2):
      mwifiex: 4-byte alignment in mwifiex_process_sta_txpd()
      mwifiex: add cfg80211 handler for set_bitrate_mask

 Documentation/DocBook/80211.tmpl                   |    5 +-
 drivers/bcma/main.c                                |    4 +-
 drivers/bcma/sprom.c                               |    3 +
 drivers/bluetooth/ath3k.c                          |    5 +
 drivers/bluetooth/btusb.c                          |   12 +-
 drivers/net/wireless/ath/ath5k/ahb.c               |    4 +-
 drivers/net/wireless/ath/ath5k/ani.c               |    9 +-
 drivers/net/wireless/ath/ath5k/ath5k.h             |  167 +++++-----
 drivers/net/wireless/ath/ath5k/attach.c            |   24 +-
 drivers/net/wireless/ath/ath5k/base.c              |   71 ++--
 drivers/net/wireless/ath/ath5k/base.h              |   11 +-
 drivers/net/wireless/ath/ath5k/caps.c              |    4 +-
 drivers/net/wireless/ath/ath5k/debug.c             |  207 ++++++------
 drivers/net/wireless/ath/ath5k/desc.h              |    4 +-
 drivers/net/wireless/ath/ath5k/dma.c               |    8 +-
 drivers/net/wireless/ath/ath5k/eeprom.c            |   46 ++--
 drivers/net/wireless/ath/ath5k/eeprom.h            |   12 +-
 drivers/net/wireless/ath/ath5k/initvals.c          |   14 +-
 drivers/net/wireless/ath/ath5k/led.c               |    8 +-
 drivers/net/wireless/ath/ath5k/mac80211-ops.c      |    4 +-
 drivers/net/wireless/ath/ath5k/pci.c               |   14 +-
 drivers/net/wireless/ath/ath5k/pcu.c               |   16 +-
 drivers/net/wireless/ath/ath5k/phy.c               |  100 +++---
 drivers/net/wireless/ath/ath5k/reg.h               |   89 +++---
 drivers/net/wireless/ath/ath5k/reset.c             |   45 ++-
 drivers/net/wireless/ath/ath5k/rfbuffer.h          |    4 +-
 drivers/net/wireless/ath/ath5k/rfgain.h            |    8 +-
 drivers/net/wireless/ath/ath5k/sysfs.c             |   10 +-
 drivers/net/wireless/ath/ath5k/trace.h             |   15 +-
 drivers/net/wireless/ath/ath9k/ar5008_phy.c        |    5 +
 drivers/net/wireless/ath/ath9k/ar9002_hw.c         |   39 ---
 drivers/net/wireless/ath/ath9k/ar9002_phy.c        |   34 +-
 .../net/wireless/ath/ath9k/ar9003_2p2_initvals.h   |   10 +-
 drivers/net/wireless/ath/ath9k/ar9003_mac.c        |    3 +-
 drivers/net/wireless/ath/ath9k/ar9003_paprd.c      |   30 ++
 drivers/net/wireless/ath/ath9k/htc_drv_init.c      |    1 +
 drivers/net/wireless/ath/ath9k/htc_drv_main.c      |    9 +-
 drivers/net/wireless/ath/ath9k/hw.c                |   94 +++++-
 drivers/net/wireless/ath/ath9k/hw.h                |    4 +-
 drivers/net/wireless/ath/ath9k/mac.c               |    3 +-
 drivers/net/wireless/ath/ath9k/rc.c                |   50 ++--
 drivers/net/wireless/ath/ath9k/reg.h               |    5 -
 drivers/net/wireless/ath/carl9170/main.c           |    8 +
 drivers/net/wireless/b43/Kconfig                   |   14 +
 drivers/net/wireless/b43/Makefile                  |    1 +
 drivers/net/wireless/b43/b43.h                     |    1 -
 drivers/net/wireless/b43/bus.c                     |  129 +++++++
 drivers/net/wireless/b43/bus.h                     |    8 +
 drivers/net/wireless/b43/dma.c                     |    9 +-
 drivers/net/wireless/b43/main.c                    |  361 +++++++++++++++-----
 drivers/net/wireless/b43/phy_common.c              |    6 +
 drivers/net/wireless/b43/phy_common.h              |    3 +
 drivers/net/wireless/b43/phy_ht.c                  |   12 +-
 drivers/net/wireless/b43/phy_lcn.c                 |   52 +++
 drivers/net/wireless/b43/phy_lcn.h                 |   14 +
 drivers/net/wireless/b43/phy_n.c                   |   62 +++-
 drivers/net/wireless/b43/tables_phy_lcn.c          |   34 ++
 drivers/net/wireless/b43/tables_phy_lcn.h          |    6 +
 drivers/net/wireless/b43/xmit.c                    |    3 +-
 drivers/net/wireless/iwlegacy/iwl-4965-tx.c        |    3 +-
 drivers/net/wireless/iwlegacy/iwl4965-base.c       |    2 +-
 drivers/net/wireless/iwlwifi/iwl-1000.c            |   13 +-
 drivers/net/wireless/iwlwifi/iwl-2000.c            |   41 ++-
 drivers/net/wireless/iwlwifi/iwl-5000.c            |   29 +--
 drivers/net/wireless/iwlwifi/iwl-6000.c            |   30 +--
 drivers/net/wireless/iwlwifi/iwl-agn-calib.c       |   15 +-
 drivers/net/wireless/iwlwifi/iwl-agn-calib.h       |    7 -
 drivers/net/wireless/iwlwifi/iwl-agn-eeprom.c      |    6 +-
 drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c        |  115 +------
 drivers/net/wireless/iwlwifi/iwl-agn-lib.c         |  162 +++++++--
 drivers/net/wireless/iwlwifi/iwl-agn-rs.c          |   28 +-
 drivers/net/wireless/iwlwifi/iwl-agn-rxon.c        |   55 +++-
 drivers/net/wireless/iwlwifi/iwl-agn-sta.c         |    3 +-
 drivers/net/wireless/iwlwifi/iwl-agn-tx.c          |  109 ++-----
 drivers/net/wireless/iwlwifi/iwl-agn-ucode.c       |   14 +-
 drivers/net/wireless/iwlwifi/iwl-agn.c             |   62 +++-
 drivers/net/wireless/iwlwifi/iwl-agn.h             |   19 +-
 drivers/net/wireless/iwlwifi/iwl-commands.h        |    3 +
 drivers/net/wireless/iwlwifi/iwl-core.c            |   23 +-
 drivers/net/wireless/iwlwifi/iwl-core.h            |   50 +---
 drivers/net/wireless/iwlwifi/iwl-dev.h             |   49 +++-
 drivers/net/wireless/iwlwifi/iwl-eeprom.c          |    7 +-
 drivers/net/wireless/iwlwifi/iwl-eeprom.h          |    1 -
 drivers/net/wireless/iwlwifi/iwl-fh.h              |    2 +-
 drivers/net/wireless/iwlwifi/iwl-hcmd.c            |   32 +--
 drivers/net/wireless/iwlwifi/iwl-led.c             |    3 +-
 drivers/net/wireless/iwlwifi/iwl-power.c           |    9 +-
 drivers/net/wireless/iwlwifi/iwl-rx.c              |   47 +++-
 drivers/net/wireless/iwlwifi/iwl-scan.c            |   10 +-
 drivers/net/wireless/iwlwifi/iwl-sta.c             |   20 +-
 drivers/net/wireless/iwlwifi/iwl-sv-open.c         |   51 +++-
 drivers/net/wireless/iwlwifi/iwl-testmode.h        |   14 +-
 drivers/net/wireless/iwlwifi/iwl-trans.c           |  154 ++++++++-
 drivers/net/wireless/iwlwifi/iwl-trans.h           |   41 +++
 drivers/net/wireless/iwlwifi/iwl-tx.c              |  139 +-------
 drivers/net/wireless/libertas/cmd.c                |   46 ++-
 drivers/net/wireless/libertas/cmd.h                |    2 +
 drivers/net/wireless/libertas/cmdresp.c            |    6 +-
 drivers/net/wireless/libertas/main.c               |   12 +-
 drivers/net/wireless/mwifiex/cfg80211.c            |   56 +++-
 drivers/net/wireless/mwifiex/debugfs.c             |    2 +-
 drivers/net/wireless/mwifiex/decl.h                |    4 +-
 drivers/net/wireless/mwifiex/fw.h                  |   11 +
 drivers/net/wireless/mwifiex/sta_cmd.c             |   10 +-
 drivers/net/wireless/mwifiex/sta_tx.c              |   13 +-
 drivers/net/wireless/rt2x00/rt2800usb.c            |    2 +
 drivers/net/wireless/rtlwifi/rtl8192cu/rf.c        |    2 +-
 drivers/net/wireless/wl12xx/acx.c                  |   12 +-
 drivers/net/wireless/wl12xx/acx.h                  |    4 +-
 drivers/net/wireless/wl12xx/boot.c                 |    4 +-
 drivers/net/wireless/wl12xx/cmd.c                  |    6 +-
 drivers/net/wireless/wl12xx/conf.h                 |   10 +-
 drivers/net/wireless/wl12xx/debugfs.c              |   15 +-
 drivers/net/wireless/wl12xx/event.c                |   42 +++
 drivers/net/wireless/wl12xx/event.h                |   12 +-
 drivers/net/wireless/wl12xx/init.c                 |    7 +-
 drivers/net/wireless/wl12xx/main.c                 |  202 ++++++++----
 drivers/net/wireless/wl12xx/ps.c                   |    9 +-
 drivers/net/wireless/wl12xx/scan.c                 |   27 ++
 drivers/net/wireless/wl12xx/scan.h                 |    1 +
 drivers/net/wireless/wl12xx/sdio.c                 |   12 +-
 drivers/net/wireless/wl12xx/tx.c                   |  143 ++++++---
 drivers/net/wireless/wl12xx/tx.h                   |   28 ++-
 drivers/net/wireless/wl12xx/wl12xx.h               |   24 +-
 include/linux/nl80211.h                            |    3 +-
 include/net/bluetooth/bluetooth.h                  |   12 +-
 include/net/bluetooth/hci.h                        |   18 +
 include/net/bluetooth/hci_core.h                   |   29 ++-
 include/net/bluetooth/l2cap.h                      |   25 ++-
 include/net/bluetooth/mgmt.h                       |    2 +
 include/net/bluetooth/smp.h                        |    1 +
 include/net/cfg80211.h                             |    1 +
 include/net/mac80211.h                             |  171 ++++++++--
 net/bluetooth/hci_core.c                           |  101 +++++--
 net/bluetooth/hci_event.c                          |   87 +++++-
 net/bluetooth/l2cap_core.c                         |  216 ++++--------
 net/bluetooth/l2cap_sock.c                         |   69 ++++-
 net/bluetooth/lib.c                                |   23 ++-
 net/bluetooth/mgmt.c                               |  148 +++++----
 net/bluetooth/sco.c                                |    4 +-
 net/bluetooth/smp.c                                |  208 ++++++++++--
 net/mac80211/aes_ccm.c                             |   37 +-
 net/mac80211/aes_ccm.h                             |    2 -
 net/mac80211/aes_cmac.c                            |   10 +-
 net/mac80211/aes_cmac.h                            |    2 +-
 net/mac80211/cfg.c                                 |   27 +-
 net/mac80211/debugfs_key.c                         |   13 +-
 net/mac80211/driver-ops.h                          |    8 +
 net/mac80211/driver-trace.h                        |   46 +++
 net/mac80211/ieee80211_i.h                         |   27 ++-
 net/mac80211/iface.c                               |    7 +-
 net/mac80211/key.c                                 |   75 ++++
 net/mac80211/key.h                                 |   32 +-
 net/mac80211/mlme.c                                |   58 +++-
 net/mac80211/rx.c                                  |   36 ++-
 net/mac80211/sta_info.h                            |    3 +-
 net/mac80211/tkip.c                                |  108 +++---
 net/mac80211/tkip.h                                |    8 +-
 net/mac80211/tx.c                                  |    3 +
 net/mac80211/util.c                                |   67 ++++
 net/mac80211/wpa.c                                 |   94 +++---
 net/wireless/scan.c                                |    2 +-
 162 files changed, 3892 insertions(+), 1916 deletions(-)
 create mode 100644 drivers/net/wireless/b43/phy_lcn.c
 create mode 100644 drivers/net/wireless/b43/phy_lcn.h
 create mode 100644 drivers/net/wireless/b43/tables_phy_lcn.c
 create mode 100644 drivers/net/wireless/b43/tables_phy_lcn.h

Omnibus patch is available here:

	http://www.kernel.org/pub/linux/kernel/people/linville/wireless-next-2.6-2011-07-15.patch.bz2

-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply

* Re: pull request: wireless-next-2.6 2011-07-15
From: David Miller @ 2011-07-15 15:54 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, netdev
In-Reply-To: <20110715153435.GA2566@tuxdriver.com>

From: "John W. Linville" <linville@tuxdriver.com>
Date: Fri, 15 Jul 2011 11:34:36 -0400

> Here is yet another batch of wireless networking changes intended
> for 3.1, with probably a smidge more yet to come... :-)
> 
> This includes another Bluetooth pull, mostly some cleanups,
> restructuring, and some minor fixes.  Along with the usual iwlagn and
> ath9k updates, mwifiex, wl12xx, ath5k, and b43 all see significant
> activity.  Johannes has done some housekeeping in mac80211 as well.
> 
> Please let me know if there are problems!

Pulled, thanks John.

It seems we have one more bluetooth regression straggler for
3.0.0, please make sure I get that soon otherwise it might
not make it in time:

http://marc.info/?l=linux-kernel&m=131072468622609&w=2

Thanks.

^ permalink raw reply

* Re: [PATCH] bridge: mask forwarding of IEEE 802 local multicast groups
From: David Lamparter @ 2011-07-15 16:03 UTC (permalink / raw)
  To: Nick Carter
  Cc: David Lamparter, Stephen Hemminger, netdev,
	Michał Mirosław, davem
In-Reply-To: <CAEJpZP1Da=G3--jThbaj5H4+H+836quXXEfGXtBwdPewr-Pjrg@mail.gmail.com>

On Fri, Jul 15, 2011 at 04:44:50PM +0100, Nick Carter wrote:
> On 12 July 2011 12:36, David Lamparter <equinox@diac24.net> wrote:
> > On Mon, Jul 11, 2011 at 08:27:55AM -0700, Stephen Hemminger wrote:
> >> I am still undecided on this. Understand the need, but don't like idea
> >> of bridge behaving in non-conforming manner. Will see if IEEE 802 committee
> >> has any input.
> >
> > The patch doesn't make the bridge behave nonconformant. The default mask
> > is 0, which just keeps the old behaviour.
>
> Also as David points out in his review, after these diffs are applied
> we will be able to remove this
> @@ -166,6 +166,9 @@ struct sk_buff *br_handle_frame(struct sk_buff *skb)
>                if (p->br->stp_enabled == BR_NO_STP && dest[5] == 0)
>                        goto forward;
> Which is non-standard.

Actually, no, we might not be able to remove this (sorry for stating the
opposite earlier). If we remove this, we can cause loops if we are a
STP-disabled bridge on a STP-enabled ethernet. We would form a STP
blackhole, causing more than one switch to assume responsibility for
forwarding packets to our segment...

While we could shift the burden for making a correct configuration onto
the admin or the userspace tools (by setting the mask to 1 on a no-STP
bridge), this would be a major change from previous behaviour and
(more or less) count as regression.

Either way I would consider removing that line a rather dangerous
change. We didn't remove that line, let's stick with it and everything
will stay as it used to be :)

> So these diffs enable us to change the existing non-conforming
> behaviour to a conforming one.
>
> > If you set the lowest 3 bits, yes, you can break your network.

Btw, a kernel warning for this would be useful i think, at least once.
"You should only enable the lowest 3 bits for sniffing bridges." or so.


-David


^ permalink raw reply

* Re: [PATCH] bridge: mask forwarding of IEEE 802 local multicast groups
From: David Lamparter @ 2011-07-15 16:33 UTC (permalink / raw)
  To: David Lamparter
  Cc: Nick Carter, Stephen Hemminger, netdev, Michał Mirosław,
	davem
In-Reply-To: <20110715160357.GC1407585@jupiter.n2.diac24.net>

On Fri, Jul 15, 2011 at 06:03:57PM +0200, David Lamparter wrote:
> On Fri, Jul 15, 2011 at 04:44:50PM +0100, Nick Carter wrote:
> > On 12 July 2011 12:36, David Lamparter <equinox@diac24.net> wrote:
> > > On Mon, Jul 11, 2011 at 08:27:55AM -0700, Stephen Hemminger wrote:
> > >> I am still undecided on this. Understand the need, but don't like idea
> > >> of bridge behaving in non-conforming manner. Will see if IEEE 802 committee
> > >> has any input.
> > >
> > > The patch doesn't make the bridge behave nonconformant. The default mask
> > > is 0, which just keeps the old behaviour.

P.S.: I'd like to once more stress this. In my opinion the patch should
be merged because it provides desireable functionality at a small cost
(one test, one knob) and __does not change any default behaviour__.


^ permalink raw reply

* (unknown), 
From: Mr. Vincent Cheng Chuen @ 2011-07-15 17:07 UTC (permalink / raw)



Good Day,

I have a business proposal of USD $22,500,000.00 only for you to transact with
me from my bank to your country.
Reply to address: choi_chui001@yahoo.co.jp and I will let you know what is
required of you.

Best Regards,
Mr. Vincent Cheng






^ permalink raw reply

* Re: [PATCH] connector: add an event for monitoring process tracers
From: Vladimir Zapolskiy @ 2011-07-15 17:41 UTC (permalink / raw)
  To: Oleg Nesterov; +Cc: Evgeniy Polyakov, David S. Miller, netdev
In-Reply-To: <20110713150942.GA4850@redhat.com>

Oleg,

first of all thank you for a good review, please see my comments below.

On Wed, Jul 13, 2011 at 6:09 PM, Oleg Nesterov <oleg@redhat.com> wrote:
> On 07/12, Vladimir Zapolskiy wrote:
>>
>> Note, a detach signal is not emitted, if a tracer process terminates
>> without explicit PTRACE_DETACH request. Such cases can be covered
>> listening to PROC_EVENT_EXIT connector events.
>
> Hmm. More and more reasons to make the implicit detach sleepable...
>
> But. There is another case. The (dead) tracee can be detached via
> do_wait(). Perhaps this falls into "covered listening to EXIT" too,
> but imho makes sense to document in the changelog. Oh, and probably
> we will add the ability to detach a zombie...
>
> I don't really understand why do you need this, but I won't argue.
>
I found that implicit ptrace detach codepath is quite mutable and
vast, and I don't want to interfere in that changes without knowing
even basic pitfalls. Somehow the sending a connector signal on
explicit detach is quite sufficient at least for the most of the proc
connector usecases I can imagine, because hopefully almost(?) all
implicit detach cases are related to tracer or tracee thread
completion, and that is supposed to be reported to userspace via
do_exit()/proc_exit_connector() path.

> As for the patch,
>
>> +void proc_ptrace_connector(struct task_struct *task)
>> +{
>> +     struct cn_msg *msg;
>> +     struct proc_event *ev;
>> +     struct timespec ts;
>> +     __u8 buffer[CN_PROC_MSG_SIZE];
>> +     struct task_struct *tracer;
>> +
>> +     if (atomic_read(&proc_event_num_listeners) < 1)
>> +             return;
>> +
>> +     msg = (struct cn_msg *)buffer;
>> +     ev = (struct proc_event *)msg->data;
>> +     get_seq(&msg->seq, &ev->cpu);
>> +     ktime_get_ts(&ts); /* get high res monotonic timestamp */
>> +     put_unaligned(timespec_to_ns(&ts), (__u64 *)&ev->timestamp_ns);
>> +     ev->what = PROC_EVENT_PTRACE;
>> +     ev->event_data.ptrace.process_pid  = task->pid;
>> +     ev->event_data.ptrace.process_tgid = task->tgid;
>> +
>> +     rcu_read_lock();
>> +     tracer = tracehook_tracer_task(task);
>> +     if (tracer) {
>> +             ev->event_data.ptrace.tracer_pid  = tracer->pid;
>> +             ev->event_data.ptrace.tracer_tgid = tracer->tgid;
>> +     } else {
>> +             ev->event_data.ptrace.tracer_pid  = 0;
>> +             ev->event_data.ptrace.tracer_tgid = 0;
>> +     }
>
> This doesn't look right. The code uses tracehook_tracer_task() to
> figure out whether this task traced or not. But this is racy.
>
> ptrace_attach:
>
>        ...attach...
>
>        /* WINDOW */
>
>        proc_ptrace_connector(task);
>
> The task can exit in between, and the caller's subthread can do
> wait4() and release it. In this case proc_ptrace_connector() will
> see tracehook_tracer_task() == NULL and report "detach".
>
> The similar race in ptrace_detach() path. Another tracer can attach
> to this task before we proc_ptrace_connector().
>
> I think proc_ptrace_connector() needs the explicit "task_struct *tracer"
> argument, NULL if ptrace_detach(). Or a simple boolean, the tracer is
> current.
>
> If you think this is fine - I won't argue.
>
Fixed in the second version of the change, thanks.

>
>
> But in any case, please rediff against
>
>        git://git.kernel.org/pub/scm/linux/kernel/git/oleg/misc.git ptrace
>
> tracehook_tracer_task() was removed, and
>
>> @@ -260,6 +261,9 @@ out:
>>       if (wait_trap)
>>               wait_event(current->signal->wait_chldexit,
>>                          !(task->group_stop & GROUP_STOP_TRAPPING));
>> +     if (!retval)
>> +             proc_ptrace_connector(task);
>> +
>>       return retval;
>>  }
>
> this chunk probably should be updated.
Rebased, thanks a lot.

Vladimir

^ permalink raw reply

* [PATCH v2] connector: add an event for monitoring process tracers
From: Vladimir Zapolskiy @ 2011-07-15 17:45 UTC (permalink / raw)
  To: Oleg Nesterov
  Cc: netdev, Vladimir Zapolskiy, Evgeniy Polyakov, David S. Miller

This change adds a procfs connector event, which is emitted on every
successful process tracer attach or detach.

If some process connects to other one, kernelspace connector reports
process id and thread group id of both these involved processes. On
disconnection null process id is returned.

Such an event allows to create a simple automated userspace mechanism
to be aware about processes connecting to others, therefore predefined
process policies can be applied to them if needed.

Note, a detach signal is emitted only in case, if a tracer process
explicitly executes PTRACE_DETACH request. In other cases like tracee
or tracer exit detach event from proc connector is not reported.

Signed-off-by: Vladimir Zapolskiy <vzapolskiy@gmail.com>
Cc: Evgeniy Polyakov <zbr@ioremap.net>
Cc: David S. Miller <davem@davemloft.net>
---

Originally proposed change can be found here:
* http://patchwork.ozlabs.org/patch/104434/

This version of the change extends proc_ptrace_connector() argument
list, so it becomes possible to specify a ptrace request eliminating
process attach/detach race.

Also tracehook_tracer_task() function was renamed to ptrace_parent(),
but as far as proc_ptrace_connector(task, PTRACE_ATTACH) is called
from a tracer process itself, it becomes possible to get rid of that
call usage completely.

Oleg, I've rebased the change, and if you don't have objections, I'd
be glad, if you can apply this change upon your ptrace branch, thank
you in advance.

 drivers/connector/cn_proc.c |   35 +++++++++++++++++++++++++++++++++++
 include/linux/cn_proc.h     |   13 +++++++++++++
 kernel/ptrace.c             |    7 ++++++-
 3 files changed, 54 insertions(+), 1 deletions(-)

diff --git a/drivers/connector/cn_proc.c b/drivers/connector/cn_proc.c
index 2b46a7e..281902d 100644
--- a/drivers/connector/cn_proc.c
+++ b/drivers/connector/cn_proc.c
@@ -28,6 +28,7 @@
 #include <linux/init.h>
 #include <linux/connector.h>
 #include <linux/gfp.h>
+#include <linux/ptrace.h>
 #include <asm/atomic.h>
 #include <asm/unaligned.h>
 
@@ -166,6 +167,40 @@ void proc_sid_connector(struct task_struct *task)
 	cn_netlink_send(msg, CN_IDX_PROC, GFP_KERNEL);
 }
 
+void proc_ptrace_connector(struct task_struct *task, int ptrace_id)
+{
+	struct cn_msg *msg;
+	struct proc_event *ev;
+	struct timespec ts;
+	__u8 buffer[CN_PROC_MSG_SIZE];
+	struct task_struct *tracer;
+
+	if (atomic_read(&proc_event_num_listeners) < 1)
+		return;
+
+	msg = (struct cn_msg *)buffer;
+	ev = (struct proc_event *)msg->data;
+	get_seq(&msg->seq, &ev->cpu);
+	ktime_get_ts(&ts); /* get high res monotonic timestamp */
+	put_unaligned(timespec_to_ns(&ts), (__u64 *)&ev->timestamp_ns);
+	ev->what = PROC_EVENT_PTRACE;
+	ev->event_data.ptrace.process_pid  = task->pid;
+	ev->event_data.ptrace.process_tgid = task->tgid;
+	if (ptrace_id == PTRACE_ATTACH) {
+		ev->event_data.ptrace.tracer_pid  = current->pid;
+		ev->event_data.ptrace.tracer_tgid = current->tgid;
+	} else if (ptrace_id == PTRACE_DETACH) {
+		ev->event_data.ptrace.tracer_pid  = 0;
+		ev->event_data.ptrace.tracer_tgid = 0;
+	} else
+		return;
+
+	memcpy(&msg->id, &cn_proc_event_id, sizeof(msg->id));
+	msg->ack = 0; /* not used */
+	msg->len = sizeof(*ev);
+	cn_netlink_send(msg, CN_IDX_PROC, GFP_KERNEL);
+}
+
 void proc_exit_connector(struct task_struct *task)
 {
 	struct cn_msg *msg;
diff --git a/include/linux/cn_proc.h b/include/linux/cn_proc.h
index 47dac5e..12c517b 100644
--- a/include/linux/cn_proc.h
+++ b/include/linux/cn_proc.h
@@ -53,6 +53,7 @@ struct proc_event {
 		PROC_EVENT_UID  = 0x00000004,
 		PROC_EVENT_GID  = 0x00000040,
 		PROC_EVENT_SID  = 0x00000080,
+		PROC_EVENT_PTRACE = 0x00000100,
 		/* "next" should be 0x00000400 */
 		/* "last" is the last process event: exit */
 		PROC_EVENT_EXIT = 0x80000000
@@ -95,6 +96,13 @@ struct proc_event {
 			__kernel_pid_t process_tgid;
 		} sid;
 
+		struct ptrace_proc_event {
+			__kernel_pid_t process_pid;
+			__kernel_pid_t process_tgid;
+			__kernel_pid_t tracer_pid;
+			__kernel_pid_t tracer_tgid;
+		} ptrace;
+
 		struct exit_proc_event {
 			__kernel_pid_t process_pid;
 			__kernel_pid_t process_tgid;
@@ -109,6 +117,7 @@ void proc_fork_connector(struct task_struct *task);
 void proc_exec_connector(struct task_struct *task);
 void proc_id_connector(struct task_struct *task, int which_id);
 void proc_sid_connector(struct task_struct *task);
+void proc_ptrace_connector(struct task_struct *task, int which_id);
 void proc_exit_connector(struct task_struct *task);
 #else
 static inline void proc_fork_connector(struct task_struct *task)
@@ -124,6 +133,10 @@ static inline void proc_id_connector(struct task_struct *task,
 static inline void proc_sid_connector(struct task_struct *task)
 {}
 
+static inline void proc_ptrace_connector(struct task_struct *task,
+					 int ptrace_id)
+{}
+
 static inline void proc_exit_connector(struct task_struct *task)
 {}
 #endif	/* CONFIG_PROC_EVENTS */
diff --git a/kernel/ptrace.c b/kernel/ptrace.c
index d7ccc79..9de3ecf 100644
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
@@ -23,6 +23,7 @@
 #include <linux/uaccess.h>
 #include <linux/regset.h>
 #include <linux/hw_breakpoint.h>
+#include <linux/cn_proc.h>
 
 
 static int ptrace_trapping_sleep_fn(void *flags)
@@ -305,9 +306,12 @@ unlock_tasklist:
 unlock_creds:
 	mutex_unlock(&task->signal->cred_guard_mutex);
 out:
-	if (!retval)
+	if (!retval) {
 		wait_on_bit(&task->jobctl, JOBCTL_TRAPPING_BIT,
 			    ptrace_trapping_sleep_fn, TASK_UNINTERRUPTIBLE);
+		proc_ptrace_connector(task, PTRACE_ATTACH);
+	}
+
 	return retval;
 }
 
@@ -415,6 +419,7 @@ static int ptrace_detach(struct task_struct *child, unsigned int data)
 	}
 	write_unlock_irq(&tasklist_lock);
 
+	proc_ptrace_connector(child, PTRACE_DETACH);
 	if (unlikely(dead))
 		release_task(child);
 
-- 
1.7.5.1


^ permalink raw reply related

* [PATCH net-next] bnx2: Close device if tx_timeout reset fails
From: Michael Chan @ 2011-07-15 16:53 UTC (permalink / raw)
  To: davem; +Cc: netdev, fbl

Based on original patch and description from Flavio Leitner <fbl@redhat.com>

When bnx2_reset_task() is called, it will stop,
(re)initialize and start the interface to restore
the working condition.

The bnx2_init_nic() calls bnx2_reset_nic() which will
reset the chip and then calls bnx2_free_skbs() to free
all the skbs.

The problem happens when bnx2_init_chip() fails because
bnx2_reset_nic() will just return skipping the ring
initializations at bnx2_init_all_rings(). Later, the
reset task starts the interface again and the system
crashes due a NULL pointer access (no skb in the ring).

To fix it, we call dev_close() if bnx2_init_nic() fails.
One minor wrinkle to deal with is the cancel_work_sync()
call in bnx2_close() to cancel bnx2_reset_task().  The
call will wait forever because it is trying to cancel
itself and the workqueue will be stuck.

Since bnx2_reset_task() holds the rtnl_lock() and checks
for netif_running() before proceeding, there is no need
to cancel bnx2_reset_task() in bnx2_close() even if
bnx2_close() and bnx2_reset_task() are running concurrently.
The rtnl_lock() serializes the 2 calls.

We need to move the cancel_work_sync() call to
bnx2_remove_one() to make sure it is canceled before freeing
the netdev struct.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Cc: Flavio Leitner <fbl@redhat.com>
---
 drivers/net/bnx2.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 4816d6a..3ad9b70 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -6342,6 +6342,7 @@ static void
 bnx2_reset_task(struct work_struct *work)
 {
 	struct bnx2 *bp = container_of(work, struct bnx2, reset_task);
+	int rc;
 
 	rtnl_lock();
 	if (!netif_running(bp->dev)) {
@@ -6351,7 +6352,14 @@ bnx2_reset_task(struct work_struct *work)
 
 	bnx2_netif_stop(bp, true);
 
-	bnx2_init_nic(bp, 1);
+	rc = bnx2_init_nic(bp, 1);
+	if (rc) {
+		netdev_err(bp->dev, "failed to reset NIC, closing\n");
+		bnx2_napi_enable(bp);
+		dev_close(bp->dev);
+		rtnl_unlock();
+		return;
+	}
 
 	atomic_set(&bp->intr_sem, 1);
 	bnx2_netif_start(bp, true);
@@ -6573,8 +6581,6 @@ bnx2_close(struct net_device *dev)
 {
 	struct bnx2 *bp = netdev_priv(dev);
 
-	cancel_work_sync(&bp->reset_task);
-
 	bnx2_disable_int_sync(bp);
 	bnx2_napi_disable(bp);
 	del_timer_sync(&bp->timer);
@@ -8404,6 +8410,7 @@ bnx2_remove_one(struct pci_dev *pdev)
 	unregister_netdev(dev);
 
 	del_timer_sync(&bp->timer);
+	cancel_work_sync(&bp->reset_task);
 
 	if (bp->mips_firmware)
 		release_firmware(bp->mips_firmware);
-- 
1.6.4.GIT



^ permalink raw reply related

* (unknown), 
From: Mr. Vincent Cheng Chuen @ 2011-07-15 18:25 UTC (permalink / raw)



Good Day,

I have a business proposal of USD $22,500,000.00 only for you to transact with
me from my bank to your country.
Reply to address: choi_chui001@yahoo.co.jp and I will let you know what is
required of you.

Best Regards,
Mr. Vincent Cheng






^ permalink raw reply

* [PATCH] Rename static setns() function
From: Dan McGee @ 2011-07-15 18:38 UTC (permalink / raw)
  To: netdev; +Cc: Dan McGee, Eric W. Biederman

Fixes the following error:

    gcc -D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall -I../include
    -DRESOLVE_HOSTNAMES -DLIBDIR=\"/usr/lib/\"   -c -o ipnetns.o ipnetns.c
    ipnetns.c:31:12: error: static declaration of ‘setns’ follows non-static
    declaration
    /usr/include/bits/sched.h:93:12: note: previous declaration of ‘setns’
    was here
    make[1]: *** [ipnetns.o] Error 1

Fixes issue introduced in commit 0dc34c7713bb7055.

Signed-off-by: Dan McGee <dan@archlinux.org>
---
 ip/ipnetns.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/ip/ipnetns.c b/ip/ipnetns.c
index db7007c..46230ad 100644
--- a/ip/ipnetns.c
+++ b/ip/ipnetns.c
@@ -28,7 +28,7 @@
 #define MNT_DETACH	0x00000002	/* Just detach from the tree */
 #endif /* MNT_DETACH */
 
-static int setns(int fd, int nstype)
+static int do_setns(int fd, int nstype)
 {
 #ifdef __NR_setns
 	return syscall(__NR_setns, fd, nstype);
@@ -150,7 +150,7 @@ static int netns_exec(int argc, char **argv)
 			strerror(errno));
 		return -1;
 	}
-	if (setns(netns, CLONE_NEWNET) < 0) {
+	if (do_setns(netns, CLONE_NEWNET) < 0) {
 		fprintf(stderr, "seting the network namespace failed: %s\n",
 			strerror(errno));
 		return -1;
-- 
1.7.6


^ permalink raw reply related

* [PATCH] ip route: don't implicitly filter address family
From: Dan McGee @ 2011-07-15 18:38 UTC (permalink / raw)
  To: netdev; +Cc: Dan McGee

When looking at the output of 'ip route show' on an IPv6 capable
machine, the default output doesn't show IPv6 routes. This is unlike any
other ip subcommand, which show all address families by default.
Furthermore, the behavior is totally bogus for different permutations of
the command:

    ip route show : will show IPv4, not show IPv6
	ip route show table all : will show IPv4 and IPv6
	ip route -f link show : will show IPv4 and IPv6

Rectify this behavior by removing some 2004 code that tries to munge the
address family if it is unspecified and fails bad at guessing the user's
intention.

Signed-off-by: Dan McGee <dan@archlinux.org>
---
 ip/iproute.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/ip/iproute.c b/ip/iproute.c
index ca09029..4458d9c 100644
--- a/ip/iproute.c
+++ b/ip/iproute.c
@@ -1236,9 +1236,6 @@ static int iproute_list_flush_or_save(int argc, char **argv, int action)
 		argc--; argv++;
 	}
 
-	if (do_ipv6 == AF_UNSPEC && filter.tb)
-		do_ipv6 = AF_INET;
-
 	ll_init_map(&rth);
 
 	if (id || od)  {
-- 
1.7.6


^ permalink raw reply related

* [PATCH] Make iproute2 configure script more flexible
From: Dan McGee @ 2011-07-15 18:52 UTC (permalink / raw)
  To: netdev; +Cc: Dan McGee

On Arch Linux, we still install the iptables shared libraries in
/usr/lib/iptables/, even though the main library is installed to
/usr/lib/libxtables.so. This change checks all available locations to
correctly find the iptables library directory.

Signed-off-by: Dan McGee <dan@archlinux.org>
---
 configure |   11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/configure b/configure
index 69797ab..0795df8 100755
--- a/configure
+++ b/configure
@@ -3,8 +3,6 @@
 #
 INCLUDE=${1:-"$PWD/include"}
 
-TABLES=
-
 check_atm()
 {
 cat >/tmp/atmtest.c <<EOF
@@ -141,9 +139,6 @@ check_ipt()
 	if ! grep TC_CONFIG_XT Config > /dev/null
 	then
 		echo "using iptables"
-		TABLES="iptables"
-	else
-		TABLES="xtables"
 	fi
 }
 
@@ -152,10 +147,10 @@ check_ipt_lib_dir()
 	IPT_LIB_DIR=""
 	for dir in /lib /usr/lib /usr/local/lib
 	do
-		for file in $dir/$TABLES/lib*t_*so ; do
+		for file in $dir/{xtables,iptables}/lib*t_*so ; do
 			if [ -f $file ]; then
-				echo $dir/$TABLES
-				echo "IPT_LIB_DIR:=$dir/$TABLES" >> Config
+				echo ${file%/*}
+				echo "IPT_LIB_DIR:=${file%/*}" >> Config
 				return
 			fi
 		done
-- 
1.7.6


^ permalink raw reply related

* [PATCH] iproute2: Remove ChangeLog
From: Dan McGee @ 2011-07-15 18:53 UTC (permalink / raw)
  To: netdev; +Cc: Dan McGee

This hasn't been updated since 2006.

Signed-off-by: Dan McGee <dan@archlinux.org>
---
 ChangeLog |  563 -------------------------------------------------------------
 1 files changed, 0 insertions(+), 563 deletions(-)
 delete mode 100644 ChangeLog

diff --git a/ChangeLog b/ChangeLog
deleted file mode 100644
index 3590a64..0000000
-- 
1.7.6


^ permalink raw reply

* Re: [PATCH] gianfar: rx parser
From: Jiri Pirko @ 2011-07-15 19:51 UTC (permalink / raw)
  To: David Miller; +Cc: sebastian.belden, netdev, sandeep.kumar
In-Reply-To: <20110715.080610.256697325487445331.davem@davemloft.net>

Fri, Jul 15, 2011 at 05:06:10PM CEST, davem@davemloft.net wrote:
>From: "Sebastian Pöhn" <sebastian.belden@googlemail.com>
>Date: Fri, 15 Jul 2011 13:09:01 +0200
>
>> +	struct gfar __iomem *regs = NULL;
>> +	u32 tempval = 0;
>> +	
>> +	regs = priv->gfargrp[0].regs;
>
>There is no reason to initialize the variable 'regs' to NULL only to
>initialize it to something else 2 lines later.
>
>The initial 'tempval' initialization is also redundant, for the same
>reason.


fixed:

From: Sebastian Pöhn <sebastian.belden@googlemail.com>
Subject: [patch net-next-2.6] gianfar: rx parser

Only let the rx parser be enabled if it is necessary (if VLAN extraction,
IP or TCP checksumming or the rx queue filer are enabled). Otherwise
disable it.

The new routine gfar_check_rx_parser_mode should be run after every
change on this features and will enable/disable the parser as necessary.

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: Sebastian Poehn <sebastian.poehn@belden.com>
---
 drivers/net/gianfar.c |   24 +++++++++++++++++++-----
 drivers/net/gianfar.h |    3 ++-
 2 files changed, 21 insertions(+), 6 deletions(-)

diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index 3321d71..d265c6e 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -2287,6 +2287,23 @@ static int gfar_set_mac_address(struct net_device *dev)
 	return 0;
 }
 
+/* Check if rx parser should be activated */
+void gfar_check_rx_parser_mode(struct gfar_private *priv)
+{
+	struct gfar __iomem *regs;
+	u32 tempval;
+
+	regs = priv->gfargrp[0].regs;
+
+	tempval = gfar_read(&regs->rctrl);
+	/* If parse is no longer required, then disable parser */
+	if (tempval & RCTRL_REQ_PARSER)
+		tempval |= RCTRL_PRSDEP_INIT;
+	else
+		tempval &= ~RCTRL_PRSDEP_INIT;
+	gfar_write(&regs->rctrl, tempval);
+}
+
 
 /* Enables and disables VLAN insertion/extraction */
 static void gfar_vlan_rx_register(struct net_device *dev,
@@ -2323,12 +2340,9 @@ static void gfar_vlan_rx_register(struct net_device *dev,
 		/* Disable VLAN tag extraction */
 		tempval = gfar_read(&regs->rctrl);
 		tempval &= ~RCTRL_VLEX;
-		/* If parse is no longer required, then disable parser */
-		if (tempval & RCTRL_REQ_PARSER)
-			tempval |= RCTRL_PRSDEP_INIT;
-		else
-			tempval &= ~RCTRL_PRSDEP_INIT;
 		gfar_write(&regs->rctrl, tempval);
+
+		gfar_check_rx_parser_mode(priv);
 	}
 
 	gfar_change_mtu(dev, dev->mtu);
diff --git a/drivers/net/gianfar.h b/drivers/net/gianfar.h
index 27499c6..87c1d86 100644
--- a/drivers/net/gianfar.h
+++ b/drivers/net/gianfar.h
@@ -286,7 +286,7 @@ extern const char gfar_driver_version[];
 #define RCTRL_PROM		0x00000008
 #define RCTRL_EMEN		0x00000002
 #define RCTRL_REQ_PARSER	(RCTRL_VLEX | RCTRL_IPCSEN | \
-				 RCTRL_TUCSEN)
+				 RCTRL_TUCSEN | RCTRL_FILREN)
 #define RCTRL_CHECKSUMMING	(RCTRL_IPCSEN | RCTRL_TUCSEN | \
 				RCTRL_PRSDEP_INIT)
 #define RCTRL_EXTHASH		(RCTRL_GHTX)
@@ -1182,6 +1182,7 @@ extern void gfar_configure_coalescing(struct gfar_private *priv,
 		unsigned long tx_mask, unsigned long rx_mask);
 void gfar_init_sysfs(struct net_device *dev);
 int gfar_set_features(struct net_device *dev, u32 features);
+extern void gfar_check_rx_parser_mode(struct gfar_private *priv);
 
 extern const struct ethtool_ops gfar_ethtool_ops;
 
-- 
1.7.6


^ permalink raw reply related

* [PATCH] iproute2: fix several warnings emitted by clang scan-build
From: Dan McGee @ 2011-07-15 19:59 UTC (permalink / raw)
  To: netdev; +Cc: Dan McGee

* genl/genl.c: remove unused basename logic, avoid dereference of
  possibly NULL variable
* ip/iptuntap.c: avoid double open and leak of file handle
* misc/arpd.c: zero out socklen structure
* misc/{ifstat,nstat,rtacct}.c: ensure uptime is initialized if
  /proc/uptime cannot be opened
* tc/m_xt.c: only unset fields if m is non-NULL

Signed-off-by: Dan McGee <dan@archlinux.org>
---
 genl/genl.c   |   11 ++---------
 ip/iptuntap.c |    2 +-
 misc/arpd.c   |    2 ++
 misc/ifstat.c |    2 +-
 misc/nstat.c  |    2 +-
 misc/rtacct.c |    2 +-
 tc/m_xt.c     |   15 ++++++++-------
 7 files changed, 16 insertions(+), 20 deletions(-)

diff --git a/genl/genl.c b/genl/genl.c
index 7ec24eb..2bee1bf 100644
--- a/genl/genl.c
+++ b/genl/genl.c
@@ -109,14 +109,6 @@ static void usage(void)
 
 int main(int argc, char **argv)
 {
-	char *basename;
-
-	basename = strrchr(argv[0], '/');
-	if (basename == NULL)
-		basename = argv[0];
-	else
-		basename++;
-
 	while (argc > 1) {
 		if (argv[1][0] != '-')
 			break;
@@ -144,8 +136,9 @@ int main(int argc, char **argv)
 		int ret;
 		struct genl_util *a = NULL;
 		a = get_genl_kind(argv[1]);
-		if (NULL == a) {
+		if (!a) {
 			fprintf(stderr,"bad genl %s\n",argv[1]);
+			exit(-1);
 		}
 
 		ret = a->parse_genlopt(a, argc-1, argv+1);
diff --git a/ip/iptuntap.c b/ip/iptuntap.c
index 2a8aa7f..588926c 100644
--- a/ip/iptuntap.c
+++ b/ip/iptuntap.c
@@ -47,7 +47,7 @@ static void usage(void)
 
 static int tap_add_ioctl(struct ifreq *ifr, uid_t uid, gid_t gid)
 {
-	int fd = open(TUNDEV, O_RDWR);
+	int fd;
 	int ret = -1;
 
 #ifdef IFF_TUN_EXCL
diff --git a/misc/arpd.c b/misc/arpd.c
index 128c49d..647b197 100644
--- a/misc/arpd.c
+++ b/misc/arpd.c
@@ -485,6 +485,8 @@ void get_arp_pkt(void)
 	DBT dbkey, dbdat;
 	int n;
 
+	memset(&sll, 0, sizeof(sll));
+
 	n = recvfrom(pset[0].fd, buf, sizeof(buf), MSG_DONTWAIT,
 		     (struct sockaddr*)&sll, &sll_len);
 	if (n < 0) {
diff --git a/misc/ifstat.c b/misc/ifstat.c
index 1cd55c4..7d33f5e 100644
--- a/misc/ifstat.c
+++ b/misc/ifstat.c
@@ -708,7 +708,7 @@ int main(int argc, char *argv[])
 		}
 		if (!ignore_history) {
 			FILE *tfp;
-			long uptime;
+			long uptime = -1;
 			if ((tfp = fopen("/proc/uptime", "r")) != NULL) {
 				if (fscanf(tfp, "%ld", &uptime) != 1)
 					uptime = -1;
diff --git a/misc/nstat.c b/misc/nstat.c
index 4f73c62..2f06ffd 100644
--- a/misc/nstat.c
+++ b/misc/nstat.c
@@ -560,7 +560,7 @@ int main(int argc, char *argv[])
 		}
 		if (!ignore_history) {
 			FILE *tfp;
-			long uptime;
+			long uptime = -1;
 			if ((tfp = fopen("/proc/uptime", "r")) != NULL) {
 				if (fscanf(tfp, "%ld", &uptime) != 1)
 					uptime = -1;
diff --git a/misc/rtacct.c b/misc/rtacct.c
index ab8fdbb..49168bd 100644
--- a/misc/rtacct.c
+++ b/misc/rtacct.c
@@ -580,7 +580,7 @@ int main(int argc, char *argv[])
 
 		if (!ignore_history) {
 			FILE *tfp;
-			long uptime;
+			long uptime = -1;
 			if ((tfp = fopen("/proc/uptime", "r")) != NULL) {
 				if (fscanf(tfp, "%ld", &uptime) != 1)
 					uptime = -1;
diff --git a/tc/m_xt.c b/tc/m_xt.c
index 86e223b..b3fdc1d 100644
--- a/tc/m_xt.c
+++ b/tc/m_xt.c
@@ -252,13 +252,14 @@ static int parse_ipt(struct action_util *a,int *argc_p,
 
 	optind = 0;
 	xtables_free_opts(1);
-	/* Clear flags if target will be used again */
-        m->tflags=0;
-        m->used=0;
-	/* Free allocated memory */
-        if (m->t)
-            free(m->t);
-
+	if (m) {
+		/* Clear flags if target will be used again */
+		m->tflags = 0;
+		m->used = 0;
+		/* Free allocated memory */
+		if (m->t)
+			free(m->t);
+	}
 
 	return 0;
 
-- 
1.7.6


^ permalink raw reply related

* Does it matter that autotuning grows the socket buffers on a request/response test?
From: Rick Jones @ 2011-07-15 21:20 UTC (permalink / raw)
  To: netdev

I was getting ready to do some aggregate netperf request/response tests, 
using the bits that will be the 2.5.0 release of netperf, where the 
"omni" tests are the default.  This means that rather than seeing the 
initial socket buffer sizes I started seeing the final socket buffer sizes.

Previously I'd explicitly looked at the final socket buffer sizes during 
TCP_STREAM tests, and emails about that are burried in the archive.  But 
I'd never looked explicitly for request/response tests.

What surprised me was that a TCP request/response test with single-byte 
requests and responses, and TCP_NODELAY set, could have its socket 
buffers grown with say no more than 31 transactions outstanding at one 
time - ie no more than 31 bytes outstanding on the connection in any one 
direction at any one time.

It does seem repeatable

# HDR="-P 1";for b in 28 29 30 31; do netperf -t omni $HDR -H 
15.184.3.62 -- -r 1 -b $b -D -O foo; HDR="-P 0"; done
OMNI Send|Recv TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 15.184.3.62 
(15.184.3.62) port 0 AF_INET : nodelay : histogram
Local       Local       Remote      Remote      Request Response Initial 
  Elapsed Throughput Throughput
Send Socket Recv Socket Send Socket Recv Socket Size    Size     Burst 
   Time               Units
Size        Size        Size        Size        Bytes   Bytes 
Requests (sec)
Final       Final       Final       Final 

16384       87380       16384       87380       1       1        28 
   10.00   200464.51  Trans/s
16384       87380       16384       87380       1       1        29 
   10.00   204136.24  Trans/s
121200      87380       121200      87380       1       1        30 
   10.00   198229.08  Trans/s
121200      87380       121200      87380       1       1        31 
   10.00   196986.98  Trans/s


# HDR="-P 1";for b in 28 29 30 31; do netperf -t omni $HDR -H 
15.184.3.62 -- -r 1 -b $b -D -O foo; HDR="-P 0"; done
OMNI Send|Recv TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 15.184.3.62 
(15.184.3.62) port 0 AF_INET : nodelay : histogram
Local       Local       Remote      Remote      Request Response Initial 
  Elapsed Throughput Throughput
Send Socket Recv Socket Send Socket Recv Socket Size    Size     Burst 
   Time               Units
Size        Size        Size        Size        Bytes   Bytes 
Requests (sec)
Final       Final       Final       Final 

16384       87380       16384       87380       1       1        28 
   10.00   202550.00  Trans/s
16384       87380       16384       87380       1       1        29 
   10.00   194460.50  Trans/s
121200      87380       121200      87380       1       1        30 
   10.00   199372.34  Trans/s
121200      87380       121200      87380       1       1        31 
   10.00   196089.33  Trans/s



The initial burst code does try to "walk up" to the number of 
outstanding requests to avoid getting things lumped together thanks to 
cwnd (*).  Though, a tcpdump trace does show the occasional segment of 
length > 1:

# tcpdump -r /tmp/trans.pcap  tcp and not port 12865 | awk '{print $NF}' 
| sort -n | uniq -c
reading from file /tmp/trans.pcap, link-type EN10MB (Ethernet)
      17 0
1903752 1
      28 2
      29 3
      10 4
      11 5
       9 6
      14 7
      18 8
       9 9
      12 10
       3 11

Still, should that have caused the socket buffers to grow?  FWIW, it 
isn't all single-byte transactions for a burst size of 29 either:

# tcpdump -r /tmp/trans_29.pcap  tcp and not port 12865 | awk '{print 
$NF}' | sort -n | uniq -c
reading from file /tmp/trans_29.pcap, link-type EN10MB (Ethernet)
      13 0
1771215 1
       4 2
       2 3
       3 4
       2 5
       2 6
       1 7
       2 8
       1 9
       1 11

but that does not seem to grow the socket buffers. 2.6.38-8-server on 
both sides through a Mellanox MT26438 operating as 10GbE.

rick jones

* #ifdef WANT_FIRST_BURST
	/* so, since we've gotten a response back, update the
	   bookkeeping accordingly.  there is one less request
	   outstanding and we can put one more out there than before. */
	requests_outstanding -= 1;
	if ((request_cwnd < first_burst_size) &&
	    (NETPERF_IS_RR(direction))) {
	  request_cwnd += 1;
	  if (debug) {
	    fprintf(where,
		    "incr req_cwnd to %d first_burst %d reqs_outstndng %d\n",
		    request_cwnd,
		    first_burst_size,
		    requests_outstanding);
	  }
	}
#endif

Also, some larger burst sizes also cause the receive socket buffer to 
increase:

# HDR="-P 1";for b in 0 1 2 4 16 64 128 256; do netperf -t omni $HDR -H 
15.184.3.62 -- -r 1 -b $b -D -O foo; HDR="-P 0"; done
OMNI Send|Recv TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 15.184.3.62 
(15.184.3.62) port 0 AF_INET : nodelay : histogram
Local       Local       Remote      Remote      Request Response Initial 
  Elapsed Throughput Throughput
Send Socket Recv Socket Send Socket Recv Socket Size    Size     Burst 
   Time               Units
Size        Size        Size        Size        Bytes   Bytes 
Requests (sec)
Final       Final       Final       Final 

16384       87380       16384       87380       1       1        0 
   10.00   20838.10   Trans/s
16384       87380       16384       87380       1       1        1 
   10.00   38204.89   Trans/s
16384       87380       16384       87380       1       1        2 
   10.00   52497.02   Trans/s
16384       87380       16384       87380       1       1        4 
   10.00   70641.97   Trans/s
16384       87380       16384       87380       1       1        16 
   10.00   136965.24  Trans/s
121200      87380       121200      87380       1       1        64 
   10.00   197037.63  Trans/s
121200      87380       16384       87380       1       1        128 
   10.00   203092.56  Trans/s
121200      313248      121200      349392      1       1        256 
   10.00   163766.32  Trans/s

^ permalink raw reply

* [patch net-next-2.6 06/21] atl1e: do vlan cleanup
From: Jiri Pirko @ 2011-07-15 21:33 UTC (permalink / raw)
  To: netdev; +Cc: davem, shemminger, eric.dumazet, greearb, mirqus
In-Reply-To: <1310765619-27827-1-git-send-email-jpirko@redhat.com>

- unify vlan and nonvlan rx path
- kill adapter->vlgrp and atl1e_vlan_rx_register
- enable vlan hw accel always

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
---
 drivers/net/atl1e/atl1e.h      |    1 -
 drivers/net/atl1e/atl1e_main.c |   49 +++++-----------------------------------
 2 files changed, 6 insertions(+), 44 deletions(-)

diff --git a/drivers/net/atl1e/atl1e.h b/drivers/net/atl1e/atl1e.h
index 8c8181b..829b5ad 100644
--- a/drivers/net/atl1e/atl1e.h
+++ b/drivers/net/atl1e/atl1e.h
@@ -433,7 +433,6 @@ struct atl1e_rx_ring {
 struct atl1e_adapter {
 	struct net_device   *netdev;
 	struct pci_dev      *pdev;
-	struct vlan_group   *vlgrp;
 	struct napi_struct  napi;
 	struct mii_if_info  mii;    /* MII interface info */
 	struct atl1e_hw        hw;
diff --git a/drivers/net/atl1e/atl1e_main.c b/drivers/net/atl1e/atl1e_main.c
index c3c5db1..c4c022a 100644
--- a/drivers/net/atl1e/atl1e_main.c
+++ b/drivers/net/atl1e/atl1e_main.c
@@ -313,36 +313,6 @@ static void atl1e_set_multi(struct net_device *netdev)
 	}
 }
 
-static void atl1e_vlan_rx_register(struct net_device *netdev,
-				   struct vlan_group *grp)
-{
-	struct atl1e_adapter *adapter = netdev_priv(netdev);
-	u32 mac_ctrl_data = 0;
-
-	netdev_dbg(adapter->netdev, "%s\n", __func__);
-
-	atl1e_irq_disable(adapter);
-
-	adapter->vlgrp = grp;
-	mac_ctrl_data = AT_READ_REG(&adapter->hw, REG_MAC_CTRL);
-
-	if (grp) {
-		/* enable VLAN tag insert/strip */
-		mac_ctrl_data |= MAC_CTRL_RMV_VLAN;
-	} else {
-		/* disable VLAN tag insert/strip */
-		mac_ctrl_data &= ~MAC_CTRL_RMV_VLAN;
-	}
-
-	AT_WRITE_REG(&adapter->hw, REG_MAC_CTRL, mac_ctrl_data);
-	atl1e_irq_enable(adapter);
-}
-
-static void atl1e_restore_vlan(struct atl1e_adapter *adapter)
-{
-	netdev_dbg(adapter->netdev, "%s\n", __func__);
-	atl1e_vlan_rx_register(adapter->netdev, adapter->vlgrp);
-}
 /*
  * atl1e_set_mac - Change the Ethernet Address of the NIC
  * @netdev: network interface device structure
@@ -1039,8 +1009,7 @@ static void atl1e_setup_mac_ctrl(struct atl1e_adapter *adapter)
 	value |= (((u32)adapter->hw.preamble_len &
 		  MAC_CTRL_PRMLEN_MASK) << MAC_CTRL_PRMLEN_SHIFT);
 
-	if (adapter->vlgrp)
-		value |= MAC_CTRL_RMV_VLAN;
+	value |= MAC_CTRL_RMV_VLAN;
 
 	value |= MAC_CTRL_BC_EN;
 	if (netdev->flags & IFF_PROMISC)
@@ -1423,19 +1392,16 @@ static void atl1e_clean_rx_irq(struct atl1e_adapter *adapter, u8 que,
 			skb->protocol = eth_type_trans(skb, netdev);
 			atl1e_rx_checksum(adapter, skb, prrs);
 
-			if (unlikely(adapter->vlgrp &&
-				(prrs->pkt_flag & RRS_IS_VLAN_TAG))) {
+			if (prrs->pkt_flag & RRS_IS_VLAN_TAG) {
 				u16 vlan_tag = (prrs->vtag >> 4) |
 					       ((prrs->vtag & 7) << 13) |
 					       ((prrs->vtag & 8) << 9);
 				netdev_dbg(netdev,
 					   "RXD VLAN TAG<RRD>=0x%04x\n",
 					   prrs->vtag);
-				vlan_hwaccel_receive_skb(skb, adapter->vlgrp,
-							 vlan_tag);
-			} else {
-				netif_receive_skb(skb);
+				__vlan_hwaccel_put_tag(skb, vlan_tag);
 			}
+			netif_receive_skb(skb);
 
 skip_pkt:
 	/* skip current packet whether it's ok or not. */
@@ -1811,7 +1777,7 @@ static netdev_tx_t atl1e_xmit_frame(struct sk_buff *skb,
 
 	tpd = atl1e_get_tpd(adapter);
 
-	if (unlikely(vlan_tx_tag_present(skb))) {
+	if (vlan_tx_tag_present(skb)) {
 		u16 vlan_tag = vlan_tx_tag_get(skb);
 		u16 atl1e_vlan_tag;
 
@@ -1898,7 +1864,6 @@ int atl1e_up(struct atl1e_adapter *adapter)
 	}
 	atl1e_init_ring_ptrs(adapter);
 	atl1e_set_multi(netdev);
-	atl1e_restore_vlan(adapter);
 
 	if (atl1e_configure(adapter)) {
 		err = -EIO;
@@ -2093,8 +2058,7 @@ static int atl1e_suspend(struct pci_dev *pdev, pm_message_t state)
 				 MAC_CTRL_PRMLEN_MASK) <<
 				 MAC_CTRL_PRMLEN_SHIFT);
 
-		if (adapter->vlgrp)
-			mac_ctrl_data |= MAC_CTRL_RMV_VLAN;
+		mac_ctrl_data |= MAC_CTRL_RMV_VLAN;
 
 		/* magic packet maybe Broadcast&multicast&Unicast frame */
 		if (wufc & AT_WUFC_MAG)
@@ -2198,7 +2162,6 @@ static const struct net_device_ops atl1e_netdev_ops = {
 	.ndo_change_mtu		= atl1e_change_mtu,
 	.ndo_do_ioctl		= atl1e_ioctl,
 	.ndo_tx_timeout		= atl1e_tx_timeout,
-	.ndo_vlan_rx_register	= atl1e_vlan_rx_register,
 #ifdef CONFIG_NET_POLL_CONTROLLER
 	.ndo_poll_controller	= atl1e_netpoll,
 #endif
-- 
1.7.6


^ permalink raw reply related

* [patch net-next-2.6 07/21] bnad: do vlan cleanup
From: Jiri Pirko @ 2011-07-15 21:33 UTC (permalink / raw)
  To: netdev; +Cc: davem, shemminger, eric.dumazet, greearb, mirqus
In-Reply-To: <1310765619-27827-1-git-send-email-jpirko@redhat.com>

- unify vlan and nonvlan rx path
- kill bnad->vlan_grp and bnad_vlan_rx_register

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
---
 drivers/net/bna/bnad.c |   55 ++++++++++++++---------------------------------
 drivers/net/bna/bnad.h |    3 +-
 2 files changed, 19 insertions(+), 39 deletions(-)

diff --git a/drivers/net/bna/bnad.c b/drivers/net/bna/bnad.c
index fa997bf..c89c9b2 100644
--- a/drivers/net/bna/bnad.c
+++ b/drivers/net/bna/bnad.c
@@ -15,6 +15,7 @@
  * All rights reserved
  * www.brocade.com
  */
+#include <linux/bitops.h>
 #include <linux/netdevice.h>
 #include <linux/skbuff.h>
 #include <linux/etherdevice.h>
@@ -24,6 +25,7 @@
 #include <linux/if_ether.h>
 #include <linux/ip.h>
 #include <linux/prefetch.h>
+#include <linux/if_vlan.h>
 
 #include "bnad.h"
 #include "bna.h"
@@ -514,24 +516,16 @@ bnad_poll_cq(struct bnad *bnad, struct bna_ccb *ccb, int budget)
 		rcb->rxq->rx_bytes += skb->len;
 		skb->protocol = eth_type_trans(skb, bnad->netdev);
 
-		if (bnad->vlan_grp && (flags & BNA_CQ_EF_VLAN)) {
-			struct bnad_rx_ctrl *rx_ctrl =
-				(struct bnad_rx_ctrl *)ccb->ctrl;
-			if (skb->ip_summed == CHECKSUM_UNNECESSARY)
-				vlan_gro_receive(&rx_ctrl->napi, bnad->vlan_grp,
-						ntohs(cmpl->vlan_tag), skb);
-			else
-				vlan_hwaccel_receive_skb(skb,
-							 bnad->vlan_grp,
-							 ntohs(cmpl->vlan_tag));
-
-		} else { /* Not VLAN tagged/stripped */
-			struct bnad_rx_ctrl *rx_ctrl =
-				(struct bnad_rx_ctrl *)ccb->ctrl;
-			if (skb->ip_summed == CHECKSUM_UNNECESSARY)
-				napi_gro_receive(&rx_ctrl->napi, skb);
-			else
-				netif_receive_skb(skb);
+		if (flags & BNA_CQ_EF_VLAN)
+			__vlan_hwaccel_put_tag(skb, ntohs(cmpl->vlan_tag));
+
+		if (skb->ip_summed == CHECKSUM_UNNECESSARY) {
+			struct bnad_rx_ctrl *rx_ctrl;
+
+			rx_ctrl = (struct bnad_rx_ctrl *) ccb->ctrl;
+			napi_gro_receive(&rx_ctrl->napi, skb);
+		} else {
+			netif_receive_skb(skb);
 		}
 
 next:
@@ -1981,19 +1975,14 @@ bnad_enable_default_bcast(struct bnad *bnad)
 static void
 bnad_restore_vlans(struct bnad *bnad, u32 rx_id)
 {
-	u16 vlan_id;
+	u16 vid;
 	unsigned long flags;
 
-	if (!bnad->vlan_grp)
-		return;
-
 	BUG_ON(!(VLAN_N_VID == (BFI_MAX_VLAN + 1)));
 
-	for (vlan_id = 0; vlan_id < VLAN_N_VID; vlan_id++) {
-		if (!vlan_group_get_device(bnad->vlan_grp, vlan_id))
-			continue;
+	for_each_set_bit(vid, bnad->active_vlans, VLAN_N_VID) {
 		spin_lock_irqsave(&bnad->bna_lock, flags);
-		bna_rx_vlan_add(bnad->rx_info[rx_id].rx, vlan_id);
+		bna_rx_vlan_add(bnad->rx_info[rx_id].rx, vid);
 		spin_unlock_irqrestore(&bnad->bna_lock, flags);
 	}
 }
@@ -2796,17 +2785,6 @@ bnad_change_mtu(struct net_device *netdev, int new_mtu)
 }
 
 static void
-bnad_vlan_rx_register(struct net_device *netdev,
-				  struct vlan_group *vlan_grp)
-{
-	struct bnad *bnad = netdev_priv(netdev);
-
-	mutex_lock(&bnad->conf_mutex);
-	bnad->vlan_grp = vlan_grp;
-	mutex_unlock(&bnad->conf_mutex);
-}
-
-static void
 bnad_vlan_rx_add_vid(struct net_device *netdev,
 				 unsigned short vid)
 {
@@ -2820,6 +2798,7 @@ bnad_vlan_rx_add_vid(struct net_device *netdev,
 
 	spin_lock_irqsave(&bnad->bna_lock, flags);
 	bna_rx_vlan_add(bnad->rx_info[0].rx, vid);
+	set_bit(vid, bnad->active_vlans);
 	spin_unlock_irqrestore(&bnad->bna_lock, flags);
 
 	mutex_unlock(&bnad->conf_mutex);
@@ -2838,6 +2817,7 @@ bnad_vlan_rx_kill_vid(struct net_device *netdev,
 	mutex_lock(&bnad->conf_mutex);
 
 	spin_lock_irqsave(&bnad->bna_lock, flags);
+	clear_bit(vid, bnad->active_vlans);
 	bna_rx_vlan_del(bnad->rx_info[0].rx, vid);
 	spin_unlock_irqrestore(&bnad->bna_lock, flags);
 
@@ -2887,7 +2867,6 @@ static const struct net_device_ops bnad_netdev_ops = {
 	.ndo_validate_addr      = eth_validate_addr,
 	.ndo_set_mac_address    = bnad_set_mac_address,
 	.ndo_change_mtu		= bnad_change_mtu,
-	.ndo_vlan_rx_register   = bnad_vlan_rx_register,
 	.ndo_vlan_rx_add_vid    = bnad_vlan_rx_add_vid,
 	.ndo_vlan_rx_kill_vid   = bnad_vlan_rx_kill_vid,
 #ifdef CONFIG_NET_POLL_CONTROLLER
diff --git a/drivers/net/bna/bnad.h b/drivers/net/bna/bnad.h
index ccdabad..7aa550b 100644
--- a/drivers/net/bna/bnad.h
+++ b/drivers/net/bna/bnad.h
@@ -24,6 +24,7 @@
 #include <linux/etherdevice.h>
 #include <linux/mutex.h>
 #include <linux/firmware.h>
+#include <linux/if_vlan.h>
 
 /* Fix for IA64 */
 #include <asm/checksum.h>
@@ -216,7 +217,7 @@ struct bnad {
 	struct bnad_tx_info tx_info[BNAD_MAX_TXS];
 	struct bnad_rx_info rx_info[BNAD_MAX_RXS];
 
-	struct vlan_group	*vlan_grp;
+	unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)];
 	/*
 	 * These q numbers are global only because
 	 * they are used to calculate MSIx vectors.
-- 
1.7.6


^ permalink raw reply related

* [patch net-next-2.6 08/21] chelsio: do vlan cleanup
From: Jiri Pirko @ 2011-07-15 21:33 UTC (permalink / raw)
  To: netdev; +Cc: davem, shemminger, eric.dumazet, greearb, mirqus
In-Reply-To: <1310765619-27827-1-git-send-email-jpirko@redhat.com>

- unify vlan and nonvlan rx path
- kill adapter->vlan_grp and t1_vlan_rx_register
- always enable vlan hw accel

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
---
 drivers/net/chelsio/common.h |    2 --
 drivers/net/chelsio/cxgb2.c  |   19 +------------------
 drivers/net/chelsio/sge.c    |   11 ++++-------
 3 files changed, 5 insertions(+), 27 deletions(-)

diff --git a/drivers/net/chelsio/common.h b/drivers/net/chelsio/common.h
index c26d863..5ccbed1 100644
--- a/drivers/net/chelsio/common.h
+++ b/drivers/net/chelsio/common.h
@@ -240,8 +240,6 @@ struct adapter {
 	struct work_struct ext_intr_handler_task;
 	struct adapter_params params;
 
-	struct vlan_group *vlan_grp;
-
 	/* Terminator modules. */
 	struct sge    *sge;
 	struct peespi *espi;
diff --git a/drivers/net/chelsio/cxgb2.c b/drivers/net/chelsio/cxgb2.c
index b422d83..61731bc 100644
--- a/drivers/net/chelsio/cxgb2.c
+++ b/drivers/net/chelsio/cxgb2.c
@@ -227,6 +227,7 @@ static int cxgb_up(struct adapter *adapter)
 		goto out_err;
 	}
 
+	t1_set_vlan_accel(adapter, 1);
 	t1_sge_start(adapter->sge);
 	t1_interrupts_enable(adapter);
 out_err:
@@ -849,19 +850,6 @@ static int t1_set_mac_addr(struct net_device *dev, void *p)
 	return 0;
 }
 
-#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
-static void t1_vlan_rx_register(struct net_device *dev,
-				   struct vlan_group *grp)
-{
-	struct adapter *adapter = dev->ml_priv;
-
-	spin_lock_irq(&adapter->async_lock);
-	adapter->vlan_grp = grp;
-	t1_set_vlan_accel(adapter, grp != NULL);
-	spin_unlock_irq(&adapter->async_lock);
-}
-#endif
-
 #ifdef CONFIG_NET_POLL_CONTROLLER
 static void t1_netpoll(struct net_device *dev)
 {
@@ -955,9 +943,6 @@ static const struct net_device_ops cxgb_netdev_ops = {
 	.ndo_do_ioctl		= t1_ioctl,
 	.ndo_change_mtu		= t1_change_mtu,
 	.ndo_set_mac_address	= t1_set_mac_addr,
-#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
-	.ndo_vlan_rx_register	= t1_vlan_rx_register,
-#endif
 #ifdef CONFIG_NET_POLL_CONTROLLER
 	.ndo_poll_controller	= t1_netpoll,
 #endif
@@ -1080,10 +1065,8 @@ static int __devinit init_one(struct pci_dev *pdev,
 		if (pci_using_dac)
 			netdev->features |= NETIF_F_HIGHDMA;
 		if (vlan_tso_capable(adapter)) {
-#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
 			netdev->features |=
 				NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
-#endif
 
 			/* T204: disable TSO */
 			if (!(is_T2(adapter)) || bi->port_number != 4) {
diff --git a/drivers/net/chelsio/sge.c b/drivers/net/chelsio/sge.c
index 58380d2..449ebf3 100644
--- a/drivers/net/chelsio/sge.c
+++ b/drivers/net/chelsio/sge.c
@@ -1397,12 +1397,11 @@ static void sge_rx(struct sge *sge, struct freelQ *fl, unsigned int len)
 	} else
 		skb_checksum_none_assert(skb);
 
-	if (unlikely(adapter->vlan_grp && p->vlan_valid)) {
+	if (p->vlan_valid) {
 		st->vlan_xtract++;
-		vlan_hwaccel_receive_skb(skb, adapter->vlan_grp,
-					 ntohs(p->vlan));
-	} else
-		netif_receive_skb(skb);
+		__vlan_hwaccel_put_tag(skb, ntohs(p->vlan));
+	}
+	netif_receive_skb(skb);
 }
 
 /*
@@ -1875,13 +1874,11 @@ netdev_tx_t t1_start_xmit(struct sk_buff *skb, struct net_device *dev)
 	}
 	cpl->iff = dev->if_port;
 
-#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
 	if (vlan_tx_tag_present(skb)) {
 		cpl->vlan_valid = 1;
 		cpl->vlan = htons(vlan_tx_tag_get(skb));
 		st->vlan_insert++;
 	} else
-#endif
 		cpl->vlan_valid = 0;
 
 send:
-- 
1.7.6


^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox