Netdev List
 help / color / mirror / Atom feed
* refcounting on dgram Unix sockets for poll(POLLOUT)
From: Alban Crequy @ 2010-12-08 21:01 UTC (permalink / raw)
  To: netdev

Hi,

When a connected datagram Unix socket is polled for POLLOUT events, the
poller is added in the wait_queue_head_t of the "server" socket:

net/unix/af_unix.c::unix_dgram_poll()
  other = unix_peer_get(sk);
  if (other) {
    if (unix_peer(other) != sk) {
      sock_poll_wait(file, &unix_sk(other)->peer_wait,
                     wait);
      ...

I wonder what prevent the "server" socket ("other") to be released
while the poller is still waiting for POLLOUT events.

There is a reference taken on the "server" socket when the client
connects:
net/unix/af_unix.c::unix_dgram_connect()
  other = unix_find_other(net, sunaddr, alen, sock->type,
            hash, &err);

But that reference could be released when the client socket
disconnects from another thread in one of the 3 possible locations:

1. unix_dgram_connect() when connecting to a different socket
     if (other != old_peer)
       unix_dgram_disconnected(sk, old_peer);
     sock_put(old_peer);

2. unix_dgram_sendmsg() when the server socket is SOCK_DEAD:
     unix_dgram_disconnected(sk, other);
     sock_put(other);

3. unix_release_sock() when the client socket is released:
     skpair = unix_peer(sk);
     if (skpair != NULL) {
       sock_put(skpair); /* It may now die */

I tried to release all the references to server_sockfd with
close(server_sockfd) on the server thread and with
connect(client_sockfd) to a different socket while client_sockfd is
being polled for POLLOUT events in a different thread, hoping to crash
the poller with the stack:
free_poll_entry()->remove_wait_queue()->spin_lock_irqsave()
But I didn't manage to crash the kernel.

Am I missing something? Is there another reference taken on
server_sockfd to protect the kernel from this scenario?

And btw, what is the test (unix_peer(other) != sk) in unix_dgram_poll()?

Alban

^ permalink raw reply

* pull request: wireless-next-2.6 2010-12-08
From: John W. Linville @ 2010-12-08 21:04 UTC (permalink / raw)
  To: davem-fT/PcQaiUtIeIZ0/mPfg9Q
  Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA

Dave,

Here is the latest batch of updates intended for 2.6.38.  It also
includes my last wireless-2.6 pull request that you just added
to net-2.6.

This includes the usual batch of drivers updates, with ath9k and
iwlwifi as the usual standouts.  This also includes some mac80211
documentation updates from Johannes, and a flurry of ath5k updates
from Nick.  This also includes a collection of bluetooth updates by
way of Gustavo, a couple of libertas updates, some more work on b43
N-phy support, and a variety of other patches.

Please let me know if there are problems!

Thanks,

John

---

The following changes since commit cfa969e385a23e4c85f50e0ed5de25a2e18bf9d4:

  Revert "ehea: Use the standard logging functions" (2010-12-06 20:45:28 -0800)

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

Anderson Lizardo (1):
      Bluetooth: Fix error handling for l2cap_init()

Andrei Emeltchenko (8):
      Bluetooth: Check sk is not owned before freeing l2cap_conn
      Bluetooth: timer check sk is not owned before freeing
      Bluetooth: do not use assignment in if condition
      Bluetooth: clean up sco code
      Bluetooth: clean up rfcomm code
      Bluetooth: clean up l2cap code
      Bluetooth: clean up hci code
      Bluetooth: clean up legal text

Andy Shevchenko (1):
      wireless: ray_cs: use '%pm' format option to print MAC

Bala Shanmugam (1):
      Bluetooth: Add new PID for Atheros 3011

Ben Greear (1):
      ath9k: Move debugfs under ieee80211/[phyname]/ath9k/

Bruno Randolf (1):
      cfg80211: Add documentation for antenna ops

Christian Lamparter (2):
      carl9170: fix carl9170_tx_prepare typo
      mac80211: ignore non-bcast mcast deauth/disassoc franes

Daniel Drake (1):
      libertas: fix memory corruption in lbs_remove_card()

David Kilroy (1):
      orinoco: abort scan on interface down

Felix Fietkau (12):
      ath9k: fix software retry counter tracking
      ath9k_hw: fix endian issues with CTLs on AR9003
      ath9k_hw: fix more bitfield related endian issues
      ath5k: Use Generic DMA for later support of AHB bus.
      ath5k: Introduce ath5k_init_softc function as in ath9k
      ath5k: Move PCI bus functions to separate file.
      ath5k: Use generic eeprom read from common ath_bus_opts struct.
      ath5k: Check if pci pdev struct is initialized in common functions.
      ath5k: Add a function to read chipset's MAC revision
      ath5k: Add initial registers values for radio RF2317 chip.
      ath5k: Add AHB bus support.
      ath5k: Fix reset and interrupts for AHB type of devices.

Gabor Juhos (1):
      ath9k: use per-device struct for pm_qos_* operations

Gustavo F. Padovan (4):
      Bluetooth: Fix not returning proper error in SCO
      Merge git://git.kernel.org/.../padovan/bluetooth-2.6 into test
      Bluetooth: Get rid of __l2cap_get_sock_by_psm()
      Bluetooth: Get rid of __rfcomm_get_sock_by_channel()

Hauke Mehrtens (1):
      ssb: Add sysfs attributes to ssb devices

Helmut Schaa (1):
      mac80211: Minor optimization in ieee80211_rx_h_data

Joe Perches (2):
      ath9k: hif_usb: Reduce indent 1 column
      wireless: Remove unnecessary casts of usb_get_intfdata

Johan Hedberg (3):
      Bluetooth: Simplify remote features callback function logic
      Bluetooth: Create a unified authentication request function
      Bluetooth: Automate remote name requests

Johannes Berg (17):
      iwlagn: remove powersave warning
      iwlagn: fix station powersave accounting for aggregation
      iwlagn: advertise reliable TX status
      iwlwifi: use mac80211 AC defines
      ath9k/carl9170: advertise P2P
      nl80211/cfg80211: extend mgmt-tx API for off-channel
      mac80211: implement off-channel mgmt TX
      mac80211: fix RX aggregation locking
      cfg80211: include CQM packet loss docs
      mac80211: document workqueue
      mac80211: publish docs for _ni functions
      mac80211: publish some misc docs
      mac80211: publish some rate control docs
      mac80211: document aggregation
      mac80211: publish interface iteration docs
      mac80211: document station handling
      mac80211: publish SMPS docs

Johannes Stezenbach (1):
      mac80211/rt2x00: add ieee80211_tx_status_ni()

John W. Linville (5):
      Merge branch 'master' of git://git.kernel.org/.../padovan/bluetooth-2.6
      Revert "ath9k: Fix STA disconnect issue due to received MIC failed bcast frames"
      Merge branch 'master' of git://git.kernel.org/.../padovan/bluetooth-next-2.6
      Merge branch 'master' of git://git.kernel.org/.../linville/wireless-2.6
      Merge branch 'master' of git://git.kernel.org/.../linville/wireless-next-2.6 into for-davem

Jouni Malinen (1):
      mac80211: Fix frame injection using non-AP vif

Mohammed Shafi Shajakhan (1):
      ath9k: Add support for Adaptive Power Management

Nick Kossifidis (30):
      ath5k: Reset cleanup and generic cleanup
      ath5k: Add new function to stop rx/tx DMA
      ath5k: Stop PCU on reset
      ath5k: Use new dma_stop function on base.c
      ath5k: Debug DMA timeouts
      ath5k: Use DCU early termination correctly
      ath5k: Check RXE when setting RXDP
      ath5k: Use new function to stop beacon queue
      ath5k: Add new field on ath5k_hw to track bandwidth modes
      ath5k: Put core clock initialization on a new function
      ath5k: Small cleanup on tweak_initvals
      ath5k: Increase PHY settling parameters for turo mode
      ath5k: Move tx retries setting outside reset_tx_queue
      ath5k: Extend get_default_sifs/slot_time
      ath5k: Extend rate_duration
      ath5k: Set all IFS intervals, not just slot time
      ath5k: Use turbo flag on DCU
      ath5k: Always set IFS intervals on reset
      ath5k: Tweak power detector delays on RF5111/RF5112
      ath5k: Update spur mitigation filter for turbo/half/quarter
      ath5k: Update PLL programming for turbo/half/quarter
      ath5k: Skip powertable setting when we are on the same channel
      ath5k: Support synth-only channel change for AR2413/AR5413
      ath5k: No need to save/restore staid flags on reset
      ath5k: Tweak phy activate to rx start delay based on bwmode
      ath5k: Skip tx power setting on AR5210 for now
      ath5k: Use correct clock when setting ofdm timings
      ath5k: Cleanup turbo channel flags
      ath5k: Clean up turbo mode initvals/rfregs
      ath5k: Set turbo bit on rf bank 2

Rafał Miłecki (8):
      ssb: extract indexes for power tables
      b43: N-PHY: swap values for radio registers 0x3b and 0x3c
      b43: N-PHY: implement very basic TX power control management
      b43: N-PHY: initialize perical variable, add missing call to CCA reset
      b43: N-PHY: fix RSSI calibration
      b43: N-PHY: fix RSSI selection
      b43: N-PHY: use defines for RSSI types
      b43: N-PHY: fix code path on PHY init

Rajkumar Manoharan (2):
      ath9k: Disable SWBA interrupt on remove_interface
      Revert "ath9k_htc: Handle monitor mode properly for HTC devices"

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

Stanislaw Gruszka (1):
      iwlagn: fix microcode error on 4965

Stefan Seyfried (1):
      Bluetooth: Fix log spamming in btusb due to autosuspend

Sujith Manoharan (1):
      ath9k_htc: Remove unused structures

Sven Neumann (1):
      libertas: fix invalid access

Vasanthakumar Thiagarajan (3):
      ath9k: Reintroduce modparam to enable btcoex
      ath9k: Remove code which enables btcoex based on subsys id
      ath9k: Fix bug in reading input gpio state for ar9003

Vasiliy Kulikov (3):
      Bluetooth: bnep: fix information leak to userland
      Bluetooth: cmtp: fix information leak to userland
      Bluetooth: hidp: fix information leak to userland

Wey-Yi Guy (8):
      iwlwifi: remove unused define
      iwlwifi: use antenna information in EEPROM
      iwlagn: Offical name for 6050g2 device
      iwlagn: Offical name for 6000g2a device
      iwlagn: Offical name for 6000g2b device
      iwlagn: Offical name for 100/130 device
      iwlagn: use different kill mask when SCO active
      iwlagn: minor change in bt coex normal LUT

 Documentation/DocBook/80211.tmpl               |   70 ++-
 drivers/bluetooth/ath3k.c                      |    4 +
 drivers/bluetooth/btusb.c                      |   12 +-
 drivers/net/wireless/ath/ar9170/usb.c          |    6 +-
 drivers/net/wireless/ath/ath.h                 |    2 +
 drivers/net/wireless/ath/ath5k/Kconfig         |   17 +-
 drivers/net/wireless/ath/ath5k/Makefile        |    2 +
 drivers/net/wireless/ath/ath5k/ahb.c           |  219 +++++
 drivers/net/wireless/ath/ath5k/ani.c           |    6 +-
 drivers/net/wireless/ath/ath5k/ath5k.h         |  260 ++++--
 drivers/net/wireless/ath/ath5k/attach.c        |   28 +-
 drivers/net/wireless/ath/ath5k/base.c          |  753 ++++++----------
 drivers/net/wireless/ath/ath5k/base.h          |    5 +-
 drivers/net/wireless/ath/ath5k/caps.c          |    6 -
 drivers/net/wireless/ath/ath5k/debug.c         |    1 +
 drivers/net/wireless/ath/ath5k/debug.h         |    2 +
 drivers/net/wireless/ath/ath5k/desc.c          |   24 +-
 drivers/net/wireless/ath/ath5k/dma.c           |  180 ++++-
 drivers/net/wireless/ath/ath5k/eeprom.c        |  127 ++--
 drivers/net/wireless/ath/ath5k/eeprom.h        |    2 +-
 drivers/net/wireless/ath/ath5k/initvals.c      |  409 ++++----
 drivers/net/wireless/ath/ath5k/led.c           |   11 +-
 drivers/net/wireless/ath/ath5k/pci.c           |  326 +++++++
 drivers/net/wireless/ath/ath5k/pcu.c           |  571 ++++++++----
 drivers/net/wireless/ath/ath5k/phy.c           |  641 ++++++++++---
 drivers/net/wireless/ath/ath5k/qcu.c           |  692 ++++++++------
 drivers/net/wireless/ath/ath5k/reg.h           |   31 +-
 drivers/net/wireless/ath/ath5k/reset.c         | 1221 +++++++++++-------------
 drivers/net/wireless/ath/ath5k/rfbuffer.h      | 1169 ++++++++---------------
 drivers/net/wireless/ath/ath5k/sysfs.c         |    4 +-
 drivers/net/wireless/ath/ath9k/ar9003_eeprom.c |  317 ++++---
 drivers/net/wireless/ath/ath9k/ar9003_eeprom.h |    9 +-
 drivers/net/wireless/ath/ath9k/ar9003_phy.c    |    6 +-
 drivers/net/wireless/ath/ath9k/ath9k.h         |    7 +-
 drivers/net/wireless/ath/ath9k/beacon.c        |    3 +-
 drivers/net/wireless/ath/ath9k/btcoex.c        |   23 -
 drivers/net/wireless/ath/ath9k/btcoex.h        |    1 -
 drivers/net/wireless/ath/ath9k/debug.c         |   35 +-
 drivers/net/wireless/ath/ath9k/debug.h         |   16 -
 drivers/net/wireless/ath/ath9k/eeprom.c        |    6 +-
 drivers/net/wireless/ath/ath9k/eeprom.h        |   28 +-
 drivers/net/wireless/ath/ath9k/eeprom_def.c    |   11 +-
 drivers/net/wireless/ath/ath9k/hif_usb.c       |  119 ++--
 drivers/net/wireless/ath/ath9k/htc_drv_main.c  |   64 ++-
 drivers/net/wireless/ath/ath9k/htc_hst.h       |   19 -
 drivers/net/wireless/ath/ath9k/hw.c            |   12 +-
 drivers/net/wireless/ath/ath9k/hw.h            |    1 +
 drivers/net/wireless/ath/ath9k/init.c          |   44 +-
 drivers/net/wireless/ath/ath9k/main.c          |   21 +-
 drivers/net/wireless/ath/ath9k/reg.h           |    6 +-
 drivers/net/wireless/ath/ath9k/xmit.c          |   27 +-
 drivers/net/wireless/ath/carl9170/fw.c         |    3 +-
 drivers/net/wireless/ath/carl9170/main.c       |    3 +-
 drivers/net/wireless/ath/carl9170/tx.c         |    2 +-
 drivers/net/wireless/ath/carl9170/usb.c        |    3 +-
 drivers/net/wireless/b43/phy_n.c               |  305 +++++--
 drivers/net/wireless/b43/phy_n.h               |    2 +-
 drivers/net/wireless/b43/radio_2055.c          |  246 +++---
 drivers/net/wireless/iwlwifi/iwl-1000.c        |   12 +-
 drivers/net/wireless/iwlwifi/iwl-5000.c        |   20 +-
 drivers/net/wireless/iwlwifi/iwl-6000.c        |   66 +-
 drivers/net/wireless/iwlwifi/iwl-agn-eeprom.c  |   20 +
 drivers/net/wireless/iwlwifi/iwl-agn-lib.c     |   34 +-
 drivers/net/wireless/iwlwifi/iwl-agn-tx.c      |   45 +-
 drivers/net/wireless/iwlwifi/iwl-agn-ucode.c   |   24 +-
 drivers/net/wireless/iwlwifi/iwl-agn.c         |    3 +-
 drivers/net/wireless/iwlwifi/iwl-commands.h    |    1 +
 drivers/net/wireless/iwlwifi/iwl-eeprom.h      |    1 -
 drivers/net/wireless/libertas/if_sdio.c        |    1 -
 drivers/net/wireless/libertas/if_spi.c         |    1 -
 drivers/net/wireless/libertas/main.c           |    2 -
 drivers/net/wireless/orinoco/main.c            |   12 +-
 drivers/net/wireless/orinoco/scan.c            |    8 +
 drivers/net/wireless/orinoco/scan.h            |    1 +
 drivers/net/wireless/p54/p54usb.c              |    2 +-
 drivers/net/wireless/ray_cs.c                  |   14 +-
 drivers/net/wireless/rt2x00/rt2800pci.c        |    1 +
 drivers/net/wireless/rt2x00/rt2x00.h           |    1 +
 drivers/net/wireless/rt2x00/rt2x00dev.c        |    9 +-
 drivers/net/wireless/zd1201.c                  |    2 +-
 drivers/ssb/main.c                             |   30 +
 drivers/ssb/pci.c                              |   44 +
 include/linux/nl80211.h                        |   25 +-
 include/linux/ssb/ssb.h                        |    4 +
 include/linux/ssb/ssb_regs.h                   |   40 +
 include/net/bluetooth/hci.h                    |   16 +-
 include/net/bluetooth/hci_core.h               |   14 +-
 include/net/bluetooth/l2cap.h                  |   22 +-
 include/net/bluetooth/rfcomm.h                 |   18 +-
 include/net/bluetooth/sco.h                    |   20 +-
 include/net/cfg80211.h                         |   18 +-
 include/net/mac80211.h                         |   28 +-
 net/bluetooth/bnep/core.c                      |    1 +
 net/bluetooth/cmtp/core.c                      |    1 +
 net/bluetooth/hci_conn.c                       |   23 +-
 net/bluetooth/hci_core.c                       |   66 +-
 net/bluetooth/hci_event.c                      |  177 +++-
 net/bluetooth/hci_sock.c                       |   17 +-
 net/bluetooth/hidp/core.c                      |    2 +-
 net/bluetooth/l2cap.c                          |   94 ++-
 net/bluetooth/rfcomm/core.c                    |    8 +-
 net/bluetooth/rfcomm/sock.c                    |   24 +-
 net/bluetooth/rfcomm/tty.c                     |   28 +-
 net/bluetooth/sco.c                            |   28 +-
 net/mac80211/agg-rx.c                          |    8 +-
 net/mac80211/cfg.c                             |   94 ++-
 net/mac80211/debugfs_sta.c                     |   29 +-
 net/mac80211/ieee80211_i.h                     |    5 +
 net/mac80211/rx.c                              |   28 +-
 net/mac80211/sta_info.h                        |   29 +-
 net/mac80211/status.c                          |   15 +-
 net/mac80211/tx.c                              |    7 +-
 net/mac80211/work.c                            |   22 +
 net/wireless/core.h                            |    4 +-
 net/wireless/mlme.c                            |    9 +-
 net/wireless/nl80211.c                         |   57 +-
 116 files changed, 5566 insertions(+), 3909 deletions(-)
 create mode 100644 drivers/net/wireless/ath/ath5k/ahb.c
 create mode 100644 drivers/net/wireless/ath/ath5k/pci.c

Omnibus patch is available here:

	http://www.kernel.org/pub/linux/kernel/people/linville/wireless-next-2.6-2010-12-08.patch.bz2

-- 
John W. Linville		Someday the world will need a hero, and you
linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org			might be all we have.  Be ready.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* 2.6.37-rc5: NULL pointer oops in selinux_socket_unix_stream_connect
From: Jeremy Fitzhardinge @ 2010-12-08 21:09 UTC (permalink / raw)
  To: James Morris, Stephen Smalley; +Cc: NetDev, Linux Kernel Mailing List

I just got this oops in a freshly booted 2.6.37-rc5 Xen domain, while
sitting idle at the login prompt:

BUG: unable to handle kernel NULL pointer dereference at 0000000000000210
IP: [<ffffffff811d55d4>] selinux_socket_unix_stream_connect+0x29/0xa0
PGD 1c99d067 PUD 1cb03067 PMD 0 
Oops: 0000 [#1] SMP 
last sysfs file: /sys/devices/system/cpu/sched_mc_power_savings
CPU 0 
Modules linked in: sunrpc dm_mirror dm_region_hash dm_log [last unloaded: scsi_wait_scan]

Pid: 2297, comm: at-spi-registry Not tainted 2.6.37-rc5+ #293 /
RIP: e030:[<ffffffff811d55d4>]  [<ffffffff811d55d4>] selinux_socket_unix_stream_connect+0x29/0xa0
RSP: e02b:ffff880006e7dd68  EFLAGS: 00010292
RAX: ffff88001d1ed8c0 RBX: ffff88001d06d9a0 RCX: 0000000000000022
RDX: ffff88001d1ed580 RSI: 0000000000000000 RDI: ffff88001b7d6ac0
RBP: ffff880006e7de18 R08: 00000000ffff0201 R09: ffff88001e78c968
R10: 000000001f47e9c2 R11: ffff88001fbf4400 R12: ffff88001d1ed8c0
R13: ffff88001d1ed580 R14: ffff88001ca00cc0 R15: 0000000000000000
FS:  00007fa643031920(0000) GS:ffff88001ff85000(0000) knlGS:0000000000000000
CS:  e033 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 0000000000000210 CR3: 000000001d78a000 CR4: 0000000000002660
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process at-spi-registry (pid: 2297, threadinfo ffff880006e7c000, task ffff88001cdd1140)
Stack:
 ffff88001d4c0bc0 000000004cffecc5 ffff880006e7ddc8 ffffffff81028dc5
 ffff8800ffffffff 0001628b2ec3fe22 ffff880006e7dde8 ffff88001d1edb80
 0000000000000001 0000936a4da34099 0000000000000000 00000000000000fa
Call Trace:
 [<ffffffff81028dc5>] ? pvclock_clocksource_read+0x48/0xb1
 [<ffffffff810074ab>] ? xen_clocksource_read+0x20/0x22
 [<ffffffff81008fd9>] ? xen_spin_lock+0xc6/0xd9
 [<ffffffff811d1d1e>] security_unix_stream_connect+0x16/0x18
 [<ffffffff81484366>] unix_stream_connect+0x215/0x3ff
 [<ffffffff813f351d>] sys_connect+0x7a/0xa0
 [<ffffffff8108cd9d>] ? audit_syscall_entry+0x1c2/0x1ee
 [<ffffffff8100bb42>] system_call_fastpath+0x16/0x1b
Code: c9 c3 55 48 89 e5 41 55 41 54 53 48 81 ec 98 00 00 00 0f 1f 44 00 00 b9 22 00 00 00 48 8b 47 20 48 8b 76 20 48 8b 98 10 02 00 00 <4c> 8b a6 10 02 00 00 31 c0 4c 8b aa 10 02 00 00 4c 8d 85 50 ff 
RIP  [<ffffffff811d55d4>] selinux_socket_unix_stream_connect+0x29/0xa0
 RSP <ffff880006e7dd68>
CR2: 0000000000000210
---[ end trace 50030b578c1ee27e ]---

This corresponds to:

(gdb) list *0xffffffff811d55d4
0xffffffff811d55d4 is in selinux_socket_unix_stream_connect (/home/jeremy/git/upstream/security/selinux/hooks.c:3929).
3924	static int selinux_socket_unix_stream_connect(struct socket *sock,
3925						      struct socket *other,
3926						      struct sock *newsk)
3927	{
3928		struct sk_security_struct *sksec_sock = sock->sk->sk_security;
3929		struct sk_security_struct *sksec_other = other->sk->sk_security;
3930		struct sk_security_struct *sksec_new = newsk->sk_security;
3931		struct common_audit_data ad;
3932		int err;
3933	


The system is a somewhat out of date Fedora 13 with
selinux-policy-3.7.19-73.fc13.noarch and
selinux-policy-targeted-3.7.19-73.fc13.noarch installed.

I'm not sure what at-spi-registry is or what it is trying to do here.
The crash seems non-deterministic; I rebooted the domain without any issues.

Thanks,
    J

^ permalink raw reply

* Re: [PATCH 0/2] New jhash function
From: Rusty Russell @ 2010-12-08 21:23 UTC (permalink / raw)
  To: David Miller; +Cc: kadlec, linux-kernel, netdev, netfilter-devel, torvalds
In-Reply-To: <20101208.090954.115924303.davem@davemloft.net>

On Thu, 9 Dec 2010 03:39:54 am David Miller wrote:
> From: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
> Date: Fri,  3 Dec 2010 13:38:59 +0100
> 
> > The current jhash.h implements the lookup2() hash function by Bob Jenkins. 
> > However, lookup2() is outdated as Bob wrote a new hash function called 
> > lookup3(). There is a longer comparison of those two and other hash
> > functions at http://burtleburtle.net/bob/hash/doobs.html.
> > 
> > Please consider applying the following patches.
> 
> Patch #1 is already in the net-next-2.6 tree, and as long as there are
> no major objections to the general crowd (including Rusty et al.) I am
> happy to put patch #2 into my tree as well.
> 
> Rusty, does the current version of patch #2 look good to you?

Yes, 2/2 good.  Thanks Jozsef!

Acked-by: Rusty Russell <rusty@rustcorp.com.au>

^ permalink raw reply

* Re: pull request: wireless-next-2.6 2010-12-08
From: David Miller @ 2010-12-08 21:25 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, netdev
In-Reply-To: <20101208210432.GH2423@tuxdriver.com>

From: "John W. Linville" <linville@tuxdriver.com>
Date: Wed, 8 Dec 2010 16:04:32 -0500

> Here is the latest batch of updates intended for 2.6.38.  It also
> includes my last wireless-2.6 pull request that you just added
> to net-2.6.
> 
> This includes the usual batch of drivers updates, with ath9k and
> iwlwifi as the usual standouts.  This also includes some mac80211
> documentation updates from Johannes, and a flurry of ath5k updates
> from Nick.  This also includes a collection of bluetooth updates by
> way of Gustavo, a couple of libertas updates, some more work on b43
> N-phy support, and a variety of other patches.
> 
> Please let me know if there are problems!

Ok, I'll suck this in later tonight, thanks John.  I'm working
on the net-2.6 --> net-next-2.6 merge at the moment.

^ permalink raw reply

* Re: echo > 0 .../disable_ipv6 broken in 2.6.37-rc4
From: Eric W. Biederman @ 2010-12-08 21:29 UTC (permalink / raw)
  To: Brian Haley; +Cc: netdev, Mahesh Kelkar, Lorenzo Colitti
In-Reply-To: <4CFD0AF0.9090809@hp.com>

Brian Haley <brian.haley@hp.com> writes:

> On 12/05/2010 07:24 PM, Eric W. Biederman wrote:
>> 
>> In 2.6.37-rc4 ipv6 can be disabled not enabled.
>> The last kernel I have tested and know this works on is 2.6.33.
>> 
>> To reproduce:
>>    ~ # ip link set lo up
>>    ~ # ping6 ::1
>>    PING ::1(::1) 56 data bytes
>>    64 bytes from ::1: icmp_seq=1 ttl=64 time=0.026 ms
>>    ^C
>>    --- ::1 ping statistics ---
>>    1 packets transmitted, 1 received, 0% packet loss, time 782ms
>>    rtt min/avg/max/mdev = 0.026/0.026/0.026/0.000 ms
>>    ~ # echo 1 > /proc/sys/net/ipv6/conf/lo/disable_ipv6 
>>    ~ # ping6 ::1
>>    connect: Network is unreachable
>>    ~ # echo 0 > /proc/sys/net/ipv6/conf/lo/disable_ipv6 
>>    ~ # ping6 ::1
>>    connect: Network is unreachable
>> 
>> 
>> I intend to poke at this a little more but at the moment
>> I am drawing a blank at what is going on.
>
> It should just be calling addrconf_notify() with either NETDEV_UP
> or NETDEV_DOWN.  Does the address not come back?  Or the route?

The address never went away, and I don't think we have a route to ::1.

Playing with this a little more if I delete the address and then bounce
the interface ping ::1 works again.  So something is just not getting
reinitialized.

Unfortunately I don't see anything obvious.  I'm still scratching my
head.

>> I intend to keep poking at this but if anyone can figure this out
>> before I do I would be greatly appreciative.
>
> I'm pulling the latest tree now, my 2.6.32.24 system is running fine, so
> it's something after that.

Agreed.  I don't have problems on 2.6.33 either, but because of overload
I haven't been doing regular testing of the kernels inbetween.

Eric

^ permalink raw reply

* Re: [Bugme-new] [Bug 24472] New: Kernel panic - not syncing: Fatal Exception
From: Jarek Poplawski @ 2010-12-08 22:01 UTC (permalink / raw)
  To: Paweł Staszewski
  Cc: Andrew Morton, netdev, Paul Mackerras, bugzilla-daemon,
	bugme-daemon, pstaszewski
In-Reply-To: <4CFFEB01.7040700@itcare.pl>

Paweł Staszewski wrote:
> W dniu 2010-12-08 21:22, Andrew Morton pisze:
>> (switched to email.  Please respond via emailed reply-to-all, not via the
>> bugzilla web interface).
>>
>> On Wed, 8 Dec 2010 20:14:45 GMT
>> bugzilla-daemon@bugzilla.kernel.org wrote:
>>
>>> https://bugzilla.kernel.org/show_bug.cgi?id=24472
>>>
>>>             Summary: Kernel panic - not syncing: Fatal Exception
>>>             Product: Drivers
>>>             Version: 2.5
>>>      Kernel Version: 2.6.36.1

Hi,
Could you try to revert this patch?:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.36.y.git;a=commitdiff;h=55c95e738da85373965cb03b4f975d0fd559865b

Jarek P.

^ permalink raw reply

* Re: [STABLE 2.6.32 PATCH] net: release dst entry while cache-hot for GSO case too
From: avagin @ 2010-12-08 22:47 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: David Miller, eric.dumazet, mjt, avagin, stable, netdev, krkumar2
In-Reply-To: <20101026.115434.241921999.davem@davemloft.net>

Hi Greg,

This patch is acked by David S. Miller. Greg, maybe you can commit it?

On 10/26/2010 10:54 PM, David Miller wrote:
> From: Eric Dumazet<eric.dumazet@gmail.com>
> Date: Mon, 11 Oct 2010 18:30:52 +0200
>
>> Le lundi 11 octobre 2010 à 20:19 +0400, Andrew Vagin a écrit :
>>> On 10/11/2010 07:59 PM, David Miller wrote:
>>>> From: Eric Dumazet<eric.dumazet@gmail.com>
>>>> Date: Mon, 11 Oct 2010 17:46:49 +0200
>>>>
>>>>> This patch was an optimization, not a bug fix.
>>>> Right, this has no business going into 2.6.32-stable at all.
>>> This is bug fix. Now nobody drops dst in case gso and veth, because the
>>> commit 60df914e295a21a223e43a7ee01e0c73c64dd111 deletes skb_dst_drop
>>> from the veth.c. We should commit my patch or revert commit 60df914e.
>>>
>>> We have two bug reports:
>>>
>>> http://www.spinics.net/lists/netdev/msg142104.html
>>>
>>> http://bugzilla.openvz.org/show_bug.cgi?id=1634
>>>
>>> Taylan verified that the patch really fix his bug.
>>
>> Now that makes sense ;)
>
> In case there is any doubt about this -stable patch submission:
>
> Acked-by: David S. Miller<davem@davemloft.net>


^ permalink raw reply

* Re: echo > 0 .../disable_ipv6 broken in 2.6.37-rc4
From: Brian Haley @ 2010-12-08 22:49 UTC (permalink / raw)
  To: Eric W. Biederman
  Cc: netdev, Mahesh Kelkar, Lorenzo Colitti, Stephen Hemminger
In-Reply-To: <m14oaoeywf.fsf@fess.ebiederm.org>

On 12/08/2010 04:29 PM, Eric W. Biederman wrote:
> Brian Haley <brian.haley@hp.com> writes:
> 
>> On 12/05/2010 07:24 PM, Eric W. Biederman wrote:
>>>
>>> In 2.6.37-rc4 ipv6 can be disabled not enabled.
>>> The last kernel I have tested and know this works on is 2.6.33.
>>>
>>> To reproduce:
>>>    ~ # ip link set lo up
>>>    ~ # ping6 ::1
>>>    PING ::1(::1) 56 data bytes
>>>    64 bytes from ::1: icmp_seq=1 ttl=64 time=0.026 ms
>>>    ^C
>>>    --- ::1 ping statistics ---
>>>    1 packets transmitted, 1 received, 0% packet loss, time 782ms
>>>    rtt min/avg/max/mdev = 0.026/0.026/0.026/0.000 ms
>>>    ~ # echo 1 > /proc/sys/net/ipv6/conf/lo/disable_ipv6 
>>>    ~ # ping6 ::1
>>>    connect: Network is unreachable
>>>    ~ # echo 0 > /proc/sys/net/ipv6/conf/lo/disable_ipv6 
>>>    ~ # ping6 ::1
<snip>

>> I'm pulling the latest tree now, my 2.6.32.24 system is running fine, so
>> it's something after that.
> 
> Agreed.  I don't have problems on 2.6.33 either, but because of overload
> I haven't been doing regular testing of the kernels inbetween.

This got broken in 2.6.34-rc1, and the most obvious culprit is this,
although I haven't bisected it:

commit dc2b99f71ef477a31020511876ab4403fb7c4420
Author: stephen hemminger <shemminger@vyatta.com>
Date:   Mon Feb 8 19:48:05 2010 +0000

    IPv6: keep permanent addresses on admin down

    Permanent IPV6 addresses should not be removed when the link is
    set to admin down, only when device is removed.

    When link is lost permanent addresses should be marked as tentative
    so that when link comes back they are subject to duplicate address
    detection (if DAD was enabled for that address).

    Other routing systems keep manually configured IPv6 addresses
    when link is set down.

Even though there was a bugfix update, it didn't help.

I unfortunately won't be able to look at this more until at least Friday,
I couldn't come up with a quick patch just looking quickly at addrconf_ifdown().

-Brian

^ permalink raw reply

* tc: show format ABI changed
From: Stephen Hemminger @ 2010-12-08 22:51 UTC (permalink / raw)
  To: David Miller, Eric Dumazet, Jarek Poplawski; +Cc: netdev

Although well intentioned, the following patch should have not
been applied since it changes the kernel ABI. It broke some scripts
parsing the output format of tc commands.

Before HTB would report bogus zero values, now it reports
nothing and that changes the output format.  Like the empty
fields in /proc, I argue we can't play fast and loose with
netlink responses.

Not a big deal to fix the script in this case, in this case
so don't revert it.

commit d250a5f90e53f5e150618186230795352d154c88
Author: Eric Dumazet <eric.dumazet@gmail.com>
Date:   Fri Oct 2 10:32:18 2009 +0000

    pkt_sched: gen_estimator: Dont report fake rate estimators
    
    Jarek Poplawski a écrit :
    >
    >
    > Hmm... So you made me to do some "real" work here, and guess what?:
    > there is one serious checkpatch warning! ;-) Plus, this new parameter
    > should be added to the function description. Otherwise:
    > Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
    >
    > Thanks,
    > Jarek P.
    >
    > PS: I guess full "Don't" would show we really mean it...
    
    Okay :) Here is the last round, before the night !
    
    Thanks again
    
    [RFC] pkt_sched: gen_estimator: Don't report fake rate estimators
    
    We currently send TCA_STATS_RATE_EST elements to netlink users, even if no estimator
    is running.
    
    # tc -s -d qdisc
    qdisc pfifo_fast 0: dev eth0 root bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
     Sent 112833764978 bytes 1495081739 pkt (dropped 0, overlimits 0 requeues 0)
     rate 0bit 0pps backlog 0b 0p requeues 0
    
    User has no way to tell if the "rate 0bit 0pps" is a real estimation, or a fake
    one (because no estimator is active)
    
    After this patch, tc command output is :
    $ tc -s -d qdisc
    qdisc pfifo_fast 0: dev eth0 root bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
     Sent 561075 bytes 1196 pkt (dropped 0, overlimits 0 requeues 0)
     backlog 0b 0p requeues 0
    
    We add a parameter to gnet_stats_copy_rate_est() function so that
    it can use gen_estimator_active(bstats, r), as suggested by Jarek.
    
    This parameter can be NULL if check is not necessary, (htb for
    example has a mandatory rate estimator)
    
    Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
    Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

^ permalink raw reply

* [net-next-2.6 PATCH] enic: Add ndo_set_rx_mode support for enic vnics
From: Roopa Prabhu @ 2010-12-08 23:01 UTC (permalink / raw)
  To: davem; +Cc: netdev

From: Roopa Prabhu <roprabhu@cisco.com>

Add ndo_set_rx_mode support to register unicast and multicast
address filters for enic devices

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      |    4 +
 drivers/net/enic/enic_main.c |  121 ++++++++++++++++++++++++++++++++++--------
 drivers/net/enic/enic_res.h  |    1 
 3 files changed, 102 insertions(+), 24 deletions(-)


diff --git a/drivers/net/enic/enic.h b/drivers/net/enic/enic.h
index 7067254..8f374c1 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.7"
+#define DRV_VERSION		"1.4.1.8"
 #define DRV_COPYRIGHT		"Copyright 2008-2010 Cisco Systems, Inc"
 
 #define ENIC_BARS_MAX		6
@@ -78,8 +78,10 @@ struct enic {
 	spinlock_t devcmd_lock;
 	u8 mac_addr[ETH_ALEN];
 	u8 mc_addr[ENIC_MULTICAST_PERFECT_FILTERS][ETH_ALEN];
+	u8 uc_addr[ENIC_UNICAST_PERFECT_FILTERS][ETH_ALEN];
 	unsigned int flags;
 	unsigned int mc_count;
+	unsigned int uc_count;
 	int csum_rx_enabled;
 	u32 port_mtu;
 	u32 rx_coalesce_usecs;
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index 9f293fa..1931f15 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -1002,7 +1002,7 @@ static int enic_dev_packet_filter(struct enic *enic, int directed,
 	return err;
 }
 
-static int enic_dev_add_multicast_addr(struct enic *enic, u8 *addr)
+static int enic_dev_add_addr(struct enic *enic, u8 *addr)
 {
 	int err;
 
@@ -1013,7 +1013,7 @@ static int enic_dev_add_multicast_addr(struct enic *enic, u8 *addr)
 	return err;
 }
 
-static int enic_dev_del_multicast_addr(struct enic *enic, u8 *addr)
+static int enic_dev_del_addr(struct enic *enic, u8 *addr)
 {
 	int err;
 
@@ -1024,29 +1024,19 @@ static int enic_dev_del_multicast_addr(struct enic *enic, u8 *addr)
 	return err;
 }
 
-/* netif_tx_lock held, BHs disabled */
-static void enic_set_multicast_list(struct net_device *netdev)
+static void enic_add_multicast_addr_list(struct enic *enic)
 {
-	struct enic *enic = netdev_priv(netdev);
+	struct net_device *netdev = enic->netdev;
 	struct netdev_hw_addr *ha;
-	int directed = 1;
-	int multicast = (netdev->flags & IFF_MULTICAST) ? 1 : 0;
-	int broadcast = (netdev->flags & IFF_BROADCAST) ? 1 : 0;
-	int promisc = (netdev->flags & IFF_PROMISC) ? 1 : 0;
 	unsigned int mc_count = netdev_mc_count(netdev);
-	int allmulti = (netdev->flags & IFF_ALLMULTI) ||
-		mc_count > ENIC_MULTICAST_PERFECT_FILTERS;
-	unsigned int flags = netdev->flags | (allmulti ? IFF_ALLMULTI : 0);
 	u8 mc_addr[ENIC_MULTICAST_PERFECT_FILTERS][ETH_ALEN];
 	unsigned int i, j;
 
-	if (mc_count > ENIC_MULTICAST_PERFECT_FILTERS)
+	if (mc_count > ENIC_MULTICAST_PERFECT_FILTERS) {
+		netdev_warn(netdev, "Registering only %d out of %d "
+			"multicast addresses\n",
+			ENIC_MULTICAST_PERFECT_FILTERS, mc_count);
 		mc_count = ENIC_MULTICAST_PERFECT_FILTERS;
-
-	if (enic->flags != flags) {
-		enic->flags = flags;
-		enic_dev_packet_filter(enic, directed,
-			multicast, broadcast, promisc, allmulti);
 	}
 
 	/* Is there an easier way?  Trying to minimize to
@@ -1068,7 +1058,7 @@ static void enic_set_multicast_list(struct net_device *netdev)
 				mc_addr[j]) == 0)
 				break;
 		if (j == mc_count)
-			enic_dev_del_multicast_addr(enic, enic->mc_addr[i]);
+			enic_dev_del_addr(enic, enic->mc_addr[i]);
 	}
 
 	for (i = 0; i < mc_count; i++) {
@@ -1077,7 +1067,7 @@ static void enic_set_multicast_list(struct net_device *netdev)
 				enic->mc_addr[j]) == 0)
 				break;
 		if (j == enic->mc_count)
-			enic_dev_add_multicast_addr(enic, mc_addr[i]);
+			enic_dev_add_addr(enic, mc_addr[i]);
 	}
 
 	/* Save the list to compare against next time
@@ -1089,6 +1079,89 @@ static void enic_set_multicast_list(struct net_device *netdev)
 	enic->mc_count = mc_count;
 }
 
+static void enic_add_unicast_addr_list(struct enic *enic)
+{
+	struct net_device *netdev = enic->netdev;
+	struct netdev_hw_addr *ha;
+	unsigned int uc_count = netdev_uc_count(netdev);
+	u8 uc_addr[ENIC_UNICAST_PERFECT_FILTERS][ETH_ALEN];
+	unsigned int i, j;
+
+	if (uc_count > ENIC_UNICAST_PERFECT_FILTERS) {
+		netdev_warn(netdev, "Registering only %d out of %d "
+			"unicast addresses\n",
+			ENIC_UNICAST_PERFECT_FILTERS, uc_count);
+		uc_count = ENIC_UNICAST_PERFECT_FILTERS;
+	}
+
+	/* Is there an easier way?  Trying to minimize to
+	 * calls to add/del unicast addrs.  We keep the
+	 * addrs from the last call in enic->uc_addr and
+	 * look for changes to add/del.
+	 */
+
+	i = 0;
+	netdev_for_each_uc_addr(ha, netdev) {
+		if (i == uc_count)
+			break;
+		memcpy(uc_addr[i++], ha->addr, ETH_ALEN);
+	}
+
+	for (i = 0; i < enic->uc_count; i++) {
+		for (j = 0; j < uc_count; j++)
+			if (compare_ether_addr(enic->uc_addr[i],
+				uc_addr[j]) == 0)
+				break;
+		if (j == uc_count)
+			enic_dev_del_addr(enic, enic->uc_addr[i]);
+	}
+
+	for (i = 0; i < uc_count; i++) {
+		for (j = 0; j < enic->uc_count; j++)
+			if (compare_ether_addr(uc_addr[i],
+				enic->uc_addr[j]) == 0)
+				break;
+		if (j == enic->uc_count)
+			enic_dev_add_addr(enic, uc_addr[i]);
+	}
+
+	/* Save the list to compare against next time
+	 */
+
+	for (i = 0; i < uc_count; i++)
+		memcpy(enic->uc_addr[i], uc_addr[i], ETH_ALEN);
+
+	enic->uc_count = uc_count;
+}
+
+/* netif_tx_lock held, BHs disabled */
+static void enic_set_rx_mode(struct net_device *netdev)
+{
+	struct enic *enic = netdev_priv(netdev);
+	int directed = 1;
+	int multicast = (netdev->flags & IFF_MULTICAST) ? 1 : 0;
+	int broadcast = (netdev->flags & IFF_BROADCAST) ? 1 : 0;
+	int promisc = (netdev->flags & IFF_PROMISC) ||
+		netdev_uc_count(netdev) > ENIC_UNICAST_PERFECT_FILTERS;
+	int allmulti = (netdev->flags & IFF_ALLMULTI) ||
+		netdev_mc_count(netdev) > ENIC_MULTICAST_PERFECT_FILTERS;
+	unsigned int flags = netdev->flags |
+		(allmulti ? IFF_ALLMULTI : 0) |
+		(promisc ? IFF_PROMISC : 0);
+
+	if (enic->flags != flags) {
+		enic->flags = flags;
+		enic_dev_packet_filter(enic, directed,
+			multicast, broadcast, promisc, allmulti);
+	}
+
+	if (!promisc) {
+		enic_add_unicast_addr_list(enic);
+		if (!allmulti)
+			enic_add_multicast_addr_list(enic);
+	}
+}
+
 /* rtnl lock is held */
 static void enic_vlan_rx_register(struct net_device *netdev,
 	struct vlan_group *vlan_group)
@@ -1852,7 +1925,7 @@ static int enic_open(struct net_device *netdev)
 		vnic_rq_enable(&enic->rq[i]);
 
 	enic_dev_add_station_addr(enic);
-	enic_set_multicast_list(netdev);
+	enic_set_rx_mode(netdev);
 
 	netif_wake_queue(netdev);
 
@@ -2328,7 +2401,8 @@ static const struct net_device_ops enic_netdev_dynamic_ops = {
 	.ndo_start_xmit		= enic_hard_start_xmit,
 	.ndo_get_stats		= enic_get_stats,
 	.ndo_validate_addr	= eth_validate_addr,
-	.ndo_set_multicast_list	= enic_set_multicast_list,
+	.ndo_set_rx_mode	= enic_set_rx_mode,
+	.ndo_set_multicast_list	= enic_set_rx_mode,
 	.ndo_set_mac_address	= enic_set_mac_address_dynamic,
 	.ndo_change_mtu		= enic_change_mtu,
 	.ndo_vlan_rx_register	= enic_vlan_rx_register,
@@ -2349,7 +2423,8 @@ static const struct net_device_ops enic_netdev_ops = {
 	.ndo_get_stats		= enic_get_stats,
 	.ndo_validate_addr	= eth_validate_addr,
 	.ndo_set_mac_address	= enic_set_mac_address,
-	.ndo_set_multicast_list	= enic_set_multicast_list,
+	.ndo_set_rx_mode	= enic_set_rx_mode,
+	.ndo_set_multicast_list	= enic_set_rx_mode,
 	.ndo_change_mtu		= enic_change_mtu,
 	.ndo_vlan_rx_register	= enic_vlan_rx_register,
 	.ndo_vlan_rx_add_vid	= enic_vlan_rx_add_vid,
diff --git a/drivers/net/enic/enic_res.h b/drivers/net/enic/enic_res.h
index 9a103d9..25be273 100644
--- a/drivers/net/enic/enic_res.h
+++ b/drivers/net/enic/enic_res.h
@@ -34,6 +34,7 @@
 #define ENIC_MAX_MTU			9000
 
 #define ENIC_MULTICAST_PERFECT_FILTERS	32
+#define ENIC_UNICAST_PERFECT_FILTERS	32
 
 #define ENIC_NON_TSO_MAX_DESC		16
 


^ permalink raw reply related

* Re: [STABLE 2.6.32 PATCH] net: release dst entry while cache-hot for GSO case too
From: Greg KH @ 2010-12-08 23:05 UTC (permalink / raw)
  To: avagin@gmail.com
  Cc: krkumar2, avagin, eric.dumazet, netdev, Greg Kroah-Hartman, mjt,
	stable, David Miller
In-Reply-To: <4D000B0D.2060101@gmail.com>

On Thu, Dec 09, 2010 at 01:47:41AM +0300, avagin@gmail.com wrote:
> Hi Greg,
> 
> This patch is acked by David S. Miller. Greg, maybe you can commit it?

What specific patch please?

confused,

greg k-h

^ permalink raw reply

* [net-2.6 PATCH] enic: Bug Fix: Pass napi reference to the isr that services receive queue
From: Vasanthy Kolluri @ 2010-12-08 23:05 UTC (permalink / raw)
  To: davem; +Cc: netdev, roprabhu, dwang2

From: Vasanthy Kolluri <vkolluri@cisco.com>

Pass reference to napi instead of enic device to the isr that services receive queue.

Signed-off-by: Vasanthy Kolluri <vkolluri@cisco.com>
Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
Signed-off-by: David Wang <dwang2@cisco.com>
---
 drivers/net/enic/enic_main.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)


diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index a466ef9..aa28b27 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -1962,7 +1962,8 @@ static void enic_poll_controller(struct net_device *netdev)
 	case VNIC_DEV_INTR_MODE_MSIX:
 		for (i = 0; i < enic->rq_count; i++) {
 			intr = enic_msix_rq_intr(enic, i);
-			enic_isr_msix_rq(enic->msix_entry[intr].vector, enic);
+			enic_isr_msix_rq(enic->msix_entry[intr].vector,
+				&enic->napi[i]);
 		}
 		intr = enic_msix_wq_intr(enic, i);
 		enic_isr_msix_wq(enic->msix_entry[intr].vector, enic);


^ permalink raw reply related

* Re: [stable] [PATCH 2.6.36] vlan: Avoid hwaccel vlan packets when vid not used
From: Greg KH @ 2010-12-08 23:06 UTC (permalink / raw)
  To: David Miller
  Cc: eric.dumazet, lkml20101129, netdev, jesse, linux-kernel, greearb,
	stable
In-Reply-To: <20101208.084731.189716071.davem@davemloft.net>

On Wed, Dec 08, 2010 at 08:47:31AM -0800, David Miller wrote:
> From: Eric Dumazet <eric.dumazet@gmail.com>
> Date: Wed, 01 Dec 2010 11:55:14 +0100
> 
> 
> Greg/-stable, please integrate this patch from Eric into 2.6.36 if you
> haven't already done so.

It looks like I took a different, older version, I'll update it to this
one now.

thanks,

greg k-h

^ permalink raw reply

* Re: [34/44] Limit sysctl_tcp_mem and sysctl_udp_mem initializers to prevent integer overflows.
From: Greg KH @ 2010-12-08 23:13 UTC (permalink / raw)
  To: David Miller
  Cc: pekkas, eric.dumazet, kaber, yoshfuji, netdev, linux-kernel,
	stable, vladislav.yasevich, linux-sctp, w, holt, kuznet, akpm,
	jmorris, torvalds, stable-review, alan, sri
In-Reply-To: <20101208.082522.226789733.davem@davemloft.net>

On Wed, Dec 08, 2010 at 08:25:22AM -0800, David Miller wrote:
> From: Eric Dumazet <eric.dumazet@gmail.com>
> Date: Wed, 08 Dec 2010 06:50:45 +0100
> 
> > Le mardi 07 décembre 2010 à 20:16 -0800, Greg KH a écrit :
> >> On Tue, Dec 07, 2010 at 05:22:34PM -0800, Linus Torvalds wrote:
> >> > On Tue, Dec 7, 2010 at 4:04 PM, Greg KH <gregkh@suse.de> wrote:
> >> > >
> >> > > From: Robin Holt <holt@sgi.com>
> >> > >
> >> > > [ Problem was fixed differently upstream. -DaveM ]
> >> > 
> >> > Gaah. I'd really like to see more of a description for things like
> >> > this. A commit ID for the alternate fix, or at least a few words about
> >> > the different fix or reason why upstream doesn't need the stable
> >> > commit.
> >> 
> >> I'll let David confirm this, he's the one who sent it to me :)
> > 
> > upstream uses commit 8d987e5c7510 (net: avoid limits overflow)
> > 
> > This commit is a bit more untrusive for stable kernels :
> > 
> > It depends on :
> > a9febbb4bd13 (sysctl: min/max bounds are optional)
> > 27b3d80a7b6a (sysctl: fix min/max handling in __do_proc_doulongvec_minmax())
> 
> Yep, this is the case.  Greg, you can add a reference to:
> 
> a9febbb4bd13
> 27b3d80a7b6a
> 8d987e5c7510
> 
> in my "[ ... ]" in the commit message to clear this up.

Now added, thanks.

greg k-h

^ permalink raw reply

* Re: echo > 0 .../disable_ipv6 broken in 2.6.37-rc4
From: Eric W. Biederman @ 2010-12-08 23:13 UTC (permalink / raw)
  To: Brian Haley; +Cc: netdev, Mahesh Kelkar, Lorenzo Colitti, Stephen Hemminger
In-Reply-To: <4D000B6D.1060708@hp.com>

Brian Haley <brian.haley@hp.com> writes:

> This got broken in 2.6.34-rc1, and the most obvious culprit is this,
> although I haven't bisected it:
>
> commit dc2b99f71ef477a31020511876ab4403fb7c4420
> Author: stephen hemminger <shemminger@vyatta.com>
> Date:   Mon Feb 8 19:48:05 2010 +0000
>
>     IPv6: keep permanent addresses on admin down
>
>     Permanent IPV6 addresses should not be removed when the link is
>     set to admin down, only when device is removed.
>
>     When link is lost permanent addresses should be marked as tentative
>     so that when link comes back they are subject to duplicate address
>     detection (if DAD was enabled for that address).
>
>     Other routing systems keep manually configured IPv6 addresses
>     when link is set down.
>
> Even though there was a bugfix update, it didn't help.
>
> I unfortunately won't be able to look at this more until at least Friday,
> I couldn't come up with a quick patch just looking quickly at
> addrconf_ifdown().

This is almost certainly it.
ip link set lo down
ip link set lo up

Is enough to break ping6 ::1.

I get the feeling the loopback address was not actually tested and
there is something different about it.

Eric

^ permalink raw reply

* Re: [stable] [PATCH 2.6.36] vlan: Avoid hwaccel vlan packets when vid not used
From: Greg KH @ 2010-12-08 23:16 UTC (permalink / raw)
  To: David Miller
  Cc: eric.dumazet, lkml20101129, netdev, jesse, linux-kernel, greearb,
	stable
In-Reply-To: <20101208.084731.189716071.davem@davemloft.net>

On Wed, Dec 08, 2010 at 08:47:31AM -0800, David Miller wrote:
> From: Eric Dumazet <eric.dumazet@gmail.com>
> Date: Wed, 01 Dec 2010 11:55:14 +0100
> 
> 
> Greg/-stable, please integrate this patch from Eric into 2.6.36 if you
> haven't already done so.

I've updated the version in the .36-stable queue with this one, thanks.

greg k-h

^ permalink raw reply

* Re: [net-next-2.6 PATCH] enic: Add ndo_set_rx_mode support for enic vnics
From: roprabhu @ 2010-12-08 23:16 UTC (permalink / raw)
  To: davem; +Cc: netdev
In-Reply-To: <20101208230148.24021.32576.stgit@savbu-pc100.cisco.com>

Please ignore. Will update Signed-off list and re-spin. Thanks.


On 12/8/10 3:01 PM, "Roopa Prabhu" <roprabhu@cisco.com> wrote:

> From: Roopa Prabhu <roprabhu@cisco.com>
> 
> Add ndo_set_rx_mode support to register unicast and multicast
> address filters for enic devices
> 
> 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      |    4 +
>  drivers/net/enic/enic_main.c |  121
> ++++++++++++++++++++++++++++++++++--------
>  drivers/net/enic/enic_res.h  |    1
>  3 files changed, 102 insertions(+), 24 deletions(-)
> 
> 
> diff --git a/drivers/net/enic/enic.h b/drivers/net/enic/enic.h
> index 7067254..8f374c1 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.7"
> +#define DRV_VERSION  "1.4.1.8"
>  #define DRV_COPYRIGHT  "Copyright 2008-2010 Cisco Systems, Inc"
>  
>  #define ENIC_BARS_MAX  6
> @@ -78,8 +78,10 @@ struct enic {
> spinlock_t devcmd_lock;
> u8 mac_addr[ETH_ALEN];
> u8 mc_addr[ENIC_MULTICAST_PERFECT_FILTERS][ETH_ALEN];
> + u8 uc_addr[ENIC_UNICAST_PERFECT_FILTERS][ETH_ALEN];
> unsigned int flags;
> unsigned int mc_count;
> + unsigned int uc_count;
> int csum_rx_enabled;
> u32 port_mtu;
> u32 rx_coalesce_usecs;
> diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
> index 9f293fa..1931f15 100644
> --- a/drivers/net/enic/enic_main.c
> +++ b/drivers/net/enic/enic_main.c
> @@ -1002,7 +1002,7 @@ static int enic_dev_packet_filter(struct enic *enic, int
> directed,
> return err;
>  }
>  
> -static int enic_dev_add_multicast_addr(struct enic *enic, u8 *addr)
> +static int enic_dev_add_addr(struct enic *enic, u8 *addr)
>  {
> int err;
>  
> @@ -1013,7 +1013,7 @@ static int enic_dev_add_multicast_addr(struct enic
> *enic, u8 *addr)
> return err;
>  }
>  
> -static int enic_dev_del_multicast_addr(struct enic *enic, u8 *addr)
> +static int enic_dev_del_addr(struct enic *enic, u8 *addr)
>  {
> int err;
>  
> @@ -1024,29 +1024,19 @@ static int enic_dev_del_multicast_addr(struct enic
> *enic, u8 *addr)
> return err;
>  }
>  
> -/* netif_tx_lock held, BHs disabled */
> -static void enic_set_multicast_list(struct net_device *netdev)
> +static void enic_add_multicast_addr_list(struct enic *enic)
>  {
> - struct enic *enic = netdev_priv(netdev);
> + struct net_device *netdev = enic->netdev;
> struct netdev_hw_addr *ha;
> - int directed = 1;
> - int multicast = (netdev->flags & IFF_MULTICAST) ? 1 : 0;
> - int broadcast = (netdev->flags & IFF_BROADCAST) ? 1 : 0;
> - int promisc = (netdev->flags & IFF_PROMISC) ? 1 : 0;
> unsigned int mc_count = netdev_mc_count(netdev);
> - int allmulti = (netdev->flags & IFF_ALLMULTI) ||
> -  mc_count > ENIC_MULTICAST_PERFECT_FILTERS;
> - unsigned int flags = netdev->flags | (allmulti ? IFF_ALLMULTI : 0);
> u8 mc_addr[ENIC_MULTICAST_PERFECT_FILTERS][ETH_ALEN];
> unsigned int i, j;
>  
> - if (mc_count > ENIC_MULTICAST_PERFECT_FILTERS)
> + if (mc_count > ENIC_MULTICAST_PERFECT_FILTERS) {
> +  netdev_warn(netdev, "Registering only %d out of %d "
> +   "multicast addresses\n",
> +   ENIC_MULTICAST_PERFECT_FILTERS, mc_count);
> mc_count = ENIC_MULTICAST_PERFECT_FILTERS;
> -
> - if (enic->flags != flags) {
> -  enic->flags = flags;
> -  enic_dev_packet_filter(enic, directed,
> -   multicast, broadcast, promisc, allmulti);
> }
>  
> /* Is there an easier way?  Trying to minimize to
> @@ -1068,7 +1058,7 @@ static void enic_set_multicast_list(struct net_device
> *netdev)
> mc_addr[j]) == 0)
> break;
> if (j == mc_count)
> -   enic_dev_del_multicast_addr(enic, enic->mc_addr[i]);
> +   enic_dev_del_addr(enic, enic->mc_addr[i]);
> }
>  
> for (i = 0; i < mc_count; i++) {
> @@ -1077,7 +1067,7 @@ static void enic_set_multicast_list(struct net_device
> *netdev)
> enic->mc_addr[j]) == 0)
> break;
> if (j == enic->mc_count)
> -   enic_dev_add_multicast_addr(enic, mc_addr[i]);
> +   enic_dev_add_addr(enic, mc_addr[i]);
> }
>  
> /* Save the list to compare against next time
> @@ -1089,6 +1079,89 @@ static void enic_set_multicast_list(struct net_device
> *netdev)
> enic->mc_count = mc_count;
>  }
>  
> +static void enic_add_unicast_addr_list(struct enic *enic)
> +{
> + struct net_device *netdev = enic->netdev;
> + struct netdev_hw_addr *ha;
> + unsigned int uc_count = netdev_uc_count(netdev);
> + u8 uc_addr[ENIC_UNICAST_PERFECT_FILTERS][ETH_ALEN];
> + unsigned int i, j;
> +
> + if (uc_count > ENIC_UNICAST_PERFECT_FILTERS) {
> +  netdev_warn(netdev, "Registering only %d out of %d "
> +   "unicast addresses\n",
> +   ENIC_UNICAST_PERFECT_FILTERS, uc_count);
> +  uc_count = ENIC_UNICAST_PERFECT_FILTERS;
> + }
> +
> + /* Is there an easier way?  Trying to minimize to
> +  * calls to add/del unicast addrs.  We keep the
> +  * addrs from the last call in enic->uc_addr and
> +  * look for changes to add/del.
> +  */
> +
> + i = 0;
> + netdev_for_each_uc_addr(ha, netdev) {
> +  if (i == uc_count)
> +   break;
> +  memcpy(uc_addr[i++], ha->addr, ETH_ALEN);
> + }
> +
> + for (i = 0; i < enic->uc_count; i++) {
> +  for (j = 0; j < uc_count; j++)
> +   if (compare_ether_addr(enic->uc_addr[i],
> +    uc_addr[j]) == 0)
> +    break;
> +  if (j == uc_count)
> +   enic_dev_del_addr(enic, enic->uc_addr[i]);
> + }
> +
> + for (i = 0; i < uc_count; i++) {
> +  for (j = 0; j < enic->uc_count; j++)
> +   if (compare_ether_addr(uc_addr[i],
> +    enic->uc_addr[j]) == 0)
> +    break;
> +  if (j == enic->uc_count)
> +   enic_dev_add_addr(enic, uc_addr[i]);
> + }
> +
> + /* Save the list to compare against next time
> +  */
> +
> + for (i = 0; i < uc_count; i++)
> +  memcpy(enic->uc_addr[i], uc_addr[i], ETH_ALEN);
> +
> + enic->uc_count = uc_count;
> +}
> +
> +/* netif_tx_lock held, BHs disabled */
> +static void enic_set_rx_mode(struct net_device *netdev)
> +{
> + struct enic *enic = netdev_priv(netdev);
> + int directed = 1;
> + int multicast = (netdev->flags & IFF_MULTICAST) ? 1 : 0;
> + int broadcast = (netdev->flags & IFF_BROADCAST) ? 1 : 0;
> + int promisc = (netdev->flags & IFF_PROMISC) ||
> +  netdev_uc_count(netdev) > ENIC_UNICAST_PERFECT_FILTERS;
> + int allmulti = (netdev->flags & IFF_ALLMULTI) ||
> +  netdev_mc_count(netdev) > ENIC_MULTICAST_PERFECT_FILTERS;
> + unsigned int flags = netdev->flags |
> +  (allmulti ? IFF_ALLMULTI : 0) |
> +  (promisc ? IFF_PROMISC : 0);
> +
> + if (enic->flags != flags) {
> +  enic->flags = flags;
> +  enic_dev_packet_filter(enic, directed,
> +   multicast, broadcast, promisc, allmulti);
> + }
> +
> + if (!promisc) {
> +  enic_add_unicast_addr_list(enic);
> +  if (!allmulti)
> +   enic_add_multicast_addr_list(enic);
> + }
> +}
> +
>  /* rtnl lock is held */
>  static void enic_vlan_rx_register(struct net_device *netdev,
> struct vlan_group *vlan_group)
> @@ -1852,7 +1925,7 @@ static int enic_open(struct net_device *netdev)
> vnic_rq_enable(&enic->rq[i]);
>  
> enic_dev_add_station_addr(enic);
> - enic_set_multicast_list(netdev);
> + enic_set_rx_mode(netdev);
>  
> netif_wake_queue(netdev);
>  
> @@ -2328,7 +2401,8 @@ static const struct net_device_ops
> enic_netdev_dynamic_ops = {
> .ndo_start_xmit  = enic_hard_start_xmit,
> .ndo_get_stats  = enic_get_stats,
> .ndo_validate_addr = eth_validate_addr,
> - .ndo_set_multicast_list = enic_set_multicast_list,
> + .ndo_set_rx_mode = enic_set_rx_mode,
> + .ndo_set_multicast_list = enic_set_rx_mode,
> .ndo_set_mac_address = enic_set_mac_address_dynamic,
> .ndo_change_mtu  = enic_change_mtu,
> .ndo_vlan_rx_register = enic_vlan_rx_register,
> @@ -2349,7 +2423,8 @@ static const struct net_device_ops enic_netdev_ops = {
> .ndo_get_stats  = enic_get_stats,
> .ndo_validate_addr = eth_validate_addr,
> .ndo_set_mac_address = enic_set_mac_address,
> - .ndo_set_multicast_list = enic_set_multicast_list,
> + .ndo_set_rx_mode = enic_set_rx_mode,
> + .ndo_set_multicast_list = enic_set_rx_mode,
> .ndo_change_mtu  = enic_change_mtu,
> .ndo_vlan_rx_register = enic_vlan_rx_register,
> .ndo_vlan_rx_add_vid = enic_vlan_rx_add_vid,
> diff --git a/drivers/net/enic/enic_res.h b/drivers/net/enic/enic_res.h
> index 9a103d9..25be273 100644
> --- a/drivers/net/enic/enic_res.h
> +++ b/drivers/net/enic/enic_res.h
> @@ -34,6 +34,7 @@
>  #define ENIC_MAX_MTU   9000
>  
>  #define ENIC_MULTICAST_PERFECT_FILTERS 32
> +#define ENIC_UNICAST_PERFECT_FILTERS 32
>  
>  #define ENIC_NON_TSO_MAX_DESC  16
>  
> 
> --
> 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


^ permalink raw reply

* [net-next-2.6 PATCH] enic: Add ndo_set_rx_mode support for enic vnics
From: Roopa Prabhu @ 2010-12-08 23:19 UTC (permalink / raw)
  To: davem; +Cc: netdev

From: Roopa Prabhu <roprabhu@cisco.com>

Add ndo_set_rx_mode support to register unicast and multicast
address filters for enic devices

Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
Signed-off-by: Vasanthy Kolluri <vkolluri@cisco.com>
Signed-off-by: David Wang <dwang2@cisco.com>
Signed-off-by: Christian Benvenuti <benve@cisco.com>
---
 drivers/net/enic/enic.h      |    4 +
 drivers/net/enic/enic_main.c |  121 ++++++++++++++++++++++++++++++++++--------
 drivers/net/enic/enic_res.h  |    1 
 3 files changed, 102 insertions(+), 24 deletions(-)


diff --git a/drivers/net/enic/enic.h b/drivers/net/enic/enic.h
index 7067254..8f374c1 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.7"
+#define DRV_VERSION		"1.4.1.8"
 #define DRV_COPYRIGHT		"Copyright 2008-2010 Cisco Systems, Inc"
 
 #define ENIC_BARS_MAX		6
@@ -78,8 +78,10 @@ struct enic {
 	spinlock_t devcmd_lock;
 	u8 mac_addr[ETH_ALEN];
 	u8 mc_addr[ENIC_MULTICAST_PERFECT_FILTERS][ETH_ALEN];
+	u8 uc_addr[ENIC_UNICAST_PERFECT_FILTERS][ETH_ALEN];
 	unsigned int flags;
 	unsigned int mc_count;
+	unsigned int uc_count;
 	int csum_rx_enabled;
 	u32 port_mtu;
 	u32 rx_coalesce_usecs;
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index 9f293fa..1931f15 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -1002,7 +1002,7 @@ static int enic_dev_packet_filter(struct enic *enic, int directed,
 	return err;
 }
 
-static int enic_dev_add_multicast_addr(struct enic *enic, u8 *addr)
+static int enic_dev_add_addr(struct enic *enic, u8 *addr)
 {
 	int err;
 
@@ -1013,7 +1013,7 @@ static int enic_dev_add_multicast_addr(struct enic *enic, u8 *addr)
 	return err;
 }
 
-static int enic_dev_del_multicast_addr(struct enic *enic, u8 *addr)
+static int enic_dev_del_addr(struct enic *enic, u8 *addr)
 {
 	int err;
 
@@ -1024,29 +1024,19 @@ static int enic_dev_del_multicast_addr(struct enic *enic, u8 *addr)
 	return err;
 }
 
-/* netif_tx_lock held, BHs disabled */
-static void enic_set_multicast_list(struct net_device *netdev)
+static void enic_add_multicast_addr_list(struct enic *enic)
 {
-	struct enic *enic = netdev_priv(netdev);
+	struct net_device *netdev = enic->netdev;
 	struct netdev_hw_addr *ha;
-	int directed = 1;
-	int multicast = (netdev->flags & IFF_MULTICAST) ? 1 : 0;
-	int broadcast = (netdev->flags & IFF_BROADCAST) ? 1 : 0;
-	int promisc = (netdev->flags & IFF_PROMISC) ? 1 : 0;
 	unsigned int mc_count = netdev_mc_count(netdev);
-	int allmulti = (netdev->flags & IFF_ALLMULTI) ||
-		mc_count > ENIC_MULTICAST_PERFECT_FILTERS;
-	unsigned int flags = netdev->flags | (allmulti ? IFF_ALLMULTI : 0);
 	u8 mc_addr[ENIC_MULTICAST_PERFECT_FILTERS][ETH_ALEN];
 	unsigned int i, j;
 
-	if (mc_count > ENIC_MULTICAST_PERFECT_FILTERS)
+	if (mc_count > ENIC_MULTICAST_PERFECT_FILTERS) {
+		netdev_warn(netdev, "Registering only %d out of %d "
+			"multicast addresses\n",
+			ENIC_MULTICAST_PERFECT_FILTERS, mc_count);
 		mc_count = ENIC_MULTICAST_PERFECT_FILTERS;
-
-	if (enic->flags != flags) {
-		enic->flags = flags;
-		enic_dev_packet_filter(enic, directed,
-			multicast, broadcast, promisc, allmulti);
 	}
 
 	/* Is there an easier way?  Trying to minimize to
@@ -1068,7 +1058,7 @@ static void enic_set_multicast_list(struct net_device *netdev)
 				mc_addr[j]) == 0)
 				break;
 		if (j == mc_count)
-			enic_dev_del_multicast_addr(enic, enic->mc_addr[i]);
+			enic_dev_del_addr(enic, enic->mc_addr[i]);
 	}
 
 	for (i = 0; i < mc_count; i++) {
@@ -1077,7 +1067,7 @@ static void enic_set_multicast_list(struct net_device *netdev)
 				enic->mc_addr[j]) == 0)
 				break;
 		if (j == enic->mc_count)
-			enic_dev_add_multicast_addr(enic, mc_addr[i]);
+			enic_dev_add_addr(enic, mc_addr[i]);
 	}
 
 	/* Save the list to compare against next time
@@ -1089,6 +1079,89 @@ static void enic_set_multicast_list(struct net_device *netdev)
 	enic->mc_count = mc_count;
 }
 
+static void enic_add_unicast_addr_list(struct enic *enic)
+{
+	struct net_device *netdev = enic->netdev;
+	struct netdev_hw_addr *ha;
+	unsigned int uc_count = netdev_uc_count(netdev);
+	u8 uc_addr[ENIC_UNICAST_PERFECT_FILTERS][ETH_ALEN];
+	unsigned int i, j;
+
+	if (uc_count > ENIC_UNICAST_PERFECT_FILTERS) {
+		netdev_warn(netdev, "Registering only %d out of %d "
+			"unicast addresses\n",
+			ENIC_UNICAST_PERFECT_FILTERS, uc_count);
+		uc_count = ENIC_UNICAST_PERFECT_FILTERS;
+	}
+
+	/* Is there an easier way?  Trying to minimize to
+	 * calls to add/del unicast addrs.  We keep the
+	 * addrs from the last call in enic->uc_addr and
+	 * look for changes to add/del.
+	 */
+
+	i = 0;
+	netdev_for_each_uc_addr(ha, netdev) {
+		if (i == uc_count)
+			break;
+		memcpy(uc_addr[i++], ha->addr, ETH_ALEN);
+	}
+
+	for (i = 0; i < enic->uc_count; i++) {
+		for (j = 0; j < uc_count; j++)
+			if (compare_ether_addr(enic->uc_addr[i],
+				uc_addr[j]) == 0)
+				break;
+		if (j == uc_count)
+			enic_dev_del_addr(enic, enic->uc_addr[i]);
+	}
+
+	for (i = 0; i < uc_count; i++) {
+		for (j = 0; j < enic->uc_count; j++)
+			if (compare_ether_addr(uc_addr[i],
+				enic->uc_addr[j]) == 0)
+				break;
+		if (j == enic->uc_count)
+			enic_dev_add_addr(enic, uc_addr[i]);
+	}
+
+	/* Save the list to compare against next time
+	 */
+
+	for (i = 0; i < uc_count; i++)
+		memcpy(enic->uc_addr[i], uc_addr[i], ETH_ALEN);
+
+	enic->uc_count = uc_count;
+}
+
+/* netif_tx_lock held, BHs disabled */
+static void enic_set_rx_mode(struct net_device *netdev)
+{
+	struct enic *enic = netdev_priv(netdev);
+	int directed = 1;
+	int multicast = (netdev->flags & IFF_MULTICAST) ? 1 : 0;
+	int broadcast = (netdev->flags & IFF_BROADCAST) ? 1 : 0;
+	int promisc = (netdev->flags & IFF_PROMISC) ||
+		netdev_uc_count(netdev) > ENIC_UNICAST_PERFECT_FILTERS;
+	int allmulti = (netdev->flags & IFF_ALLMULTI) ||
+		netdev_mc_count(netdev) > ENIC_MULTICAST_PERFECT_FILTERS;
+	unsigned int flags = netdev->flags |
+		(allmulti ? IFF_ALLMULTI : 0) |
+		(promisc ? IFF_PROMISC : 0);
+
+	if (enic->flags != flags) {
+		enic->flags = flags;
+		enic_dev_packet_filter(enic, directed,
+			multicast, broadcast, promisc, allmulti);
+	}
+
+	if (!promisc) {
+		enic_add_unicast_addr_list(enic);
+		if (!allmulti)
+			enic_add_multicast_addr_list(enic);
+	}
+}
+
 /* rtnl lock is held */
 static void enic_vlan_rx_register(struct net_device *netdev,
 	struct vlan_group *vlan_group)
@@ -1852,7 +1925,7 @@ static int enic_open(struct net_device *netdev)
 		vnic_rq_enable(&enic->rq[i]);
 
 	enic_dev_add_station_addr(enic);
-	enic_set_multicast_list(netdev);
+	enic_set_rx_mode(netdev);
 
 	netif_wake_queue(netdev);
 
@@ -2328,7 +2401,8 @@ static const struct net_device_ops enic_netdev_dynamic_ops = {
 	.ndo_start_xmit		= enic_hard_start_xmit,
 	.ndo_get_stats		= enic_get_stats,
 	.ndo_validate_addr	= eth_validate_addr,
-	.ndo_set_multicast_list	= enic_set_multicast_list,
+	.ndo_set_rx_mode	= enic_set_rx_mode,
+	.ndo_set_multicast_list	= enic_set_rx_mode,
 	.ndo_set_mac_address	= enic_set_mac_address_dynamic,
 	.ndo_change_mtu		= enic_change_mtu,
 	.ndo_vlan_rx_register	= enic_vlan_rx_register,
@@ -2349,7 +2423,8 @@ static const struct net_device_ops enic_netdev_ops = {
 	.ndo_get_stats		= enic_get_stats,
 	.ndo_validate_addr	= eth_validate_addr,
 	.ndo_set_mac_address	= enic_set_mac_address,
-	.ndo_set_multicast_list	= enic_set_multicast_list,
+	.ndo_set_rx_mode	= enic_set_rx_mode,
+	.ndo_set_multicast_list	= enic_set_rx_mode,
 	.ndo_change_mtu		= enic_change_mtu,
 	.ndo_vlan_rx_register	= enic_vlan_rx_register,
 	.ndo_vlan_rx_add_vid	= enic_vlan_rx_add_vid,
diff --git a/drivers/net/enic/enic_res.h b/drivers/net/enic/enic_res.h
index 9a103d9..25be273 100644
--- a/drivers/net/enic/enic_res.h
+++ b/drivers/net/enic/enic_res.h
@@ -34,6 +34,7 @@
 #define ENIC_MAX_MTU			9000
 
 #define ENIC_MULTICAST_PERFECT_FILTERS	32
+#define ENIC_UNICAST_PERFECT_FILTERS	32
 
 #define ENIC_NON_TSO_MAX_DESC		16
 


^ permalink raw reply related

* Re: echo > 0 .../disable_ipv6 broken in 2.6.37-rc4
From: Stephen Hemminger @ 2010-12-08 23:49 UTC (permalink / raw)
  To: Eric W. Biederman; +Cc: Brian Haley, netdev, Mahesh Kelkar, Lorenzo Colitti
In-Reply-To: <m1tyineu3p.fsf@fess.ebiederm.org>

On Wed, 08 Dec 2010 15:13:30 -0800
ebiederm@xmission.com (Eric W. Biederman) wrote:

> Brian Haley <brian.haley@hp.com> writes:
> 
> > This got broken in 2.6.34-rc1, and the most obvious culprit is this,
> > although I haven't bisected it:
> >
> > commit dc2b99f71ef477a31020511876ab4403fb7c4420
> > Author: stephen hemminger <shemminger@vyatta.com>
> > Date:   Mon Feb 8 19:48:05 2010 +0000
> >
> >     IPv6: keep permanent addresses on admin down
> >
> >     Permanent IPV6 addresses should not be removed when the link is
> >     set to admin down, only when device is removed.
> >
> >     When link is lost permanent addresses should be marked as tentative
> >     so that when link comes back they are subject to duplicate address
> >     detection (if DAD was enabled for that address).
> >
> >     Other routing systems keep manually configured IPv6 addresses
> >     when link is set down.
> >
> > Even though there was a bugfix update, it didn't help.
> >
> > I unfortunately won't be able to look at this more until at least Friday,
> > I couldn't come up with a quick patch just looking quickly at
> > addrconf_ifdown().
> 
> This is almost certainly it.
> ip link set lo down
> ip link set lo up
> 
> Is enough to break ping6 ::1.
> 
> I get the feeling the loopback address was not actually tested and
> there is something different about it.

Loopback is already handled as special case in addrconf. Look at IFF_LOOPBACK
perhaps there is a logic error there.


-- 

^ permalink raw reply

* [net-next-2.6 PATCH 0/2] enic: updates to version 1.4.1.9
From: Roopa Prabhu @ 2010-12-08 23:53 UTC (permalink / raw)
  To: davem; +Cc: netdev

This patch series implements the following enic driver updates:

01/2 - Add ndo_set_vf_mac support for enic dynamic devices
02/2 - Use VF mac set by IFLA_VF_MAC in port profile provisioning data


Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
Signed-off-by: David Wang <dwang2@cisco.com>
Signed-off-by: Christian Benvenuti <benve@cisco.com>

^ permalink raw reply

* [net-next-2.6 PATCH 1/2] enic: Add ndo_set_vf_mac support for enic dynamic devices
From: Roopa Prabhu @ 2010-12-08 23:53 UTC (permalink / raw)
  To: davem; +Cc: netdev
In-Reply-To: <20101208235340.24874.50597.stgit@savbu-pc100.cisco.com>

From: Roopa Prabhu <roprabhu@cisco.com>

This patch implements the ndo_set_vf_mac netdev operation for enic
dynamic devices. It treats the mac address set by IFLA_VF_MAC as a
special case to use it in the port profile provisioning data.

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      |    3 ++-
 drivers/net/enic/enic_main.c |   20 ++++++++++++++++++++
 2 files changed, 22 insertions(+), 1 deletions(-)


diff --git a/drivers/net/enic/enic.h b/drivers/net/enic/enic.h
index 8f374c1..bd473a9 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.8"
+#define DRV_VERSION		"1.4.1.9"
 #define DRV_COPYRIGHT		"Copyright 2008-2010 Cisco Systems, Inc"
 
 #define ENIC_BARS_MAX		6
@@ -61,6 +61,7 @@ struct enic_port_profile {
 	char name[PORT_PROFILE_MAX];
 	u8 instance_uuid[PORT_UUID_MAX];
 	u8 host_uuid[PORT_UUID_MAX];
+	u8 vf_mac[ETH_ALEN];
 };
 
 /* Per-instance private data structure */
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index 1931f15..ddeffb5 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -1231,6 +1231,23 @@ static int enic_dev_init_done(struct enic *enic, int *done, int *error)
 	return err;
 }
 
+static int enic_set_vf_mac(struct net_device *netdev, int vf, u8 *mac)
+{
+	struct enic *enic = netdev_priv(netdev);
+
+	if (vf != PORT_SELF_VF)
+		return -EOPNOTSUPP;
+
+	/* Ignore the vf argument for now. We can assume the request
+	 * is coming on a vf.
+	 */
+	if (is_valid_ether_addr(mac)) {
+		memcpy(enic->pp.vf_mac, mac, ETH_ALEN);
+		return 0;
+	} else
+		return -EINVAL;
+}
+
 static int enic_set_port_profile(struct enic *enic, u8 *mac)
 {
 	struct vic_provinfo *vp;
@@ -2411,6 +2428,9 @@ static const struct net_device_ops enic_netdev_dynamic_ops = {
 	.ndo_tx_timeout		= enic_tx_timeout,
 	.ndo_set_vf_port	= enic_set_vf_port,
 	.ndo_get_vf_port	= enic_get_vf_port,
+#ifdef IFLA_VF_MAX
+	.ndo_set_vf_mac		= enic_set_vf_mac,
+#endif
 #ifdef CONFIG_NET_POLL_CONTROLLER
 	.ndo_poll_controller	= enic_poll_controller,
 #endif


^ permalink raw reply related

* [net-next-2.6 PATCH 2/2] enic: Use VF mac set by IFLA_VF_MAC in port profile provisioning data
From: Roopa Prabhu @ 2010-12-08 23:54 UTC (permalink / raw)
  To: davem; +Cc: netdev
In-Reply-To: <20101208235340.24874.50597.stgit@savbu-pc100.cisco.com>

From: Roopa Prabhu <roprabhu@cisco.com>

This patch adds support in enic 802.1Qbh port profile provisioning code
to use the mac address set by IFLA_VF_MAC. For now we handle this mac as a
special case for a VM mac address sent to us by libvirt. The VM mac address
is sent to the switch along with the rest of the port profile provisioning
data. This patch also adds calls to register and deregister the mac address
during port profile association/deassociation.

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      |    1 +
 drivers/net/enic/enic_main.c |   79 ++++++++++++++++++++++++++++++------------
 2 files changed, 57 insertions(+), 23 deletions(-)


diff --git a/drivers/net/enic/enic.h b/drivers/net/enic/enic.h
index bd473a9..577067e 100644
--- a/drivers/net/enic/enic.h
+++ b/drivers/net/enic/enic.h
@@ -62,6 +62,7 @@ struct enic_port_profile {
 	u8 instance_uuid[PORT_UUID_MAX];
 	u8 host_uuid[PORT_UUID_MAX];
 	u8 vf_mac[ETH_ALEN];
+	u8 mac_addr[ETH_ALEN];
 };
 
 /* Per-instance private data structure */
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index ddeffb5..21be989 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -1278,9 +1278,14 @@ static int enic_set_port_profile(struct enic *enic, u8 *mac)
 			VIC_LINUX_PROV_TLV_PORT_PROFILE_NAME_STR,
 			strlen(enic->pp.name) + 1, enic->pp.name);
 
-		vic_provinfo_add_tlv(vp,
-			VIC_LINUX_PROV_TLV_CLIENT_MAC_ADDR,
-			ETH_ALEN, mac);
+		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);
+		else
+			vic_provinfo_add_tlv(vp,
+				VIC_LINUX_PROV_TLV_CLIENT_MAC_ADDR,
+				ETH_ALEN, mac);
 
 		if (enic->pp.set & ENIC_SET_INSTANCE) {
 			sprintf(uuid_str, "%pUB", enic->pp.instance_uuid);
@@ -1300,16 +1305,18 @@ static int enic_set_port_profile(struct enic *enic, u8 *mac)
 		vic_provinfo_free(vp);
 		if (err)
 			return err;
+
+		enic->pp.set |= ENIC_SET_APPLIED;
 		break;
 
 	case PORT_REQUEST_DISASSOCIATE:
+		enic->pp.set &= ~ENIC_SET_APPLIED;
 		break;
 
 	default:
 		return -EINVAL;
 	}
 
-	enic->pp.set |= ENIC_SET_APPLIED;
 	return 0;
 }
 
@@ -1317,29 +1324,31 @@ static int enic_set_vf_port(struct net_device *netdev, int vf,
 	struct nlattr *port[])
 {
 	struct enic *enic = netdev_priv(netdev);
+	struct enic_port_profile new_pp;
+	int err = 0;
 
-	memset(&enic->pp, 0, sizeof(enic->pp));
+	memset(&new_pp, 0, sizeof(new_pp));
 
 	if (port[IFLA_PORT_REQUEST]) {
-		enic->pp.set |= ENIC_SET_REQUEST;
-		enic->pp.request = nla_get_u8(port[IFLA_PORT_REQUEST]);
+		new_pp.set |= ENIC_SET_REQUEST;
+		new_pp.request = nla_get_u8(port[IFLA_PORT_REQUEST]);
 	}
 
 	if (port[IFLA_PORT_PROFILE]) {
-		enic->pp.set |= ENIC_SET_NAME;
-		memcpy(enic->pp.name, nla_data(port[IFLA_PORT_PROFILE]),
+		new_pp.set |= ENIC_SET_NAME;
+		memcpy(new_pp.name, nla_data(port[IFLA_PORT_PROFILE]),
 			PORT_PROFILE_MAX);
 	}
 
 	if (port[IFLA_PORT_INSTANCE_UUID]) {
-		enic->pp.set |= ENIC_SET_INSTANCE;
-		memcpy(enic->pp.instance_uuid,
+		new_pp.set |= ENIC_SET_INSTANCE;
+		memcpy(new_pp.instance_uuid,
 			nla_data(port[IFLA_PORT_INSTANCE_UUID]), PORT_UUID_MAX);
 	}
 
 	if (port[IFLA_PORT_HOST_UUID]) {
-		enic->pp.set |= ENIC_SET_HOST;
-		memcpy(enic->pp.host_uuid,
+		new_pp.set |= ENIC_SET_HOST;
+		memcpy(new_pp.host_uuid,
 			nla_data(port[IFLA_PORT_HOST_UUID]), PORT_UUID_MAX);
 	}
 
@@ -1347,21 +1356,39 @@ static int enic_set_vf_port(struct net_device *netdev, int vf,
 	if (vf != PORT_SELF_VF)
 		return -EOPNOTSUPP;
 
-	if (!(enic->pp.set & ENIC_SET_REQUEST))
+	if (!(new_pp.set & ENIC_SET_REQUEST))
 		return -EOPNOTSUPP;
 
-	if (enic->pp.request == PORT_REQUEST_ASSOCIATE) {
-
-		/* If the interface mac addr hasn't been assigned,
-		 * assign a random mac addr before setting port-
-		 * profile.
-		 */
+	if (new_pp.request == PORT_REQUEST_ASSOCIATE) {
+		/* Special case handling */
+		if (!is_zero_ether_addr(enic->pp.vf_mac))
+			memcpy(new_pp.mac_addr, enic->pp.vf_mac, ETH_ALEN);
 
 		if (is_zero_ether_addr(netdev->dev_addr))
 			random_ether_addr(netdev->dev_addr);
+	} else if (new_pp.request == PORT_REQUEST_DISASSOCIATE) {
+		if (!is_zero_ether_addr(enic->pp.mac_addr))
+			enic_dev_del_addr(enic, enic->pp.mac_addr);
 	}
 
-	return enic_set_port_profile(enic, netdev->dev_addr);
+	memcpy(&enic->pp, &new_pp, sizeof(struct enic_port_profile));
+
+	err = enic_set_port_profile(enic, netdev->dev_addr);
+	if (err)
+		goto set_port_profile_cleanup;
+
+	if (!is_zero_ether_addr(enic->pp.mac_addr))
+		enic_dev_add_addr(enic, enic->pp.mac_addr);
+
+set_port_profile_cleanup:
+	memset(enic->pp.vf_mac, 0, ETH_ALEN);
+
+	if (err || enic->pp.request == PORT_REQUEST_DISASSOCIATE) {
+		memset(netdev->dev_addr, 0, ETH_ALEN);
+		memset(enic->pp.mac_addr, 0, ETH_ALEN);
+	}
+
+	return err;
 }
 
 static int enic_get_vf_port(struct net_device *netdev, int vf,
@@ -1941,7 +1968,10 @@ static int enic_open(struct net_device *netdev)
 	for (i = 0; i < enic->rq_count; i++)
 		vnic_rq_enable(&enic->rq[i]);
 
-	enic_dev_add_station_addr(enic);
+	if (enic_is_dynamic(enic) && !is_zero_ether_addr(enic->pp.mac_addr))
+		enic_dev_add_addr(enic, enic->pp.mac_addr);
+	else
+		enic_dev_add_station_addr(enic);
 	enic_set_rx_mode(netdev);
 
 	netif_wake_queue(netdev);
@@ -1989,7 +2019,10 @@ static int enic_stop(struct net_device *netdev)
 
 	netif_carrier_off(netdev);
 	netif_tx_disable(netdev);
-	enic_dev_del_station_addr(enic);
+	if (enic_is_dynamic(enic) && !is_zero_ether_addr(enic->pp.mac_addr))
+		enic_dev_del_addr(enic, enic->pp.mac_addr);
+	else
+		enic_dev_del_station_addr(enic);
 
 	for (i = 0; i < enic->wq_count; i++) {
 		err = vnic_wq_disable(&enic->wq[i]);


^ permalink raw reply related

* Re: [PATCH] atm: correct sysfs 'device' link creation and parent relationships
From: Dan Williams @ 2010-12-09  0:33 UTC (permalink / raw)
  To: David Miller
  Cc: kay.sievers-tD+1rO4QERM, netdev-u79uwXL29TY76Z2rM5mHXA,
	duncan.sands-GANU6spQydw, linux-usb-u79uwXL29TY76Z2rM5mHXA,
	chas-vT06rRrALxcmhCb6mdbn6A
In-Reply-To: <20101208.121532.232745367.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>

On Wed, 2010-12-08 at 12:15 -0800, David Miller wrote:
> From: David Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
> Date: Wed, 08 Dec 2010 10:11:21 -0800 (PST)
> 
> > From: Kay Sievers <kay.sievers-tD+1rO4QERM@public.gmane.org>
> > Date: Tue, 7 Dec 2010 08:35:53 +0100
> > 
> >> On Sun, Dec 5, 2010 at 23:17, Dan Williams <dcbw-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
> >>> The ATM subsystem was incorrectly creating the 'device' link for ATM
> >>> nodes in sysfs.  This led to incorrect device/parent relationships
> >>> exposed by sysfs and udev.  Instead of rolling the 'device' link by hand
> >>> in the generic ATM code, pass each ATM driver's bus device down to the
> >>> sysfs code and let sysfs do this stuff correctly.
> >> 
> >> Looks good to me.
> > 
> > I've applied this to net-2.6, thanks Dan.
> 
> Actually I'm reverting, it breaks the build.
> 
> Did you even grep for "atm_dev_register()" after changning the number
> of arguments, or were you depending upon build failures to guide you?

What seems to have happened here was that I built against my installed
kernel config, which apparently does not enable a few of the drivers,
and thus I missed the error.  I apologize, I will submit a new patch,
and I will not let this happen again.

Dan

> Please never do the latter, as it always leads to things like this.
> 
> drivers/atm/fore200e.c:2577:7: error: too few arguments to function 'atm_dev_register'
> drivers/atm/iphase.c:3175:2: error: too few arguments to function 'atm_dev_register'



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

^ permalink raw reply

* NULL dereference in econet AUN-over-UDP receive
From: Nelson Elhage @ 2010-12-09  0:30 UTC (permalink / raw)
  To: netdev

While testing one of my econet reproducers on a patched kernel, I triggered a
NULL pointer dereference in the econet AUN-over-UDP receive path. Upon further
investigation, I now suspect that this code path hasn't worked at all in years.

A copy of the oops is below for your reference, but here's my analysis:

When aun_data_available receives a data packet (ah->code == 2), it calls
aun_incoming to process the skb. The start of aun_incoming looks like:

static void aun_incoming(struct sk_buff *skb, struct aunhdr *ah, size_t len)
{
	struct iphdr *ip = ip_hdr(skb);
	unsigned char stn = ntohl(ip->saddr) & 0xff;
	struct sock *sk = NULL;
	struct sk_buff *newskb;
---> 	struct ec_device *edev = skb->dev->ec_ptr;    


However, as far as I can tell, skb->dev is always NULL, meaning that that last
line will fault immediately before this function can do any real work.

In particular, 'skb' comes from "skb = skb_recv_datagram(sk, 0, 1, &err)" in
aun_data_available. skb_recv_datagram() pulls skb's off of sk->sk_receive_queue,
and (unless I'm missing something), the only way things get on that queue is via
sock_queue_rcv_skb, which explicitly sets skb->dev = NULL.

So, if I understand this all correctly, receiving AUN-over-UDP just plain hasn't
worked at all for a long time -- I can reproduce this crash on 2.6.12, which is
the earliest I've tested, and from reading code I suspect it's been broken at
least since 2.6.0.

I am not an expert in the networking subsystem, though, so if I am missing some
way that this code does actually work, please feel to correct me.

If, on the other hand, this code really hasn't worked in years, and no one
noticed, I wonder if we should reconsider moving this code into staging and
eventually out entirely, at least unless any real users step forward.

- Nelson


---- snip here ----

BUG: unable to handle kernel NULL pointer dereference at 0000000000000240
IP: [<ffffffff813a303e>] aun_data_available+0xb3/0x28d
PGD e818067 PUD e819067 PMD 0 
Oops: 0000 [#1] SMP 
last sysfs file: /sys/devices/virtual/net/lo/operstate
CPU 0 
Modules linked in:

Pid: 0, comm: swapper Not tainted 2.6.37-rc3 #39 /Bochs
RIP: 0010:[<ffffffff813a303e>]  [<ffffffff813a303e>] aun_data_available+0xb3/0x28d
RSP: 0018:ffff88000fc03b00  EFLAGS: 00010246
RAX: 0000000000000000 RBX: ffff88000fc03b3c RCX: ffff88000e808800
RDX: 0000000000000002 RSI: 0000000000000286 RDI: ffff88000e8060d4
RBP: ffff88000fc03b70 R08: 0000000000000003 R09: 0000000000000002
R10: ffff88000e69ac00 R11: 00000000ffffffff R12: ffff88000e80886a
R13: ffff88000e439500 R14: ffff88000e8060d4 R15: ffff88000e80884e
FS:  0000000000000000(0000) GS:ffff88000fc00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 0000000000000240 CR3: 000000000e813000 CR4: 00000000000006f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process swapper (pid: 0, threadinfo ffffffff81600000, task ffffffff8162b020)
Stack:
 ffff88000fc03ba0 ffffffff8131d614 ffff880000000010 ffff88000e806000
 0200000100000000 0202000a00000000 ffffc90000086d48 0000000000000246
 ffff88000fc03b70 ffff88000e806000 ffff88000e439500 0000000000000000
Call Trace:
 <IRQ> 
 [<ffffffff8131d614>] ? rt_intern_hash+0x5de/0x606
 [<ffffffff812f7839>] sock_queue_rcv_skb+0x168/0x187
 [<ffffffff81325641>] ip_queue_rcv_skb+0x45/0x4c
 [<ffffffff81031aa0>] ? try_to_wake_up+0x265/0x277
 [<ffffffff8133ee23>] __udp_queue_rcv_skb+0x50/0xb9
 [<ffffffff813403b0>] udp_queue_rcv_skb+0x1ad/0x26e
 [<ffffffff81340b67>] __udp4_lib_rcv+0x30a/0x50d
 [<ffffffff81340d7f>] udp_rcv+0x15/0x17
 [<ffffffff813206b1>] ip_local_deliver+0x12d/0x1d0
 [<ffffffff81320546>] ip_rcv+0x4f2/0x530
 [<ffffffff81300fb3>] __netif_receive_skb+0x34d/0x377
 [<ffffffff81301c1d>] netif_receive_skb+0x67/0x6e
 [<ffffffff812fb763>] ? __netdev_alloc_skb+0x1d/0x3a
 [<ffffffff8129a189>] cp_rx_poll+0x2e8/0x3ab
 [<ffffffff81007414>] ? nommu_map_page+0x0/0xa0
 [<ffffffff81302308>] net_rx_action+0xa7/0x215
 [<ffffffff8103c0f9>] __do_softirq+0xcd/0x18c
 [<ffffffff81002e4c>] call_softirq+0x1c/0x28
 [<ffffffff810042c3>] do_softirq+0x33/0x68
 [<ffffffff8103bc61>] irq_exit+0x36/0x38
 [<ffffffff810039a8>] do_IRQ+0xa3/0xba
 [<ffffffff813be8d3>] ret_from_intr+0x0/0xa
 <EOI> 
 [<ffffffff810089a1>] ? default_idle+0x62/0x7a
 [<ffffffff813c1882>] ? atomic_notifier_call_chain+0x13/0x15
 [<ffffffff81001321>] cpu_idle+0x54/0xbe
 [<ffffffff813a3d49>] rest_init+0x6d/0x6f
 [<ffffffff8169cc85>] start_kernel+0x332/0x33d
 [<ffffffff8169c2a8>] x86_64_start_reservations+0xb8/0xbc
 [<ffffffff8169c39e>] x86_64_start_kernel+0xf2/0xf9
Code: 00 80 fa 04 0f 84 bb 01 00 00 80 fa 02 0f 85 c3 01 00 00 45 8b bd a0 00 00 00 4e 8d 3c 39 41 8b 47 0c 0f c8 88 45 b7 49 8b 45 20 <4c> 8b b0 40 02 00 00 4d 85 f6 0f 84 4f 01 00 00 41 8a 46 01 48 
RIP  [<ffffffff813a303e>] aun_data_available+0xb3/0x28d
 RSP <ffff88000fc03b00>
CR2: 0000000000000240
---[ end trace 8e7c904f0da8a9a0 ]---
Kernel panic - not syncing: Fatal exception in interrupt
Pid: 0, comm: swapper Tainted: G      D     2.6.37-rc3 #39
Call Trace:
 <IRQ>  [<ffffffff813bc1b4>] panic+0x8c/0x18d
 [<ffffffff810374ff>] ? kmsg_dump+0x115/0x12f
 [<ffffffff813bf5a2>] oops_end+0x81/0x8e
 [<ffffffff81020b01>] no_context+0x1f7/0x206
 [<ffffffff81067af6>] ? handle_IRQ_event+0x52/0x117
 [<ffffffff81020c92>] __bad_area_nosemaphore+0x182/0x1a5
 [<ffffffff81069aa5>] ? handle_fasteoi_irq+0xd5/0xe0
 [<ffffffff81020cc3>] bad_area_nosemaphore+0xe/0x10
 [<ffffffff813c160a>] do_page_fault+0x1e3/0x3db
 [<ffffffff810039a8>] ? do_IRQ+0xa3/0xba
 [<ffffffff813be8d3>] ? ret_from_intr+0x0/0xa
 [<ffffffff8102c35c>] ? enqueue_task_fair+0x156/0x162
 [<ffffffff812fcb99>] ? __skb_recv_datagram+0x116/0x258
 [<ffffffff813beadf>] page_fault+0x1f/0x30
 [<ffffffff813a303e>] ? aun_data_available+0xb3/0x28d
 [<ffffffff8131d614>] ? rt_intern_hash+0x5de/0x606
 [<ffffffff812f7839>] sock_queue_rcv_skb+0x168/0x187
 [<ffffffff81325641>] ip_queue_rcv_skb+0x45/0x4c
 [<ffffffff81031aa0>] ? try_to_wake_up+0x265/0x277
 [<ffffffff8133ee23>] __udp_queue_rcv_skb+0x50/0xb9
 [<ffffffff813403b0>] udp_queue_rcv_skb+0x1ad/0x26e
 [<ffffffff81340b67>] __udp4_lib_rcv+0x30a/0x50d
 [<ffffffff81340d7f>] udp_rcv+0x15/0x17
 [<ffffffff813206b1>] ip_local_deliver+0x12d/0x1d0
 [<ffffffff81320546>] ip_rcv+0x4f2/0x530
 [<ffffffff81300fb3>] __netif_receive_skb+0x34d/0x377
 [<ffffffff81301c1d>] netif_receive_skb+0x67/0x6e
 [<ffffffff812fb763>] ? __netdev_alloc_skb+0x1d/0x3a
 [<ffffffff8129a189>] cp_rx_poll+0x2e8/0x3ab
 [<ffffffff81007414>] ? nommu_map_page+0x0/0xa0
 [<ffffffff81302308>] net_rx_action+0xa7/0x215
 [<ffffffff8103c0f9>] __do_softirq+0xcd/0x18c
 [<ffffffff81002e4c>] call_softirq+0x1c/0x28
 [<ffffffff810042c3>] do_softirq+0x33/0x68
 [<ffffffff8103bc61>] irq_exit+0x36/0x38
 [<ffffffff810039a8>] do_IRQ+0xa3/0xba
 [<ffffffff813be8d3>] ret_from_intr+0x0/0xa
 <EOI>  [<ffffffff810089a1>] ? default_idle+0x62/0x7a
 [<ffffffff813c1882>] ? atomic_notifier_call_chain+0x13/0x15
 [<ffffffff81001321>] cpu_idle+0x54/0xbe
 [<ffffffff813a3d49>] rest_init+0x6d/0x6f
 [<ffffffff8169cc85>] start_kernel+0x332/0x33d
 [<ffffffff8169c2a8>] x86_64_start_reservations+0xb8/0xbc
 [<ffffffff8169c39e>] x86_64_start_kernel+0xf2/0xf9

^ 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