Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH] iproute2: initialize the ll_map only once
From: Stephen Hemminger @ 2010-12-10 19:38 UTC (permalink / raw)
  To: Octavian Purdila; +Cc: netdev, Lucian Adrian Grijincu, Vlad Dogaru
In-Reply-To: <1291993190-8838-1-git-send-email-opurdila@ixiacom.com>

On Fri, 10 Dec 2010 16:59:50 +0200
Octavian Purdila <opurdila@ixiacom.com> wrote:

> Avoid initializing the LL map (which involves a costly RTNL dump)
> multiple times. This can happen when running in batch mode.
> 
> Signed-off-by: Octavian Purdila <opurdila@ixiacom.com>

applied
-- 

^ permalink raw reply

* Re: unable to handle kernel NULL pointer dereference in skb_dequeue
From: Denys Fedoryshchenko @ 2010-12-10 19:51 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: Andrej Ota, linux-kernel, gvs, Rami Rosen, netdev
In-Reply-To: <1291387595.2897.350.camel@edumazet-laptop>

On Friday 03 December 2010 16:46:35 Eric Dumazet wrote:
> Le vendredi 03 décembre 2010 à 15:37 +0100, Andrej Ota a écrit :
> > >> Patch that works for me is below. Now I only hope I haven't
> > >> (re)introduced a memory leak...
> > > 
> > > Problem comes from commit 55c95e738da85 (fix return value of
> > > __pppoe_xmit() method)
> > > 
> > > I am not sure patch is OK
> > 
> > Me neither. That's why I wrote "works for me". All I dare say is that it
> > works better than current code and is probably no worse than it was
> > before above mentioned commit. Apart from that, there is no point in
> > having return value for __pppoe_xmit if return value isn't needed.
> > 
> > Easiest way of triggering this BUG is by terminating PPPoE on the server
> > side, which then hits "if (!dev) { goto abort; }". This in turn calls
> > "kfree_skb(skb); return 0;" which returns to pppoe_rcv_core which then
> > goto-s to "abort_put" which again calls "kfree_skb(skb)". Voila the bug.
> > 
> > I don't know how to trigger "if (skb_cow_head(skb, ..." to see if I have
> > just caused another BUG. However, if I read file comments at the top, I
> > see a comment from 19/07/01 stating that I have to delete original skb
> > if code succeeds and never delete it on failure. About the skb copy
> > mentioned in the same comment, I don't know. 2001 was many commits ago.
> 
> Well, all I wanted to say was that _I_ was not sure, but probably other
> network guys have a better diagnostic.
> 
> Rami, could you re-explain the rationale of your patch ?
> 
> Thanks
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Is there any plans to queue any patch to stable?
pppoe is almost dead in 2.6.36.*

^ permalink raw reply

* RE: [net-next-2.6 25/27] e1000e: static analysis tools complain of a possible null ptr p dereference
From: Joe Perches @ 2010-12-10 19:58 UTC (permalink / raw)
  To: Tantilov, Emil S
  Cc: Kirsher, Jeffrey T, davem@davemloft.net, Allan, Bruce W,
	netdev@vger.kernel.org, gospo@redhat.com, bphilips@novell.com,
	netdev@vger.kernel.org, gospo@redhat.com, bphilips@novell.com
In-Reply-To: <EA929A9653AAE14F841771FB1DE5A136602D54FD2F@rrsmsx501.amr.corp.intel.com>

On Fri, 2010-12-10 at 12:35 -0700, Tantilov, Emil S wrote:
> >On Fri, 2010-12-10 at 02:06 -0800, Jeff Kirsher wrote:
> >> diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
> >[]
> >> +		default:
> >> +			data[i] = 0;
> >> +			continue;
> >> +			break;
> >Using
> >	continue;
> >	break;
> >is odd and unhelpful.
> >Just continue; is sufficient and clear.
> It's odd and without consequence but not necessarily "unhelpful" as it
> can protect from bugs in case someone was to add another case
> statement.

continue statements are not fall-through.

Adding another case statement in the switch below
this case label would work just fine.

> While unlikely, bugs in switch statements due to missing breaks are
> not unheard of.

True, but that's not this case.

> Looking at the kernel source there is no consistency as far as break
> in the default: case is concerned.

It's not the break, it's the break after continue that's odd.

Glancing through the source code using
	$ grep -rP --include=*.[ch] -B 3 "\bcontinue\s*;\s*break\s*;" *
this is a pretty unusual coding style.

Most all of the matches are like:
	if (condition)
		continue;
	break;

Your choice, your code.  I just think it's ugly
as well as odd and unhelpful.

cheers, Joe


^ permalink raw reply

* Re: [net-next-2.6 25/27] e1000e: static analysis tools complain of a possible null ptr p dereference
From: David Miller @ 2010-12-10 20:16 UTC (permalink / raw)
  To: emil.s.tantilov
  Cc: joe, jeffrey.t.kirsher, davem, bruce.w.allan, netdev, gospo,
	bphilips
In-Reply-To: <EA929A9653AAE14F841771FB1DE5A136602D54FD2F@rrsmsx501.amr.corp.intel.com>

From: "Tantilov, Emil S" <emil.s.tantilov@intel.com>
Date: Fri, 10 Dec 2010 12:35:45 -0700

> Dave, unless this is infringing on some coding style rule, I would request that the patch be applied as is.

I think Ben's request is more than reasonable.  Please make his requested
change.  "continue; break;" looks quite silly to me too.

^ permalink raw reply

* Re: unable to handle kernel NULL pointer dereference in skb_dequeue
From: David Miller @ 2010-12-10 20:18 UTC (permalink / raw)
  To: nuclearcat; +Cc: eric.dumazet, andrej, linux-kernel, gvs, ramirose, netdev
In-Reply-To: <201012102151.04983.nuclearcat@nuclearcat.com>

From: Denys Fedoryshchenko <nuclearcat@nuclearcat.com>
Date: Fri, 10 Dec 2010 21:51:04 +0200

> On Friday 03 December 2010 16:46:35 Eric Dumazet wrote:
>> Le vendredi 03 décembre 2010 à 15:37 +0100, Andrej Ota a écrit :
>> > >> Patch that works for me is below. Now I only hope I haven't
>> > >> (re)introduced a memory leak...
>> > > 
>> > > Problem comes from commit 55c95e738da85 (fix return value of
>> > > __pppoe_xmit() method)
>> > > 
>> > > I am not sure patch is OK
>> > 
>> > Me neither. That's why I wrote "works for me". All I dare say is that it
>> > works better than current code and is probably no worse than it was
>> > before above mentioned commit. Apart from that, there is no point in
>> > having return value for __pppoe_xmit if return value isn't needed.
>> > 
>> > Easiest way of triggering this BUG is by terminating PPPoE on the server
>> > side, which then hits "if (!dev) { goto abort; }". This in turn calls
>> > "kfree_skb(skb); return 0;" which returns to pppoe_rcv_core which then
>> > goto-s to "abort_put" which again calls "kfree_skb(skb)". Voila the bug.
>> > 
>> > I don't know how to trigger "if (skb_cow_head(skb, ..." to see if I have
>> > just caused another BUG. However, if I read file comments at the top, I
>> > see a comment from 19/07/01 stating that I have to delete original skb
>> > if code succeeds and never delete it on failure. About the skb copy
>> > mentioned in the same comment, I don't know. 2001 was many commits ago.
>> 
>> Well, all I wanted to say was that _I_ was not sure, but probably other
>> network guys have a better diagnostic.
>> 
>> Rami, could you re-explain the rationale of your patch ?
>> 
>> Thanks
>> 
>> 
>> --
>> To unsubscribe from this list: send the line "unsubscribe netdev" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Is there any plans to queue any patch to stable?
> pppoe is almost dead in 2.6.36.*

