Netdev List
 help / color / mirror / Atom feed
* [PATCH RFC] ethtool: add multiple queue support to {get,set}_ringparams
From: Ajit Khaparde @ 2010-03-14  1:43 UTC (permalink / raw)
  To: David Miller, jeff; +Cc: netdev

With network devices and hence device drivers supporting
multiple Tx and Rx rings, currently there is no way for
ethtool to specify which Tx/Rx ring the user wants to get/set.
This patch enhances the get/set ring params option by allowing
the user to specify the Tx/Rx ring id of interest.
Please review.

Current Usage:
ethtool -g <interface name>

ethtool -G <interface name> [new parameters to set]

New Usage:
ethtool -g <interface name> [ RING-ID ]

ethtool -G <interface name> [ RING-ID ] [new parameters to set]

Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
---
 ethtool-copy.h |    1 +
 ethtool.8      |    8 ++++++++
 ethtool.c      |   19 +++++++++++++++++--
 3 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/ethtool-copy.h b/ethtool-copy.h
index 8681f5e..1ac6beb 100644
--- a/ethtool-copy.h
+++ b/ethtool-copy.h
@@ -199,6 +199,7 @@ struct ethtool_coalesce {
 /* for configuring RX/TX ring parameters */
 struct ethtool_ringparam {
 	__u32	cmd;	/* ETHTOOL_{G,S}RINGPARAM */
+	__u32	ring_id;
 
 	/* Read only attributes.  These indicate the maximum number
 	 * of pending RX/TX ring entries the driver will allow the
diff --git a/ethtool.8 b/ethtool.8
index eb6430b..14b8984 100644
--- a/ethtool.8
+++ b/ethtool.8
@@ -116,9 +116,11 @@ ethtool \- Display or change ethernet card settings
 
 .B ethtool \-g|\-\-show\-ring
 .I ethX
+.RI [ N ]
 
 .B ethtool \-G|\-\-set\-ring
 .I ethX
+.RI [ N ]
 .RB [ rx
 .IR N ]
 .RB [ rx-mini
@@ -287,9 +289,15 @@ Changes the coalescing settings of the specified ethernet device.
 .B \-g \-\-show\-ring
 Queries the specified ethernet device for rx/tx ring parameter information.
 .TP
+.B N
+The tx/rx ring id.
+.TP
 .B \-G \-\-set\-ring
 Changes the rx/tx ring parameters of the specified ethernet device.
 .TP
+.B N
+The tx/rx ring id.
+.TP
 .BI rx \ N
 Changes the number of ring entries for the Rx ring.
 .TP
diff --git a/ethtool.c b/ethtool.c
index fc9e419..650bb8c 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -156,8 +156,10 @@ static struct option {
 		"		[tx-usecs-high N]\n"
 		"		[tx-frames-high N]\n"
 	        "		[sample-interval N]\n" },
-    { "-g", "--show-ring", MODE_GRING, "Query RX/TX ring parameters" },
+    { "-g", "--show-ring", MODE_GRING, "Query RX/TX ring parameters",
+		"		[ RING ID ]\n" },
     { "-G", "--set-ring", MODE_SRING, "Set RX/TX ring parameters",
+		"		[ RING ID ]\n"		
 		"		[ rx N ]\n"
 		"		[ rx-mini N ]\n"
 		"		[ rx-jumbo N ]\n"
@@ -265,6 +267,7 @@ static int pause_rx_wanted = -1;
 static int pause_tx_wanted = -1;
 
 static struct ethtool_ringparam ering;
+static int ring_id = 0;
 static int gring_changed = 0;
 static int ring_rx_wanted = -1;
 static int ring_rx_mini_wanted = -1;
@@ -605,6 +608,10 @@ static void parse_cmdline(int argc, char **argp)
 				flash = 1;
 				break;
 			}
+			if (mode == MODE_SRING) {
+				ring_id = get_int(argp[i], 10);
+				break;
+			}
 			/* fallthrough */
 		default:
 			if (mode == MODE_GREGS) {
@@ -639,6 +646,10 @@ static void parse_cmdline(int argc, char **argp)
 				i = argc;
 				break;
 			}
+			if (mode == MODE_GRING) {
+				ring_id = get_int(argp[i], 10);
+				break;
+			}
 			if (mode == MODE_SRING) {
 				parse_generic_cmdline(argc, argp, i,
 					&gring_changed,
@@ -1761,6 +1772,7 @@ static int do_sring(int fd, struct ifreq *ifr)
 	int err, changed = 0;
 
 	ering.cmd = ETHTOOL_GRINGPARAM;
+	ering.ring_id = ring_id;
 	ifr->ifr_data = (caddr_t)&ering;
 	err = send_ioctl(fd, ifr);
 	if (err) {
@@ -1776,6 +1788,7 @@ static int do_sring(int fd, struct ifreq *ifr)
 	}
 
 	ering.cmd = ETHTOOL_SRINGPARAM;
+	ering.ring_id = ring_id;
 	ifr->ifr_data = (caddr_t)&ering;
 	err = send_ioctl(fd, ifr);
 	if (err) {
@@ -1790,9 +1803,11 @@ static int do_gring(int fd, struct ifreq *ifr)
 {
 	int err;
 
-	fprintf(stdout, "Ring parameters for %s:\n", devname);
+	fprintf(stdout, "Ring parameters for ring id %d for %s:\n",
+							ring_id, devname);
 
 	ering.cmd = ETHTOOL_GRINGPARAM;
+	ering.ring_id = ring_id;
 	ifr->ifr_data = (caddr_t)&ering;
 	err = send_ioctl(fd, ifr);
 	if (err == 0) {
-- 
1.6.3.3


^ permalink raw reply related

* [RFC PATCH net-2.6] net/ethtool: add multiple queue support to {get,set}_ringparams
From: Ajit Khaparde @ 2010-03-14  1:43 UTC (permalink / raw)
  To: David Miller, jeff; +Cc: netdev

With network devices and hence device drivers supporting
multiple Tx and Rx rings, currently there is no way for
ethtool to specify which Tx/Rx ring the user wants to get/set.
This patch enhances the {get,set}_ringparams by allowing
the user to specify the Tx/Rx ring id of interest.
Please review.

Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
---
 include/linux/ethtool.h |    1 +
 net/core/ethtool.c      |    5 ++++-
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index b33f316..de6a90a 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -206,6 +206,7 @@ struct ethtool_coalesce {
 /* for configuring RX/TX ring parameters */
 struct ethtool_ringparam {
 	__u32	cmd;	/* ETHTOOL_{G,S}RINGPARAM */
+	__u32	ring_id;
 
 	/* Read only attributes.  These indicate the maximum number
 	 * of pending RX/TX ring entries the driver will allow the
diff --git a/net/core/ethtool.c b/net/core/ethtool.c
index f4cb6b6..81e2e62 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -881,11 +881,14 @@ static noinline_for_stack int ethtool_set_coalesce(struct net_device *dev, void
 
 static int ethtool_get_ringparam(struct net_device *dev, void __user *useraddr)
 {
-	struct ethtool_ringparam ringparam = { .cmd = ETHTOOL_GRINGPARAM };
+	struct ethtool_ringparam ringparam;
 
 	if (!dev->ethtool_ops->get_ringparam)
 		return -EOPNOTSUPP;
 
+	if (copy_from_user(&ringparam, useraddr, sizeof(ringparam)))
+		return -EFAULT;
+
 	dev->ethtool_ops->get_ringparam(dev, &ringparam);
 
 	if (copy_to_user(useraddr, &ringparam, sizeof(ringparam)))
-- 
1.6.3.3


^ permalink raw reply related

* Re: [PATCH] [PATCH]: CONFIG_BRIDGE_IGMP_SNOOPING must depend on CONFIG_INET
From: David Miller @ 2010-03-14  0:19 UTC (permalink / raw)
  To: henne; +Cc: herbert, bridge, netdev, linux-kernel
In-Reply-To: <1268514611-7930-1-git-send-email-henne@nachtwindheim.de>

From: Henrik Kretzschmar <henne@nachtwindheim.de>
Date: Sat, 13 Mar 2010 22:10:11 +0100

> Linking the kernel fails with the the following error message,
> if CONFIG_BRIDGE_IGMP_SNOOPING is set and CONFIG_INET is not set.
> 
> net/built-in.o: In function `br_multicast_alloc_query':
> br_multicast.c:(.text+0x52045): undefined reference to `ip_send_check'
> 
> This patch is tested.
> 
> Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de>

This has been fixed for some time in the net-2.6 tree
and now Linus just pulled that tree in so his tree
has the fix too.

^ permalink raw reply

* Re: 2.6.34-rc1: rcu lockdep bug?
From: Paul E. McKenney @ 2010-03-13 21:58 UTC (permalink / raw)
  To: Américo Wang
  Cc: Eric Dumazet, David Miller, peterz, linux-kernel, netdev
In-Reply-To: <20100313053356.GC3704@hack>

On Sat, Mar 13, 2010 at 01:33:56PM +0800, Américo Wang wrote:
> On Fri, Mar 12, 2010 at 02:37:38PM +0100, Eric Dumazet wrote:
> >Le vendredi 12 mars 2010 à 21:11 +0800, Américo Wang a écrit :
> >
> >> Oh, but lockdep complains about rcu_read_lock(), it said
> >> rcu_read_lock() can't be used in softirq context.
> >> 
> >> Am I missing something?
> >
> >Well, lockdep might be dumb, I dont know...
> >
> >I suggest you read rcu_read_lock_bh kernel doc :
> >
> >/**
> > * rcu_read_lock_bh - mark the beginning of a softirq-only RCU critical
> >section
> > *
> > * This is equivalent of rcu_read_lock(), but to be used when updates
> > * are being done using call_rcu_bh(). Since call_rcu_bh() callbacks
> > * consider completion of a softirq handler to be a quiescent state,
> > * a process in RCU read-side critical section must be protected by
> > * disabling softirqs. Read-side critical sections in interrupt context
> > * can use just rcu_read_lock().
> > *
> > */
> >
> >
> >Last sentence being perfect :
> >
> >Read-side critical sections in interrupt context
> >can use just rcu_read_lock().
> >
> 
> Yeah, right, then it is more likely to be a bug of rcu lockdep.
> Paul is looking at it.

Except that it seems to be working correctly for me...

							Thanx, Paul

^ permalink raw reply

* [PATCH] [PATCH]: CONFIG_BRIDGE_IGMP_SNOOPING must depend on CONFIG_INET
From: Henrik Kretzschmar @ 2010-03-13 21:10 UTC (permalink / raw)
  To: herbert; +Cc: bridge, netdev, linux-kernel, Henrik Kretzschmar
In-Reply-To: <[PATCH]: CONFIG_BRIDGE_IGMP_SNOOPING must depend on CONFIG_INET>

Linking the kernel fails with the the following error message,
if CONFIG_BRIDGE_IGMP_SNOOPING is set and CONFIG_INET is not set.

net/built-in.o: In function `br_multicast_alloc_query':
br_multicast.c:(.text+0x52045): undefined reference to `ip_send_check'

This patch is tested.

Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de>

---
 net/bridge/Kconfig |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/bridge/Kconfig b/net/bridge/Kconfig
index 19a6b96..52ef2dc 100644
--- a/net/bridge/Kconfig
+++ b/net/bridge/Kconfig
@@ -34,7 +34,7 @@ config BRIDGE
 
 config BRIDGE_IGMP_SNOOPING
 	bool "IGMP snooping"
-	depends on BRIDGE
+	depends on BRIDGE && INET
 	default y
 	---help---
 	  If you say Y here, then the Ethernet bridge will be able selectively
-- 
1.6.3.3


^ permalink raw reply related

* [GIT]: Networking
From: David Miller @ 2010-03-13 20:36 UTC (permalink / raw)
  To: torvalds; +Cc: akpm, netdev, linux-kernel


1) bfin_can build fix from Barry Song.

2) gianfar TX ring SMP race fix from Anton Vorontsov

3) Add support for smc91x on Qualcomm MSM boards, from David Brown.

4) Hot plug removal crash fix in cxgb3 from Divy Le Ray.

5) It's possible to bombard a socket sufficiently such that
   socket backlog accumulates forever.  Put in a limit point at
   which we'll simply start dropping frames.  From Zhu Yi and
   Eric Dumazet.

6) Barrier fixes in r8169 and typhoon from David Dillow.

7) MAINTAINER tweaks for CAN protocol and bridge.

8) Fix excessive route cache rebuilds, from Eric Dumazet.

9) Fix TCP synack packet sizing, also from Eric.

