Netdev List
 help / color / mirror / Atom feed
* [BUG/PATCH] ppp_mppe discards 50% of packets from some servers
From: Phil Hord @ 2012-05-04 22:28 UTC (permalink / raw)
  To: netdev

[BUG] ppp_mppe discards 50% of packets from some servers

[2.] Full description of the problem/report:

When I connect to a server using MPPE, I receive about every other
packet with the FLUSHED bit turned off. These packets are dropped by
ppp_mppe.c just like the SPEC says they should be. I am not able to
maintain tcp connections through the VPN with these packets being discarded.

I found a patch discussed here:
http://ubuntuforums.org/showthread.php?t=1095189

When I stop dropping those packets (by making this change to the driver;
see patch at end), the problem went away.

When I connect to a different server, I do not have this problem.

WhenI connect using Windows XP or Windows 7 clients, I do not have any
packet loss on either server, though I have not confirmed whether every
other packet still has the FLUSHED bit turned off.

I could see the symptom clearly by pinging a machine on the VPN. Every
other ping packet is lost with the old driver. Once I installed the new
driver, every ping is responded correctly.

I do not know any details about the two servers (one that works and one
that doesn't) except both are managed by the same mega-company but in
different countries (China and Czech).

--- /etc/ppp/peers/server1
pty "pptp remote-server1 --nolaunchpppd"
name "username"
remotename PPTP
require-mppe-128
file /etc/ppp/options.pptp

--- /etc/ppp/options.pptp:
lock
noauth
refuse-pap
refuse-eap
refuse-chap
refuse-mschap
nobsdcomp
nodeflate



[3.] Keywords (i.e., modules, networking, kernel):
ppp_mppe.ko, networking, kernel, mppe

[4.] Kernel information
[4.1.] Kernel version (from /proc/version):
Linux version 3.0.0-14-generic (buildd@allspice) (gcc version 4.6.1
(Ubuntu/Linaro 4.6.1-9ubuntu3) ) #23-Ubuntu SMP Mon Nov 21 20:28:43 UTC 2011


[4.2.] Kernel .config file:
*shrug*

[5.] Most recent kernel version which did not have the bug:

I have never seen a version able to connect to the failing server reliably.

[6.] Output of Oops.. message (if applicable) with symbolic information
     resolved (see Documentation/oops-tracing.txt)

N/A


[7.] A small shell script or example program which triggers the
     problem (if possible)

$ sudo pon server2
$ ping some-machine.server2
...
^C
20 packets transmitted, 10 received, 50% packet loss



[8.] Environment
[8.1.] Software (add the output of the ver_linux script here)
If some fields are empty or look unusual you may have an old version.
Compare to the current minimal requirements in Documentation/Changes.
 
Linux iptv-lnx-hordp 3.0.0-14-generic #23-Ubuntu SMP Mon Nov 21 20:28:43
UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
 
Gnu C                  4.6.1
Gnu make               3.81
binutils               2.21.53.20110810
util-linux             2.19.1
mount                  support
module-init-tools      3.16
e2fsprogs              1.41.14
pcmciautils            015
PPP                    2.4.5
Linux C Library        2.13
Dynamic linker (ldd)   2.13
Procps                 3.2.8
Net-tools              1.60
Kbd                    1.15.2
Sh-utils               8.5
wireless-tools         30
Modules Loaded         ppp_mppe des_generic md4 nls_utf8 cifs ppp_async
crc_ccitt usb_storage uas mos7840 asix usbserial usbnet hid_logitech
ff_memless bnep rfcomm pci_stub vboxpci vboxnetadp vboxnetflt vboxdrv
kvm_intel kvm parport_pc ppdev autofs4 binfmt_misc dm_crypt
snd_hda_codec_hdmi nvidia uvcvideo videodev arc4 v4l2_compat_ioctl32
joydev btusb bluetooth snd_hda_codec_conexant iwlagn thinkpad_acpi
snd_seq_midi snd_hda_intel snd_rawmidi mac80211 snd_hda_codec psmouse
snd_hwdep snd_seq_midi_event serio_raw cfg80211 snd_seq snd_pcm
snd_seq_device snd_timer snd nvram tpm_tis video soundcore
snd_page_alloc wmi mei lp parport usbhid hid mmc_block ahci sdhci_pci
sdhci libahci xhci_hcd e1000e

[8.2.] Processor information (from /proc/cpuinfo):
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 42
model name      : Intel(R) Core(TM) i7-2760QM CPU @ 2.40GHz
stepping        : 7
cpu MHz         : 800.000
cache size      : 6144 KB
physical id     : 0
siblings        : 8
core id         : 0
cpu cores       : 4
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe
syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology
nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est
tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic popcnt aes xsave avx
lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority
ept vpid
bogomips        : 4784.69
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

processor       : 1
vendor_id       : GenuineIntel
cpu family      : 6
model           : 42
model name      : Intel(R) Core(TM) i7-2760QM CPU @ 2.40GHz
stepping        : 7
cpu MHz         : 800.000
cache size      : 6144 KB
physical id     : 0
siblings        : 8
core id         : 0
cpu cores       : 4
apicid          : 1
initial apicid  : 1
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe
syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology
nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est
tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic popcnt aes xsave avx
lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority
ept vpid
bogomips        : 4784.17
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

processor       : 2
vendor_id       : GenuineIntel
cpu family      : 6
model           : 42
model name      : Intel(R) Core(TM) i7-2760QM CPU @ 2.40GHz
stepping        : 7
cpu MHz         : 800.000
cache size      : 6144 KB
physical id     : 0
siblings        : 8
core id         : 1
cpu cores       : 4
apicid          : 2
initial apicid  : 2
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe
syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology
nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est
tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic popcnt aes xsave avx
lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority
ept vpid
bogomips        : 4785.08
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

processor       : 3
vendor_id       : GenuineIntel
cpu family      : 6
model           : 42
model name      : Intel(R) Core(TM) i7-2760QM CPU @ 2.40GHz
stepping        : 7
cpu MHz         : 800.000
cache size      : 6144 KB
physical id     : 0
siblings        : 8
core id         : 1
cpu cores       : 4
apicid          : 3
initial apicid  : 3
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe
syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology
nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est
tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic popcnt aes xsave avx
lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority
ept vpid
bogomips        : 4784.56
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

processor       : 4
vendor_id       : GenuineIntel
cpu family      : 6
model           : 42
model name      : Intel(R) Core(TM) i7-2760QM CPU @ 2.40GHz
stepping        : 7
cpu MHz         : 800.000
cache size      : 6144 KB
physical id     : 0
siblings        : 8
core id         : 2
cpu cores       : 4
apicid          : 4
initial apicid  : 4
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe
syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology
nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est
tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic popcnt aes xsave avx
lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority
ept vpid
bogomips        : 4784.34
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

processor       : 5
vendor_id       : GenuineIntel
cpu family      : 6
model           : 42
model name      : Intel(R) Core(TM) i7-2760QM CPU @ 2.40GHz
stepping        : 7
cpu MHz         : 800.000
cache size      : 6144 KB
physical id     : 0
siblings        : 8
core id         : 2
cpu cores       : 4
apicid          : 5
initial apicid  : 5
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe
syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology
nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est
tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic popcnt aes xsave avx
lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority
ept vpid
bogomips        : 4784.48
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

processor       : 6
vendor_id       : GenuineIntel
cpu family      : 6
model           : 42
model name      : Intel(R) Core(TM) i7-2760QM CPU @ 2.40GHz
stepping        : 7
cpu MHz         : 800.000
cache size      : 6144 KB
physical id     : 0
siblings        : 8
core id         : 3
cpu cores       : 4
apicid          : 6
initial apicid  : 6
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe
syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology
nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est
tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic popcnt aes xsave avx
lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority
ept vpid
bogomips        : 4784.48
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

processor       : 7
vendor_id       : GenuineIntel
cpu family      : 6
model           : 42
model name      : Intel(R) Core(TM) i7-2760QM CPU @ 2.40GHz
stepping        : 7
cpu MHz         : 800.000
cache size      : 6144 KB
physical id     : 0
siblings        : 8
core id         : 3
cpu cores       : 4
apicid          : 7
initial apicid  : 7
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe
syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology
nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est
tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic popcnt aes xsave avx
lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority
ept vpid
bogomips        : 4784.52
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:


[8.3.] Module information (from /proc/modules):
ppp_mppe 13035 4 - Live 0xffffffffa0fbe000
des_generic 21415 0 - Live 0xffffffffa0fc9000
md4 12595 0 - Live 0xffffffffa0fb9000
nls_utf8 12557 1 - Live 0xffffffffa0fc4000
cifs 273872 2 - Live 0xffffffffa0f75000
ppp_async 17539 2 - Live 0xffffffffa0f6f000
crc_ccitt 12667 1 ppp_async, Live 0xffffffffa0ef5000
usb_storage 57901 0 - Live 0xffffffffa0f5f000
uas 18027 0 - Live 0xffffffffa0f47000
mos7840 36023 0 - Live 0xffffffffa0f55000
asix 22704 0 - Live 0xffffffffa0f4e000
usbserial 47107 1 mos7840, Live 0xffffffffa0f3a000
usbnet 26212 1 asix, Live 0xffffffffa0f00000
hid_logitech 17677 0 - Live 0xffffffffa0efa000
ff_memless 13097 1 hid_logitech, Live 0xffffffffa0ee9000
bnep 18436 2 - Live 0xffffffffa0eef000
rfcomm 47946 12 - Live 0xffffffffa0e85000
pci_stub 12622 1 - Live 0xffffffffa0e02000
vboxpci 23200 0 - Live 0xffffffffa0e7e000
vboxnetadp 13382 0 - Live 0xffffffffa0251000
vboxnetflt 23441 0 - Live 0xffffffffa0e77000
vboxdrv 282548 3 vboxpci,vboxnetadp,vboxnetflt, Live 0xffffffffa0ea3000
kvm_intel 61643 0 - Live 0xffffffffa0e92000
kvm 383781 1 kvm_intel, Live 0xffffffffa0e18000
parport_pc 36962 0 - Live 0xffffffffa0e0d000
ppdev 17113 0 - Live 0xffffffffa0e07000
autofs4 37024 3 - Live 0xffffffffa0df7000
binfmt_misc 17540 1 - Live 0xffffffffa0df1000
dm_crypt 23199 0 - Live 0xffffffffa0de6000
snd_hda_codec_hdmi 32040 4 - Live 0xffffffffa0fec000
nvidia 11713772 45 - Live 0xffffffffa02b9000 (P)
uvcvideo 72711 0 - Live 0xffffffffa0ff5000
videodev 92992 1 uvcvideo, Live 0xffffffffa0fd4000
arc4 12529 6 - Live 0xffffffffa0242000
v4l2_compat_ioctl32 17083 1 videodev, Live 0xffffffffa021a000
joydev 17693 0 - Live 0xffffffffa0214000
btusb 18600 2 - Live 0xffffffffa023c000
bluetooth 166112 23 bnep,rfcomm,btusb, Live 0xffffffffa0f0b000
snd_hda_codec_conexant 62197 1 - Live 0xffffffffa0203000
iwlagn 314213 0 - Live 0xffffffffa0256000
thinkpad_acpi 81819 0 - Live 0xffffffffa02a4000
snd_seq_midi 13324 0 - Live 0xffffffffa0166000
snd_hda_intel 33390 5 - Live 0xffffffffa0247000
snd_rawmidi 30547 1 snd_seq_midi, Live 0xffffffffa015d000
mac80211 462092 1 iwlagn, Live 0xffffffffa0191000
snd_hda_codec 104802 3
snd_hda_codec_hdmi,snd_hda_codec_conexant,snd_hda_intel, Live
0xffffffffa0221000
psmouse 73882 0 - Live 0xffffffffa017d000
snd_hwdep 13668 1 snd_hda_codec, Live 0xffffffffa00fb000
snd_seq_midi_event 14899 1 snd_seq_midi, Live 0xffffffffa010d000
serio_raw 13166 0 - Live 0xffffffffa00e1000
cfg80211 199587 2 iwlagn,mac80211, Live 0xffffffffa012b000
snd_seq 61896 2 snd_seq_midi,snd_seq_midi_event, Live 0xffffffffa016c000
snd_pcm 96714 4 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec, Live
0xffffffffa0112000
snd_seq_device 14540 3 snd_seq_midi,snd_rawmidi,snd_seq, Live
0xffffffffa00d6000
snd_timer 29991 3 snd_seq,snd_pcm, Live 0xffffffffa0104000
snd 68266 19
snd_hda_codec_hdmi,snd_hda_codec_conexant,thinkpad_acpi,snd_hda_intel,snd_rawmidi,snd_hda_codec,snd_hwdep,snd_seq,snd_pcm,snd_seq_device,snd_timer,
Live 0xffffffffa00e9000
nvram 14413 1 thinkpad_acpi, Live 0xffffffffa00b1000
tpm_tis 18546 0 - Live 0xffffffffa00db000
video 19412 0 - Live 0xffffffffa00d0000
soundcore 12680 1 snd, Live 0xffffffffa007a000
snd_page_alloc 18529 2 snd_hda_intel,snd_pcm, Live 0xffffffffa00ca000
wmi 19256 0 - Live 0xffffffffa00b6000
mei 41480 0 - Live 0xffffffffa00a5000 (C)
lp 17799 0 - Live 0xffffffffa004a000
parport 46562 3 parport_pc,ppdev,lp, Live 0xffffffffa0098000
usbhid 47198 1 hid_logitech, Live 0xffffffffa00bd000
hid 95463 2 hid_logitech,usbhid, Live 0xffffffffa007f000
mmc_block 22923 0 - Live 0xffffffffa0029000
ahci 26002 4 - Live 0xffffffffa0072000
sdhci_pci 14032 0 - Live 0xffffffffa0069000
sdhci 32166 1 sdhci_pci, Live 0xffffffffa005c000
libahci 26861 1 ahci, Live 0xffffffffa0050000
xhci_hcd 82820 0 - Live 0xffffffffa0034000
e1000e 160582 0 - Live 0xffffffffa0000000

[8.4.] Loaded driver and hardware information (/proc/ioports, /proc/iomem)
 cat /proc/ioports /proc/iomem
0000-0cf7 : PCI Bus 0000:00
  0000-001f : dma1
  0020-0021 : pic1
  0040-0043 : timer0
  0050-0053 : timer1
  0060-0060 : keyboard
  0062-0062 : EC data
  0064-0064 : keyboard
  0066-0066 : EC cmd
  0070-0071 : rtc0
  0080-008f : dma page reg
  00a0-00a1 : pic2
  00c0-00df : dma2
  00f0-00ff : fpu
  03c0-03df : vga+
  0400-047f : pnp 00:02
    0400-0403 : ACPI PM1a_EVT_BLK
    0404-0405 : ACPI PM1a_CNT_BLK
    0408-040b : ACPI PM_TMR
    0410-0415 : ACPI CPU throttle
    0420-042f : ACPI GPE0_BLK
    0450-0450 : ACPI PM2_CNT_BLK
  0500-057f : pnp 00:02
  0800-080f : pnp 00:02
0cf8-0cff : PCI conf1
0d00-ffff : PCI Bus 0000:00
  15e0-15ef : pnp 00:02
  1600-167f : pnp 00:02
  3000-3fff : PCI Bus 0000:0d
  4000-4fff : PCI Bus 0000:05
  5000-5fff : PCI Bus 0000:01
    5000-507f : 0000:01:00.0
  6020-603f : 0000:00:1f.2
    6020-603f : ahci
  6040-605f : 0000:00:19.0
  6060-6067 : 0000:00:1f.2
    6060-6067 : ahci
  6068-606f : 0000:00:1f.2
    6068-606f : ahci
  6070-6077 : 0000:00:16.3
    6070-6077 : serial
  6078-607b : 0000:00:1f.2
    6078-607b : ahci
  607c-607f : 0000:00:1f.2
    607c-607f : ahci
  efa0-efbf : 0000:00:1f.3
00000000-0000ffff : reserved
00010000-0009d7ff : System RAM
0009d800-0009ffff : reserved
000a0000-000bffff : PCI Bus 0000:00
000c0000-000c7fff : Video ROM
000c8000-000cbfff : pnp 00:00
000cc000-000cffff : pnp 00:00
000d0000-000d3fff : pnp 00:00
000d4000-000d7fff : pnp 00:00
000d8000-000dbfff : pnp 00:00
000dc000-000dffff : pnp 00:00
000e0000-000fffff : reserved
  000f0000-000fffff : System ROM
00100000-bf19efff : System RAM
  01000000-015f753e : Kernel code
  015f753f-01aba6ff : Kernel data
  01bb9000-01d0bfff : Kernel bss
bf19f000-bf69efff : reserved
bf69f000-bf79efff : ACPI Non-volatile Storage
bf79f000-bf7fefff : ACPI Tables
bf7ff000-bf7fffff : System RAM
bf800000-bfffffff : reserved
c0000000-febfffff : PCI Bus 0000:00
  c0000000-d1ffffff : PCI Bus 0000:01
    c0000000-cfffffff : 0000:01:00.0
    d0000000-d1ffffff : 0000:01:00.0
  d2000000-d30fffff : PCI Bus 0000:01
    d2000000-d2ffffff : 0000:01:00.0
      d2000000-d2ffffff : nvidia
    d3000000-d3003fff : 0000:01:00.1
      d3000000-d3003fff : ICH HD audio
    d3080000-d30fffff : 0000:01:00.0
  d3100000-d38fffff : PCI Bus 0000:05
  d3900000-d40fffff : PCI Bus 0000:0d
  d4100000-d41fffff : PCI Bus 0000:0e
    d4100000-d4101fff : 0000:0e:00.0
      d4100000-d4101fff : xhci_hcd
  d4200000-d49fffff : PCI Bus 0000:0d
    d4200000-d42000ff : 0000:0d:00.0
      d4200000-d42000ff : mmc0
  d4a00000-d51fffff : PCI Bus 0000:05
  d5200000-d52fffff : PCI Bus 0000:03
    d5200000-d5201fff : 0000:03:00.0
      d5200000-d5201fff : iwlagn
  d5300000-d531ffff : 0000:00:19.0
    d5300000-d531ffff : e1000e
  d5320000-d5323fff : 0000:00:1b.0
    d5320000-d5323fff : ICH HD audio
  d5324000-d53240ff : 0000:00:1f.3
  d5325000-d532500f : 0000:00:16.0
    d5325000-d532500f : mei
  d5328000-d53287ff : 0000:00:1f.2
    d5328000-d53287ff : ahci
  d5329000-d53293ff : 0000:00:1d.0
    d5329000-d53293ff : ehci_hcd
  d532a000-d532a3ff : 0000:00:1a.0
    d532a000-d532a3ff : ehci_hcd
  d532b000-d532bfff : 0000:00:19.0
    d532b000-d532bfff : e1000e
  d532c000-d532cfff : 0000:00:16.3
  f8000000-fbffffff : PCI MMCONFIG 0000 [bus 00-3f]
    f8000000-fbffffff : reserved
      f8000000-fbffffff : pnp 00:02
fec00000-fec00fff : reserved
fed00000-fed003ff : HPET 0
fed08000-fed08fff : reserved
fed10000-fed19fff : reserved
  fed10000-fed13fff : pnp 00:02
  fed18000-fed18fff : pnp 00:02
  fed19000-fed19fff : pnp 00:02
fed1c000-fed1ffff : reserved
  fed1c000-fed1ffff : pnp 00:02
fed40000-fed4bfff : PCI Bus 0000:00
  fed45000-fed4bfff : pnp 00:02
fee00000-fee00fff : Local APIC
  fee00000-fee00fff : reserved
ffd20000-ffffffff : reserved
100000000-43dffffff : System RAM
43e000000-43fffffff : RAM buffer

[X.] Other notes, patches, fixes, workarounds:


Patch follows:

-->8--

Subject: [PATCH] ppp_mppe: Don't discard non-FLUSHED-bit packets

In mppe_decompress, packets without the FLUSHED bit set
are discarded.  Some servers clear this bit on every other
packet and so streams are impossible to maintain.

Fix this by keeping these packets with the FLUSHED bit set.

This may turn out to be the wrong way to fix this, but it
has worked for me so far.  I only connect to three servers,
though.

Signed-off-by: Phil Hord <hordp@cisco.com>
---
 drivers/net/ppp/ppp_mppe.c |    6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/net/ppp/ppp_mppe.c b/drivers/net/ppp/ppp_mppe.c
index 9a1849a..765c28a 100644
--- a/drivers/net/ppp/ppp_mppe.c
+++ b/drivers/net/ppp/ppp_mppe.c
@@ -517,12 +517,6 @@ mppe_decompress(void *arg, unsigned char *ibuf, int
isize, unsigned char *obuf,
                state->sanity_errors += 100;
                sanity = 1;
        }
-       if (!state->stateful && !flushed) {
-               printk(KERN_DEBUG "mppe_decompress[%d]: FLUSHED bit not
set in "
-                      "stateless mode!\n", state->unit);
-               state->sanity_errors += 100;
-               sanity = 1;
-       }
        if (state->stateful && ((ccount & 0xff) == 0xff) && !flushed) {
                printk(KERN_DEBUG "mppe_decompress[%d]: FLUSHED bit not
set on "
                       "flag packet!\n", state->unit);
-- 
1.7.10.509.g991919

^ permalink raw reply related

* RE: [PATCH 2/4] ipgre: follow state of lower device
From: Christian Benvenuti (benve) @ 2012-05-04 23:34 UTC (permalink / raw)
  To: Stephen Hemminger, David Miller; +Cc: netdev, kaber
In-Reply-To: <20120503154025.0845359e@nehalam.linuxnetplumber.net>

Is this the same issue I described in the email below?

  Subject:Route flush on linkdown: physical vs virtual/stacked
interfaces
  http://marc.info/?l=linux-netdev&m=133468470719285&w=2

(ie, need to propagate carrier changes to upper layer device/s)

Thanks
/Chris

> -----Original Message-----
> From: netdev-owner@vger.kernel.org
[mailto:netdev-owner@vger.kernel.org] On Behalf Of Stephen
> Hemminger
> Sent: Thursday, May 03, 2012 3:40 PM
> To: David Miller
> Cc: netdev@vger.kernel.org
> Subject: Re: [PATCH 2/4] ipgre: follow state of lower device
> 
> On Sat, 14 Apr 2012 14:53:02 -0400 (EDT)
> David Miller <davem@davemloft.net> wrote:
> 
> > From: Stephen Hemminger <shemminger@vyatta.com>
> > Date: Thu, 12 Apr 2012 09:31:17 -0700
> >
> > > GRE tunnels like other layered devices should propogate
> > > carrier and RFC2863 state from lower device to tunnel.
> > >
> > > Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> >
> > Like others I don't like the ugly hash traversal.
> >
> > A small hash on ifindex, iflink, or whatever ought to be easy and
make
> > the code look much nicer.
> >
> > Longer term project is that a lot of this tunneling code can be
> > commonized at some point.
> 
> The whole set of tunnels needs to be cleaned up to be something
modular, clean
> and cached like the code in OpenVswitch.
> --
> 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

* [PATCH 0/3] First pass of cleanups for pskb_expand_head
From: Alexander Duyck @ 2012-05-05  0:26 UTC (permalink / raw)
  To: netdev; +Cc: davem, eric.dumazet, jeffrey.t.kirsher

After looking over the tcp coalesing and GRO code a couple of days ago it
occurred to me that pskb_expand_head has a few flaws.  A few of which are
addressed in this patch series.

This change set takes care of some of the minor cleanup items.  One thing
that caught my eye is the fact the memmove code in the fast-path is likely
no longer doing any thing but burning cycles on a call that doesn't
actually move any memory.

The other change is a follow on to that to drop the fastpath variable which
really just means if the skb is cloned or not.

The final change in this set just adds an inline for getting the end offset
since there were multiple places where we were computing end - head to get
the offset and if we are storing it as an offset it makes more sense to
just pull the actual value.

There are a few more items that I will try to get to next week.  The big one
is the fact that pskb_expand_head can mess up the truesize since it can
allocate a new head but never updates the truesize.  I plan on adding a helper
function for the cases where we are just using it unshare the head so I can
identify the places where we are actually modifying the size.

---

Alexander Duyck (3):
      skb: Add inline helper for getting the skb end offset from head
      skb: Drop "fastpath" variable for skb_cloned check in pskb_expand_head
      skb: Drop bad code from pskb_expand_head


 drivers/atm/ambassador.c             |    2 +
 drivers/atm/idt77252.c               |    2 +
 drivers/net/wimax/i2400m/usb-rx.c    |    2 +
 drivers/staging/octeon/ethernet-tx.c |    2 +
 include/linux/skbuff.h               |   12 ++++++++-
 net/core/skbuff.c                    |   46 ++++++++++------------------------
 6 files changed, 29 insertions(+), 37 deletions(-)

-- 
Thanks,

Alex

^ permalink raw reply

* [PATCH 1/3] skb: Drop bad code from pskb_expand_head
From: Alexander Duyck @ 2012-05-05  0:26 UTC (permalink / raw)
  To: netdev; +Cc: davem, eric.dumazet, jeffrey.t.kirsher
In-Reply-To: <20120505001059.21292.31647.stgit@gitlad.jf.intel.com>

The fast-path for pskb_expand_head contains a check where the size plus the
unaligned size of skb_shared_info is compared against the size of the data
buffer.  This code path has two issues.  First is the fact that after the
recent changes by Eric Dumazet to __alloc_skb and build_skb the shared info
is always placed in the optimal spot for a buffer size making this check
unnecessary.  The second issue is the fact that the check doesn't take into
account the aligned size of shared info.  As a result the code burns cycles
doing a memcpy with nothing actually being shifted.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
---

 net/core/skbuff.c |   12 ------------
 1 files changed, 0 insertions(+), 12 deletions(-)

diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index c199aa4..4d085d4 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -951,17 +951,6 @@ int pskb_expand_head(struct sk_buff *skb, int nhead, int ntail,
 		fastpath = atomic_read(&skb_shinfo(skb)->dataref) == delta;
 	}
 
-	if (fastpath && !skb->head_frag &&
-	    size + sizeof(struct skb_shared_info) <= ksize(skb->head)) {
-		memmove(skb->head + size, skb_shinfo(skb),
-			offsetof(struct skb_shared_info,
-				 frags[skb_shinfo(skb)->nr_frags]));
-		memmove(skb->head + nhead, skb->head,
-			skb_tail_pointer(skb) - skb->head);
-		off = nhead;
-		goto adjust_others;
-	}
-
 	data = kmalloc(size + SKB_DATA_ALIGN(sizeof(struct skb_shared_info)),
 		       gfp_mask);
 	if (!data)
@@ -997,7 +986,6 @@ int pskb_expand_head(struct sk_buff *skb, int nhead, int ntail,
 
 	skb->head     = data;
 	skb->head_frag = 0;
-adjust_others:
 	skb->data    += off;
 #ifdef NET_SKBUFF_DATA_USES_OFFSET
 	skb->end      = size;

^ permalink raw reply related

* [PATCH 2/3] skb: Drop "fastpath" variable for skb_cloned check in pskb_expand_head
From: Alexander Duyck @ 2012-05-05  0:26 UTC (permalink / raw)
  To: netdev; +Cc: davem, eric.dumazet, jeffrey.t.kirsher
In-Reply-To: <20120505001059.21292.31647.stgit@gitlad.jf.intel.com>

Since there is now only one spot that actually uses "fastpath" there isn't
much point in carrying it.  Instead we can just use a check for skb_cloned
to verify if we can perform the fast-path free for the head or not.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
---

 net/core/skbuff.c |   22 ++++++++--------------
 1 files changed, 8 insertions(+), 14 deletions(-)

diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 4d085d4..17e4b1e 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -932,7 +932,6 @@ int pskb_expand_head(struct sk_buff *skb, int nhead, int ntail,
 	u8 *data;
 	int size = nhead + (skb_end_pointer(skb) - skb->head) + ntail;
 	long off;
-	bool fastpath;
 
 	BUG_ON(nhead < 0);
 
@@ -941,16 +940,6 @@ int pskb_expand_head(struct sk_buff *skb, int nhead, int ntail,
 
 	size = SKB_DATA_ALIGN(size);
 
-	/* Check if we can avoid taking references on fragments if we own
-	 * the last reference on skb->head. (see skb_release_data())
-	 */
-	if (!skb->cloned)
-		fastpath = true;
-	else {
-		int delta = skb->nohdr ? (1 << SKB_DATAREF_SHIFT) + 1 : 1;
-		fastpath = atomic_read(&skb_shinfo(skb)->dataref) == delta;
-	}
-
 	data = kmalloc(size + SKB_DATA_ALIGN(sizeof(struct skb_shared_info)),
 		       gfp_mask);
 	if (!data)
@@ -966,9 +955,12 @@ int pskb_expand_head(struct sk_buff *skb, int nhead, int ntail,
 	       skb_shinfo(skb),
 	       offsetof(struct skb_shared_info, frags[skb_shinfo(skb)->nr_frags]));
 
-	if (fastpath) {
-		skb_free_head(skb);
-	} else {
+	/*
+	 * if shinfo is shared we must drop the old head gracefully, but if it
+	 * is not we can just drop the old head and let the existing refcount
+	 * be since all we did is relocate the values
+	 */
+	if (skb_cloned(skb)) {
 		/* copy this zero copy skb frags */
 		if (skb_shinfo(skb)->tx_flags & SKBTX_DEV_ZEROCOPY) {
 			if (skb_copy_ubufs(skb, gfp_mask))
@@ -981,6 +973,8 @@ int pskb_expand_head(struct sk_buff *skb, int nhead, int ntail,
 			skb_clone_fraglist(skb);
 
 		skb_release_data(skb);
+	} else {
+		skb_free_head(skb);
 	}
 	off = (data + nhead) - skb->head;
 

^ permalink raw reply related

* [PATCH 3/3] skb: Add inline helper for getting the skb end offset from head
From: Alexander Duyck @ 2012-05-05  0:26 UTC (permalink / raw)
  To: netdev; +Cc: davem, eric.dumazet, jeffrey.t.kirsher
In-Reply-To: <20120505001059.21292.31647.stgit@gitlad.jf.intel.com>

With the recent changes for how we compute the skb truesize it occurs to me
we are probably going to have a lot of calls to skb_end_pointer -
skb->head.  Instead of running all over the place doing that it would make
more sense to just make it a separate inline skb_end_offset(skb) that way
we can return the correct value without having gcc having to do all the
optimization to cancel out skb->head - skb->head.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
---

 drivers/atm/ambassador.c             |    2 +-
 drivers/atm/idt77252.c               |    2 +-
 drivers/net/wimax/i2400m/usb-rx.c    |    2 +-
 drivers/staging/octeon/ethernet-tx.c |    2 +-
 include/linux/skbuff.h               |   12 +++++++++++-
 net/core/skbuff.c                    |   12 ++++++------
 6 files changed, 21 insertions(+), 11 deletions(-)

diff --git a/drivers/atm/ambassador.c b/drivers/atm/ambassador.c
index f8f41e0..89b30f3 100644
--- a/drivers/atm/ambassador.c
+++ b/drivers/atm/ambassador.c
@@ -802,7 +802,7 @@ static void fill_rx_pool (amb_dev * dev, unsigned char pool,
     }
     // cast needed as there is no %? for pointer differences
     PRINTD (DBG_SKB, "allocated skb at %p, head %p, area %li",
-	    skb, skb->head, (long) (skb_end_pointer(skb) - skb->head));
+	    skb, skb->head, (long) skb_end_offset(skb));
     rx.handle = virt_to_bus (skb);
     rx.host_address = cpu_to_be32 (virt_to_bus (skb->data));
     if (rx_give (dev, &rx, pool))
diff --git a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c
index 1c05212..8974bd2 100644
--- a/drivers/atm/idt77252.c
+++ b/drivers/atm/idt77252.c
@@ -1258,7 +1258,7 @@ idt77252_rx_raw(struct idt77252_dev *card)
 	tail = readl(SAR_REG_RAWCT);
 
 	pci_dma_sync_single_for_cpu(card->pcidev, IDT77252_PRV_PADDR(queue),
-				    skb_end_pointer(queue) - queue->head - 16,
+				    skb_end_offset(queue) - 16,
 				    PCI_DMA_FROMDEVICE);
 
 	while (head != tail) {
diff --git a/drivers/net/wimax/i2400m/usb-rx.c b/drivers/net/wimax/i2400m/usb-rx.c
index e325768..b78ee67 100644
--- a/drivers/net/wimax/i2400m/usb-rx.c
+++ b/drivers/net/wimax/i2400m/usb-rx.c
@@ -277,7 +277,7 @@ retry:
 		d_printf(1, dev, "RX: size changed to %d, received %d, "
 			 "copied %d, capacity %ld\n",
 			 rx_size, read_size, rx_skb->len,
-			 (long) (skb_end_pointer(new_skb) - new_skb->head));
+			 (long) skb_end_offset(new_skb));
 		goto retry;
 	}
 		/* In most cases, it happens due to the hardware scheduling a
diff --git a/drivers/staging/octeon/ethernet-tx.c b/drivers/staging/octeon/ethernet-tx.c
index 56d74dc..418ed03 100644
--- a/drivers/staging/octeon/ethernet-tx.c
+++ b/drivers/staging/octeon/ethernet-tx.c
@@ -344,7 +344,7 @@ int cvm_oct_xmit(struct sk_buff *skb, struct net_device *dev)
 	}
 	if (unlikely
 	    (skb->truesize !=
-	     sizeof(*skb) + skb_end_pointer(skb) - skb->head)) {
+	     sizeof(*skb) + skb_end_offset(skb))) {
 		/*
 		   printk("TX buffer truesize has been changed\n");
 		 */
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 37f5391..91ad5e2 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -645,11 +645,21 @@ static inline unsigned char *skb_end_pointer(const struct sk_buff *skb)
 {
 	return skb->head + skb->end;
 }
+
+static inline unsigned int skb_end_offset(const struct sk_buff *skb)
+{
+	return skb->end;
+}
 #else
 static inline unsigned char *skb_end_pointer(const struct sk_buff *skb)
 {
 	return skb->end;
 }
+
+static inline unsigned int skb_end_offset(const struct sk_buff *skb)
+{
+	return skb->end - skb->head;
+}
 #endif
 
 /* Internal */
@@ -2558,7 +2568,7 @@ static inline bool skb_is_recycleable(const struct sk_buff *skb, int skb_size)
 		return false;
 
 	skb_size = SKB_DATA_ALIGN(skb_size + NET_SKB_PAD);
-	if (skb_end_pointer(skb) - skb->head < skb_size)
+	if (skb_end_offset(skb) < skb_size)
 		return false;
 
 	if (skb_shared(skb) || skb_cloned(skb))
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 17e4b1e..2c35da8 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -829,7 +829,7 @@ static void copy_skb_header(struct sk_buff *new, const struct sk_buff *old)
 struct sk_buff *skb_copy(const struct sk_buff *skb, gfp_t gfp_mask)
 {
 	int headerlen = skb_headroom(skb);
-	unsigned int size = (skb_end_pointer(skb) - skb->head) + skb->data_len;
+	unsigned int size = skb_end_offset(skb) + skb->data_len;
 	struct sk_buff *n = alloc_skb(size, gfp_mask);
 
 	if (!n)
@@ -930,7 +930,7 @@ int pskb_expand_head(struct sk_buff *skb, int nhead, int ntail,
 {
 	int i;
 	u8 *data;
-	int size = nhead + (skb_end_pointer(skb) - skb->head) + ntail;
+	int size = nhead + skb_end_offset(skb) + ntail;
 	long off;
 
 	BUG_ON(nhead < 0);
@@ -2727,14 +2727,13 @@ struct sk_buff *skb_segment(struct sk_buff *skb, netdev_features_t features)
 			if (unlikely(!nskb))
 				goto err;
 
-			hsize = skb_end_pointer(nskb) - nskb->head;
+			hsize = skb_end_offset(nskb);
 			if (skb_cow_head(nskb, doffset + headroom)) {
 				kfree_skb(nskb);
 				goto err;
 			}
 
-			nskb->truesize += skb_end_pointer(nskb) - nskb->head -
-					  hsize;
+			nskb->truesize += skb_end_offset(nskb) - hsize;
 			skb_release_head_state(nskb);
 			__skb_push(nskb, doffset);
 		} else {
@@ -2883,7 +2882,8 @@ int skb_gro_receive(struct sk_buff **head, struct sk_buff *skb)
 		skb_frag_size_sub(frag, offset);
 
 		/* all fragments truesize : remove (head size + sk_buff) */
-		delta_truesize = skb->truesize - SKB_TRUESIZE(skb_end_pointer(skb) - skb->head);
+		delta_truesize = skb->truesize -
+				 SKB_TRUESIZE(skb_end_offset(skb));
 
 		skb->truesize -= skb->data_len;
 		skb->len -= skb->data_len;

^ permalink raw reply related

* Re: [net-next PATCH v4 0/8] Managing the forwarding database(FDB)
From: John Fastabend @ 2012-05-05  5:00 UTC (permalink / raw)
  To: Roopa Prabhu
  Cc: Sridhar Samudrala, Michael S. Tsirkin, shemminger, bhutchings,
	hadi, jeffrey.t.kirsher, netdev, gregory.v.rose, krkumar2
In-Reply-To: <CAGe6so8q26X=HoQx+P-wkoLMtq1NhRerk98-v0cxhUpvMH4zmQ@mail.gmail.com>

On 5/4/2012 1:34 PM, Roopa Prabhu wrote:
> 
> 
> On Thu, May 3, 2012 at 10:43 PM, Sridhar Samudrala <sri@us.ibm.com <mailto:sri@us.ibm.com>> wrote:
> 
>     On 5/3/2012 12:38 PM, John Fastabend wrote:
> 
>         On 5/2/2012 4:36 PM, Sridhar Samudrala wrote:
> 
>             On 5/2/2012 2:52 PM, John Fastabend wrote:
> 
>                 On 5/2/2012 8:08 AM, Michael S. Tsirkin wrote:
> 
>                     On Sun, Apr 15, 2012 at 01:06:37PM -0400, David Miller wrote:
> 
>                         From: John Fastabend<john.r.fastabend@__intel.com <mailto:john.r.fastabend@intel.com>>
>                         Date: Sun, 15 Apr 2012 09:43:51 -0700
> 
>                             The following series is a submission for net-next to allow
>                             embedded switches and other stacked devices other then the
>                             Linux bridge to manage a forwarding database.
> 
>                             Previously discussed here,
> 
>                             http://lists.openwall.net/__netdev/2012/03/19/26 <http://lists.openwall.net/netdev/2012/03/19/26>
> 
>                             v4: propagate return codes correctly for ndo_dflt_Fdb_dump()
> 
>                             v3: resolve the macvlan patch 8/8 to fix a dev_set_promiscuity()
>                                  error and add the flags field to change and get link routines.
> 
>                             v2: addressed feedback from Ben Hutchings resolving a typo in the
>                                  multicast add/del routines and improving the error handling
>                                  when both NTF_SELF and NTF_MASTER are set.
> 
>                             I've tested this with 'br' tool published by Stephen Hemminger
>                             soon to be renamed 'bridge' I believe and various traffic
>                             generators mostly pktgen, ping, and netperf.
> 
>                         All applied, if we need any more tweaks we can just add them
>                         on top of this work.
> 
>                         Thanks John.
> 
>                     John, do you plan to update kvm userspace to use this interface?
> 
>                 No immediate plans. I would really appreciate it if you or one
>                 of the IBM developers working in this space took it on. Of course
>                 if no one steps up I guess I can eventually get at it but it will
>                 be sometime. For now I've been doing this manually with the bridge
>                 tool yet to be published.
> 
> 
>             Does this mean that when we add an interface to a bridge, it need not be put in promiscuous mode and
>             add/delete fdb entries dynamically?
> 
>         The net/bridge will automatically put the interface in promisc mode
>         when the device is attached. We do need to add/delete fdb entries
>         though to allow forwarding packets from the virtual function and
>         any emulated devices e.g. tap devices on the bridge.
> 
> 
>     Consider the following scenario where we have a SR-IOV NIC with 1 PF
>     and 2 VFs (VF1 & VF2).
>     - eth0 is the PF which is attached to bridge br0 and connected to 2 VMs VM1 and VM2.
>     - eth1 is the VF1 terminated on the host and assigned to VM3 via macvtap0 in passthru mode.
>     - VF2 is directly assigned to VM4 via pci-device assignment.
> 
>      VM1      VM2         VM3           VM4
>     (mac1)  (mac2)     (mac3)         (mac4)
>      |        |           |             |
>      |        |           |             |
>     vnet0   vnet1         |             |
>      |        |           |             |
>      \        /           |             |
>      \      /            |             |
>        br0            macvtap0         |
>         |              (mac3)          |
>         |                |             |
>        eth0            eth1            |
>         |              (mac3)          |
>         |               |              |
>       ------------------------------__------
>      | PF              VF1           VF2  |
>      |                                    |
>      |                 VEB                |
>      ------------------------------__------
> 
>     In this setup, i think when VM1 and VM2 come up, mac1 and mac2 have to be added to the
>     embedded bridge's fdb.  Once we add these 2 entries, all the 4 VMs can talk to each other.
>     Is this correct?
> 

Correct as Roopa indicated.

>     Now, if VM1 or VM2 wants to add secondary mac addresses, i think we need qemu to add a new fdb
>     entry when it receives add mac address command via virtio control vq.
> 
> 
> yes. I had used (with some tweaks) some existing qemu patches on patchwork to try this out with my implementation.
> 
> The links to the patches on patchwork are listed in my cover mail at http://marc.info/?l=linux-netdev&m=131534911001054&w=2 <http://marc.info/?l=linux-netdev&m=131534911001054&w=2>
> 
>  
> 
>     Can we add multiple mac addresses to VFs? For example VM3 and VM4 trying to add a secondary mac address.

Yes this is why we also added the fdb interface to the macvlan device as well.

> 
>     What about VMs trying to create VLANs? I think this will work on VM1 and VM2. However with VM3
>     and VM4, i think we need qemu to add vlans to the VFs when the VMs create them.
> 
> 
> yes for vlans too, the qemu patches pointed out above can be reused.
> 
> Thanks,
> Roopa
>  
> 

^ permalink raw reply

* Re: [PATCH 1/3] skb: Drop bad code from pskb_expand_head
From: Eric Dumazet @ 2012-05-05  5:35 UTC (permalink / raw)
  To: Alexander Duyck; +Cc: netdev, davem, jeffrey.t.kirsher
In-Reply-To: <20120505002645.21292.38368.stgit@gitlad.jf.intel.com>

On Fri, 2012-05-04 at 17:26 -0700, Alexander Duyck wrote:
> The fast-path for pskb_expand_head contains a check where the size plus the
> unaligned size of skb_shared_info is compared against the size of the data
> buffer.  This code path has two issues.  First is the fact that after the
> recent changes by Eric Dumazet to __alloc_skb and build_skb the shared info
> is always placed in the optimal spot for a buffer size making this check
> unnecessary.  The second issue is the fact that the check doesn't take into
> account the aligned size of shared info.  As a result the code burns cycles
> doing a memcpy with nothing actually being shifted.
> 
> Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
> ---
> 
>  net/core/skbuff.c |   12 ------------
>  1 files changed, 0 insertions(+), 12 deletions(-)
> 
> diff --git a/net/core/skbuff.c b/net/core/skbuff.c
> index c199aa4..4d085d4 100644
> --- a/net/core/skbuff.c
> +++ b/net/core/skbuff.c
> @@ -951,17 +951,6 @@ int pskb_expand_head(struct sk_buff *skb, int nhead, int ntail,
>  		fastpath = atomic_read(&skb_shinfo(skb)->dataref) == delta;
>  	}
>  
> -	if (fastpath && !skb->head_frag &&
> -	    size + sizeof(struct skb_shared_info) <= ksize(skb->head)) {
> -		memmove(skb->head + size, skb_shinfo(skb),
> -			offsetof(struct skb_shared_info,
> -				 frags[skb_shinfo(skb)->nr_frags]));
> -		memmove(skb->head + nhead, skb->head,
> -			skb_tail_pointer(skb) - skb->head);
> -		off = nhead;
> -		goto adjust_others;
> -	}
> -
>  	data = kmalloc(size + SKB_DATA_ALIGN(sizeof(struct skb_shared_info)),
>  		       gfp_mask);
>  	if (!data)
> @@ -997,7 +986,6 @@ int pskb_expand_head(struct sk_buff *skb, int nhead, int ntail,
>  
>  	skb->head     = data;
>  	skb->head_frag = 0;
> -adjust_others:
>  	skb->data    += off;
>  #ifdef NET_SKBUFF_DATA_USES_OFFSET
>  	skb->end      = size;
> 

I totally agree this code is no longer needed, we already have the
skb_shared_info at the end of the buffer.

Acked-by: Eric Dumazet <edumazet@google.com>

^ permalink raw reply

* Re: [PATCH 2/3] skb: Drop "fastpath" variable for skb_cloned check in pskb_expand_head
From: Eric Dumazet @ 2012-05-05  5:37 UTC (permalink / raw)
  To: Alexander Duyck; +Cc: netdev, davem, jeffrey.t.kirsher
In-Reply-To: <20120505002651.21292.19680.stgit@gitlad.jf.intel.com>

On Fri, 2012-05-04 at 17:26 -0700, Alexander Duyck wrote:
> Since there is now only one spot that actually uses "fastpath" there isn't
> much point in carrying it.  Instead we can just use a check for skb_cloned
> to verify if we can perform the fast-path free for the head or not.
> 
> Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
> ---
> 
>  net/core/skbuff.c |   22 ++++++++--------------
>  1 files changed, 8 insertions(+), 14 deletions(-)
> 
> diff --git a/net/core/skbuff.c b/net/core/skbuff.c
> index 4d085d4..17e4b1e 100644
> --- a/net/core/skbuff.c
> +++ b/net/core/skbuff.c
> @@ -932,7 +932,6 @@ int pskb_expand_head(struct sk_buff *skb, int nhead, int ntail,
>  	u8 *data;
>  	int size = nhead + (skb_end_pointer(skb) - skb->head) + ntail;
>  	long off;
> -	bool fastpath;
>  
>  	BUG_ON(nhead < 0);
>  
> @@ -941,16 +940,6 @@ int pskb_expand_head(struct sk_buff *skb, int nhead, int ntail,
>  
>  	size = SKB_DATA_ALIGN(size);
>  
> -	/* Check if we can avoid taking references on fragments if we own
> -	 * the last reference on skb->head. (see skb_release_data())
> -	 */
> -	if (!skb->cloned)
> -		fastpath = true;
> -	else {
> -		int delta = skb->nohdr ? (1 << SKB_DATAREF_SHIFT) + 1 : 1;
> -		fastpath = atomic_read(&skb_shinfo(skb)->dataref) == delta;
> -	}
> -
>  	data = kmalloc(size + SKB_DATA_ALIGN(sizeof(struct skb_shared_info)),
>  		       gfp_mask);
>  	if (!data)
> @@ -966,9 +955,12 @@ int pskb_expand_head(struct sk_buff *skb, int nhead, int ntail,
>  	       skb_shinfo(skb),
>  	       offsetof(struct skb_shared_info, frags[skb_shinfo(skb)->nr_frags]));
>  
> -	if (fastpath) {
> -		skb_free_head(skb);
> -	} else {
> +	/*
> +	 * if shinfo is shared we must drop the old head gracefully, but if it
> +	 * is not we can just drop the old head and let the existing refcount
> +	 * be since all we did is relocate the values
> +	 */
> +	if (skb_cloned(skb)) {
>  		/* copy this zero copy skb frags */
>  		if (skb_shinfo(skb)->tx_flags & SKBTX_DEV_ZEROCOPY) {
>  			if (skb_copy_ubufs(skb, gfp_mask))
> @@ -981,6 +973,8 @@ int pskb_expand_head(struct sk_buff *skb, int nhead, int ntail,
>  			skb_clone_fraglist(skb);
>  
>  		skb_release_data(skb);
> +	} else {
> +		skb_free_head(skb);
>  	}
>  	off = (data + nhead) - skb->head;
>  
> 

Excellent

Acked-by: Eric Dumazet <edumazet@google.com>

^ permalink raw reply

* Re: [PATCH 3/3] skb: Add inline helper for getting the skb end offset from head
From: Eric Dumazet @ 2012-05-05  5:39 UTC (permalink / raw)
  To: Alexander Duyck; +Cc: netdev, davem, jeffrey.t.kirsher
In-Reply-To: <20120505002656.21292.89799.stgit@gitlad.jf.intel.com>

On Fri, 2012-05-04 at 17:26 -0700, Alexander Duyck wrote:
> With the recent changes for how we compute the skb truesize it occurs to me
> we are probably going to have a lot of calls to skb_end_pointer -
> skb->head.  Instead of running all over the place doing that it would make
> more sense to just make it a separate inline skb_end_offset(skb) that way
> we can return the correct value without having gcc having to do all the
> optimization to cancel out skb->head - skb->head.
> 
> Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
> ---
> 
>  drivers/atm/ambassador.c             |    2 +-
>  drivers/atm/idt77252.c               |    2 +-
>  drivers/net/wimax/i2400m/usb-rx.c    |    2 +-
>  drivers/staging/octeon/ethernet-tx.c |    2 +-
>  include/linux/skbuff.h               |   12 +++++++++++-
>  net/core/skbuff.c                    |   12 ++++++------
>  6 files changed, 21 insertions(+), 11 deletions(-)

Acked-by: Eric Dumazet <edumazet@google.com>

^ permalink raw reply

* Re: [PATCH 0/3] First pass of cleanups for pskb_expand_head
From: Eric Dumazet @ 2012-05-05  5:44 UTC (permalink / raw)
  To: Alexander Duyck; +Cc: netdev, davem, jeffrey.t.kirsher
In-Reply-To: <20120505001059.21292.31647.stgit@gitlad.jf.intel.com>

On Fri, 2012-05-04 at 17:26 -0700, Alexander Duyck wrote:
> pull the actual value.
> 
> There are a few more items that I will try to get to next week.  The big one
> is the fact that pskb_expand_head can mess up the truesize since it can
> allocate a new head but never updates the truesize.  I plan on adding a helper
> function for the cases where we are just using it unshare the head so I can
> identify the places where we are actually modifying the size.

In the old days, truesize adjustements were done after
pskb_expand_head() calls. (Mabye because some contexts didnt care of
truesize for ephemeral skbs, not charged to a socket)

So it will be a nice cleanup for sure.

^ permalink raw reply

* Re: [PATCH 0/3] First pass of cleanups for pskb_expand_head
From: Alexander Duyck @ 2012-05-05  6:51 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: Alexander Duyck, netdev, davem, jeffrey.t.kirsher
In-Reply-To: <1336196671.3752.490.camel@edumazet-glaptop>

On 5/4/2012 10:44 PM, Eric Dumazet wrote:
> On Fri, 2012-05-04 at 17:26 -0700, Alexander Duyck wrote:
>> pull the actual value.
>>
>> There are a few more items that I will try to get to next week.  The big one
>> is the fact that pskb_expand_head can mess up the truesize since it can
>> allocate a new head but never updates the truesize.  I plan on adding a helper
>> function for the cases where we are just using it unshare the head so I can
>> identify the places where we are actually modifying the size.
> In the old days, truesize adjustements were done after
> pskb_expand_head() calls. (Mabye because some contexts didnt care of
> truesize for ephemeral skbs, not charged to a socket)
>
> So it will be a nice cleanup for sure.

I suspect the reason for no truesize adjustment is because this function 
gets called in the transmit path, and we probably should be adjusting 
truesize while there is still a desctructor in place that will turn 
around and subtract the truesize from the socket memory.  I'm still 
thinking about what would be the best solution to that, but in the 
meantime I figure I can at least add a helper function to handle all the 
pskb_expand_head(skb, 0, 0, GFP_ATOMIC) cases and just replace them with 
something like skb_unshare_head(skb).  That way I will have a better 
idea of the few cases where we might actually impact truesize.

^ permalink raw reply

* Re: [net-next 2/8] e1000e: initial support for i217
From: Bjørn Mork @ 2012-05-05  8:01 UTC (permalink / raw)
  To: Jeff Kirsher; +Cc: davem, Bruce Allan, netdev, gospo, sassmann
In-Reply-To: <1336127716-20383-3-git-send-email-jeffrey.t.kirsher@intel.com>

Jeff Kirsher <jeffrey.t.kirsher@intel.com> writes:

> diff --git a/drivers/net/ethernet/intel/e1000e/defines.h b/drivers/net/ethernet/intel/e1000e/defines.h
> index 3a50259..11c4666 100644
> --- a/drivers/net/ethernet/intel/e1000e/defines.h
> +++ b/drivers/net/ethernet/intel/e1000e/defines.h
> @@ -74,7 +74,9 @@
>  #define E1000_WUS_BC           E1000_WUFC_BC
>  
>  /* Extended Device Control */
> +#define E1000_CTRL_EXT_LPCD  0x00000004     /* LCD Power Cycle Done */
>  #define E1000_CTRL_EXT_SDP3_DATA 0x00000080 /* Value of SW Definable Pin 3 */
> +#define E1000_CTRL_EXT_FORCE_SMBUS 0x00000004 /* Force SMBus mode*/
>  #define E1000_CTRL_EXT_EE_RST    0x00002000 /* Reinitialize from EEPROM */
>  #define E1000_CTRL_EXT_SPD_BYPS  0x00008000 /* Speed Select Bypass */
>  #define E1000_CTRL_EXT_RO_DIS    0x00020000 /* Relaxed Ordering disable */

The mangled sorting and alignment of the new entries made me wonder if
this was a typo.  But reading further below it looks like
E1000_CTRL_EXT_LPCD is input and E1000_CTRL_EXT_FORCE_SMBUS is output.
If that is correct, then it probably deserves a small comment here along
with better sorting and alignment to make it clear that the duplicate
value is intentional?


Bjørn

^ permalink raw reply

* Re: [PATCH 01/13 v4] usb/net: rndis: inline the cpu_to_le32() macro
From: Linus Walleij @ 2012-05-05  9:01 UTC (permalink / raw)
  To: Jussi Kivilinna
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA, linux-usb-u79uwXL29TY76Z2rM5mHXA,
	Greg Kroah-Hartman, David S. Miller, Felipe Balbi, Haiyang Zhang,
	Wei Yongjun, Ben Hutchings
In-Reply-To: <20120502182938.15804ij32yd8jsis-tzMWlZeEOor1KXRcyAk9cg@public.gmane.org>

On Wed, May 2, 2012 at 5:29 PM, Jussi Kivilinna
<jussi.kivilinna-E01nCVcF24I@public.gmane.org> wrote:

> Quoting Linus Walleij <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>:
>
>> The header file <linux/usb/rndis_host.h> used a number of #defines
>> that included the cpu_to_le32() macro to assure the result will be
>> in LE endianness. Inlining this into the code instead of using it
>> in the code definitions yields consolidation opportunities later
>> on as you will see in the following patches. The individual
>> drivers also used local defines - all are switched over to the
>> pattern of doing the conversion at the call sites instead.
>>
>
> After this patch, endianness checks with sparse output:
(...)
> Patch fixing this attached.

Thanks! Folded this into patch 1 and added your Signed-off-by.

> Patch-set to clean-up ugliness caused by this patch at:
> http://koti.mbnet.fi/axh/kernel/rndis_wlan/

This seems like a good middle-ground as compared to the
other suggestion to force all defines to be cpu_to_le32().

Do you want me to rebase this on top of my series (there was
a number of conflicts later in the series) and carry it as part
of this patch set?

Yours,
Linus Walleij
--
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

* Re: [PATCH 00/13 v4] usb/net: rndis: first step toward consolidation
From: Linus Walleij @ 2012-05-05  9:02 UTC (permalink / raw)
  To: David Miller
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA, linux-usb-u79uwXL29TY76Z2rM5mHXA,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r, balbi-l0cyMroinI0,
	jussi.kivilinna-E01nCVcF24I, haiyangz-0li6OtcxBFHby3iVrkZq2A,
	yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY,
	ben-/+tVBieCtBitmTQ+vhA3Yw
In-Reply-To: <20120502.202020.1507739621351234969.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>

On Thu, May 3, 2012 at 2:20 AM, David Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org> wrote:

> From: "Linus Walleij" <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> Date: Tue,  1 May 2012 20:22:09 +0200
>
>> The REAL v4 patch set... forget v3 :-(
>
> You'll definitely need to submit at least a v5, especially
> after all of the endian bugs that have been spotted.

Yep Jussi is helping me to hash this out...

Thanks,
Linus Walleij
--
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

* Re: IP_MULTICAST_IF getsockopt man part
From: Michael Kerrisk (man-pages) @ 2012-05-05 11:57 UTC (permalink / raw)
  To: Jiri Pirko; +Cc: linux-man, netdev
In-Reply-To: <20120504090013.GA2362@minipsycho>

On Fri, May 4, 2012 at 9:00 PM, Jiri Pirko <jpirko@redhat.com> wrote:
> Hi.
>
> <quote>
> IP_MULTICAST_IF (since Linux 1.2)
>                      Set the local device for a multicast socket.
>                      Argument is an ip_mreqn or ip_mreq structure
>                      similar to IP_ADD_MEMBERSHIP.
> </quote>
>
> That is not true. Setsockopt recognizes only ip_mreqn and in_addr. I
> made patch which makes it recognize ip_mreq as well. So that would be
> probably ok.
> http://patchwork.ozlabs.org/patch/156815/
>
> On the other hand, getsockopt works only with in_addr. That I think is
> good behaviour but manpages here needs to be corrected in this way (read
> part needs to be added here)

Jirka,

I'm having trouble to understand what you mean. Perhaps it would be
simplest if you showed your proposed replacement text for the text
quoted above.

Thanks,

Michael



-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Author of "The Linux Programming Interface"; http://man7.org/tlpi/

^ permalink raw reply

* [net-next 0/4][pull request] Intel Wired LAN Driver Updates
From: Jeff Kirsher @ 2012-05-05 12:38 UTC (permalink / raw)
  To: davem; +Cc: Jeff Kirsher, netdev, gospo, sassmann

This series of patches contains updates for e1000e and ixgbe.

NOTE- The ixgbe patch can and probably should be applied to
David Miller's net tree as well.

The following are changes since commit bd14b1b2e29bd6812597f896dde06eaf7c6d2f24:
  tcp: be more strict before accepting ECN negociation
and are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next master

Bruce Allan (2):
  e1000e: enable forced master/slave on 82577
  e1000e: increase version number

John Fastabend (1):
  ixgbe: dcb: IEEE PFC stats and reset logic incorrect

Richard Alpe (1):
  e1000e: clear REQ and GNT in EECD (82571 && 82572)

 drivers/net/ethernet/intel/e1000e/82571.c       |   12 ++++-
 drivers/net/ethernet/intel/e1000e/netdev.c      |    2 +-
 drivers/net/ethernet/intel/e1000e/phy.c         |   71 ++++++++++++++--------
 drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c |    7 ++
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c   |    6 ++-
 5 files changed, 69 insertions(+), 29 deletions(-)

-- 
1.7.7.6

^ permalink raw reply

* [net-next 1/4] e1000e: enable forced master/slave on 82577
From: Jeff Kirsher @ 2012-05-05 12:38 UTC (permalink / raw)
  To: davem; +Cc: Bruce Allan, netdev, gospo, sassmann, Jeff Kirsher
In-Reply-To: <1336221493-913-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Bruce Allan <bruce.w.allan@intel.com>

Like other supported (igp) PHYs, the driver needs to be able to force the
master/slave mode on 82577.  Since the code is the same as what already
exists in the code flow for igp PHYs, move it to a new function to be
called for both flows.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/e1000e/phy.c |   71 +++++++++++++++++++-----------
 1 files changed, 45 insertions(+), 26 deletions(-)

diff --git a/drivers/net/ethernet/intel/e1000e/phy.c b/drivers/net/ethernet/intel/e1000e/phy.c
index ada7133..0334d01 100644
--- a/drivers/net/ethernet/intel/e1000e/phy.c
+++ b/drivers/net/ethernet/intel/e1000e/phy.c
@@ -639,6 +639,45 @@ s32 e1000e_write_kmrn_reg_locked(struct e1000_hw *hw, u32 offset, u16 data)
 }
 
 /**
+ *  e1000_set_master_slave_mode - Setup PHY for Master/slave mode
+ *  @hw: pointer to the HW structure
+ *
+ *  Sets up Master/slave mode
+ **/
+static s32 e1000_set_master_slave_mode(struct e1000_hw *hw)
+{
+	s32 ret_val;
+	u16 phy_data;
+
+	/* Resolve Master/Slave mode */
+	ret_val = e1e_rphy(hw, PHY_1000T_CTRL, &phy_data);
+	if (ret_val)
+		return ret_val;
+
+	/* load defaults for future use */
+	hw->phy.original_ms_type = (phy_data & CR_1000T_MS_ENABLE) ?
+	    ((phy_data & CR_1000T_MS_VALUE) ?
+	     e1000_ms_force_master : e1000_ms_force_slave) : e1000_ms_auto;
+
+	switch (hw->phy.ms_type) {
+	case e1000_ms_force_master:
+		phy_data |= (CR_1000T_MS_ENABLE | CR_1000T_MS_VALUE);
+		break;
+	case e1000_ms_force_slave:
+		phy_data |= CR_1000T_MS_ENABLE;
+		phy_data &= ~(CR_1000T_MS_VALUE);
+		break;
+	case e1000_ms_auto:
+		phy_data &= ~CR_1000T_MS_ENABLE;
+		/* fall-through */
+	default:
+		break;
+	}
+
+	return e1e_wphy(hw, PHY_1000T_CTRL, phy_data);
+}
+
+/**
  *  e1000_copper_link_setup_82577 - Setup 82577 PHY for copper link
  *  @hw: pointer to the HW structure
  *
@@ -659,7 +698,11 @@ s32 e1000_copper_link_setup_82577(struct e1000_hw *hw)
 	/* Enable downshift */
 	phy_data |= I82577_CFG_ENABLE_DOWNSHIFT;
 
-	return e1e_wphy(hw, I82577_CFG_REG, phy_data);
+	ret_val = e1e_wphy(hw, I82577_CFG_REG, phy_data);
+	if (ret_val)
+		return ret_val;
+
+	return e1000_set_master_slave_mode(hw);
 }
 
 /**
@@ -895,31 +938,7 @@ s32 e1000e_copper_link_setup_igp(struct e1000_hw *hw)
 				return ret_val;
 		}
 
-		ret_val = e1e_rphy(hw, PHY_1000T_CTRL, &data);
-		if (ret_val)
-			return ret_val;
-
-		/* load defaults for future use */
-		phy->original_ms_type = (data & CR_1000T_MS_ENABLE) ?
-			((data & CR_1000T_MS_VALUE) ?
-			e1000_ms_force_master :
-			e1000_ms_force_slave) :
-			e1000_ms_auto;
-
-		switch (phy->ms_type) {
-		case e1000_ms_force_master:
-			data |= (CR_1000T_MS_ENABLE | CR_1000T_MS_VALUE);
-			break;
-		case e1000_ms_force_slave:
-			data |= CR_1000T_MS_ENABLE;
-			data &= ~(CR_1000T_MS_VALUE);
-			break;
-		case e1000_ms_auto:
-			data &= ~CR_1000T_MS_ENABLE;
-		default:
-			break;
-		}
-		ret_val = e1e_wphy(hw, PHY_1000T_CTRL, data);
+		ret_val = e1000_set_master_slave_mode(hw);
 	}
 
 	return ret_val;
-- 
1.7.7.6

^ permalink raw reply related

* [net-next 3/4] e1000e: increase version number
From: Jeff Kirsher @ 2012-05-05 12:38 UTC (permalink / raw)
  To: davem; +Cc: Bruce Allan, netdev, gospo, sassmann, Jeff Kirsher
In-Reply-To: <1336221493-913-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Bruce Allan <bruce.w.allan@intel.com>

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/e1000e/netdev.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index b53ea83..f648299 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -56,7 +56,7 @@
 
 #define DRV_EXTRAVERSION "-k"
 
-#define DRV_VERSION "1.11.3" DRV_EXTRAVERSION
+#define DRV_VERSION "2.0.0" DRV_EXTRAVERSION
 char e1000e_driver_name[] = "e1000e";
 const char e1000e_driver_version[] = DRV_VERSION;
 
-- 
1.7.7.6

^ permalink raw reply related

* [net-next 2/4] e1000e: clear REQ and GNT in EECD (82571 && 82572)
From: Jeff Kirsher @ 2012-05-05 12:38 UTC (permalink / raw)
  To: davem; +Cc: Richard Alpe, netdev, gospo, sassmann, Jeff Kirsher
In-Reply-To: <1336221493-913-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Richard Alpe <richard.alpe@ericsson.com>

Clear the REQ and GNT bit in the eeprom control register (EECD).
This is required if the eeprom is to be accessed with auto read
EERD register.

After a cold reset this doesn't matter but if PBIST MAC test was
executed before booting, the register was left in a dirty state
(the 2 bits where set), which caused the read operation to time out
and returning 0.

Reference (page 312):
http://download.intel.com/design/network/manuals/316080.pdf

Reported-by: Aleksandar Igic <aleksandar.igic@dektech.com.au>
Signed-off-by: Richard Alpe <richard.alpe@ericsson.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/e1000e/82571.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/intel/e1000e/82571.c b/drivers/net/ethernet/intel/e1000e/82571.c
index 6a8a908..36db4df 100644
--- a/drivers/net/ethernet/intel/e1000e/82571.c
+++ b/drivers/net/ethernet/intel/e1000e/82571.c
@@ -999,7 +999,7 @@ static s32 e1000_set_d0_lplu_state_82571(struct e1000_hw *hw, bool active)
  **/
 static s32 e1000_reset_hw_82571(struct e1000_hw *hw)
 {
-	u32 ctrl, ctrl_ext;
+	u32 ctrl, ctrl_ext, eecd;
 	s32 ret_val;
 
 	/*
@@ -1072,6 +1072,16 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw)
 	 */
 
 	switch (hw->mac.type) {
+	case e1000_82571:
+	case e1000_82572:
+		/*
+		 * REQ and GNT bits need to be cleared when using AUTO_RD
+		 * to access the EEPROM.
+		 */
+		eecd = er32(EECD);
+		eecd &= ~(E1000_EECD_REQ | E1000_EECD_GNT);
+		ew32(EECD, eecd);
+		break;
 	case e1000_82573:
 	case e1000_82574:
 	case e1000_82583:
-- 
1.7.7.6

^ permalink raw reply related

* [net-next 4/4] ixgbe: dcb: IEEE PFC stats and reset logic incorrect
From: Jeff Kirsher @ 2012-05-05 12:38 UTC (permalink / raw)
  To: davem; +Cc: John Fastabend, netdev, gospo, sassmann, Jeff Kirsher
In-Reply-To: <1336221493-913-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: John Fastabend <john.r.fastabend@intel.com>

PFC stats are only tabulated when PFC is enabled. However in IEEE
mode the ieee_pfc pfc_tc bits were not checked and the calculation
was aborted.

This results in statistics not being reported through ethtool and
possible a false Tx hang occurring when receiving pause frames.

Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c |    7 +++++++
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c   |    6 +++++-
 2 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c
index 652e4b0..2feacf6 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c
@@ -662,6 +662,13 @@ static int ixgbe_dcbnl_ieee_setpfc(struct net_device *dev,
 			return -ENOMEM;
 	}
 
+	if (pfc->pfc_en) {
+		adapter->last_lfc_mode = adapter->hw.fc.current_mode;
+		adapter->hw.fc.current_mode = ixgbe_fc_pfc;
+	} else {
+		adapter->hw.fc.current_mode = adapter->last_lfc_mode;
+	}
+
 	prio_tc = adapter->ixgbe_ieee_ets->prio_tc;
 	memcpy(adapter->ixgbe_ieee_pfc, pfc, sizeof(*adapter->ixgbe_ieee_pfc));
 	return ixgbe_dcb_hw_pfc_config(&adapter->hw, pfc->pfc_en, prio_tc);
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index b2daff3..4048c9d 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -637,7 +637,11 @@ static void ixgbe_update_xoff_received(struct ixgbe_adapter *adapter)
 			clear_bit(__IXGBE_HANG_CHECK_ARMED,
 				  &adapter->tx_ring[i]->state);
 		return;
-	} else if (!(adapter->dcb_cfg.pfc_mode_enable))
+	} else if (((adapter->dcbx_cap & DCB_CAP_DCBX_VER_CEE) &&
+		    !(adapter->dcb_cfg.pfc_mode_enable)) ||
+		   ((adapter->dcbx_cap & DCB_CAP_DCBX_VER_IEEE) &&
+		    adapter->ixgbe_ieee_pfc &&
+		    !(adapter->ixgbe_ieee_pfc->pfc_en)))
 		return;
 
 	/* update stats for each tc, only valid with PFC enabled */
-- 
1.7.7.6

^ permalink raw reply related

* ipctl - new tool for efficient read/write of net related sysctl
From: Oskar Berggren @ 2012-05-05 15:13 UTC (permalink / raw)
  To: netdev

Hi,

In a project of mine I need to read (and possibly set) many of the properties
found under /proc/sys/net/ipv4/conf/. This is simple enough, except that
when you have hundreds of interfaces, it is really slow. In my tests it takes
about 4 seconds to read a single variable for 700 interfaces. For a while I
worked around this using the binary sysctl() interface, but this is deprecated.

In an experiment to get around this limitation I have created "ipctl", a kernel
module and accompanying user space library/tool. Communication between
kernel and user space is based on generic netlink. What used to take
seconds now happen in a few milliseconds.

So far I have only implemented support for the proxy_arp setting. Do you
think it's worthwhile to pursue this to create something more complete? Are
there other ideas on how one might get fast read/write of the IP-related
settings in procfs?

The full source code is available at:
https://github.com/oskarb/ipctl

Kernel module enclosed below. Haven't done much kernel programming
before, so comments are most welcome!

/Oskar


#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/inetdevice.h>
#include <linux/netdevice.h>
#include <net/netlink.h>
#include <net/genetlink.h>
#include "../../include/libipctl/ipctl-nl.h"

#define MOD_AUTHOR "Oskar Berggren <oskar.berggren@gmail.com>"
#define MOD_DESC "A module to offer efficient mass control of the IP
sysctl family traditionally controlled through /proc."
#define MOD_VER "0.1"


static int ipctl_get_proxyarp_by_ifindex(int ifIndex, int *on)
{
	struct net *net = &init_net;
	struct net_device *dev;
	struct in_device *in_dev;

	dev = dev_get_by_index(net, ifIndex);

	if (dev)
	{
		if (__in_dev_get_rtnl(dev))
		{
			in_dev = __in_dev_get_rtnl(dev);
			*on = IN_DEV_CONF_GET(in_dev, PROXY_ARP);
		}

		dev_put(dev);  // Release reference.
	}

	return 0;
}


static int ipctl_set_proxyarp_by_ifindex(int ifIndex, int on)
{
	struct net *net = &init_net;
	struct net_device *dev;
	struct in_device *in_dev;

	dev = dev_get_by_index(net, ifIndex);

	if (dev)
	{
		if (__in_dev_get_rtnl(dev))
		{
			in_dev = __in_dev_get_rtnl(dev);
			IN_DEV_CONF_SET(in_dev, PROXY_ARP, on);
		}

		dev_put(dev);  // Release reference.
	}

	return 0;
}


/* family definition */
static struct genl_family ipctl_gnl_family = {
	.id = GENL_ID_GENERATE,
	.hdrsize = 0,
	.name = IPCTL_GENL_NAME,
	.version = IPCTL_GENL_VERSION,
	.maxattr = IPCTL_ATTR_MAX,
};


static int ipctl_reply(struct sk_buff *skb, struct genl_info *info,
		       int property, int ifIndex, int value)
{
	struct sk_buff *skb_reply;
	void *msg_head;
	int rc;

	pr_debug("ipctl: reply start\n");

	skb_reply = genlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL);
	if (skb_reply == NULL)
		goto out;

	msg_head = genlmsg_put(skb_reply, 0, info->snd_seq,
&ipctl_gnl_family, 0, IPCTL_CMD_GET);
	if (msg_head == NULL) {
		rc = -ENOMEM;
		goto out;
	}

	rc = nla_put_u32(skb_reply, IPCTL_ATTR_PROPERTY, property);
	if (rc != 0)
		goto out;

	rc = nla_put_u32(skb_reply, IPCTL_ATTR_IFINDEX, ifIndex);
	if (rc != 0)
		goto out;

	rc = nla_put_u8(skb_reply, IPCTL_ATTR_VALUE, value);
	if (rc != 0)
		goto out;
	
	/* finalize the message */
	genlmsg_end(skb_reply, msg_head);

	rc = genlmsg_reply(skb_reply , info);
	if (rc != 0)
		goto out;

	return 0;
out:
	pr_warning("ipctl: Error occured in reply: %d\n", rc);

	return rc;
}


/* handler for SET messages via NETLINK */
int ipctl_set(struct sk_buff *skb, struct genl_info *info)
{
	/* message handling code goes here; return 0 on success, negative
	 * values on failure */

	int property = nla_get_u32(info->attrs[IPCTL_ATTR_PROPERTY]);
	int ifIndex = nla_get_u32(info->attrs[IPCTL_ATTR_IFINDEX]);
	int value = nla_get_u8(info->attrs[IPCTL_ATTR_VALUE]);

	pr_debug("ipctl: set p=%d i=%d v=%d\n", property, ifIndex, value);

	if (property == IPCTL_PROPERTY_PROXYARP)
		return ipctl_set_proxyarp_by_ifindex(ifIndex, value);

	return 0;
}


/* handler for GET messages via NETLINK */
int ipctl_get(struct sk_buff *skb, struct genl_info *info)
{
	/* message handling code goes here; return 0 on success, negative
	 * values on failure */

	int property = nla_get_u32(info->attrs[IPCTL_ATTR_PROPERTY]);
	int ifIndex = nla_get_u32(info->attrs[IPCTL_ATTR_IFINDEX]);
	int value = 0;
	int retval = 0;

	pr_debug("ipctl: get p=%d i=%d\n", property, ifIndex);

	if (property == IPCTL_PROPERTY_PROXYARP)
		retval = ipctl_get_proxyarp_by_ifindex(ifIndex, &value);

	if (retval)
		return retval;

	return ipctl_reply(skb, info, property, ifIndex, value);
}


/* NETLINK operation definition */
struct genl_ops ipctl_gnl_ops_set = {
	.cmd = IPCTL_CMD_SET,
	.flags = GENL_ADMIN_PERM,
	.policy = ipctl_genl_policy,
	.doit = ipctl_set,
	.dumpit = NULL,
};

struct genl_ops ipctl_gnl_ops_get = {
	.cmd = IPCTL_CMD_GET,
	.flags = 0,
	.policy = ipctl_genl_policy,
	.doit = ipctl_get,
	.dumpit = NULL,
};


static int __init ipctl_init(void)
{
	int rc;

	printk(KERN_INFO "ipctl: %s.\n", MOD_VER);

	rc = genl_register_family(&ipctl_gnl_family);
	if (rc)
		printk("ipctl: genl_register_family: %d.\n", rc);

	rc = genl_register_ops(&ipctl_gnl_family, &ipctl_gnl_ops_set);
	if (rc)
		printk("ipctl: genl_register_ops: %d.\n", rc);

	rc = genl_register_ops(&ipctl_gnl_family, &ipctl_gnl_ops_get);
	if (rc)
		printk("ipctl: genl_register_ops: %d.\n", rc);

	/*
	 * A non 0 return means init_module failed; module can't be loaded.
	 */
	return 0;
}


static void __exit ipctl_exit(void)
{
	genl_unregister_family(&ipctl_gnl_family);
}


module_init(ipctl_init);
module_exit(ipctl_exit);

MODULE_LICENSE("GPL");
MODULE_AUTHOR(MOD_AUTHOR);
MODULE_DESCRIPTION(MOD_DESC);
MODULE_VERSION(MOD_VER);

^ permalink raw reply

* Re: [net-next 5/9] e1000e: Disable ASPM L1 on 82574
From: Nix @ 2012-05-05 16:33 UTC (permalink / raw)
  To: Wyborny, Carolyn, Matthew Garrett
  Cc: Kirsher, Jeffrey T, davem@davemloft.net, Chris Boot,
	netdev@vger.kernel.org, gospo@redhat.com, sassmann@redhat.com
In-Reply-To: <87sjfhaukf.fsf@spindle.srvr.nix>

On 3 May 2012, nix@esperi.org.uk outgrape:

> On 3 May 2012, Carolyn Wyborny told this:
>
>> It would be good to know why/how your system is re-enabling the
>> setting. The problem is not solvable in firmware unfortunately and is
>> somewhat platform dependent. MMIO-tracer might be used to try and see
>
> I entirely forgot about that tool! *Definitely* worth trying.
>
> I'll give it a try this weekend.

Well, mmiotrace was a total flop: massive numbers of unexpected
secondary interrupts and a hard lockup. Still, I've now diagnosed this
bug and it's right up Matthew Garrett's street!

Matthew: the problem here is a server with an 82574L (controlled by the
e1000e driver). This NIC has a hardware bug causing it to lock up in a
way that only a reboot can solve in an hour or two if PCIe ASPM is not
disabled during boot (leaving me with my home directory stuck behind a
dead NIC on a headless machine, most annoying). The driver is attempting
to disable it, but failing.

>> when the re-enabling config space is written, but it might be too
>> heavyweight for a live production system.
>
> Given that the re-enabling happens at around the same time as the boot
> scripts finish running (it's done by the time I can log in), that's not
> going to be a problem. Hence my speculation that it's being re-enabled
> when the interface stabilizes (which is, of course, asynchronous) or
> something like that.

This is wrong. The disable never happens. The BIOS has been told to
enable PCIe ASPM. However, the kernel log says:

May  5 17:06:53 spindle info: [    0.629699]  pci0000:00: Requesting ACPI _OSC control (0x1d)
May  5 17:06:53 spindle info: [    0.629941]  pci0000:00: ACPI _OSC request failed (AE_NOT_FOUND), returned control mask: 0x1d
May  5 17:06:53 spindle info: [    0.630373] ACPI _OSC control for PCIe not granted, disabling ASPM

Unless pcie_aspm=force has been specified on the kernel command line,
this flips aspm_disabled to 1.

The e1000e driver then says (with a bit of extra debugging info I
added):

May  5 17:06:53 spindle info: [    1.248153] e1000e 0000:03:00.0: Disabling ASPM L0s L1
May  5 17:06:53 spindle info: [    1.248393] e1000e 0000:03:00.0: Disabling ASPM via pci_disable_link_state_locked()
May  5 17:06:53 spindle info: [    1.248823] e1000e 0000:03:00.0: aspm disabled, not forcing

i.e. because aspm_disabled is set, pci/pcie/aspm.c refuses to make any
changes at all to ASPM link state, not even to turn *off* ASPM on a
device on which the BIOS turned it on at boot. So ASPM remains enabled
and the NIC eventually locks up.

The question here is how to fix it. It appears that the motherboard or
BIOS on this machine does not grant _OSC control even (especially?) if
you have turned on PCIe ASPM in the BIOS. But perhaps even if _OSC is
not granted you should permit PCIe to be *disabled* by drivers, just not
enabled? (The BIOS appears to be buggy in this area: if you turn off
ASPM, save, and go back into setup, ASPM has turned itself back on
again!)

I'm not sure what the right thing to do is here: I don't know enough
about this area. But it does seem very strange that the only way I have
to turn off PCIe ASPM reliably on this device is to tell the kernel to
forcibly turn it *on*!

^ permalink raw reply

* Re: [net-next PATCH v4 0/8] Managing the forwarding database(FDB)
From: Michael S. Tsirkin @ 2012-05-05 19:53 UTC (permalink / raw)
  To: Roopa Prabhu
  Cc: Sridhar Samudrala, John Fastabend, shemminger, bhutchings, hadi,
	jeffrey.t.kirsher, netdev, gregory.v.rose, krkumar2
In-Reply-To: <CAGe6so8q26X=HoQx+P-wkoLMtq1NhRerk98-v0cxhUpvMH4zmQ@mail.gmail.com>

On Fri, May 04, 2012 at 01:34:24PM -0700, Roopa Prabhu wrote:
> the qemu patches pointed out above can be reused.

Do you have plans to do this?

^ permalink raw reply

* [PATCH] net/ipv6/af_inet6.c: checkpatch cleanup
From: Eldad Zack @ 2012-05-05 20:13 UTC (permalink / raw)
  To: David S. Miller, Alexey Kuznetsov, James Morris,
	Hideaki YOSHIFUJI, Patrick McHardy
  Cc: netdev, linux-kernel, Eldad Zack

af_inet6.c:80: ERROR: do not initialise statics to 0 or NULL
af_inet6.c:259: ERROR: spaces required around that '=' (ctx:VxV)
af_inet6.c:394: WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
af_inet6.c:412: WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
af_inet6.c:422: ERROR: do not use assignment in if condition
af_inet6.c:425: ERROR: do not use assignment in if condition
af_inet6.c:433: ERROR: do not use assignment in if condition
af_inet6.c:437: WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
af_inet6.c:446: ERROR: spaces required around that '=' (ctx:VxV)
af_inet6.c:478: WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
af_inet6.c:485: ERROR: that open brace { should be on the previous line
af_inet6.c:485: ERROR: space required before the open parenthesis '('
af_inet6.c:513: WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
af_inet6.c:629: WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
af_inet6.c:647: WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
af_inet6.c:687: WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
af_inet6.c:709: WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
af_inet6.c:1073: ERROR: space required before the open parenthesis '('

Signed-off-by: Eldad Zack <eldad@fogrefinery.com>
---
 net/ipv6/af_inet6.c |   29 +++++++++++------------------
 1 file changed, 11 insertions(+), 18 deletions(-)

diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index 0ad046c..bf8e146 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -77,7 +77,7 @@ struct ipv6_params ipv6_defaults = {
 	.autoconf = 1,
 };
 
-static int disable_ipv6_mod = 0;
+static int disable_ipv6_mod;
 
 module_param_named(disable, disable_ipv6_mod, int, 0444);
 MODULE_PARM_DESC(disable, "Disable IPv6 module such that it is non-functional");
@@ -256,7 +256,7 @@ out_rcu_unlock:
 /* bind for INET6 API */
 int inet6_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
 {
-	struct sockaddr_in6 *addr=(struct sockaddr_in6 *)uaddr;
+	struct sockaddr_in6 *addr = (struct sockaddr_in6 *)uaddr;
 	struct sock *sk = sock->sk;
 	struct inet_sock *inet = inet_sk(sk);
 	struct ipv6_pinfo *np = inet6_sk(sk);
@@ -390,7 +390,6 @@ out_unlock:
 	rcu_read_unlock();
 	goto out;
 }
-
 EXPORT_SYMBOL(inet6_bind);
 
 int inet6_release(struct socket *sock)
@@ -408,7 +407,6 @@ int inet6_release(struct socket *sock)
 
 	return inet_release(sock);
 }
-
 EXPORT_SYMBOL(inet6_release);
 
 void inet6_destroy_sock(struct sock *sk)
@@ -419,10 +417,12 @@ void inet6_destroy_sock(struct sock *sk)
 
 	/* Release rx options */
 
-	if ((skb = xchg(&np->pktoptions, NULL)) != NULL)
+	skb = xchg(&np->pktoptions, NULL);
+	if (skb != NULL)
 		kfree_skb(skb);
 
-	if ((skb = xchg(&np->rxpmtu, NULL)) != NULL)
+	skb = xchg(&np->rxpmtu, NULL);
+	if (skb != NULL)
 		kfree_skb(skb);
 
 	/* Free flowlabels */
@@ -430,10 +430,10 @@ void inet6_destroy_sock(struct sock *sk)
 
 	/* Free tx options */
 
-	if ((opt = xchg(&np->opt, NULL)) != NULL)
+	opt = xchg(&np->opt, NULL);
+	if (opt != NULL)
 		sock_kfree_s(sk, opt, opt->tot_len);
 }
-
 EXPORT_SYMBOL_GPL(inet6_destroy_sock);
 
 /*
@@ -443,7 +443,7 @@ EXPORT_SYMBOL_GPL(inet6_destroy_sock);
 int inet6_getname(struct socket *sock, struct sockaddr *uaddr,
 		 int *uaddr_len, int peer)
 {
-	struct sockaddr_in6 *sin=(struct sockaddr_in6 *)uaddr;
+	struct sockaddr_in6 *sin = (struct sockaddr_in6 *)uaddr;
 	struct sock *sk = sock->sk;
 	struct inet_sock *inet = inet_sk(sk);
 	struct ipv6_pinfo *np = inet6_sk(sk);
@@ -474,7 +474,6 @@ int inet6_getname(struct socket *sock, struct sockaddr *uaddr,
 	*uaddr_len = sizeof(*sin);
 	return 0;
 }
-
 EXPORT_SYMBOL(inet6_getname);
 
 int inet6_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
@@ -482,8 +481,7 @@ int inet6_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 	struct sock *sk = sock->sk;
 	struct net *net = sock_net(sk);
 
-	switch(cmd)
-	{
+	switch (cmd) {
 	case SIOCGSTAMP:
 		return sock_get_timestamp(sk, (struct timeval __user *)arg);
 
@@ -509,7 +507,6 @@ int inet6_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 	/*NOTREACHED*/
 	return 0;
 }
-
 EXPORT_SYMBOL(inet6_ioctl);
 
 const struct proto_ops inet6_stream_ops = {
@@ -625,7 +622,6 @@ out_illegal:
 	       p->type);
 	goto out;
 }
-
 EXPORT_SYMBOL(inet6_register_protosw);
 
 void
@@ -643,7 +639,6 @@ inet6_unregister_protosw(struct inet_protosw *p)
 		synchronize_net();
 	}
 }
-
 EXPORT_SYMBOL(inet6_unregister_protosw);
 
 int inet6_sk_rebuild_header(struct sock *sk)
@@ -683,7 +678,6 @@ int inet6_sk_rebuild_header(struct sock *sk)
 
 	return 0;
 }
-
 EXPORT_SYMBOL_GPL(inet6_sk_rebuild_header);
 
 int ipv6_opt_accepted(struct sock *sk, struct sk_buff *skb)
@@ -705,7 +699,6 @@ int ipv6_opt_accepted(struct sock *sk, struct sk_buff *skb)
 	}
 	return 0;
 }
-
 EXPORT_SYMBOL_GPL(ipv6_opt_accepted);
 
 static int ipv6_gso_pull_exthdrs(struct sk_buff *skb, int proto)
@@ -1070,7 +1063,7 @@ static int __init inet6_init(void)
 	BUILD_BUG_ON(sizeof(struct inet6_skb_parm) > sizeof(dummy_skb->cb));
 
 	/* Register the socket-side information for inet6_create.  */
-	for(r = &inetsw6[0]; r < &inetsw6[SOCK_MAX]; ++r)
+	for (r = &inetsw6[0]; r < &inetsw6[SOCK_MAX]; ++r)
 		INIT_LIST_HEAD(r);
 
 	if (disable_ipv6_mod) {
-- 
1.7.10

^ permalink raw reply related


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