I'll deal with it for -stable once I evaluate this patch for upstream,
which I haven't even gotten to yet.

When people bark about -stable this and -stable that, it just takes
more time away from me actually getting through all the patches.  If
it causes a crash, I know it should go to stable and I'll take care of
it.  So there is no need to make an explicit note or query about it.

Thanks.

^ permalink raw reply

* Re: [net-next-2.6 03/27] Documentation/networking/igb.txt: update documentation
From: David Miller @ 2010-12-10 20:21 UTC (permalink / raw)
  To: bhutchings; +Cc: jeffrey.t.kirsher, davem, netdev, gospo, bphilips
In-Reply-To: <1291996224.11673.2.camel@bwh-desktop>

From: Ben Hutchings <bhutchings@solarflare.com>
Date: Fri, 10 Dec 2010 15:50:24 +0000

> On Fri, 2010-12-10 at 01:50 -0800, Jeff Kirsher wrote:
>> Update Intel Wired LAN igb documentation.
>> 
>> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
>> ---
>>  Documentation/networking/igb.txt |   22 +++++++++++++++++++---
>>  1 files changed, 19 insertions(+), 3 deletions(-)
>> 
>> diff --git a/Documentation/networking/igb.txt b/Documentation/networking/igb.txt
>> index ab2d718..393bdb7 100644
>> --- a/Documentation/networking/igb.txt
>> +++ b/Documentation/networking/igb.txt
>> @@ -36,6 +36,7 @@ Default Value: 0
>>  This parameter adds support for SR-IOV.  It causes the driver to spawn up to
>>  max_vfs worth of virtual function.
>>  
>> +
>>  Additional Configurations
>>  =========================
>>  
>> @@ -60,7 +61,8 @@ Additional Configurations
>>    Ethtool
>>    -------
>>    The driver utilizes the ethtool interface for driver configuration and
>> -  diagnostics, as well as displaying statistical information.
>> +  diagnostics, as well as displaying statistical information. The latest
>> +  version of Ethtool can be found at:
>>  
>>    http://sourceforge.net/projects/gkernel.
> 
> Please update this to:
> http://ftp.kernel.org/pub/software/network/ethtool/

Indeed.

Intel folks, please address all of Ben's feedback and respin this
pull request, thanks.

^ permalink raw reply

* Re: [PATCH] connector: add module alias
From: David Miller @ 2010-12-10 20:28 UTC (permalink / raw)
  To: zbr; +Cc: shemminger, netdev
In-Reply-To: <20101209184746.GA2476@ioremap.net>

From: Evgeniy Polyakov <zbr@ioremap.net>
Date: Thu, 9 Dec 2010 21:47:46 +0300

> On Thu, Dec 09, 2010 at 09:36:46AM -0800, Stephen Hemminger (shemminger@vyatta.com) wrote:
>> Since connector can be built as a module and uses netlink socket
>> to communicate. The module should have an alias to autoload when socket
>> of NETLINK_CONNECTOR type is requested.
> 
> Ack, thank you.

Please use formalized "Acked-by: " tags so that the automated tools do
all the work for me and I don't have to type it in by hand.

> David, please apply.

Done, thanks.

^ permalink raw reply

* pull request: wireless-2.6 2010-12-10
From: John W. Linville @ 2010-12-10 20:29 UTC (permalink / raw)
  To: davem; +Cc: linux-wireless, netdev, linux-kernel

Dave,

Here is the latest round of wireless bits intended for 2.6.37...

Included are some orinoco fixes, one to avoid the crash in bug 23932 and
two others that render TKIP countermeasures ineffective (i.e. decreased
security).  Helmut has provided us a fix to avoid a BUG when using
shared skbs.  The ath9k team gives us a fix for failed resumes on
ath9k_htc, a fix for detecting broadcast frames with a MIC failure, a
fix for a null pointer access when generating beacons, and a DMA issue
that can lead to memory corruption.  Matteo Croce pitches-in with a fix
to prevent transmitting with too much power.  Finally,  Javier Cardona
provides a trio of ath5k fixes that restore mesh function on those
devices.

Please let me know if there are problems!

Thanks,

John

---

The following changes since commit f19872575ff7819a3723154657a497d9bca66b33:

  tcp: protect sysctl_tcp_cookie_size reads (2010-12-08 12:34:09 -0800)

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

David Kilroy (3):
      orinoco: initialise priv->hw before assigning the interrupt
      orinoco: clear countermeasure setting on commit
      orinoco: fix TKIP countermeasure behaviour

Felix Fietkau (1):
      ath9k: fix a DMA related race condition on reset

Helmut Schaa (1):
      mac80211: Fix BUG in pskb_expand_head when transmitting shared skbs

Javier Cardona (3):
      ath5k: Fix beaconing in mesh mode
      ath5k: Prevent mesh interfaces from being counted as ad-hoc
      ath5k: Put the right tsf value in mesh beacons

Matteo Croce (1):
      ath9k: fix bug in tx power

Rajkumar Manoharan (1):
      ath9k: fix beacon resource related race condition

Senthil Balasubramanian (1):
      ath9k: Fix STA disconnect issue due to received MIC failed bcast frames

Sujith Manoharan (1):
      ath9k_htc: Fix suspend/resume

 drivers/net/wireless/ath/ath5k/base.c         |   13 +++++++----
 drivers/net/wireless/ath/ath9k/ath9k.h        |    2 +-
 drivers/net/wireless/ath/ath9k/eeprom_def.c   |   12 +++++++---
 drivers/net/wireless/ath/ath9k/hif_usb.c      |    7 ++++++
 drivers/net/wireless/ath/ath9k/htc.h          |    3 ++
 drivers/net/wireless/ath/ath9k/htc_drv_init.c |    6 +++++
 drivers/net/wireless/ath/ath9k/htc_drv_main.c |    4 +-
 drivers/net/wireless/ath/ath9k/mac.c          |    3 +-
 drivers/net/wireless/ath/ath9k/main.c         |   26 +++++++++---------------
 drivers/net/wireless/ath/ath9k/recv.c         |    9 +++++++-
 drivers/net/wireless/ath/ath9k/xmit.c         |   22 +++++---------------
 drivers/net/wireless/orinoco/main.c           |    6 +++++
 drivers/net/wireless/orinoco/orinoco_cs.c     |   14 ++++++------
 drivers/net/wireless/orinoco/spectrum_cs.c    |   14 ++++++------
 drivers/net/wireless/orinoco/wext.c           |    4 +-
 net/mac80211/tx.c                             |   21 +++++++++++++++++--
 16 files changed, 100 insertions(+), 66 deletions(-)

diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 8251946..42ed923 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -1917,7 +1917,8 @@ ath5k_beacon_send(struct ath5k_softc *sc)
 		sc->bmisscount = 0;
 	}
 