10) CPMAC bug fixes for VLAN receive, and PHY chip fallbacks,
    from Florian Fainelli.

11) Fix RCU handling in bridging code, from Herbert Xu.

12) Fix ipsec flow ID handling, also from Herbert.

13) Fix address length check regression in AF_PACKET, from Jiri Pirko.

14) %pI4 conversion in sunrpc from Joe Perches.  Joe sent this two
    months ago and the NFS folks didn't integrate, Trond told me
    I could take this in via net-2.6 if I like so that's what I've
    done.

15) TIPC oops and RX filtering fixes from Neil Horman.

16) QLCNIC bug fixes from Sucheta Chakraborty.  ETHTOOL get
    TX csum status was horked, add some missing driver stats,
    multicast addr handling fix, and better firmware image
    validation.

17) GRE tunnel header destination address checking fix from Timo Teräs.

18) Missing change to remove obsoleted bnx2x firmware, from
    Vladislav Zolotarov.

19) IPV6 addrconf timer bug fixes from Stephen Hemminger.

20) Fix for packet corruption and TX hang over NFSv2 in
    e1000e, from Jesse Brandeburg.

21) Pegasus USB ID addition, from Petko Manolov.

22) Various use-after-free, leak, et al. fixes from Dan Carpenter.

23) 4K buffer on kernel stack regression fix in Bluetooth from Marcel
    Holtmann.

24) When Ingo added the sync wakeup hints to the networking
    socket handling, he missed tcp_prequeue().  From Mike Galbraith.

25) And the usual assortment of wireless fixes and cures from
    John Linville and the crew.

26) Fix TCP hang, can't test TTL on timewait socket, from Eric
    Dumazet.

27) qeth bug fixes (unsafe checksumming settings, etc.)
    via Ursula Braun.

28) ->poll_controller() passes wrong device pointer to tg3_interrupt(),
    fix from Louis Rilling

29) Fix a regression added to dev_mc_add() (could return with
    lock held), from Eric Dumazet.

30) Couple reverts in wireless to fix bugs.  Fix missing unlock
    in mac80211 STA code, etc. all via John Linville and the
    wireless crew.

31) sky2 resume can unlock without holding lock.  Fix from
    Mike McCormack.

32) DHCP has no way to see that DAD failure on an address it
    selected, so send a proper notification from ipv6.  From
    Herbert Xu.

33) tg3 driver checks flag bit on wrong word.  Fix from Julia Lawall.

34) Tulip probe message regression fix from Joe Perches.

35) Bridge multicast code forgets to drop lock in error path, fix
    from YOSHIFUJI Hideaki.

Please pull, thanks a lot!

The following changes since commit daf9fe2ee9a203c4fc555cfe5c5f3d9f660e743c:
  Linus Torvalds (1):
        Merge branch 'for-linus' of git://git.kernel.org/.../sameo/mfd-2.6

are available in the git repository at:

  master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6.git master

Ajit Khaparde (2):
      be2net: remove usage of be_pci_func
      be2net: remove unused code in be_load_fw

Amit Kumar Salecha (2):
      qlcnic: fix bios version check
      qlcnic: remove extra space from board names

Anton Vorontsov (1):
      gianfar: Fix TX ring processing on SMP machines

Barry Song (1):
      can: fix bfin_can build error after alloc_candev() change

Breno Leitao (1):
      s2io: Fixing debug message

Bruno Randolf (4):
      ath5k: use fixed antenna for tx descriptors
      ath5k: fix TSF reset
      ath5k: fix I/Q calibration (for real)
      ath5k: read eeprom IQ calibration values correctly for G mode

Bryan Polk (1):
      rt2x00: Add USB ID for CEIVA adapter to rt73usb

Dan Carpenter (8):
      zd1211rw: fix potential array underflow
      cpmac: use after free
      cassini: fix off by one
      davinci_emac: off by one
      bridge: cleanup: remove unneed check
      ems_usb: cleanup: remove uneeded check
      sock.c: potential null dereference
      irda-usb: add error handling and fix leak

David Brown (1):
      net: smc91x: Support Qualcomm MSM development boards.

David Dillow (2):
      r8169: use correct barrier between cacheable and non-cacheable memory
      typhoon: fix incorrect use of smp_wmb()

David S. Miller (4):
      Merge branch 'master' of git://git.kernel.org/.../linville/wireless-next-2.6
      MAINTAINERS: Add netdev to bridge entry.
      ipconfig: Handle devices which take some time to come up.
      Merge branch 'master' of git://git.kernel.org/.../linville/wireless-2.6

Divy Le Ray (1):
      cxgb3: fix hot plug removal crash

Eric Dumazet (8):
      tcp: Add SNMP counters for backlog and min_ttl drops
      net: fix route cache rebuilds
      tcp: Fix tcp_make_synack()
      ethtool: Use noinline_for_stack
      tcp: Fix tcp_v4_rcv()
      net: Annotates neigh_invalidate()
      net: Fix dev_mc_add()
      mac80211: Fix memory leak in ieee80211_if_write()

Figo.zhang (1):
      fix a race in ks8695_poll

Florian Fainelli (3):
      cpmac: fix the receiving of 802.1q frames
      cpmac: fallback to switch mode if no PHY chip found
      cpmac: bump version to 0.5.2

Frank Blaschka (2):
      qeth: l3 send dhcp in non pass thru mode
      qeth: change checksumming default for HiperSockets

Greg Ungerer (1):
      net: add ColdFire support to the smc91x driver

Helmut Schaa (3):
      rt2x00: fix rt2800pci compilation with SoC
      rt2x00: Export rt2x00soc_probe from rt2x00soc
      rt2x00: remove KSEG1ADDR define from rt2x00soc.h