-	if (sc->opmode == NL80211_IFTYPE_AP && sc->num_ap_vifs > 1) {
+	if ((sc->opmode == NL80211_IFTYPE_AP && sc->num_ap_vifs > 1) ||
+			sc->opmode == NL80211_IFTYPE_MESH_POINT) {
 		u64 tsf = ath5k_hw_get_tsf64(ah);
 		u32 tsftu = TSF_TO_TU(tsf);
 		int slot = ((tsftu % sc->bintval) * ATH_BCBUF) / sc->bintval;
@@ -1949,8 +1950,9 @@ ath5k_beacon_send(struct ath5k_softc *sc)
 		/* NB: hw still stops DMA, so proceed */
 	}
 
-	/* refresh the beacon for AP mode */
-	if (sc->opmode == NL80211_IFTYPE_AP)
+	/* refresh the beacon for AP or MESH mode */
+	if (sc->opmode == NL80211_IFTYPE_AP ||
+			sc->opmode == NL80211_IFTYPE_MESH_POINT)
 		ath5k_beacon_update(sc->hw, vif);
 
 	ath5k_hw_set_txdp(ah, sc->bhalq, bf->daddr);
@@ -2851,7 +2853,8 @@ static int ath5k_add_interface(struct ieee80211_hw *hw,
 
 	/* Assign the vap/adhoc to a beacon xmit slot. */
 	if ((avf->opmode == NL80211_IFTYPE_AP) ||
-	    (avf->opmode == NL80211_IFTYPE_ADHOC)) {
+	    (avf->opmode == NL80211_IFTYPE_ADHOC) ||
+	    (avf->opmode == NL80211_IFTYPE_MESH_POINT)) {
 		int slot;
 
 		WARN_ON(list_empty(&sc->bcbuf));
@@ -2870,7 +2873,7 @@ static int ath5k_add_interface(struct ieee80211_hw *hw,
 		sc->bslot[avf->bslot] = vif;
 		if (avf->opmode == NL80211_IFTYPE_AP)
 			sc->num_ap_vifs++;
-		else
+		else if (avf->opmode == NL80211_IFTYPE_ADHOC)
 			sc->num_adhoc_vifs++;
 	}
 
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index 0d0bec3..0963071 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -329,7 +329,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp);
 struct ath_txq *ath_txq_setup(struct ath_softc *sc, int qtype, int subtype);
 void ath_tx_cleanupq(struct ath_softc *sc, struct ath_txq *txq);
 int ath_tx_setup(struct ath_softc *sc, int haltype);
-void ath_drain_all_txq(struct ath_softc *sc, bool retry_tx);
+bool ath_drain_all_txq(struct ath_softc *sc, bool retry_tx);
 void ath_draintxq(struct ath_softc *sc,
 		     struct ath_txq *txq, bool retry_tx);
 void ath_tx_node_init(struct ath_softc *sc, struct ath_node *an);
diff --git a/drivers/net/wireless/ath/ath9k/eeprom_def.c b/drivers/net/wireless/ath/ath9k/eeprom_def.c
index 526d7c9..a3ccb1b 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom_def.c
+++ b/drivers/net/wireless/ath/ath9k/eeprom_def.c
@@ -1063,15 +1063,19 @@ static void ath9k_hw_set_def_power_per_rate_table(struct ath_hw *ah,
 	case 1:
 		break;
 	case 2:
-		scaledPower -= REDUCE_SCALED_POWER_BY_TWO_CHAIN;
+		if (scaledPower > REDUCE_SCALED_POWER_BY_TWO_CHAIN)
+			scaledPower -= REDUCE_SCALED_POWER_BY_TWO_CHAIN;
+		else
+			scaledPower = 0;
 		break;
 	case 3:
-		scaledPower -= REDUCE_SCALED_POWER_BY_THREE_CHAIN;
+		if (scaledPower > REDUCE_SCALED_POWER_BY_THREE_CHAIN)
+			scaledPower -= REDUCE_SCALED_POWER_BY_THREE_CHAIN;
+		else
+			scaledPower = 0;
 		break;
 	}
 
-	scaledPower = max((u16)0, scaledPower);
-
 	if (IS_CHAN_2GHZ(chan)) {
 		numCtlModes = ARRAY_SIZE(ctlModesFor11g) -
 			SUB_NUM_CTL_MODES_AT_2G_40;
diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c
index dfb6560..0de3c3d 100644
--- a/drivers/net/wireless/ath/ath9k/hif_usb.c
+++ b/drivers/net/wireless/ath/ath9k/hif_usb.c
@@ -1024,6 +1024,13 @@ static int ath9k_hif_usb_suspend(struct usb_interface *interface,
 	struct hif_device_usb *hif_dev =
 		(struct hif_device_usb *) usb_get_intfdata(interface);
 
+	/*
+	 * The device has to be set to FULLSLEEP mode in case no
+	 * interface is up.
+	 */
+	if (!(hif_dev->flags & HIF_USB_START))
+		ath9k_htc_suspend(hif_dev->htc_handle);
+
 	ath9k_hif_usb_dealloc_urbs(hif_dev);
 
 	return 0;
diff --git a/drivers/net/wireless/ath/ath9k/htc.h b/drivers/net/wireless/ath/ath9k/htc.h
index 75ecf6a..c3b561d 100644
--- a/drivers/net/wireless/ath/ath9k/htc.h
+++ b/drivers/net/wireless/ath/ath9k/htc.h
@@ -455,6 +455,8 @@ u32 ath9k_htc_calcrxfilter(struct ath9k_htc_priv *priv);
 void ath9k_htc_ps_wakeup(struct ath9k_htc_priv *priv);
 void ath9k_htc_ps_restore(struct ath9k_htc_priv *priv);
 void ath9k_ps_work(struct work_struct *work);
+bool ath9k_htc_setpower(struct ath9k_htc_priv *priv,
+			enum ath9k_power_mode mode);
 
 void ath9k_start_rfkill_poll(struct ath9k_htc_priv *priv);
 void ath9k_init_leds(struct ath9k_htc_priv *priv);
@@ -464,6 +466,7 @@ int ath9k_htc_probe_device(struct htc_target *htc_handle, struct device *dev,
 			   u16 devid, char *product);
 void ath9k_htc_disconnect_device(struct htc_target *htc_handle, bool hotunplug);
 #ifdef CONFIG_PM
+void ath9k_htc_suspend(struct htc_target *htc_handle);
 int ath9k_htc_resume(struct htc_target *htc_handle);
 #endif
 #ifdef CONFIG_ATH9K_HTC_DEBUGFS
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
index 7c8a38d..8776f49 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
@@ -891,6 +891,12 @@ void ath9k_htc_disconnect_device(struct htc_target *htc_handle, bool hotunplug)
 }
 
 #ifdef CONFIG_PM
+
+void ath9k_htc_suspend(struct htc_target *htc_handle)
+{
+	ath9k_htc_setpower(htc_handle->drv_priv, ATH9K_PM_FULL_SLEEP);
+}
+
 int ath9k_htc_resume(struct htc_target *htc_handle)
 {
 	int ret;
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index 9a3be8d..51977ca 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -63,8 +63,8 @@ static enum htc_phymode ath9k_htc_get_curmode(struct ath9k_htc_priv *priv,
 	return mode;
 }
 
-static bool ath9k_htc_setpower(struct ath9k_htc_priv *priv,
-			       enum ath9k_power_mode mode)
+bool ath9k_htc_setpower(struct ath9k_htc_priv *priv,
+			enum ath9k_power_mode mode)
 {
 	bool ret;
 
diff --git a/drivers/net/wireless/ath/ath9k/mac.c b/drivers/net/wireless/ath/ath9k/mac.c
index 8c13479..c996963 100644
--- a/drivers/net/wireless/ath/ath9k/mac.c
+++ b/drivers/net/wireless/ath/ath9k/mac.c
@@ -703,8 +703,7 @@ int ath9k_hw_rxprocdesc(struct ath_hw *ah, struct ath_desc *ds,
 			rs->rs_phyerr = phyerr;
 		} else if (ads.ds_rxstatus8 & AR_DecryptCRCErr)
 			rs->rs_status |= ATH9K_RXERR_DECRYPT;
-		else if ((ads.ds_rxstatus8 & AR_MichaelErr) &&
-		         rs->rs_keyix != ATH9K_RXKEYIX_INVALID)
+		else if (ads.ds_rxstatus8 & AR_MichaelErr)
 			rs->rs_status |= ATH9K_RXERR_MIC;
 		else if (ads.ds_rxstatus8 & AR_KeyMiss)
 			rs->rs_status |= ATH9K_RXERR_DECRYPT;
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index dace215..c0c3464 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -244,11 +244,12 @@ int ath_set_channel(struct ath_softc *sc, struct ieee80211_hw *hw,
 	 * the relevant bits of the h/w.
 	 */
 	ath9k_hw_set_interrupts(ah, 0);
-	ath_drain_all_txq(sc, false);
+	stopped = ath_drain_all_txq(sc, false);
 
 	spin_lock_bh(&sc->rx.pcu_lock);
 
-	stopped = ath_stoprecv(sc);
+	if (!ath_stoprecv(sc))
+		stopped = false;
 
 	/* XXX: do not flush receive queue here. We don't want
 	 * to flush data frames already in queue because of
@@ -1519,8 +1520,6 @@ static void ath9k_remove_interface(struct ieee80211_hw *hw,
 	struct ath_softc *sc = aphy->sc;
 	struct ath_common *common = ath9k_hw_common(sc->sc_ah);
 	struct ath_vif *avp = (void *)vif->drv_priv;
-	bool bs_valid = false;
-	int i;
 
 	ath_print(common, ATH_DBG_CONFIG, "Detach Interface\n");
 
@@ -1534,26 +1533,21 @@ static void ath9k_remove_interface(struct ieee80211_hw *hw,
 	if ((sc->sc_ah->opmode == NL80211_IFTYPE_AP) ||
 	    (sc->sc_ah->opmode == NL80211_IFTYPE_ADHOC) ||
 	    (sc->sc_ah->opmode == NL80211_IFTYPE_MESH_POINT)) {
+		/* Disable SWBA interrupt */
+		sc->sc_ah->imask &= ~ATH9K_INT_SWBA;
 		ath9k_ps_wakeup(sc);
+		ath9k_hw_set_interrupts(sc->sc_ah, sc->sc_ah->imask);
 		ath9k_hw_stoptxdma(sc->sc_ah, sc->beacon.beaconq);
 		ath9k_ps_restore(sc);
+		tasklet_kill(&sc->bcon_tasklet);
 	}
 
 	ath_beacon_return(sc, avp);
 	sc->sc_flags &= ~SC_OP_BEACONS;
 
-	for (i = 0; i < ARRAY_SIZE(sc->beacon.bslot); i++) {
-		if (sc->beacon.bslot[i] == vif) {
-			printk(KERN_DEBUG "%s: vif had allocated beacon "
-			       "slot\n", __func__);
-			sc->beacon.bslot[i] = NULL;
-			sc->beacon.bslot_aphy[i] = NULL;
-		} else if (sc->beacon.bslot[i])
-			bs_valid = true;
-	}
-	if (!bs_valid && (sc->sc_ah->imask & ATH9K_INT_SWBA)) {
-		/* Disable SWBA interrupt */
-		sc->sc_ah->imask &= ~ATH9K_INT_SWBA;
+	if (sc->nbcnvifs) {
+		/* Re-enable SWBA interrupt */
+		sc->sc_ah->imask |= ATH9K_INT_SWBA;
 		ath9k_ps_wakeup(sc);
 		ath9k_hw_set_interrupts(sc->sc_ah, sc->sc_ah->imask);
 		ath9k_ps_restore(sc);
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index 1a62e35..fdc2ec5 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -838,6 +838,10 @@ static bool ath9k_rx_accept(struct ath_common *common,
 			    struct ath_rx_status *rx_stats,
 			    bool *decrypt_error)
 {
+#define is_mc_or_valid_tkip_keyix ((is_mc ||			\
+		(rx_stats->rs_keyix != ATH9K_RXKEYIX_INVALID && \
+		test_bit(rx_stats->rs_keyix, common->tkip_keymap))))
+
 	struct ath_hw *ah = common->ah;
 	__le16 fc;
 	u8 rx_status_len = ah->caps.rx_status_len;
@@ -879,15 +883,18 @@ static bool ath9k_rx_accept(struct ath_common *common,
 		if (rx_stats->rs_status & ATH9K_RXERR_DECRYPT) {
 			*decrypt_error = true;
 		} else if (rx_stats->rs_status & ATH9K_RXERR_MIC) {
+			bool is_mc;
 			/*
 			 * The MIC error bit is only valid if the frame
 			 * is not a control frame or fragment, and it was
 			 * decrypted using a valid TKIP key.
 			 */
+			is_mc = !!is_multicast_ether_addr(hdr->addr1);
+
 			if (!ieee80211_is_ctl(fc) &&
 			    !ieee80211_has_morefrags(fc) &&
 			    !(le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_FRAG) &&
-			    test_bit(rx_stats->rs_keyix, common->tkip_keymap))
+			    is_mc_or_valid_tkip_keyix)
 				rxs->flag |= RX_FLAG_MMIC_ERROR;
 			else
 				rx_stats->rs_status &= ~ATH9K_RXERR_MIC;
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index f2ade24..aff0478 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -1120,7 +1120,7 @@ void ath_draintxq(struct ath_softc *sc, struct ath_txq *txq, bool retry_tx)
 	}
 }
 
-void ath_drain_all_txq(struct ath_softc *sc, bool retry_tx)
+bool ath_drain_all_txq(struct ath_softc *sc, bool retry_tx)
 {
 	struct ath_hw *ah = sc->sc_ah;
 	struct ath_common *common = ath9k_hw_common(sc->sc_ah);
@@ -1128,7 +1128,7 @@ void ath_drain_all_txq(struct ath_softc *sc, bool retry_tx)
 	int i, npend = 0;
 
 	if (sc->sc_flags & SC_OP_INVALID)
-		return;
+		return true;
 
 	/* Stop beacon queue */
 	ath9k_hw_stoptxdma(sc->sc_ah, sc->beacon.beaconq);
@@ -1142,25 +1142,15 @@ void ath_drain_all_txq(struct ath_softc *sc, bool retry_tx)
 		}
 	}
 
-	if (npend) {
-		int r;
-
-		ath_print(common, ATH_DBG_FATAL,
-			  "Failed to stop TX DMA. Resetting hardware!\n");
-
-		spin_lock_bh(&sc->sc_resetlock);
-		r = ath9k_hw_reset(ah, sc->sc_ah->curchan, ah->caldata, false);
-		if (r)
-			ath_print(common, ATH_DBG_FATAL,
-				  "Unable to reset hardware; reset status %d\n",
-				  r);
-		spin_unlock_bh(&sc->sc_resetlock);
-	}
+	if (npend)
+		ath_print(common, ATH_DBG_FATAL, "Failed to stop TX DMA!\n");
 
 	for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++) {
 		if (ATH_TXQ_SETUP(sc, i))
 			ath_draintxq(sc, &sc->tx.txq[i], retry_tx);
 	}
+
+	return !npend;
 }
 
 void ath_tx_cleanupq(struct ath_softc *sc, struct ath_txq *txq)
diff --git a/drivers/net/wireless/orinoco/main.c b/drivers/net/wireless/orinoco/main.c
index fa0cf74..f3d396e 100644
--- a/drivers/net/wireless/orinoco/main.c
+++ b/drivers/net/wireless/orinoco/main.c
@@ -1811,6 +1811,12 @@ static int __orinoco_commit(struct orinoco_private *priv)
 	struct net_device *dev = priv->ndev;
 	int err = 0;
 
+	/* If we've called commit, we are reconfiguring or bringing the
+	 * interface up. Maintaining countermeasures across this would
+	 * be confusing, so note that we've disabled them. The port will
+	 * be enabled later in orinoco_commit or __orinoco_up. */
+	priv->tkip_cm_active = 0;
+
 	err = orinoco_hw_program_rids(priv);
 
 	/* FIXME: what about netif_tx_lock */
diff --git a/drivers/net/wireless/orinoco/orinoco_cs.c b/drivers/net/wireless/orinoco/orinoco_cs.c
index 71b3d68..32954c4 100644
--- a/drivers/net/wireless/orinoco/orinoco_cs.c
+++ b/drivers/net/wireless/orinoco/orinoco_cs.c
@@ -151,20 +151,20 @@ orinoco_cs_config(struct pcmcia_device *link)
 		goto failed;
 	}
 
-	ret = pcmcia_request_irq(link, orinoco_interrupt);
-	if (ret)
-		goto failed;
-
-	/* We initialize the hermes structure before completing PCMCIA
-	 * configuration just in case the interrupt handler gets
-	 * called. */
 	mem = ioport_map(link->resource[0]->start,
 			resource_size(link->resource[0]));
 	if (!mem)
 		goto failed;
 
+	/* We initialize the hermes structure before completing PCMCIA
+	 * configuration just in case the interrupt handler gets
+	 * called. */
 	hermes_struct_init(hw, mem, HERMES_16BIT_REGSPACING);
 
+	ret = pcmcia_request_irq(link, orinoco_interrupt);
+	if (ret)
+		goto failed;
+
 	ret = pcmcia_enable_device(link);
 	if (ret)
 		goto failed;
diff --git a/drivers/net/wireless/orinoco/spectrum_cs.c b/drivers/net/wireless/orinoco/spectrum_cs.c
index fb859a5..db34c28 100644
--- a/drivers/net/wireless/orinoco/spectrum_cs.c
+++ b/drivers/net/wireless/orinoco/spectrum_cs.c
@@ -214,21 +214,21 @@ spectrum_cs_config(struct pcmcia_device *link)
 		goto failed;
 	}
 
-	ret = pcmcia_request_irq(link, orinoco_interrupt);
-	if (ret)
-		goto failed;
-
-	/* We initialize the hermes structure before completing PCMCIA
-	 * configuration just in case the interrupt handler gets
-	 * called. */
 	mem = ioport_map(link->resource[0]->start,
 			resource_size(link->resource[0]));
 	if (!mem)
 		goto failed;
 
+	/* We initialize the hermes structure before completing PCMCIA
+	 * configuration just in case the interrupt handler gets
+	 * called. */
 	hermes_struct_init(hw, mem, HERMES_16BIT_REGSPACING);
 	hw->eeprom_pda = true;
 
+	ret = pcmcia_request_irq(link, orinoco_interrupt);
+	if (ret)
+		goto failed;
+
 	ret = pcmcia_enable_device(link);
 	if (ret)
 		goto failed;
diff --git a/drivers/net/wireless/orinoco/wext.c b/drivers/net/wireless/orinoco/wext.c
index 93505f9..e5afabe 100644
--- a/drivers/net/wireless/orinoco/wext.c
+++ b/drivers/net/wireless/orinoco/wext.c
@@ -911,10 +911,10 @@ static int orinoco_ioctl_set_auth(struct net_device *dev,
 		 */
 		if (param->value) {
 			priv->tkip_cm_active = 1;
-			ret = hermes_enable_port(hw, 0);
+			ret = hermes_disable_port(hw, 0);
 		} else {
 			priv->tkip_cm_active = 0;
-			ret = hermes_disable_port(hw, 0);
+			ret = hermes_enable_port(hw, 0);
 		}
 		break;
 
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index df6aac5..7a637b8 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1737,15 +1737,13 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
 	int nh_pos, h_pos;
 	struct sta_info *sta = NULL;
 	u32 sta_flags = 0;
+	struct sk_buff *tmp_skb;
 
 	if (unlikely(skb->len < ETH_HLEN)) {
 		ret = NETDEV_TX_OK;
 		goto fail;
 	}
 
-	nh_pos = skb_network_header(skb) - skb->data;
-	h_pos = skb_transport_header(skb) - skb->data;
-
 	/* convert Ethernet header to proper 802.11 header (based on
 	 * operation mode) */
 	ethertype = (skb->data[12] << 8) | skb->data[13];
@@ -1918,6 +1916,20 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
 		goto fail;
 	}
 