Herbert Xu (4):
      ipsec: Fix bogus bundle flowi
      bridge: Use RCU list primitive in __br_mdb_ip_get
      bridge: Fix RCU race in br_multicast_stop
      ipv6: Send netlink notification when DAD fails

Jeff Garzik (2):
      ethtool: Add direct access to ops->get_sset_count
      ethtool: Add direct access to ops->get_sset_count

Jesse Brandeburg (1):
      e1000e: fix packet corruption and tx hang during NFSv2

Jiri Pirko (2):
      af_packet: move strict addr_len check right before dev_[mc/unicast]_[add/del]
      rndis_wlan: correct multicast_list handling V3

Joe Perches (3):
      net/sunrpc: Remove uses of NIPQUAD, use %pI4
      net/sunrpc: Convert (void)snprintf to snprintf
      drivers/net/tulip/eeprom.c: fix bogus "(null)" in tulip init messages

Johannes Berg (2):
      ar9170: load firmware asynchronously
      iwlwifi: load firmware asynchronously before mac80211 registration

John W. Linville (1):
      Merge branch 'wireless-2.6' of git://git.kernel.org/.../iwlwifi/iwlwifi-2.6

Jouni Malinen (2):
      mac80211: Fix reassociation processing (within ESS roaming)
      mac80211: Fix sta_mtx unlocking on insert STA failure path

Julia Lawall (1):
      drivers/net/tg3.c: change the field used with the TG3_FLAG_10_100_ONLY constant

Jussi Kivilinna (1):
      asix: fix setting mac address for AX88772

Juuso Oikarinen (1):
      mac80211: Fix (dynamic) power save entry

Louis Rilling (1):
      tg3: Fix tg3_poll_controller() passing wrong pointer to tg3_interrupt()

Marcel Holtmann (1):
      Bluetooth: Use single_open() for inquiry cache within debugfs

Matthew Garrett (1):
      rfkill: Add support for KEY_RFKILL

Mike Galbraith (1):
      net: add scheduler sync hint to tcp_prequeue().

Mike McCormack (1):
      sky2: Avoid rtnl_unlock without rtnl_lock

Ming Lei (1):
      ath9k: fix lockdep warning when unloading module

Neil Horman (3):
      tipc: Fix oops on send prior to entering networked mode (v3)
      tipc: fix endianness on tipc subscriber messages
      tipc: filter out messages not intended for this host

Oliver Hartkopp (1):
      MAINTAINER: Correct CAN Maintainer responsibilities and paths

Petko Manolov (1):
      another pegasus usb net device

Randy Dunlap (1):
      bridge: depends on INET

Reinette Chatre (2):
      iwl3945: fix memory corruption
      Revert "iwlwifi: Send broadcast probe request only when asked to"

Sarveshwar Bandi (1):
      be2net: download NCSI section during firmware update

Stanislaw Gruszka (1):
      airo: return from set_wep_key() when key length is zero

Sucheta Chakraborty (4):
      qlcnic: fix tx csum status
      qlcnic: additional driver statistics.
      qlcnic: fix multicast handling
      qlcnic: validate unified fw image

Sujith (1):
      mac80211: Fix HT rate control configuration

Timo Teräs (1):
      gre: fix hard header destination address checking

Ursula Braun (3):
      qeth: enable kmsg hash processing in qeth_core_sys.c
      qeth: set promisc off after trace disabling failure
      qeth: no recovery after layer mismatch (z/VM NICs)

Vladislav Zolotarov (1):
      bnx2x: Removed FW 5.2.7

Wolfgang Grandegger (1):
      MAINTAINERS: add netdev to CAN network layer and drivers entries

YOSHIFUJI Hideaki (1):
      bridge: ensure to unlock in error path in br_multicast_query().

YOSHIFUJI Hideaki / 吉藤英明 (2):
      ipv6: Optmize translation between IPV6_PREFER_SRC_xxx and RT6_LOOKUP_F_xxx.
      ipv6 ip6_tunnel: eliminate unused recursion field from ip6_tnl{}.

Zhu Yi (11):
      net: add limit for socket backlog
      tcp: use limited socket backlog
      udp: use limited socket backlog
      llc: use limited socket backlog
      sctp: use limited socket backlog
      tipc: use limited socket backlog
      x25: use limited socket backlog
      net: backlog functions rename
      net: add __must_check to sk_add_backlog
      libipw: split ieee->networks into small pieces
      ipw2200: use kmalloc for large local variables

stephen hemminger (4):
      IPv6: addrconf dad timer unnecessary bh_disable
      IPv6: addrconf timer race
      IPv6: addrconf notify when address is unavailable
      IPv6: fix race between cleanup and add/delete address

 MAINTAINERS                                  |   21 +-
 drivers/net/Kconfig                          |    2 +-
 drivers/net/arm/ks8695net.c                  |    2 +-
 drivers/net/benet/be.h                       |    5 -
 drivers/net/benet/be_cmds.c                  |    6 -
 drivers/net/benet/be_hw.h                    |    5 +-
 drivers/net/benet/be_main.c                  |   25 +-
 drivers/net/can/bfin_can.c                   |    3 +-
 drivers/net/can/usb/ems_usb.c                |    4 +-
 drivers/net/cassini.c                        |    2 +-
 drivers/net/cpmac.c                          |   14 +-
 drivers/net/cxgb3/cxgb3_main.c               |    1 +
 drivers/net/davinci_emac.c                   |    2 +-
 drivers/net/e1000e/defines.h                 |    2 +
 drivers/net/e1000e/ich8lan.c                 |   10 +
 drivers/net/gianfar.c                        |    5 +-
 drivers/net/irda/irda-usb.c                  |    4 +
 drivers/net/qlcnic/qlcnic.h                  |   13 +-
 drivers/net/qlcnic/qlcnic_ethtool.c          |   17 +
 drivers/net/qlcnic/qlcnic_hw.c               |   32 +-
 drivers/net/qlcnic/qlcnic_init.c             |  156 +-
 drivers/net/qlcnic/qlcnic_main.c             |    5 +
 drivers/net/r8169.c                          |    4 +-
 drivers/net/s2io.c                           |    6 +-
 drivers/net/sky2.c                           |    2 +-
 drivers/net/smc91x.h                         |   42 +
 drivers/net/tg3.c                            |    4 +-
 drivers/net/tulip/eeprom.c                   |   54 +-
 drivers/net/typhoon.c                        |    6 +-
 drivers/net/usb/asix.c                       |   30 +-
 drivers/net/usb/pegasus.h                    |    6 +-
 drivers/net/wireless/airo.c                  |    3 +-
 drivers/net/wireless/ath/ar9170/ar9170.h     |    1 +
 drivers/net/wireless/ath/ar9170/main.c       |   10 +-
 drivers/net/wireless/ath/ar9170/usb.c        |  170 +-
 drivers/net/wireless/ath/ath5k/eeprom.c      |    4 +-
 drivers/net/wireless/ath/ath5k/phy.c         |   41 +-
 drivers/net/wireless/ath/ath5k/reg.h         |    1 +
 drivers/net/wireless/ath/ath5k/reset.c       |   22 +-
 drivers/net/wireless/ath/ath9k/rc.c          |    6 +-
 drivers/net/wireless/ath/ath9k/xmit.c        |    4 +-
 drivers/net/wireless/ipw2x00/ipw2200.c       |   19 +-
 drivers/net/wireless/ipw2x00/libipw.h        |    2 +-
 drivers/net/wireless/ipw2x00/libipw_module.c |   37 +-
 drivers/net/wireless/iwlwifi/iwl-3945.c      |    6 +-
 drivers/net/wireless/iwlwifi/iwl-agn.c       |  159 +-
 drivers/net/wireless/iwlwifi/iwl-dev.h       |    2 +
 drivers/net/wireless/iwlwifi/iwl-scan.c      |   49 +-
 drivers/net/wireless/rndis_wlan.c            |   66 +-
 drivers/net/wireless/rt2x00/rt2800pci.c      |    2 +-
 drivers/net/wireless/rt2x00/rt2x00soc.c      |    1 +
 drivers/net/wireless/rt2x00/rt2x00soc.h      |    2 -
 drivers/net/wireless/rt2x00/rt73usb.c        |    2 +
 drivers/net/wireless/zd1211rw/zd_mac.c       |   10 +-
 drivers/s390/net/qeth_core.h                 |    3 +-
 drivers/s390/net/qeth_core_main.c            |    5 +-
 drivers/s390/net/qeth_core_sys.c             |    3 +
 drivers/s390/net/qeth_l2_main.c              |   16 +-
 drivers/s390/net/qeth_l3_main.c              |   82 +-
 firmware/bnx2x-e1-5.2.7.0.fw.ihex            |10178 --------------------
 firmware/bnx2x-e1h-5.2.7.0.fw.ihex           |12847 --------------------------
 include/linux/ethtool.h                      |   24 +-
 include/linux/rfkill.h                       |    2 +-
 include/linux/snmp.h                         |    2 +
 include/net/ip6_route.h                      |   18 +
 include/net/ip6_tunnel.h                     |    1 -
 include/net/mac80211.h                       |    3 +-
 include/net/sock.h                           |   17 +-
 include/net/tcp.h                            |    2 +-
 include/net/xfrm.h                           |    3 +-
 net/bluetooth/hci_sysfs.c                    |   41 +-
 net/bridge/Kconfig                           |    1 +
 net/bridge/br_multicast.c                    |   19 +-
 net/core/dev_mcast.c                         |    5 +-
 net/core/ethtool.c                           |  103 +-
 net/core/neighbour.c                         |    2 +
 net/core/sock.c                              |   19 +-
 net/dccp/minisocks.c                         |    2 +-
 net/ipv4/ip_gre.c                            |    7 +-
 net/ipv4/ipconfig.c                          |   57 +-
 net/ipv4/proc.c                              |    2 +
 net/ipv4/route.c                             |   50 +-
 net/ipv4/tcp_ipv4.c                          |   15 +-
 net/ipv4/tcp_minisocks.c                     |    2 +-
 net/ipv4/tcp_output.c                        |   18 +-
 net/ipv4/udp.c                               |    6 +-
 net/ipv4/xfrm4_policy.c                      |    5 +-
 net/ipv6/addrconf.c                          |  104 +-
 net/ipv6/fib6_rules.c                        |   11 +-
 net/ipv6/route.c                             |   11 +-
 net/ipv6/tcp_ipv6.c                          |    7 +-
 net/ipv6/udp.c                               |   28 +-
 net/ipv6/xfrm6_policy.c                      |    3 +-
 net/llc/llc_c_ac.c                           |    2 +-
 net/llc/llc_conn.c                           |    3 +-
 net/mac80211/debugfs_netdev.c                |   10 +-
 net/mac80211/mlme.c                          |   32 +-
 net/mac80211/rate.h                          |    5 +-
 net/mac80211/sta_info.c                      |    1 +
 net/packet/af_packet.c                       |    6 +-
 net/rfkill/input.c                           |    8 +
 net/sctp/input.c                             |   42 +-
 net/sctp/socket.c                            |    3 +
 net/sunrpc/xprtrdma/transport.c              |    7 +-
 net/sunrpc/xprtsock.c                        |    9 +-
 net/tipc/bearer.c                            |   37 +-
 net/tipc/bearer.h                            |    2 +-
 net/tipc/link.c                              |    9 +
 net/tipc/net.c                               |   25 +-
 net/tipc/socket.c                            |    6 +-
 net/tipc/subscr.c                            |   57 +-
 net/tipc/subscr.h                            |    2 -
 net/x25/x25_dev.c                            |    2 +-
 net/xfrm/xfrm_policy.c                       |    7 +-
 114 files changed, 1298 insertions(+), 23810 deletions(-)
 delete mode 100644 firmware/bnx2x-e1-5.2.7.0.fw.ihex
 delete mode 100644 firmware/bnx2x-e1h-5.2.7.0.fw.ihex