+	/*
+	 * If the skb is shared we need to obtain our own copy.
+	 */
+	if (skb_shared(skb)) {
+		tmp_skb = skb;
+		skb = skb_copy(skb, GFP_ATOMIC);
+		kfree_skb(tmp_skb);
+
+		if (!skb) {
+			ret = NETDEV_TX_OK;
+			goto fail;
+		}
+	}
+
 	hdr.frame_control = fc;
 	hdr.duration_id = 0;
 	hdr.seq_ctrl = 0;
@@ -1936,6 +1948,9 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
 		encaps_len = 0;
 	}
 
+	nh_pos = skb_network_header(skb) - skb->data;
+	h_pos = skb_transport_header(skb) - skb->data;
+
 	skb_pull(skb, skip_header_bytes);
 	nh_pos -= skip_header_bytes;
 	h_pos -= skip_header_bytes;
-- 
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 related

* Re: [PATCH v16 02/17]Add a new struct for device to manipulate external buffer.
From: David Miller @ 2010-12-10 20:36 UTC (permalink / raw)
  To: xiaohui.xin; +Cc: netdev, kvm, linux-kernel, mst, mingo, herbert, jdike
In-Reply-To: <38fbf05a450b34e939aa1b0f3a5126711990f0cc.1291187695.git.xiaohui.xin@intel.com>

From: xiaohui.xin@intel.com
Date: Wed,  1 Dec 2010 16:08:13 +0800

> From: Xin Xiaohui <xiaohui.xin@intel.com>
> 
>     Add a structure in structure net_device, the new field is
>     named as mp_port. It's for mediate passthru (zero-copy).
>     It contains the capability for the net device driver,
>     a socket, and an external buffer creator, external means
>     skb buffer belongs to the device may not be allocated from
>     kernel space.
> 
>     Signed-off-by: Xin Xiaohui <xiaohui.xin@intel.com>
>     Signed-off-by: Zhao Yu <yzhao81new@gmail.com>
>     Reviewed-by: Jeff Dike <jdike@linux.intel.com>

Please eliminate whatever is causing this indentation of your
commit messages.

There should be no special indentation of the commit message.

^ permalink raw reply

* Re: [PATCH v16 03/17] Add a ndo_mp_port_prep pointer to net_device_ops.
From: David Miller @ 2010-12-10 20:36 UTC (permalink / raw)
  To: xiaohui.xin; +Cc: netdev, kvm, linux-kernel, mst, mingo, herbert, jdike
In-Reply-To: <cd0686f2b8fc16a1d87ced228b2a90b93f008b94.1291187695.git.xiaohui.xin@intel.com>

From: xiaohui.xin@intel.com
Date: Wed,  1 Dec 2010 16:08:14 +0800

> +#if defined(CONFIG_MEDIATE_PASSTHRU) || defined(CONFIG_MEDIATE_PASSTHRU_MODULE)
> +	int			(*ndo_mp_port_prep)(struct net_device *dev,
> +						struct mp_port *port);
> +#endif

Please rename this config option so that it is clear, by name, that
this option is for a networking facility.

F.e. CONFIG_NET_MEDIATE_PASSTHRU

^ permalink raw reply

* Re: [PATCH] ipv6: slightly simplify keeping IPv6 addresses on link down
From: David Miller @ 2010-12-10 20:43 UTC (permalink / raw)
  To: shemminger; +Cc: lorenzo, netdev
In-Reply-To: <20101201130421.0ac08bcd@nehalam>

From: Stephen Hemminger <shemminger@vyatta.com>
Date: Wed, 1 Dec 2010 13:04:21 -0800

> On Wed, 1 Dec 2010 12:52:42 -0800
> Lorenzo Colitti <lorenzo@google.com> wrote:
> 
>> No, wait... The loop is protected by idev->lock, and the code just
>> before it that clears the temporary address list is essentially
>> identical (except it looks over tempaddr_list instead). Wouldn't that
>> blow up as well?
> 
> The old code walked the list until it was empty. New code could
> get confused if list changed by other changes during the
> period when idev->lock is dropped and notifier is called.

I think Stephen has a point here.

You can't use a "_safe" list traversal if you are dropping the
lock in the middle of that traversal, which is what you code
will be doing.

Lorenzo you've already added serious bugs to this code with your
previous address handling changes (which had reference counting bugs),
so I'm going to heavily scrutinize any "cleanup" or other kind of
change you try to make here.

In fact I really wish you would just leave this code as-is instead
of trying to make such pointless tweaks to it.

Thanks.

^ permalink raw reply

* Re: [PATCH] connector: add module alias
From: Evgeniy Polyakov @ 2010-12-10 20:44 UTC (permalink / raw)
  To: David Miller; +Cc: shemminger, netdev
In-Reply-To: <20101210.122813.229758283.davem@davemloft.net>

On Fri, Dec 10, 2010 at 12:28:13PM -0800, David Miller (davem@davemloft.net) wrote:
> >> Since connector can be built as a module and uses netlink socket
> >> to communicate. The module should have an alias to autoload when socket
> >> of NETLINK_CONNECTOR type is requested.
> > 
> > Ack, thank you.
> 
> Please use formalized "Acked-by: " tags so that the automated tools do
> all the work for me and I don't have to type it in by hand.

Will do, thanks.

-- 
	Evgeniy Polyakov

^ permalink raw reply

* Re: [PATCH 1/2] via-velocity: set sleep speed to 10Mbps for powersaving.
From: David Miller @ 2010-12-10 20:47 UTC (permalink / raw)
  To: romieu; +Cc: netdev, DavidLv, ShirleyHu, AndersMa
In-Reply-To: <20101209092656.GA4064@electric-eye.fr.zoreil.com>

From: Francois Romieu <romieu@fr.zoreil.com>
Date: Thu, 9 Dec 2010 10:26:56 +0100

> Signed-off-by: David Lv <DavidLv@viatech.com.cn>
> Acked-by: Francois Romieu <romieu@fr.zoreil.com>

Please, no new module parameters that only have obscure meanings
on specific device types.

This is terrible for users.

I'm not applying these two patches, sorry.

I know it already has the 1000M one, and if I was handling driver patches
directly when that got in I apologize for not catching it, it's wrong too.

There is nothing that prevents adding ethtool facilities for this issue.

In fact looking at the via velocity driver options, many of them
completely duplicate existing ethtool mechanisms.  It's beyond a mess.

So I'm putting the line in the sand and will not allow new such options
to be added, sorry.

^ permalink raw reply

* Re: [PATCH] ipv6: fix nl group when advertising a new link
From: David Miller @ 2010-12-10 20:49 UTC (permalink / raw)
  To: tgraf; +Cc: nicolas.dichtel, netdev
In-Reply-To: <20101208100454.GA7638@canuck.infradead.org>

From: Thomas Graf <tgraf@infradead.org>
Date: Wed, 8 Dec 2010 05:04:54 -0500

> On Wed, Dec 08, 2010 at 10:38:31AM +0100, Nicolas Dichtel wrote:
>> >From d2ed52e7fcb639470c89045f7b0ce31eb681896a Mon Sep 17 00:00:00 2001
>> From: Wang Xuefu <xuefu.wang@6wind.com>
>> Date: Wed, 8 Dec 2010 10:24:48 +0100
>> Subject: [PATCH] ipv6: fix nl group when advertising a new link
>> 
>> New idev are advertised with NL group RTNLGRP_IPV6_IFADDR, but
>> should use RTNLGRP_IPV6_IFINFO.
>> Bug was introduced by commit 8d7a76c9.
>> 
>> Signed-off-by: Wang Xuefu <xuefu.wang@6wind.com>
>> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
> 
> Acked-by: Thomas Graf <tgraf@infradead.org>

Applied to net-2.6, thanks.

^ permalink raw reply

* Re: pull request: wireless-2.6 2010-12-10
From: David Miller @ 2010-12-10 20:52 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, netdev, linux-kernel
In-Reply-To: <20101210202902.GG4296@tuxdriver.com>

From: "John W. Linville" <linville@tuxdriver.com>
Date: Fri, 10 Dec 2010 15:29:03 -0500

> Here is the latest round of wireless bits intended for 2.6.37...
> 
> Included are some orinoco fixes, one to avoid the crash in bug 23932 and
> two others that render TKIP countermeasures ineffective (i.e. decreased
> security).  Helmut has provided us a fix to avoid a BUG when using
> shared skbs.  The ath9k team gives us a fix for failed resumes on
> ath9k_htc, a fix for detecting broadcast frames with a MIC failure, a
> fix for a null pointer access when generating beacons, and a DMA issue
> that can lead to memory corruption.  Matteo Croce pitches-in with a fix
> to prevent transmitting with too much power.  Finally,  Javier Cardona
> provides a trio of ath5k fixes that restore mesh function on those
> devices.
> 
> Please let me know if there are problems!

Pulled, thanks John.

^ permalink raw reply

* Re: [PATCH] Sysctl interface to UNIX_INFLIGHT_TRIGGER_GC v.3
From: David Miller @ 2010-12-10 20:56 UTC (permalink / raw)
  To: eric.dumazet; +Cc: pavel, shanwei, netdev
In-Reply-To: <1291986273.3580.16.camel@edumazet-laptop>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 10 Dec 2010 14:04:33 +0100

> Le vendredi 10 décembre 2010 à 15:48 +0300, Pavel Vasilyev a écrit :
>> On 10.12.2010 06:45, Shan Wei wrote:
>> > Pavel Vasilyev wrote, at 12/10/2010 01:26 AM:
>> >> Sysctl interface to UNIX_INFLIGHT_TRIGGER_GC.
>> >> IMHO convenient for testing.
>> >>
>> >> +inflight_trigger_gc - INTEGER
>> >> +	The maximal number of inflight sockets for force garbage collect.
>> >> +
>> >> +	Default: 16000
>> > 
>> > 1) For lower payload and enough memory, it's not necessary to force garbage collection.
>> > So set it to 0, disable gc.
>> 
>> 
>> May be, set default to 2000, and zero to disable
>> 
> 
> zero to disable ?
> 
> Maybe you missed commit 9915672d41273f5b77 intent.
> 
> If you have no limit (like old kernels), you can freeze your machine,
> even if it has terabytes of ram, running a single program, even as a non
> root user.
> 
> When we discussed about the fix, we said a limit was needed, obviously.
> 
> Now you'll have to prove we need to make it a sysctl (yet
> another /proc/sys/net parameter, yet another documentation to add...)
> 
> Even changing default from 16000 to 2000 must be for a valid reason (a
> real use case)

I don't want to add this sysctl.  Exactly because there is no reason
to believe that the current value could even need to be changed by
anyone.

Once a demonstratable need can be proven and shown beyond a shadow
of a doubt, we can consider adding the sysctl.

We have too many damn sysctls as-is.

^ permalink raw reply

* Re: [PATCH v2] bridge: Fix return values of br_multicast_add_group/br_multicast_new_group
From: David Miller @ 2010-12-10 21:01 UTC (permalink / raw)
  To: tklauser; +Cc: shemminger, bridge, netdev
In-Reply-To: <1291987084-27302-1-git-send-email-tklauser@distanz.ch>

From: Tobias Klauser <tklauser@distanz.ch>
Date: Fri, 10 Dec 2010 14:18:04 +0100

> If br_multicast_new_group returns NULL, we would return 0 (no error) to
> the caller of br_multicast_add_group, which is not what we want. Instead
> br_multicast_new_group should return ERR_PTR(-ENOMEM) in this case.
> Also propagate the error number returned by br_mdb_rehash properly.
> 
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>

Looks good, applied to net-next-2.6