^ permalink raw reply

* Re: [PATCH net-next-2.6] bridge: ensure to unlock in error path in br_multicast_query().
From: David Miller @ 2010-03-13 20:27 UTC (permalink / raw)
  To: yoshfuji; +Cc: netdev
In-Reply-To: <201003101524.o2AFO75x027843@94.43.138.210.xn.2iij.net>

From: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Date: Thu, 11 Mar 2010 00:07:34 +0900

> Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH] drivers/net/tulip/eeprom.c: fix bogus "(null)" in tulip init messages
From: David Miller @ 2010-03-13 20:26 UTC (permalink / raw)
  To: mikpe; +Cc: joe, netdev, grundler, kyle, linux-kernel
In-Reply-To: <19351.61461.545790.609086@pilspetsen.it.uu.se>

From: Mikael Pettersson <mikpe@it.uu.se>
Date: Wed, 10 Mar 2010 20:16:37 +0100

> Joe Perches writes:
>  > Signed-off-by: Joe Perches <joe@perches.com>
 ...
> Tested-by: Mikael Pettersson <mikpe@it.uu.se>

Applied, thanks everyone.

^ permalink raw reply

* Re: [PATCH] sky2: Avoid rtnl_unlock without rtnl_lock
From: David Miller @ 2010-03-13 20:24 UTC (permalink / raw)
  To: mikem; +Cc: shemminger, netdev
In-Reply-To: <4B9ACA33.5060104@ring3k.org>

From: Mike McCormack <mikem@ring3k.org>
Date: Sat, 13 Mar 2010 08:11:47 +0900

> Make sure we always call rtnl_lock before going down the
> error path in sky2_resume, which unlocks the rtnl lock.
> 
> Signed-off-by: Mike McCormack <mikem@ring3k.org>

Applied, thanks Mike.

^ permalink raw reply

* Re: ipv6: Send netlink notification when DAD fails
From: David Miller @ 2010-03-13 20:23 UTC (permalink / raw)
  To: herbert; +Cc: netdev
In-Reply-To: <20100313111117.GA25903@gondor.apana.org.au>

From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Sat, 13 Mar 2010 19:11:17 +0800

> ipv6: Send netlink notification when DAD fails
> 
> If we are managing IPv6 addresses using DHCP, it would be nice
> for user-space to be notified if an address configured through
> DHCP fails DAD.  Otherwise user-space would have to poll to see
> whether DAD succeeds.
> 
> This patch uses the existing notification mechanism and simply
> hooks it into the DAD failure code path.
> 
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

Applied, thanks Herbert.

^ permalink raw reply

* Re: [PATCH] drivers/net/tg3.c: change the field used with the TG3_FLAG_10_100_ONLY constant
From: David Miller @ 2010-03-13 20:22 UTC (permalink / raw)
  To: julia; +Cc: mcarlson, mchan, netdev, linux-kernel, kernel-janitors
In-Reply-To: <Pine.LNX.4.64.1003131000420.30245@ask.diku.dk>

From: Julia Lawall <julia@diku.dk>
Date: Sat, 13 Mar 2010 10:01:09 +0100 (CET)

> From: Julia Lawall <julia@diku.dk>
> 
> The constant TG3_FLAG_10_100_ONLY should be used with the tg3_flags field,
> not the tg3_flags2 field, as done elsewhere in the same file.
> 
> Signed-off-by: Julia Lawall <julia@diku.dk>

Applied, thanks a lot Julia.

^ permalink raw reply

* Re: [PATCH] NET: tg3: fix brace, switch, and comma spacing coding style in tg3.c This is a patch to the tg3.c file that aligns switch and case statements, else statements following braces, and inserts a space after commas listed in the coding style g
From: Joe Perches @ 2010-03-13 20:22 UTC (permalink / raw)
  To: David Miller
  Cc: thisdyingdream, sjharms, mcarlson, mchan, benli, netdev,
	linux-kernel, sharms
In-Reply-To: <20100313.115555.209991546.davem@davemloft.net>

On Sat, 2010-03-13 at 11:55 -0800, David Miller wrote:
> From: Steven Harms <thisdyingdream@gmail.com>
> Date: Sat, 13 Mar 2010 14:52:26 -0500
> 
> > Would you like me to submit the patch adding only the spaces after
> > commas and leave the rest of the defines as is, or discard the changes
> > all together?
> 
> I would like you to toss them altogether.

I think that Steven got off on the wrong foot
a bit by adding the parentheses to the defines.

I think the other changes he suggested are
tree-wide style consistency only and are ok.

Perhaps you might reconsider later, after
net-next reopens.



^ permalink raw reply

* Re: [PATCH] fix PHY polling system blocking
From: David Miller @ 2010-03-13 20:12 UTC (permalink / raw)
  To: stefani; +Cc: linux-kernel, netdev
In-Reply-To: <1268484790.6339.37.camel@wall-e>

From: Stefani Seibold <stefani@seibold.net>
Date: Sat, 13 Mar 2010 13:53:10 +0100

> For PHY chips without interrupts, the status of the ethernet will be
> polled every 2 sec. The poll function will read some register of the MII
> PHY. The time between the sending the MII_READ_COMMAND and receiving the
> result could be very long (>100us).

I'm not apply this, as I described in my previous email.

If it's expensive to detect link configuration changes that
doesn't mean you just turn it off.

^ permalink raw reply

* Re: [PATCH] fix PHY polling system blocking
From: David Miller @ 2010-03-13 20:10 UTC (permalink / raw)
  To: stefani; +Cc: akpm, linux-kernel, netdev
In-Reply-To: <1268481242.4885.70.camel@wall-e>

From: Stefani Seibold <stefani@seibold.net>
Date: Sat, 13 Mar 2010 12:54:02 +0100

> There is not real drawback, only the detection of a connection type
> change without unplugging the cable will not work. But this is more an
> esoteric use case.

I don't think it's so esoteric.

We should definitely notice all link state and capability changes.

If proper functionality cannot be done without an expensive operation,
it doesn't mean we take away the proper functionality.

I really don't agree with these changes, sorry.

^ permalink raw reply