Please in the future make is clear, in your subject line, which
tree this patch is meant for.

I had to figure it out by trial and error, because this patch
does not apply properly to net-2.6


^ permalink raw reply

* Re: PCI: make pci_restore_state return void
From: Jesse Barnes @ 2010-12-10 21:07 UTC (permalink / raw)
  To: Jon Mason
  Cc: linux-pci, Jonathan Corbet, linux-media, Andrew Gallatin,
	Brice Goglin, netdev, Solarflare linux maintainers, Steve Hodgson,
	Ben Hutchings, Stephen Hemminger, Ivo van Doorn,
	Gertjan van Wingerde, linux-wireless, Brian King,
	Anil Ravindranath, linux-scsi, Jaya Kumar, boyod.yang
In-Reply-To: <1291160606-31494-1-git-send-email-jon.mason@exar.com>

On Tue, 30 Nov 2010 17:43:26 -0600
Jon Mason <jon.mason@exar.com> wrote:

> pci_restore_state only ever returns 0, thus there is no benefit in
> having it return any value.  Also, a large majority of the callers do
> not check the return code of pci_restore_state.  Make the
> pci_restore_state a void return and avoid the overhead.
> 
> Signed-off-by: Jon Mason <jon.mason@exar.com>
> ---

Applied to linux-next, thanks.

-- 
Jesse Barnes, Intel Open Source Technology Center

^ permalink raw reply

* [PATCH net-next-2.6] ipv6: Fix 'release_it' logic in tcp_v6_get_peer()
From: David Miller @ 2010-12-10 21:17 UTC (permalink / raw)
  To: netdev


We accidently set it to "true" for the case where we
are using a route bound peer.

Signed-off-by: David S. Miller <davem@davemloft.net>
---
 net/ipv6/tcp_ipv6.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 3194585..fee0768 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -1877,7 +1877,7 @@ static struct inet_peer *tcp_v6_get_peer(struct sock *sk, bool *release_it)
 		if (!rt->rt6i_peer)
 			rt6_bind_peer(rt, 1);
 		peer = rt->rt6i_peer;
-		*release_it = true;
+		*release_it = false;
 	}
 
 	return peer;
-- 
1.7.3.2


^ permalink raw reply related

* Please promote b1d670f10e80 to 2.6.37/stable to fix gcc mainline build
From: Andi Kleen @ 2010-12-10 21:18 UTC (permalink / raw)
  To: davem; +Cc: gregory.v.rose, jeffrey.t.kirsher, netdev


Without this patch a gcc mainline kernel build fails. This is currently only
fixed in net-next. Could the patch please be promoted to 2.6.37 and
ideally for stable too?

Thanks,

-Andi

commit b1d670f10e8078485884f0cf7e384d890909aeaa
Author: Greg Rose <gregory.v.rose@intel.com>
Date:   Tue Nov 16 19:41:36 2010 -0800

    Remove extra struct page member from the buffer info structure
    
    declaration.
    
    Reported-by: Andi Kleen <andi@firstfloor.org>
    Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
    Tested-by: Emil Tantilov <emil.s.tantilov@intel.com>
    Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>


-- 
ak@linux.intel.com -- Speaking for myself only.

^ permalink raw reply

* Re: unable to handle kernel NULL pointer dereference in skb_dequeue
From: Jarek Poplawski @ 2010-12-10 21:30 UTC (permalink / raw)
  To: David Miller
  Cc: nuclearcat, eric.dumazet, andrej, linux-kernel, gvs, ramirose,
	netdev
In-Reply-To: <20101210.121845.70177370.davem@davemloft.net>

David Miller wrote:
> From: Denys Fedoryshchenko <nuclearcat@nuclearcat.com>
> Date: Fri, 10 Dec 2010 21:51:04 +0200
...
>> Is there any plans to queue any patch to stable?
>> pppoe is almost dead in 2.6.36.*
> 
> I'll deal with it for -stable once I evaluate this patch for upstream,
> which I haven't even gotten to yet.

This patch is here:
http://patchwork.ozlabs.org/patch/75095/

But IMHO it's buggy for the reason I mentioned. Since Andrej
didn't respond yet I'd suggest reverting of the offending
commit 55c95e738da85. If you agree with that but e.g. too busy,
let me know.

Jarek P.

^ permalink raw reply

* Re: ctnetlink loop
From: David Miller @ 2010-12-10 22:01 UTC (permalink / raw)
  To: pablo; +Cc: netfilter-devel, netdev, linux-kernel
In-Reply-To: <4D00B5CD.3050406@netfilter.org>

From: Pablo Neira Ayuso <pablo@netfilter.org>
Date: Thu, 09 Dec 2010 11:56:13 +0100

> netfilter: ctnetlink: fix loop in ctnetlink_get_conntrack()
> 
> From: Pablo Neira Ayuso <pablo@netfilter.org>
> 
> This patch fixes a loop in ctnetlink_get_conntrack() that can be
> triggered if you use the same socket to receive events and to
> perform a GET operation. Under heavy load, netlink_unicast()
> may return -EAGAIN, this error code is reserved in nfnetlink for
> the module load-on-demand. Instead, we return -ENOBUFS which is
> the appropriate error code that has to be propagated to
> user-space.
> 
> Reported-by: Holger Eitzenberger <holger@eitzenberger.org>
> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

Since Patrick seems to be inactive I have applied this directly
to net-2.6, thanks guys!

^ permalink raw reply

* [net-next-2.6 PATCH] enic: Move enic port profile handling code to a new 802.1Qbh provisioning info type
From: Roopa Prabhu @ 2010-12-10 22:02 UTC (permalink / raw)
  To: davem; +Cc: netdev

From: Roopa Prabhu <roprabhu@cisco.com>



Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
Signed-off-by: David Wang <dwang2@cisco.com>
Signed-off-by: Christian Benvenuti <benve@cisco.com>
---
 drivers/net/enic/enic.h      |    2 +-
 drivers/net/enic/enic_main.c |   33 +++++++++++++++++++++++----------
 drivers/net/enic/vnic_vic.h  |   31 +++++++++++++++++++++++--------
 3 files changed, 47 insertions(+), 19 deletions(-)


diff --git a/drivers/net/enic/enic.h b/drivers/net/enic/enic.h
index 577067e..a937f49 100644
--- a/drivers/net/enic/enic.h
+++ b/drivers/net/enic/enic.h
@@ -32,7 +32,7 @@
 
 #define DRV_NAME		"enic"
 #define DRV_DESCRIPTION		"Cisco VIC Ethernet NIC Driver"
-#define DRV_VERSION		"1.4.1.9"
+#define DRV_VERSION		"1.4.1.10"
 #define DRV_COPYRIGHT		"Copyright 2008-2010 Cisco Systems, Inc"
 
 #define ENIC_BARS_MAX		6
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index 21be989..9befd54 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -1252,7 +1252,10 @@ static int enic_set_port_profile(struct enic *enic, u8 *mac)
 {
 	struct vic_provinfo *vp;
 	u8 oui[3] = VIC_PROVINFO_CISCO_OUI;
+	u16 os_type = VIC_GENERIC_PROV_OS_TYPE_LINUX;
 	char uuid_str[38];
+	char client_mac_str[18];
+	u8 *client_mac;
 	int err;
 
 	err = enic_vnic_dev_deinit(enic);
@@ -1270,37 +1273,47 @@ static int enic_set_port_profile(struct enic *enic, u8 *mac)
 			return -EADDRNOTAVAIL;
 
 		vp = vic_provinfo_alloc(GFP_KERNEL, oui,
-			VIC_PROVINFO_LINUX_TYPE);
+			VIC_PROVINFO_GENERIC_TYPE);
 		if (!vp)
 			return -ENOMEM;
 
 		vic_provinfo_add_tlv(vp,
-			VIC_LINUX_PROV_TLV_PORT_PROFILE_NAME_STR,
+			VIC_GENERIC_PROV_TLV_PORT_PROFILE_NAME_STR,
 			strlen(enic->pp.name) + 1, enic->pp.name);
 
 		if (!is_zero_ether_addr(enic->pp.mac_addr))
-			vic_provinfo_add_tlv(vp,
-				VIC_LINUX_PROV_TLV_CLIENT_MAC_ADDR,
-				ETH_ALEN, enic->pp.mac_addr);
+			client_mac = enic->pp.mac_addr;
 		else
-			vic_provinfo_add_tlv(vp,
-				VIC_LINUX_PROV_TLV_CLIENT_MAC_ADDR,
-				ETH_ALEN, mac);
+			client_mac = mac;
+
+		vic_provinfo_add_tlv(vp,
+			VIC_GENERIC_PROV_TLV_CLIENT_MAC_ADDR,
+			ETH_ALEN, client_mac);
+
+		sprintf(client_mac_str, "%pM", client_mac);
+		vic_provinfo_add_tlv(vp,
+			VIC_GENERIC_PROV_TLV_CLUSTER_PORT_UUID_STR,
+			sizeof(client_mac_str), client_mac_str);
 
 		if (enic->pp.set & ENIC_SET_INSTANCE) {
 			sprintf(uuid_str, "%pUB", enic->pp.instance_uuid);
 			vic_provinfo_add_tlv(vp,
-				VIC_LINUX_PROV_TLV_CLIENT_UUID_STR,
+				VIC_GENERIC_PROV_TLV_CLIENT_UUID_STR,
 				sizeof(uuid_str), uuid_str);
 		}
 
 		if (enic->pp.set & ENIC_SET_HOST) {
 			sprintf(uuid_str, "%pUB", enic->pp.host_uuid);
 			vic_provinfo_add_tlv(vp,
-				VIC_LINUX_PROV_TLV_HOST_UUID_STR,
+				VIC_GENERIC_PROV_TLV_HOST_UUID_STR,
 				sizeof(uuid_str), uuid_str);
 		}
 
+		os_type = htons(os_type);
+		vic_provinfo_add_tlv(vp,
+			VIC_GENERIC_PROV_TLV_OS_TYPE,
+			sizeof(os_type), &os_type);
+
 		err = enic_dev_init_prov(enic, vp);
 		vic_provinfo_free(vp);
 		if (err)
diff --git a/drivers/net/enic/vnic_vic.h b/drivers/net/enic/vnic_vic.h
index 7e46e5e..f700f5d 100644
--- a/drivers/net/enic/vnic_vic.h
+++ b/drivers/net/enic/vnic_vic.h
@@ -24,14 +24,29 @@
 /* Note: String field lengths include null char */
 
 #define VIC_PROVINFO_CISCO_OUI		{ 0x00, 0x00, 0x0c }
-#define VIC_PROVINFO_LINUX_TYPE		0x2
-
-enum vic_linux_prov_tlv_type {
-	VIC_LINUX_PROV_TLV_PORT_PROFILE_NAME_STR = 0,
-	VIC_LINUX_PROV_TLV_CLIENT_MAC_ADDR = 1,			/* u8[6] */
-	VIC_LINUX_PROV_TLV_CLIENT_NAME_STR = 2,
-	VIC_LINUX_PROV_TLV_HOST_UUID_STR = 8,
-	VIC_LINUX_PROV_TLV_CLIENT_UUID_STR = 9,
+#define VIC_PROVINFO_GENERIC_TYPE		0x4
+
+enum vic_generic_prov_tlv_type {
+	VIC_GENERIC_PROV_TLV_PORT_PROFILE_NAME_STR = 0,
+	VIC_GENERIC_PROV_TLV_CLIENT_MAC_ADDR = 1,
+	VIC_GENERIC_PROV_TLV_CLIENT_NAME_STR = 2,
+	VIC_GENERIC_PROV_TLV_CLUSTER_PORT_NAME_STR = 3,
+	VIC_GENERIC_PROV_TLV_CLUSTER_PORT_UUID_STR = 4,
+	VIC_GENERIC_PROV_TLV_CLUSTER_UUID_STR = 5,
+	VIC_GENERIC_PROV_TLV_CLUSTER_NAME_STR = 7,
+	VIC_GENERIC_PROV_TLV_HOST_UUID_STR = 8,
+	VIC_GENERIC_PROV_TLV_CLIENT_UUID_STR = 9,
+	VIC_GENERIC_PROV_TLV_INCARNATION_NUMBER = 10,
+	VIC_GENERIC_PROV_TLV_OS_TYPE = 11,
+	VIC_GENERIC_PROV_TLV_OS_VENDOR = 12,
+	VIC_GENERIC_PROV_TLV_CLIENT_TYPE = 15,
+};
+
+enum vic_generic_prov_os_type {
+	VIC_GENERIC_PROV_OS_TYPE_UNKNOWN = 0,
+	VIC_GENERIC_PROV_OS_TYPE_ESX = 1,
+	VIC_GENERIC_PROV_OS_TYPE_LINUX = 2,
+	VIC_GENERIC_PROV_OS_TYPE_WINDOWS = 3,
 };
 
 struct vic_provinfo {


^ permalink raw reply related

* Re: [PATCH net-2.6] net/ipv6/udp.c: fix typo in flush_stack()
From: David Miller @ 2010-12-10 22:05 UTC (permalink / raw)
  To: eric.dumazet; +Cc: jpirko, netdev
In-Reply-To: <1291902488.4063.28.camel@edumazet-laptop>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Thu, 09 Dec 2010 14:48:08 +0100

> Le jeudi 09 décembre 2010 à 14:40 +0100, Jiri Pirko a écrit :
>> skb1 should be passed as parameter to sk_rcvqueues_full() here.
>> 
>> Signed-off-by: Jiri Pirko <jpirko@redhat.com>
>> 
>> diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
>> index 91def93..d2b268e 100644
>> --- a/net/ipv6/udp.c
>> +++ b/net/ipv6/udp.c
>> @@ -602,7 +602,7 @@ static void flush_stack(struct sock **stack, unsigned int count,
>>  
>>  		sk = stack[i];
>>  		if (skb1) {
>> -			if (sk_rcvqueues_full(sk, skb)) {
>> +			if (sk_rcvqueues_full(sk, skb1)) {
>>  				kfree_skb(skb1);
>>  				goto drop;
>>  			}
> 
> net-2.6 ? Its the same truesize anyway...
> 
> So it's not a bug, but a cosmetic change.
> (I am ok with it, but for net-next-2.6)

Agreed, applied to net-next-2.6, thanks.

^ permalink raw reply

* Re: [net-next 2/8] bnx2x: add select queue callback
From: David Miller @ 2010-12-10 22:11 UTC (permalink / raw)
  To: dmitry; +Cc: netdev, eilong
In-Reply-To: <1291896556.8745.7.camel@lb-tlvb-dmitry>

From: "Dmitry Kravkov" <dmitry@broadcom.com>
Date: Thu, 9 Dec 2010 14:09:16 +0200

> +#endif
> +	/* Select queue (if defined) adjust for fcoe */
> +	fp_index = skb_tx_hash(dev, skb) - FCOE_CONTEXT_USE;
> +
> +	return (fp_index >= 0 ? fp_index : 0);

This doesn't make any sense, and it's one of the reasons I really
hate the fact that drivers sometimes need to override the
select_queue method.

Because 9 times out of 10 they get it wrong.

You're mapping queues 0 --> FCOE_CONTEXT_USE to zero.

But that's not what you actually want.

You're actually trying to make non-FCOE traffic hash only amongst the
non-FCOE queues.

So make your code actually do that instead of screwing up the
distribution of the hash result.

^ permalink raw reply


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