* Re: [PATCH] NET: tg3: fix brace, switch, and comma spacing coding style in tg3.c This is a patch to the tg3.c file that aligns switch and case statements, else statements following braces, and inserts a space after commas listed in the coding style g
From: David Miller @ 2010-03-13 19:55 UTC (permalink / raw)
  To: thisdyingdream
  Cc: sjharms, mcarlson, mchan, benli, netdev, linux-kernel, sharms
In-Reply-To: <b6bf7b051003131152t38c8b1e1m33e8844468b9e46a@mail.gmail.com>

From: Steven Harms <thisdyingdream@gmail.com>
Date: Sat, 13 Mar 2010 14:52:26 -0500

> Would you like me to submit the patch adding only the spaces after
> commas and leave the rest of the defines as is, or discard the changes
> all together?

I would like you to toss them altogether.

^ permalink raw reply

* [PATCH] vsprintf.c: remove stack variable ksym from
From: Joe Perches @ 2010-03-13 19:54 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Andrew Morton, Nick Andrew, Linux Kernel Mailing List,
	Greg Kroah-Hartman, netdev, Bjorn Helgaas
In-Reply-To: <1268502295.30289.44.camel@Joe-Laptop.home>

On Sat, 2010-03-13 at 09:44 -0800, Joe Perches wrote:
> On Sat, 2010-03-13 at 07:35 -0800, Linus Torvalds wrote:
> > On Fri, 12 Mar 2010, Andrew Morton wrote:
> > > nice.
> > But the kallsyms_lookup()/sprint_symbol() functions don't take a 
> > length parameter, so we have to do the worst-case thing (which itself has 
> > tons of unnecessary padding).
> Perhaps a new snprint_symbol function with the
> other kallsyms... functions changed as necessary.

Perhaps something like this:

Functions added:

kallsyms_lookup_n	length limited kallsyms_lookup
snprint_symbol		length limited sprint_symbol
module_address_lookup_n	length limited module_address_lookup

Changes to vsprintf.c, function symbol_string:

remove stack variable ksym, just use output buffer
and length limited functions.

Compiled, untested

Signed-off-by: Joe Perches
---
 include/linux/kallsyms.h |    7 ++++
 include/linux/module.h   |   15 ++++++++
 kernel/kallsyms.c        |   91 ++++++++++++++++++++++++++++++++++++++++------
 kernel/module.c          |   33 +++++++++++++++++
 lib/vsprintf.c           |   14 ++++---
 5 files changed, 143 insertions(+), 17 deletions(-)

diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h
index d8e9b3d..b1729b5 100644
--- a/include/linux/kallsyms.h
+++ b/include/linux/kallsyms.h
@@ -34,8 +34,15 @@ const char *kallsyms_lookup(unsigned long addr,
 			    unsigned long *offset,
 			    char **modname, char *namebuf);
 
+const char *kallsyms_lookup_n(unsigned long addr,
+			      unsigned long *symbolsize,
+			      unsigned long *offset,
+			      char **modname, char *namebuf, size_t size);
+
 /* Look up a kernel symbol and return it in a text buffer. */
 extern int sprint_symbol(char *buffer, unsigned long address);
+/* Look up a kernel symbol and return it in a text buffer. */
+extern int snprint_symbol(char *buffer, size_t size, unsigned long address);
 
 /* Look up a kernel symbol and print it to the kernel messages. */
 extern void __print_symbol(const char *fmt, unsigned long address);
diff --git a/include/linux/module.h b/include/linux/module.h
index 5e869ff..7a65fad 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -520,6 +520,11 @@ const char *module_address_lookup(unsigned long addr,
 			    unsigned long *offset,
 			    char **modname,
 			    char *namebuf);
+const char *module_address_lookup_n(unsigned long addr,
+				    unsigned long *symbolsize,
+				    unsigned long *offset,
+				    char **modname,
+				    char *namebuf, size_t size);
 int lookup_module_symbol_name(unsigned long addr, char *symname);
 int lookup_module_symbol_attrs(unsigned long addr, unsigned long *size, unsigned long *offset, char *modname, char *name);
 
@@ -598,6 +603,16 @@ static inline const char *module_address_lookup(unsigned long addr,
 	return NULL;
 }
 
+/* For kallsyms to ask for address resolution.  NULL means not found. */
+static inline const char *module_address_lookup_n(unsigned long addr,
+						  unsigned long *symbolsize,
+						  unsigned long *offset,
+						  char **modname,
+						  char *namebuf, size_t size)
+{
+	return NULL;
+}
+
 static inline int lookup_module_symbol_name(unsigned long addr, char *symname)
 {
 	return -ERANGE;
diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c
index 8e5288a..0516d23 100644
--- a/kernel/kallsyms.c
+++ b/kernel/kallsyms.c
@@ -84,9 +84,11 @@ static int is_ksym_addr(unsigned long addr)
  * Expand a compressed symbol data into the resulting uncompressed string,
  * given the offset to where the symbol is in the compressed stream.
  */
-static unsigned int kallsyms_expand_symbol(unsigned int off, char *result)
+static unsigned int kallsyms_expand_symbol(unsigned int off,
+					   char *result, size_t size)
 {
-	int len, skipped_first = 0;
+	int len;
+	bool skipped_first = false;
 	const u8 *tptr, *data;
 
 	/* Get the compressed symbol length from the first symbol byte. */
@@ -110,16 +112,18 @@ static unsigned int kallsyms_expand_symbol(unsigned int off, char *result)
 		len--;
 
 		while (*tptr) {
-			if (skipped_first) {
+			if (skipped_first && size > 1) {
 				*result = *tptr;
 				result++;
+				size--;
 			} else
-				skipped_first = 1;
+				skipped_first = true;
 			tptr++;
 		}
 	}
 
-	*result = '\0';
+	if (size)
+		*result = '\0';
 
 	/* Return to offset to the next symbol. */
 	return off;
@@ -174,7 +178,7 @@ unsigned long kallsyms_lookup_name(const char *name)
 	unsigned int off;
 
 	for (i = 0, off = 0; i < kallsyms_num_syms; i++) {
-		off = kallsyms_expand_symbol(off, namebuf);
+		off = kallsyms_expand_symbol(off, namebuf, sizeof(namebuf));
 
 		if (strcmp(namebuf, name) == 0)
 			return kallsyms_addresses[i];
@@ -193,7 +197,7 @@ int kallsyms_on_each_symbol(int (*fn)(void *, const char *, struct module *,
 	int ret;
 
 	for (i = 0, off = 0; i < kallsyms_num_syms; i++) {
-		off = kallsyms_expand_symbol(off, namebuf);
+		off = kallsyms_expand_symbol(off, namebuf, sizeof(namebuf));
 		ret = fn(data, namebuf, NULL, kallsyms_addresses[i]);
 		if (ret != 0)
 			return ret;
@@ -292,7 +296,8 @@ const char *kallsyms_lookup(unsigned long addr,
 
 		pos = get_symbol_pos(addr, symbolsize, offset);
 		/* Grab name */
-		kallsyms_expand_symbol(get_symbol_offset(pos), namebuf);
+		kallsyms_expand_symbol(get_symbol_offset(pos),
+				       namebuf, KSYM_NAME_LEN);
 		if (modname)
 			*modname = NULL;
 		return namebuf;
@@ -303,6 +308,38 @@ const char *kallsyms_lookup(unsigned long addr,
 				     namebuf);
 }
 
+/*
+ * Lookup an address (length_limited)
+ * - modname is set to NULL if it's in the kernel.
+ * - We guarantee that the returned name is valid until we reschedule even if.
+ *   It resides in a module.
+ * - We also guarantee that modname will be valid until rescheduled.
+ */
+const char *kallsyms_lookup_n(unsigned long addr,
+			      unsigned long *symbolsize,
+			      unsigned long *offset,
+			      char **modname, char *namebuf, size_t size)
+{
+	if (size)
+		namebuf[size - 1] = 0;
+	namebuf[0] = 0;
+
+	if (is_ksym_addr(addr)) {
+		unsigned long pos;
+
+		pos = get_symbol_pos(addr, symbolsize, offset);
+		/* Grab name */
+		kallsyms_expand_symbol(get_symbol_offset(pos), namebuf, size);
+		if (modname)
+			*modname = NULL;
+		return namebuf;
+	}
+
+	/* See if it's in a module. */
+	return module_address_lookup_n(addr, symbolsize, offset, modname,
+				       namebuf, size);
+}
+
 int lookup_symbol_name(unsigned long addr, char *symname)
 {
 	symname[0] = '\0';
@@ -313,7 +350,8 @@ int lookup_symbol_name(unsigned long addr, char *symname)
 
 		pos = get_symbol_pos(addr, NULL, NULL);
 		/* Grab name */
-		kallsyms_expand_symbol(get_symbol_offset(pos), symname);
+		kallsyms_expand_symbol(get_symbol_offset(pos),
+				       symname, KSYM_NAME_LEN);
 		return 0;
 	}
 	/* See if it's in a module. */
@@ -331,7 +369,8 @@ int lookup_symbol_attrs(unsigned long addr, unsigned long *size,
 
 		pos = get_symbol_pos(addr, size, offset);
 		/* Grab name */
-		kallsyms_expand_symbol(get_symbol_offset(pos), name);
+		kallsyms_expand_symbol(get_symbol_offset(pos),
+				       name, KSYM_NAME_LEN);
 		modname[0] = '\0';
 		return 0;
 	}
@@ -340,6 +379,36 @@ int lookup_symbol_attrs(unsigned long addr, unsigned long *size,
 }
 
 /* Look up a kernel symbol and return it in a text buffer. */
+int snprint_symbol(char *buffer, size_t size, unsigned long address)
+{
+	char *modname;
+	const char *name;
+	unsigned long offset, ksize;
+	int len;
+
+	name = kallsyms_lookup_n(address, &ksize, &offset, &modname,
+				 buffer, size);
+	if (!name)
+		return snprintf(buffer, size, "0x%lx", address);
+
+	if (name != buffer)
+		strncpy(buffer, name, size);
+	len = strlen(buffer);
+	buffer += len;
+
+	if (modname)
+		len += snprintf(buffer, size - len,
+				"+%#lx/%#lx [%s]", offset, ksize, modname);
+	else
+		len += snprintf(buffer, size - len,
+				"+%#lx/%#lx", offset, ksize);
+
+	return len;
+}
+EXPORT_SYMBOL_GPL(snprint_symbol);
+
+
+/* Look up a kernel symbol and return it in a text buffer. */
 int sprint_symbol(char *buffer, unsigned long address)
 {
 	char *modname;
@@ -407,7 +476,7 @@ static unsigned long get_ksymbol_core(struct kallsym_iter *iter)
 
 	iter->type = kallsyms_get_symbol_type(off);
 
-	off = kallsyms_expand_symbol(off, iter->name);
+	off = kallsyms_expand_symbol(off, iter->name, sizeof(iter->name));
 
 	return off - iter->nameoff;
 }
diff --git a/kernel/module.c b/kernel/module.c
index c968d36..17a879a 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -2607,6 +2607,39 @@ const char *module_address_lookup(unsigned long addr,
 	return ret;
 }
 
+/* For kallsyms to ask for address resolution.  NULL means not found.  Careful
+ * not to lock to avoid deadlock on oopses, simply disable preemption. */
+const char *module_address_lookup_n(unsigned long addr,
+				    unsigned long *ksize,
+				    unsigned long *offset,
+				    char **modname,
+				    char *namebuf, size_t size)
+{
+	struct module *mod;
+	const char *ret = NULL;
+
+	preempt_disable();
+	list_for_each_entry_rcu(mod, &modules, list) {
+		if (within_module_init(addr, mod) ||
+		    within_module_core(addr, mod)) {
+			if (modname)
+				*modname = mod->name;
+			ret = get_ksymbol(mod, addr, ksize, offset);
+			break;
+		}
+	}
+	/* Make a copy in here where it's safe */
+	if (ret) {
+		if (size) {
+			strncpy(namebuf, ret, size - 1);
+			namebuf[size - 1] = 0;
+		}
+		ret = namebuf;
+	}
+	preempt_enable();
+	return ret;
+}
+
 int lookup_module_symbol_name(unsigned long addr, char *symname)
 {
 	struct module *mod;
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 0d461c7..dab6354 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -571,13 +571,15 @@ static char *symbol_string(char *buf, char *end, void *ptr,
 {
 	unsigned long value = (unsigned long) ptr;
 #ifdef CONFIG_KALLSYMS
-	char sym[KSYM_SYMBOL_LEN];
-	if (ext != 'f' && ext != 's')
-		sprint_symbol(sym, value);
-	else
-		kallsyms_lookup(value, NULL, NULL, NULL, sym);
+	/* Cap ending position to spec.field_width if specified */
+	if (spec.field_width > 0 && (end - buf) > spec.field_width)
+		end = buf + spec.field_width;
 
-	return string(buf, end, sym, spec);
+	if (ext != 'f' && ext != 's')
+		return buf + snprint_symbol(buf, end - buf, value);
+		
+	kallsyms_lookup_n(value, NULL, NULL, NULL, buf, end - buf);
+	return buf + strlen(buf);
 #else
 	spec.field_width = 2 * sizeof(void *);
 	spec.flags |= SPECIAL | SMALL | ZEROPAD;

^ permalink raw reply related

* Re: [PATCH] NET: tg3: fix brace, switch, and comma spacing coding style in tg3.c This is a patch to the tg3.c file that aligns switch and case statements, else statements following braces, and inserts a space after commas listed in the coding style g
From: Steven Harms @ 2010-03-13 19:52 UTC (permalink / raw)
  To: David Miller
  Cc: sjharms, mcarlson, mchan, benli, netdev, linux-kernel, sharms

David,

Would you like me to submit the patch adding only the spaces after
commas and leave the rest of the defines as is, or discard the changes
all together?

On Sat, Mar 13, 2010 at 2:49 PM, David Miller <davem@davemloft.net> wrote:
> From: Steven Harms <sjharms@gmail.com>
> Date: Sat, 13 Mar 2010 14:39:11 -0500
>
>> -#define tw32_mailbox(reg, val)       tp->write32_mbox(tp, reg, val)
>> -#define tw32_mailbox_f(reg, val)     tw32_mailbox_flush(tp, (reg), (val))
>> -#define tw32_rx_mbox(reg, val)       tp->write32_rx_mbox(tp, reg, val)
>> -#define tw32_tx_mbox(reg, val)       tp->write32_tx_mbox(tp, reg, val)
>> -#define tr32_mailbox(reg)    tp->read32_mbox(tp, reg)
>> +#define tw32_mailbox(reg, val)       (tp->write32_mbox(tp, reg, val))
>
> Please keep this kind of code masterbation to yourself.
> This is not the style we want for this driver.
>



-- 
GPG Key ID: C92EF367 / 1428 FE8E 1E07 DDA8 EFD7 195F DCCD F5B3 C92E F367

WWW: http://www.sharms.org/blog

^ permalink raw reply

* Re: [PATCH] NET: tg3: fix brace, switch, and comma spacing coding style in tg3.c This is a patch to the tg3.c file that aligns switch and case statements, else statements following braces, and inserts a space after commas listed in the coding style guidelines and verified by checkpatch.pl tool.
From: David Miller @ 2010-03-13 19:49 UTC (permalink / raw)
  To: sjharms; +Cc: mcarlson, mchan, benli, netdev, linux-kernel, sharms
In-Reply-To: <1268509151-27281-1-git-send-email-sharms@ubuntu.com>

From: Steven Harms <sjharms@gmail.com>
Date: Sat, 13 Mar 2010 14:39:11 -0500

> -#define tw32_mailbox(reg, val)	tp->write32_mbox(tp, reg, val)
> -#define tw32_mailbox_f(reg, val)	tw32_mailbox_flush(tp, (reg), (val))
> -#define tw32_rx_mbox(reg, val)	tp->write32_rx_mbox(tp, reg, val)
> -#define tw32_tx_mbox(reg, val)	tp->write32_tx_mbox(tp, reg, val)
> -#define tr32_mailbox(reg)	tp->read32_mbox(tp, reg)
> +#define tw32_mailbox(reg, val)	(tp->write32_mbox(tp, reg, val))

Please keep this kind of code masterbation to yourself.
This is not the style we want for this driver.

^ permalink raw reply

* [PATCH] NET: tg3: fix brace, switch, and comma spacing coding style in tg3.c This is a patch to the tg3.c file that aligns switch and case statements, else statements following braces, and inserts a space after commas listed in the coding style guidelines and verified by checkpatch.pl tool.
From: Steven Harms @ 2010-03-13 19:39 UTC (permalink / raw)
  To: mcarlson, mchan, davem, benli; +Cc: netdev, linux-kernel, sharms

---
 drivers/net/tg3.c |   60 +++++++++++++++++++++++-----------------------------
 1 files changed, 27 insertions(+), 33 deletions(-)

diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 0fa7688..02e6326 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -496,16 +496,16 @@ static void tg3_write32_mbox_5906(struct tg3 *tp, u32 off, u32 val)
 	writel(val, tp->regs + off + GRCMBOX_BASE);
 }
 
-#define tw32_mailbox(reg, val)	tp->write32_mbox(tp, reg, val)
-#define tw32_mailbox_f(reg, val)	tw32_mailbox_flush(tp, (reg), (val))
-#define tw32_rx_mbox(reg, val)	tp->write32_rx_mbox(tp, reg, val)
-#define tw32_tx_mbox(reg, val)	tp->write32_tx_mbox(tp, reg, val)
-#define tr32_mailbox(reg)	tp->read32_mbox(tp, reg)
+#define tw32_mailbox(reg, val)	(tp->write32_mbox(tp, reg, val))
+#define tw32_mailbox_f(reg, val)	(tw32_mailbox_flush(tp, (reg), (val)))
+#define tw32_rx_mbox(reg, val)	(tp->write32_rx_mbox(tp, reg, val))
+#define tw32_tx_mbox(reg, val)	(tp->write32_tx_mbox(tp, reg, val))
+#define tr32_mailbox(reg)	(tp->read32_mbox(tp, reg))
 
-#define tw32(reg,val)		tp->write32(tp, reg, val)
-#define tw32_f(reg,val)		_tw32_flush(tp,(reg),(val), 0)
-#define tw32_wait_f(reg,val,us)	_tw32_flush(tp,(reg),(val), (us))
-#define tr32(reg)		tp->read32(tp, reg)
+#define tw32(reg, val)		(tp->write32(tp, (reg), (val)))
+#define tw32_f(reg, val)		(_tw32_flush(tp, (reg), (val), 0))
+#define tw32_wait_f(reg, val, us)	(_tw32_flush(tp, (reg), (val), (us)))
+#define tr32(reg)		(tp->read32(tp, reg))
 
 static void tg3_write_mem(struct tg3 *tp, u32 off, u32 val)
 {
@@ -579,11 +579,11 @@ static int tg3_ape_lock(struct tg3 *tp, int locknum)
 		return 0;
 
 	switch (locknum) {
-		case TG3_APE_LOCK_GRC:
-		case TG3_APE_LOCK_MEM:
-			break;
-		default:
-			return -EINVAL;
+	case TG3_APE_LOCK_GRC:
+	case TG3_APE_LOCK_MEM:
+		break;
+	default:
+		return -EINVAL;
 	}
 
 	off = 4 * locknum;
@@ -617,11 +617,11 @@ static void tg3_ape_unlock(struct tg3 *tp, int locknum)
 		return;
 
 	switch (locknum) {
-		case TG3_APE_LOCK_GRC:
-		case TG3_APE_LOCK_MEM:
-			break;
-		default:
-			return;
+	case TG3_APE_LOCK_GRC:
+	case TG3_APE_LOCK_MEM:
+		break;
+	default:
+		return;
 	}
 
 	off = 4 * locknum;
@@ -1855,8 +1855,7 @@ static int tg3_phy_reset_5703_4_5(struct tg3 *tp)
 	    GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) {
 		/* Set Extended packet length bit for jumbo frames */
 		tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x4400);
-	}
-	else {
+	} else {
 		tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x0400);
 	}
 
@@ -1974,8 +1973,7 @@ out:
 		tg3_writephy(tp, MII_TG3_DSP_ADDRESS, 0x401f);
 		tg3_writephy(tp, MII_TG3_DSP_RW_PORT, 0x14e2);
 		tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x0400);
-	}
-	else if (tp->tg3_flags2 & TG3_FLG2_PHY_JITTER_BUG) {
+	} else if (tp->tg3_flags2 & TG3_FLG2_PHY_JITTER_BUG) {
 		tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x0c00);
 		tg3_writephy(tp, MII_TG3_DSP_ADDRESS, 0x000a);
 		if (tp->tg3_flags2 & TG3_FLG2_PHY_ADJUST_TRIM) {
@@ -3425,7 +3423,7 @@ static int tg3_fiber_aneg_smachine(struct tg3 *tp,
 	ap->rxconfig = rx_cfg_reg;
 	ret = ANEG_OK;
 
-	switch(ap->state) {
+	switch (ap->state) {
 	case ANEG_STATE_UNKNOWN:
 		if (ap->flags & (MR_AN_ENABLE | MR_RESTART_AN))
 			ap->state = ANEG_STATE_AN_ENABLE;
@@ -3463,11 +3461,10 @@ static int tg3_fiber_aneg_smachine(struct tg3 *tp,
 		/* fallthru */
 	case ANEG_STATE_RESTART:
 		delta = ap->cur_time - ap->link_time;
-		if (delta > ANEG_STATE_SETTLE_TIME) {
+		if (delta > ANEG_STATE_SETTLE_TIME)
 			ap->state = ANEG_STATE_ABILITY_DETECT_INIT;
-		} else {
+		else
 			ret = ANEG_TIMER_ENAB;
-		}
 		break;
 
 	case ANEG_STATE_DISABLE_LINK_OK:
@@ -3491,9 +3488,8 @@ static int tg3_fiber_aneg_smachine(struct tg3 *tp,
 		break;
 
 	case ANEG_STATE_ABILITY_DETECT:
-		if (ap->ability_match != 0 && ap->rxconfig != 0) {
+		if (ap->ability_match != 0 && ap->rxconfig != 0)
 			ap->state = ANEG_STATE_ACK_DETECT_INIT;
-		}
 		break;
 
 	case ANEG_STATE_ACK_DETECT_INIT:
@@ -4171,8 +4167,7 @@ static int tg3_setup_fiber_mii_phy(struct tg3 *tp, int force_reset)
 					current_duplex = DUPLEX_FULL;
 				else
 					current_duplex = DUPLEX_HALF;
-			}
-			else
+			} else
 				current_link_up = 0;
 		}
 	}
@@ -4240,8 +4235,7 @@ static void tg3_serdes_parallel_detect(struct tg3 *tp)
 				tp->tg3_flags2 |= TG3_FLG2_PARALLEL_DETECT;
 			}
 		}
-	}
-	else if (netif_carrier_ok(tp->dev) &&
+	} else if (netif_carrier_ok(tp->dev) &&
 		 (tp->link_config.autoneg == AUTONEG_ENABLE) &&
 		 (tp->tg3_flags2 & TG3_FLG2_PARALLEL_DETECT)) {
 		u32 phy2;
-- 
1.6.3.3


^ permalink raw reply related

* Re: [PATCH] vsprintf.c: Use noinline_for_stack
From: Joe Perches @ 2010-03-13 17:44 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Andrew Morton, Nick Andrew, Linux Kernel Mailing List,
	Greg Kroah-Hartman, netdev, Bjorn Helgaas
In-Reply-To: <alpine.LFD.2.00.1003130734420.3719@i5.linux-foundation.org>

On Sat, 2010-03-13 at 07:35 -0800, Linus Torvalds wrote:
> On Fri, 12 Mar 2010, Andrew Morton wrote:
> > nice.
> But the kallsyms_lookup()/sprint_symbol() functions don't take a 
> length parameter, so we have to do the worst-case thing (which itself has 
> tons of unnecessary padding).

I sent a patch once about that using a struct
because I didn't like the unbounded sprint
http://lkml.org/lkml/2009/4/15/16

> Gaah. We do _not_ want a kmalloc() or something like that in this path, 
> since its' very much used for oopses (which in turn may be due to various 
> slab bugs etc).

Perhaps a new snprint_symbol function with the
other kallsyms... functions changed as necessary.

thoughts?

^ permalink raw reply

* Re: [PATCH] vsprintf.c: Use noinline_for_stack
From: Linus Torvalds @ 2010-03-13 15:35 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Joe Perches, Nick Andrew, Linux Kernel Mailing List,
	Greg Kroah-Hartman, netdev, Bjorn Helgaas
In-Reply-To: <20100312162559.a8e51777.akpm@linux-foundation.org>


On Fri, 12 Mar 2010, Andrew Morton wrote:
> 
> -ENOTESTINGRESULTS.
> 
> Before:
> 
> akpm:/usr/src/25> objdump -d lib/vsprintf.o | perl scripts/checkstack.pl
> 0x00000e82 pointer [vsprintf.o]:                        344
> 0x0000198c pointer [vsprintf.o]:                        344
> 0x000025d6 scnprintf [vsprintf.o]:                      216
> 0x00002648 scnprintf [vsprintf.o]:                      216
> 0x00002565 snprintf [vsprintf.o]:                       208
> 0x0000267c sprintf [vsprintf.o]:                        208
> 0x000030a3 bprintf [vsprintf.o]:                        208
> 0x00003b1e sscanf [vsprintf.o]:                         208
> 0x00000608 number [vsprintf.o]:                         136
> 0x00000937 number [vsprintf.o]:                         136
> 
> After:
> 
> akpm:/usr/src/25> objdump -d lib/vsprintf.o | perl scripts/checkstack.pl  
> 0x00000a7c symbol_string [vsprintf.o]:                  248
> 0x00000ae8 symbol_string [vsprintf.o]:                  248
> 0x00002310 scnprintf [vsprintf.o]:                      216
> 0x00002382 scnprintf [vsprintf.o]:                      216
> 0x0000229f snprintf [vsprintf.o]:                       208
> 0x000023b6 sprintf [vsprintf.o]:                        208
> 0x00002ddd bprintf [vsprintf.o]:                        208
> 0x00003858 sscanf [vsprintf.o]:                         208
> 0x00000625 number [vsprintf.o]:                         136
> 0x00000954 number [vsprintf.o]:                         136
> 
> nice.

Note that the fact that the numbers are smaller is to some degree less 
important than _where_ the numbers are.

In the "before" side, it's the "pointer()" function that has a big stack 
depth. And the recursion that is going to happen is very much about 
vsnprintf -> pointer -> vsnprintf, so that is bad.

Now it's the new non-inlined leaf functions that still have a big stack 
footprint, and that's much better, because they wouldn't be part of any 
recursive behavior.

Not that I think it's wonderful even now. Especially that whole 
'symbol_string()' thing is not only a big stack user, it ends up calling 
down a fair number of other functions. Non-recursively, but still.

That, in turn, is due to this:

 - include/linux/kallsyms.h:
	#define KSYM_NAME_LEN 128
	#define KSYM_SYMBOL_LEN (sizeof("%s+%#lx/%#lx [%s]") + (KSYM_NAME_LEN - 1) + \

 - symbol_string():
	char sym[KSYM_SYMBOL_LEN];

ie we "need" about 150 bytes for just that silly symbol expansion (rounded 
up etc). Which is ridiculous, since we could/should limit it to something 
sane. But the kallsyms_lookup()/sprint_symbol() functions don't take a 
length parameter, so we have to do the worst-case thing (which itself has 
tons of unnecessary padding).

Gaah. We do _not_ want a kmalloc() or something like that in this path, 
since its' very much used for oopses (which in turn may be due to various 
slab bugs etc).

		Linus

^ permalink raw reply

* Re: [RFC PATCH net-next 1/7 v2]IPv6:netfilter: defrag: Handle sysctls about IPv6 conntrack defragment per-netns
From: YOSHIFUJI Hideaki @ 2010-03-13 13:58 UTC (permalink / raw)
  To: Shan Wei
  Cc: Patrick McHardy, David Miller, Alexey Dobriyan, Yasuyuki KOZAKAI,
	netdev@vger.kernel.org, netfilter-devel, yoshfuji
In-Reply-To: <4B88BE39.6050307@cn.fujitsu.com>

Hi,

(2010/02/27 15:39), Shan Wei wrote:
> Register nf_conntrack_frag6_{timeout,high_thresh,low_thresh} sysctls per-netns.
> nf_conntrack_frag6_timeout and ip6frag_time, nf_conntrack_frag6_low_thresh and ip6frag_low_thresh,
> nf_conntrack_frag6_high_thresh and ip6frag_high_thresh, the three sets are equivalent.
> The former sysctls are just an alias for he latter ones of IPv6.
>
> More discussion about it, see http://marc.info/?l=netfilter-devel&m=126709777922959&w=2.

As I mailed in reply to [0/7], I'm not for this,
because the context (including parameters) should be kept
separated between defragmentation in core ipv6 and one in netfilter.

--yoshfuji

^ permalink raw reply

* Re: [RFC PATCH net-next 0/7 v2]IPv6:netfilter: defragment
From: YOSHIFUJI Hideaki @ 2010-03-13 13:47 UTC (permalink / raw)
  To: Shan Wei
  Cc: YOSHIFUJI Hideaki, Patrick McHardy, David Miller, Alexey Dobriyan,
	Yasuyuki KOZAKAI, netdev@vger.kernel.org, netfilter-devel,
	yoshfuji
In-Reply-To: <4B98B4FC.50904@cn.fujitsu.com>

Hi.

(2010/03/11 18:16), Shan Wei wrote:
> yoshifuji-san:
>
> YOSHIFUJI Hideaki wrote, at 03/11/2010 01:13 AM:
>> Well, because the context of defragment are different
>> from standard ones (e.g., In netfilter, defragment can
>> happen even on forwarding path, and the result is always
>> thrown away anyway), I think it is not a good idea to
>> touch standard MIB here. However I'm okay to increment
>> other stats like InDiscards, OurDiscards and netfilter
>> specific stats.
>
> Not only on router, but also on host, if conntrack fails to reassemble
> fragments, the fragments will not be forwarded to IPv4/IPv6 stack.
> So, these fragments can't be traced from MIB counter.
>
> And, IPv4 conntrack records these fragments.
> Is the context of IPv4 defragment different from IPv6?

Yes, it is different.

As you know, defragment can not happen on routers in IPv6.
Because we do want to preserve hop-by-hop option etc,
we preserve original packets in netfilter code.

In IPv6, defragment in netfilter is a temporary just
for conntrack.  The state (including defragmented packet)
is not preserved, and original fragments are used in further
process (including local processing or forwarding).

So, please take that defragment failure is same as other
random reasons what netfilter code thinks.  Of course,
you can introduce nf-specific counters that show reasons
why packets are discarded in netfilter module.

>> On the other hand, I'd even say we should NOT send
>> icmp here (at least by default) because standard routers
>> never send such packet.
>
> Yes,for routers, the patch-set does not send icmp message to
> source host. It only does on destination host with IPv6 connection
> track enable.

Please make it optional (via parameter) at least.

Regards,

--yoshfuji

^ permalink raw reply

* [PATCH] fix PHY polling system blocking
From: Stefani Seibold @ 2010-03-13 12:53 UTC (permalink / raw)
  To: linux-kernel, netdev

This patch fix the PHY poller, which can block the whole system. PHY
access are normaly not very fast, since there are serial attached.

For PHY chips without interrupts, the status of the ethernet will be
polled every 2 sec. The poll function will read some register of the MII
PHY. The time between the sending the MII_READ_COMMAND and receiving the
result could be very long (>100us).

For example:

On a Freescale PPC 834x this result in a delay of 450 us due the slow
communication with the PHY chip. The time between the sending the
MII_READ_COMMAND and receiving the result is more the 100 us on this
controller.
   
The patch modifies the poller a lit bit. Only a link status state change
will result in a successive detection of the connection type. The poll
cycle on the other hand will be increased to one every seconds.

All in all this patch will prevent a blocking of f.e nearly 400 us every
two seconds of the whole system on a PPC 834x.

There is not real drawback, only the detection of a connection type
change without unplugging the cable will not work. But this is more an
esoteric use case.

The patch is against kernel 2.6.33. Please merge it.

Signed-off-by: Stefani Seibold <stefani@seibold.net>
---
 phy.c        |    5 ++---
 phy_device.c |   11 ++++++++---
 2 files changed, 10 insertions(+), 6 deletions(-)

diff -u -N -r -p linux-2.6.33.orig/drivers/net/phy/phy.c linux-2.6.33/drivers/net/phy/phy.c
--- linux-2.6.33.orig/drivers/net/phy/phy.c	2010-02-24 19:52:17.000000000 +0100
+++ linux-2.6.33/drivers/net/phy/phy.c	2010-02-28 22:53:14.725464101 +0100
@@ -871,9 +871,8 @@ void phy_state_machine(struct work_struc
 		case PHY_RUNNING:
 			/* Only register a CHANGE if we are
 			 * polling */
-			if (PHY_POLL == phydev->irq)
-				phydev->state = PHY_CHANGELINK;
-			break;
+			if (PHY_POLL != phydev->irq)
+				break;
 		case PHY_CHANGELINK:
 			err = phy_read_status(phydev);
 
diff -u -N -r -p linux-2.6.33.orig/drivers/net/phy/phy_device.c linux-2.6.33/drivers/net/phy/phy_device.c
--- linux-2.6.33.orig/drivers/net/phy/phy_device.c	2010-02-24 19:52:17.000000000 +0100
+++ linux-2.6.33/drivers/net/phy/phy_device.c	2010-02-28 22:53:14.726464145 +0100
@@ -161,7 +161,7 @@ struct phy_device* phy_device_create(str
 	dev->speed = 0;
 	dev->duplex = -1;
 	dev->pause = dev->asym_pause = 0;
-	dev->link = 1;
+	dev->link = 0;
 	dev->interface = PHY_INTERFACE_MODE_GMII;
 
 	dev->autoneg = AUTONEG_ENABLE;
@@ -694,10 +694,15 @@ int genphy_update_link(struct phy_device
 	if (status < 0)
 		return status;
 
-	if ((status & BMSR_LSTATUS) == 0)
+	if ((status & BMSR_LSTATUS) == 0) {
+		if (phydev->link == 0)
+			return 1;
 		phydev->link = 0;
-	else
+	} else {
+		if (phydev->link == 1)
+			return 1;
 		phydev->link = 1;
+	}
 
 	return 0;
 }

^ permalink raw reply

* Re: Code paths setting gso_size
From: Eric Dumazet @ 2010-03-13 12:09 UTC (permalink / raw)
  To: William Allen Simpson
  Cc: Linux Kernel Network Developers, Dan Carpenter, David Miller,
	Simon Horman
In-Reply-To: <4B9B7591.9080706@gmail.com>

Le samedi 13 mars 2010 à 06:22 -0500, William Allen Simpson a écrit :
> This is a new thread dedicated to a specific topic, spawned by an
> earlier discussion.  I've CC'd only those that participated recently.
> 
> I've written:
> # In this particular instance, I suggest that you take a look at all the
> # places that gso_size is set, and cross index with all the code paths that
> # place these TCP headers onto the txq without a check of doff -- as I did!
> #
> # I'll specifically mention the tun and virtio_net devices, but I'm also
> # particularly concerned with af_packet.c and skbuff.c -- and the general
> # problem with inet_lro.c, too.
> #
> # Amazingly enough, folks sometimes use Linux for routers....
> #
> 
> Eric (and David) have written:
> # Only *locally* generated trafic by linux kernel can enter this path.
> #
> 
> So, let us begin with the tun device, and work our way through the others.
> 

Thats a really good idea William, I'll start another thread to study all
the paths setting skb->len to a possible wrong value. But I'll do this
in my own time, and if I find something, I'll post a patch.

Sure we'll find some bugs by this studies, since in average we find 100
bugs per month, and introduce 90 new ones, thanks God for this.




^ 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