* Re: [PATCH 0/2] iputils: minor ninfod and ping6 fixes
From: YOSHIFUJI Hideaki @ 2012-12-19 21:05 UTC (permalink / raw)
To: Jan Synacek; +Cc: netdev
In-Reply-To: <1354868724-15549-1-git-send-email-jsynacek@redhat.com>
Jan Synacek wrote:
> When calling ping6 with the flowlabel (e.g. `ping6 -F 123 ::1'), it exited with
> an error. For some reason, the errno was set when it should not have been. Maybe
> it shouldn't be checked at all, maybe just checking flowlabel for values below
> zero would be enough. I wanted to be on the safer side so I left the errno check
> in there.
>
> Also, I fixed the rest of the unused variables in ninfod.
>
> Jan Synacek (2):
> ninfod: Fix more unused variables.
> ping6: Fix -F switch.
>
> ninfod/ni_ifaddrs.c | 8 +-------
> ping6.c | 3 ++-
> 2 files changed, 3 insertions(+), 8 deletions(-)
>
Fixes committed. Thank you!
--yoshfuji
^ permalink raw reply
* Re: [PATCH] 8139cp: Prevent dev_close/cp_interrupt race on MTU change
From: David Miller @ 2012-12-19 22:31 UTC (permalink / raw)
To: dwmw2; +Cc: jogreene, netdev
In-Reply-To: <1355950547.18919.93.camel@shinybook.infradead.org>
From: David Woodhouse <dwmw2@infradead.org>
Date: Wed, 19 Dec 2012 20:55:47 +0000
> On Wed, 2012-12-19 at 12:40 -0800, David Miller wrote:
>> You sent this as a "request for testing" last week, but I saw
>> no testing on real hardware whatsoever.
>
> Thanks for the reminder :)
>
> Seems to work fine here. I haven't confirmed whether I actually see the
> race or not but changing MTU on a live device works fine, even when it's
> being ping-flooded.
>
> Tested-by: David Woodhouse <David.Woodhouse@intel.com>
That's more like it, applied, thanks everyone. :-)
^ permalink raw reply
* Re: [PATCH 1/4] solos-pci: add GPIO support for newer versions on Geos board
From: David Miller @ 2012-12-19 22:54 UTC (permalink / raw)
To: dwmw2; +Cc: netdev, nathan
In-Reply-To: <1355950881-31550-1-git-send-email-dwmw2@infradead.org>
From: David Woodhouse <dwmw2@infradead.org>
Date: Wed, 19 Dec 2012 21:01:18 +0000
> From: Nathan Williams <nathan@traverse.com.au>
>
> dwmw2: Tidy up a little, simpler matching on which GPIO is being accessed,
> only register on newer boards, register under PCI device instead of
> duplicating them under each ATM device.
>
> Signed-off-by: Nathan Williams <nathan@traverse.com.au>
> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Applied.
^ permalink raw reply
* Re: [PATCH 2/4] solos-pci: remove superfluous debug output
From: David Miller @ 2012-12-19 22:54 UTC (permalink / raw)
To: dwmw2; +Cc: netdev, nathan
In-Reply-To: <1355950881-31550-2-git-send-email-dwmw2@infradead.org>
From: David Woodhouse <dwmw2@infradead.org>
Date: Wed, 19 Dec 2012 21:01:19 +0000
> From: Nathan Williams <nathan@traverse.com.au>
>
> Signed-off-by: Nathan Williams <nathan@traverse.com.au>
> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Applied.
^ permalink raw reply
* Re: [PATCH 3/4] solos-pci: add firmware upgrade support for new models
From: David Miller @ 2012-12-19 22:54 UTC (permalink / raw)
To: dwmw2; +Cc: netdev, nathan
In-Reply-To: <1355950881-31550-3-git-send-email-dwmw2@infradead.org>
From: David Woodhouse <dwmw2@infradead.org>
Date: Wed, 19 Dec 2012 21:01:20 +0000
> From: Nathan Williams <nathan@traverse.com.au>
>
> Signed-off-by: Nathan Williams <nathan@traverse.com.au>
> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Applied.
^ permalink raw reply
* Re: [PATCH 4/4] solos-pci: ensure all TX packets are aligned to 4 bytes
From: David Miller @ 2012-12-19 22:54 UTC (permalink / raw)
To: dwmw2; +Cc: netdev, David.Woodhouse
In-Reply-To: <1355950881-31550-4-git-send-email-dwmw2@infradead.org>
From: David Woodhouse <dwmw2@infradead.org>
Date: Wed, 19 Dec 2012 21:01:21 +0000
> From: David Woodhouse <David.Woodhouse@intel.com>
>
> The FPGA can't handled unaligned DMA (yet). So copy into an aligned buffer,
> if skb->data isn't suitably aligned.
>
> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next V4 00/13] Add basic VLAN support to bridges
From: Vlad Yasevich @ 2012-12-19 22:58 UTC (permalink / raw)
To: Andrew Collins
Cc: netdev, shemminger, davem, or.gerlitz, jhs, mst, erdnetdev, jiri
In-Reply-To: <CAKTPYJTAB-oOW5UE9EbNxwA+XbhmJu1FLrvq_mU8B1Qi6trxeA@mail.gmail.com>
On 12/19/2012 05:54 PM, Andrew Collins wrote:
> On Wed, Dec 19, 2012 at 10:48 AM, Vlad Yasevich <vyasevic@redhat.com> wrote:
>> This series of patches provides an ability to add VLANs to the bridge
>> ports. This is similar to what can be found in most switches. The bridge
>> port may have any number of VLANs added to it including vlan 0 priority tagged
>> traffic. When vlans are added to the port, only traffic tagged with particular
>> vlan will forwarded over this port. Additionally, vlan ids are added to FDB
>> entries and become part of the lookup. This way we correctly identify the FDB
>> entry.
>
> This is likely well beyond the scope of this change, but I figured I'd
> throw out the question anyway. This changeset looks to bring the
> Linux bridging code closer to the 802.1Q-2005 definition of a bridge,
> which is nice to see, I'm curious if this changeset also opens up the
> possibility of supporting MSTP in the future? The big thing I see
> missing is per-VLAN port state, although I'm not very familiar with
> the current STP/bridge interactions. Has anyone put any thought into
> what other necessary bridge pieces might be missing for MSTP support?
> (specifically regarding bridge/vlan interaction, obviously something
> to handle the MSTP protocol itself would need to exist as well)
>
heh.. opening up all sorts of cans of worms today... :)
Have only given it some very passing thoughts. Absolutely nothing
concrete here. Maybe someone else has.
-vlad
^ permalink raw reply
* Re: [PATCH V2 00/12] Add basic VLAN support to bridges
From: Vlad Yasevich @ 2012-12-19 22:59 UTC (permalink / raw)
To: vyasevic; +Cc: Shmulik Ladkani, netdev, shemminger, davem, or.gerlitz, jhs, mst
In-Reply-To: <50D21D98.7020907@redhat.com>
On 12/19/2012 03:03 PM, Vlad Yasevich wrote:
> On 12/19/2012 02:37 PM, Shmulik Ladkani wrote:
>> Hi Vlad,
>>
>> On Wed, 19 Dec 2012 09:13:10 -0500 Vlad Yasevich <vyasevic@redhat.com>
>> wrote:
>>>> Why the "untagged vlan" is per-bridge global?
>>> It's not. There is a per port untagged pointer where you can designate
>>> which VLAN is untagged/native on a port.
>>
>> Ok (misinterpreted the text in the cover letter).
>>
>>>> 802.1q switches usually allow conifguring per-vlan, per-port
>>>> tagged/untagged egress policy: each vid has its port membership map and
>>>> an accompanying port egress-policy map.
>>>> This gives great flexibility defining all sorts of configurations.
>>>
>>> Right, and that's what's provided here.
>>> * Each VLAN has port membership map (net_bridge_vlan.portgroup).
>>> * Each port has a list of vlans configured as well
>>> (net_port_vlan.vlan_list).
>>> * Each port also has a single vlan that can be untagged
>>> (net_bridge_port.untagged).
>>> * The bridge also has a single untagged vlan (net_bridge.untagged)
>>>
>>> The limitation (in switches as well) is that only a single VLAN
>>> may be untagged on any 1 port.
>>
>> Switches usually allow you to configure each port's egress policy per
>> vlan, and allow you to configure multiple vlans to _egress_ untagged
>> on a port.
>>
>>> If you have more then 1, you don't know
>>> which VLAN the untagged traffic belongs to.
>>
>> The port's PVID uniquely determines VID to associate with the frame
>> during _ingress_ on that port - in the case frame arrived untagged.
>>
>> This is unrelated to whether a frame having a specific VID would _egress_
>> tagged or untagged on that port.
>>
>
>
> Ahh... I see what you mean. You would like to separate
> ingress policy and egress policy with regard to how tags are applied...
> I haven't seen that type of config before.
>
> I did say "Basic VLAN support". :)
>
> In this set of patches ingress and egress policies are hardcoded the
> same...
>
> So, consider that what I am calling "untagged" in this series is
> really vlan associated with PVID. To change the egress policy, we
> could add an untagged bitmap into the vlan. Then the bitmap from the
> vlan would determine the egress policy. If the port is in the "tagged"
> bitmap, frame leaves tagged. If the port is in the "untagged" bitmap,
> frame leaves untagged.
>
> The code to make this would would be simple enough. The more
> interesting part would be the configuration :)
Actually, this looks much simpler then I originally thought. I think I
might have something half-baked tomorrow.
-vlad
>
>
>>>> Personally, I'd prefer a fully flexible vlan bridge allowing all sorts
>>>> of configurations (as available in 802.1q switches).
>>>>
>>>> What's the reason limiting such configurations?
>>>
>>> So, what do you see that's missing?
>>
>
> [ snip good example ]
>
>>
>> The bridge constructs needed for supporting such setups are:
>> - per port: PVID
>> - per VLAN: port membership map
>> - per VLAN: port egress policy map
>
> Ok, so from above, membership map is the exiting port_bitmap. Egress
> policy map could be new untagged_bitmap. We wouldn't need a tagged
> policy map since a port can't be "in egress policy, but not in
> membership map".
>
> Membership port_bitmap is consulted on egress for basic forward/drop
> decision (just as it is now). Egress policy (untagged bitmap) is
> consulted to see how the forwarding is done.
>
> Sounds about right? If so, I could probably work something up.
> Will probably leave the configuration for later as that might take a bit
> longer to figure out.
>
> -vlad
>
>>
>> I agree, tools other than a vlan bridge may implement such setups, but
>> using the vlan bridge would be preferred, mainly due to the simplicity.
>>
>> Regards,
>> Shmulik
>>
>
^ permalink raw reply
* Re: [PATCH] pkt_sched: act_xt support new Xtables interface
From: Jamal Hadi Salim @ 2012-12-19 23:00 UTC (permalink / raw)
To: Hasan Chowdhury
Cc: Stephen Hemminger, Jan Engelhardt, Yury Stankevich,
netdev@vger.kernel.org, pablo, netfilter-devel
In-Reply-To: <CAASe=fQZGwjM_2PStRE0tje33Doi6TuwJJ3p7x-SRcwq3mQvRg@mail.gmail.com>
On 12-12-19 10:51 AM, Hasan Chowdhury wrote:
> Hi Jamal,
> I will test it once I get some opportunity , but think I like to know
> even before any testing
>
> 1. What will be the new procedure to compile iproute2 after the patch
> apply (any new library or any configuration that needs to be adjusted )
git pull Stephens latest tree.
Apply patch 1 and compile.
When you are done compiling an m_xt.so will sit in the tc directory;
unfortunate that we are putting out this shared libs. Backup your distro
version and copy this over to that location. On ubuntu 12.04:
sudo cp tc/m_xt.so /usr/lib/tc/m_xt.so
will do it.
> 2. tc filter add dev eth0 protocol ip parent 1: prio 3 u32 match ip src
> 192.168.0.0/16 <http://192.168.0.0/16> flowid 1:1 action xt -j MARK
> --set-mark 3
>
>
> is this still a valid command ?
>
Indeed it is.
cheers,
jamal
^ permalink raw reply
* Re: [PATCH net-next V4 00/13] Add basic VLAN support to bridges
From: Andrew Collins @ 2012-12-19 22:54 UTC (permalink / raw)
To: Vlad Yasevich
Cc: netdev, shemminger, davem, or.gerlitz, jhs, mst, erdnetdev, jiri
In-Reply-To: <1355939304-21804-1-git-send-email-vyasevic@redhat.com>
On Wed, Dec 19, 2012 at 10:48 AM, Vlad Yasevich <vyasevic@redhat.com> wrote:
> This series of patches provides an ability to add VLANs to the bridge
> ports. This is similar to what can be found in most switches. The bridge
> port may have any number of VLANs added to it including vlan 0 priority tagged
> traffic. When vlans are added to the port, only traffic tagged with particular
> vlan will forwarded over this port. Additionally, vlan ids are added to FDB
> entries and become part of the lookup. This way we correctly identify the FDB
> entry.
This is likely well beyond the scope of this change, but I figured I'd
throw out the question anyway. This changeset looks to bring the
Linux bridging code closer to the 802.1Q-2005 definition of a bridge,
which is nice to see, I'm curious if this changeset also opens up the
possibility of supporting MSTP in the future? The big thing I see
missing is per-VLAN port state, although I'm not very familiar with
the current STP/bridge interactions. Has anyone put any thought into
what other necessary bridge pieces might be missing for MSTP support?
(specifically regarding bridge/vlan interaction, obviously something
to handle the MSTP protocol itself would need to exist as well)
^ permalink raw reply
* Re: [PATCH] pkt_sched: act_xt support new Xtables interface
From: Jamal Hadi Salim @ 2012-12-19 23:05 UTC (permalink / raw)
To: Jan Engelhardt
Cc: Hasan Chowdhury, Stephen Hemminger, Yury Stankevich,
netdev@vger.kernel.org, pablo, netfilter-devel
In-Reply-To: <alpine.LNX.2.01.1212191648490.13317@nerf07.vanv.qr>
On 12-12-19 10:52 AM, Jan Engelhardt wrote:
>
>
> Humm... that's a huge patch for what seems to be equal to act_ipt.c
> Let's do a cross-diff:
>
I was thinking of our little discussion when doing that.
The one reason i separated the two is so when the time is right you
can patch on top of only act_xt.c and eventually act_ipt.c will die..
Does changes on top of act_xt.c sound palatable to you?
Otherwise, you are right - it is overkill
cheers,
jamal
^ permalink raw reply
* Re: TCP delayed ACK heuristic
From: Eric Dumazet @ 2012-12-19 23:08 UTC (permalink / raw)
To: Rick Jones
Cc: Cong Wang, David Laight, netdev, Ben Greear, David Miller,
Stephen Hemminger, Thomas Graf
In-Reply-To: <50D209E9.2000504@hp.com>
On Wed, 2012-12-19 at 10:39 -0800, Rick Jones wrote:
> On 12/18/2012 11:00 PM, Cong Wang wrote:
> > On Tue, 2012-12-18 at 16:39 +0000, David Laight wrote:
> >> There are problems with only implementing the acks
> >> specified by RFC1122.
> >
> > Yeah, the problem is if we can violate this RFC for getting better
> > performance. Or it is just a no-no?
> >
> > Although RFC 2525 mentions this as "Stretch ACK Violation", I am still
> > not sure if that means we can violate RFC1122 legally.
>
> The term used in RFC1122 is "SHOULD" not "MUST." Same for RFC2525 when
> it talks about "Stretch ACK Violation." A TCP stack may have behaviour
> which differs from a SHOULD so long as there is a reasonable reason for it.
Generally speaking, there are no reasonable reasons, unless you control
both sender and receiver, and the path between.
ACK can be incredibly useful to recover from losses in a short time.
The vast majority of TCP sessions are small lived, and we send one ACK
per received segment anyway at beginning [1] or retransmits to let the
sender smoothly increase its cwnd, so an auto-tuning facility wont help
them that much.
For long and fast sessions, we have the LRO/GRO heuristic.
This leaves a fraction of flows where the ACK rate should not really
matter.
[1] This refers to the quickack mode
^ permalink raw reply
* Re: [PATCH] build: unbreak linkage of m_xt.so
From: Stephen Hemminger @ 2012-12-20 0:03 UTC (permalink / raw)
To: Mike Frysinger
Cc: Jan Engelhardt, stephen.hemminger, netdev, jhs, urykhy, shemonc,
pablo, netfilter-devel
In-Reply-To: <201212181348.00379.vapier@gentoo.org>
[-- Attachment #1: Type: text/plain, Size: 393 bytes --]
On Tue, 18 Dec 2012 13:47:58 -0500
Mike Frysinger <vapier@gentoo.org> wrote:
> this patch is no longer necessary one you merged my:
> configure: move toolchain init to a function
>
> it's actually undesirable to apply this after that since it makes the configure
> script less clear again ...
>
> sorry if my commit message wasn't obvious.
> -mike
ok, went back to old way.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* [GIT] Networking
From: David Miller @ 2012-12-20 0:06 UTC (permalink / raw)
To: torvalds; +Cc: akpm, netdev, linux-kernel
1) Really fix tuntap SKB use after free bug, from Eric Dumazet.
2) Adjust SKB data pointer to point past the transport header before
calling icmpv6_notify() so that the headers are in the state which
that function expects. From Duan Jiong.
3) Fix ambiguities in the new tuntap multi-queue APIs. From
Jason Wang.
4) mISDN needs to use del_timer_sync(), from Konstantin Khlebnikov.
5) Don't destroy mutex after freeing up device private in mac802154,
fix also from Konstantin Khlebnikov.
6) Fix INET request socket leak in TCP and DCCP, from Christoph Paasch.
7) SCTP HMAC kconfig rework, from Neil Horman.
8) Fix SCTP jprobes function signature, otherwise things explode,
from Daniel Borkmann.
9) Fix typo in ipv6-offload Makefile variable reference, from
Simon Arlott.
10) Don't fail USBNET open just because remote wakeup isn't
supported, from Oliver Neukum.
11) be2net driver bug fixes from Sathya Perla.
12) SOLOS PCI ATM driver bug fixes from Nathan Williams and David
Woodhouse.
13) Fix MTU changing regression in 8139cp driver, from John Greene.
Please pull, thanks a lot!
The following changes since commit 17bc14b767cf0692420c43dbe5310ae98a5a7836:
Revert "sched: Update_cfs_shares at period edge" (2012-12-14 07:20:43 -0800)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net master
for you to fetch changes up to 152a2a8b5e1d4cbe91a7c66f1028db15164a3766:
solos-pci: ensure all TX packets are aligned to 4 bytes (2012-12-19 14:53:53 -0800)
----------------------------------------------------------------
Amerigo Wang (2):
bridge: update selinux perm table for RTM_NEWMDB and RTM_DELMDB
bridge: add flags to distinguish permanent mdb entires
Ang Way Chuang (1):
bridge: remove temporary variable for MLDv2 maximum response code computation
Bjørn Mork (1):
net: qmi_wwan: add ZTE MF880
Christoph Paasch (1):
inet: Fix kmemleak in tcp_v4/6_syn_recv_sock and dccp_v4/6_request_recv_sock
Cong Ding (1):
ipv6: addrconf.c: remove unnecessary "if"
Dan Williams (3):
i2400m: add Intel 6150 device IDs
qmi_wwan/cdc_ether: add Dell Wireless 5800 (Novatel E362) USB IDs
cdc_ether: cleanup: use USB_DEVICE_AND_INTERFACE_INFO for Novatel 551/E362
Daniel Borkmann (1):
sctp: jsctp_sf_eat_sack: fix jprobes function signature mismatch
David Woodhouse (1):
solos-pci: ensure all TX packets are aligned to 4 bytes
Duan Jiong (1):
ipv6: Change skb->data before using icmpv6_notify() to propagate redirect
Eric Dumazet (1):
tuntap: reset network header before calling skb_get_rxhash()
Gabor Juhos (1):
rt2x00: zero-out rx_status
Hannes Frederic Sowa (2):
netlink: change presentation of portid in procfs to unsigned
netlink: validate addr_len on bind
Jason Wang (2):
tuntap: fix ambigious multiqueue API
tuntap: fix sparse warning
John Greene (1):
8139cp: Prevent dev_close/cp_interrupt race on MTU change
John W. Linville (1):
Merge branch 'master' of git://git.kernel.org/.../linville/wireless into for-davem
Konstantin Khlebnikov (4):
mISDN: fix race in timer canceling on module unloading
stmmac: fix platform driver unregistering
bonding: do not cancel works in bond_uninit()
mac802154: fix destructon ordering for ieee802154 devices
Lennert Buytenhek (1):
ksz884x: fix receive polling race condition
Marc Kleine-Budde (1):
can: sja1000: fix compilation on x86
Nathan Williams (3):
solos-pci: add GPIO support for newer versions on Geos board
solos-pci: remove superfluous debug output
solos-pci: add firmware upgrade support for new models
Neil Horman (1):
sctp: Change defaults on cookie hmac selection
Oliver Neukum (3):
usbnet: handle PM failure gracefully
usbnet: generic manage_power()
use generic usbnet_manage_power()
Sachin Kamat (2):
drivers/net: Use of_match_ptr() macro in smc91x.c
drivers/net: Use of_match_ptr() macro in smsc911x.c
Sathya Perla (2):
be2net: fix be_close() to ensure all events are ack'ed
be2net: fix wrong frag_idx reported by RX CQ
Shahed Shaikh (1):
qlcnic: fix unused variable warnings
Shawn Guo (1):
net: fec: forbid FEC_PTP on SoCs that do not support
Signed-off-by: Sony Chacko (1):
qlcnic: update driver version
Simon Arlott (1):
ipv6: Fix Makefile offload objects
Tony Lindgren (1):
cpts: Fix build error caused by include of plat/clock.h
Vlad Yasevich (2):
bridge: Do not unregister all PF_BRIDGE rtnl operations
bridge: Correctly encode addresses when dumping mdb entries
Vladimir Kondratiev (1):
wireless: fix Atheros drivers compilation
chas williams - CONTRACTOR (1):
atm: use scnprintf() instead of sprintf()
drivers/atm/solos-pci.c | 186 ++++++++++++++++++++++++++++++++++++++++----
drivers/isdn/mISDN/dsp_core.c | 3 +-
drivers/net/bonding/bond_main.c | 2 -
drivers/net/can/sja1000/sja1000_of_platform.c | 2 +-
drivers/net/ethernet/emulex/benet/be.h | 2 +-
drivers/net/ethernet/emulex/benet/be_cmds.c | 5 ++
drivers/net/ethernet/emulex/benet/be_main.c | 59 ++++++++++----
drivers/net/ethernet/freescale/Kconfig | 3 +-
drivers/net/ethernet/micrel/ksz884x.c | 12 ++-
drivers/net/ethernet/qlogic/qlcnic/qlcnic.h | 4 +-
drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c | 5 +-
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c | 5 +-
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 5 --
drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c | 3 +-
drivers/net/ethernet/realtek/8139cp.c | 18 +++--
drivers/net/ethernet/smsc/smc91x.c | 4 +-
drivers/net/ethernet/smsc/smsc911x.c | 4 +-
drivers/net/ethernet/stmicro/stmmac/stmmac.h | 6 +-
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 22 +++---
drivers/net/ethernet/ti/cpts.c | 2 -
drivers/net/tun.c | 87 +++++++++++++++------
drivers/net/usb/cdc_ether.c | 45 +++++------
drivers/net/usb/cdc_ncm.c | 10 +--
drivers/net/usb/qmi_wwan.c | 15 ++++
drivers/net/usb/usbnet.c | 25 ++++--
drivers/net/wimax/i2400m/i2400m-usb.h | 3 +
drivers/net/wimax/i2400m/usb.c | 6 ++
drivers/net/wireless/Makefile | 2 +-
drivers/net/wireless/rt2x00/rt2x00dev.c | 8 ++
include/linux/usb/usbnet.h | 3 +
include/net/inet_connection_sock.h | 1 +
include/net/ndisc.h | 7 ++
include/uapi/linux/if_bridge.h | 3 +
net/atm/atm_sysfs.c | 40 ++++------
net/bridge/br_mdb.c | 22 ++++--
net/bridge/br_multicast.c | 13 ++--
net/bridge/br_netlink.c | 1 -
net/bridge/br_private.h | 5 +-
net/dccp/ipv4.c | 4 +-
net/dccp/ipv6.c | 3 +-
net/ipv4/inet_connection_sock.c | 16 ++++
net/ipv4/tcp_ipv4.c | 6 +-
net/ipv6/Makefile | 2 +-
net/ipv6/addrconf.c | 3 +-
net/ipv6/ndisc.c | 17 ++++
net/ipv6/tcp_ipv6.c | 3 +-
net/mac802154/ieee802154_dev.c | 4 +-
net/netlink/af_netlink.c | 5 +-
net/sctp/Kconfig | 27 ++++++-
net/sctp/probe.c | 3 +-
net/sctp/protocol.c | 4 +-
security/selinux/nlmsgtab.c | 2 +
52 files changed, 545 insertions(+), 202 deletions(-)
^ permalink raw reply
* Re: TCP delayed ACK heuristic
From: Cong Wang @ 2012-12-20 3:23 UTC (permalink / raw)
To: David Miller
Cc: rick.jones2, David.Laight, netdev, greearb, eric.dumazet,
shemminger, tgraf
In-Reply-To: <20121219.125939.1674292599518627751.davem@davemloft.net>
On Wed, 2012-12-19 at 12:59 -0800, David Miller wrote:
>
> Yes, but RFC2525 makes it very clear why we should not even
> consider doing crap like this.
>
> ACKs are the only information we have to detect loss.
>
> And, for the same reasons that TCP VEGAS is fundamentally broken, we
> cannot measure the pipe or some other receiver-side-visible piece of
> information to determine when it's "safe" to stretch ACK.
>
> And even if it's "safe", we should not do it so that losses are
> accurately detected and we don't spuriously retransmit.
>
> The only way to know when the bandwidth increases is to "test" it, by
> sending more and more packets until drops happen. That's why all
> successful congestion control algorithms must operate on explicited
> tested pieces of information.
>
> Similarly, it's not really possible to universally know if it's safe
> to stretch ACK or not.
Sounds reasonable. Thanks for your explanation.
>
> Can we please drop this idea? It has zero value and all downside as
> far as I'm concerned.
>
Yeah, I am just trying to see if there is any way to get a reasonable
heuristic.
So, can we at least have a sysctl to control the timeout of the delayed
ACK? I mean the minimum 40ms. TCP_QUICKACK can help too, but it requires
the receiver to modify the application and has to be set every time when
calling recv().
Thanks!
^ permalink raw reply
* Re: [PATCH V2 00/12] Add basic VLAN support to bridges
From: Shmulik Ladkani @ 2012-12-20 7:00 UTC (permalink / raw)
To: vyasevic; +Cc: netdev, shemminger, davem, or.gerlitz, jhs, mst
In-Reply-To: <50D21D98.7020907@redhat.com>
Hi Vlad,
On Wed, 19 Dec 2012 15:03:36 -0500 Vlad Yasevich <vyasevic@redhat.com> wrote:
> > The port's PVID uniquely determines VID to associate with the frame
> > during _ingress_ on that port - in the case frame arrived untagged.
> >
> > This is unrelated to whether a frame having a specific VID would _egress_
> > tagged or untagged on that port.
>
> Ahh... I see what you mean. You would like to separate
> ingress policy and egress policy with regard to how tags are applied...
Exactly.
Those are two different things; sometimes their configuration collide,
sometimes not.
> > The bridge constructs needed for supporting such setups are:
> > - per port: PVID
> > - per VLAN: port membership map
> > - per VLAN: port egress policy map
>
> Ok, so from above, membership map is the exiting port_bitmap.
Ok.
> Egress policy map could be new untagged_bitmap. We wouldn't need a tagged
> policy map since a port can't be "in egress policy, but not in
> membership map".
Yes, that is correct.
However I wouldn't call it "untagged_bitmap".
The name might suggest that "egress untagged" is an anomaly, where
"normal" behavior is egress tagged.
But as said, both are valid, its just a matter of configuration.
You basically need one more bit for each member port, stating
egress tagged/untagged.
> Sounds about right? If so, I could probably work something up.
Yes, looking forward to review the code.
P.S.
Sorry for late spotting this; I don't follow net-dev regularly.
I hope to take a look at the code soon, see if I have any meaningful
comments.
Regards,
Shmulik
^ permalink raw reply
* Re: PMTU discovery is broken on kernel 3.7.1 for UDP sockets
From: Yurij M. Plotnikov @ 2012-12-20 7:14 UTC (permalink / raw)
To: Ben Hutchings; +Cc: netdev, Alexandra N. Kossovsky
In-Reply-To: <1355945864.2676.21.camel@bwh-desktop.uk.solarflarecom.com>
On 12/19/12 23:37, Ben Hutchings wrote:
> On Wed, 2012-12-19 at 18:27 +0400, Yurij M. Plotnikov wrote:
>
>> On 12/19/12 17:35, Ben Hutchings wrote:
>>
>>> On Wed, 2012-12-19 at 17:10 +0400, Yurij M. Plotnikov wrote:
>>>
>>>
>>>> On kernel 3.7.1 I get strange behaviour of IP_MTU_DISCOVER socket
>>>> option. The behaviour in case of IP_PMTUDISC_DO and IP_PMTUDISC_WANT
>>>> values of IP_MTU_DISCOVER socket option on SOCK_DGRAM socket are the
>>>> same and packet is always sent with "Don't Fragment" bit in case of
>>>> IP_PMTUDISC_WANT. Also, the value of IP_MTU socket option is not updated.
>>>>
>>>>
>>> You could try reverting:
>>>
>>> commit ee9a8f7ab2edf801b8b514c310455c94acc232f6
>>> Author: Steffen Klassert<steffen.klassert@secunet.com>
>>> Date: Mon Oct 8 00:56:54 2012 +0000
>>>
>>> ipv4: Don't report stale pmtu values to userspace
>>>
>>> We report cached pmtu values even if they are already expired.
>>> Change this to not report these values after they are expired
>>> and fix a race in the expire time calculation, as suggested by
>>> Eric Dumazet.
>>>
>>> Still, PMTU information is not supposed to expire for 10 minutes...
>>>
>>>
>>>
>> With reverted commit there is no such problem on 3.7.1: IP_MTU is
>> updated and DF is set only for the first packet in case of
>> IP_PMTUDISC_WANT.
>>
> [...]
>
> So it looks like something is going wrong with the expiry calculation
> here.
>
> This change shouldn't affect the PMTU actually used by the kernel, but
> could affect Onload since that relies on netlink route updates to keep
> in synch. You didn't say you were using Onload, but if you are then we
> should not bother netdev with this until we can demonstrate a problem
> that involves only the kernel stack.
>
>
The results were obtained on pure Linux kernel without using Onload.
Yurij.
^ permalink raw reply
* Re: [PATCH net-next V4 03/13] bridge: Validate that vlan is permitted on ingress
From: Cong Wang @ 2012-12-20 7:27 UTC (permalink / raw)
To: netdev
In-Reply-To: <1355939304-21804-4-git-send-email-vyasevic@redhat.com>
On Wed, 19 Dec 2012 at 17:48 GMT, Vlad Yasevich <vyasevic@redhat.com> wrote:
> +static inline u16 br_get_vlan(const struct sk_buff *skb)
> +{
> + u16 tag;
> +
> + if (vlan_tx_tag_present(skb))
> + return vlan_tx_tag_get(skb) & VLAN_VID_MASK;
> +
> + if (vlan_get_tag(skb, &tag))
> + return 0;
> +
> + return tag & VLAN_VID_MASK;
> +}
> +
Nitpick:
The name br_get_vlan() can easily confuse people with br_vlan_find().
Also, this function looks like not bridge-specific, how about moving
it to if_vlan.h?
^ permalink raw reply
* Re: PMTU discovery is broken on kernel 3.7.1 for UDP sockets
From: Steffen Klassert @ 2012-12-20 7:34 UTC (permalink / raw)
To: Ben Hutchings; +Cc: Yurij M. Plotnikov, netdev, Alexandra N. Kossovsky
In-Reply-To: <1355945864.2676.21.camel@bwh-desktop.uk.solarflarecom.com>
On Wed, Dec 19, 2012 at 07:37:44PM +0000, Ben Hutchings wrote:
> On Wed, 2012-12-19 at 18:27 +0400, Yurij M. Plotnikov wrote:
> > On 12/19/12 17:35, Ben Hutchings wrote:
> > > On Wed, 2012-12-19 at 17:10 +0400, Yurij M. Plotnikov wrote:
> > >
> > >> On kernel 3.7.1 I get strange behaviour of IP_MTU_DISCOVER socket
> > >> option. The behaviour in case of IP_PMTUDISC_DO and IP_PMTUDISC_WANT
> > >> values of IP_MTU_DISCOVER socket option on SOCK_DGRAM socket are the
> > >> same and packet is always sent with "Don't Fragment" bit in case of
> > >> IP_PMTUDISC_WANT. Also, the value of IP_MTU socket option is not updated.
> > >>
> > > You could try reverting:
> > >
> > > commit ee9a8f7ab2edf801b8b514c310455c94acc232f6
> > > Author: Steffen Klassert<steffen.klassert@secunet.com>
> > > Date: Mon Oct 8 00:56:54 2012 +0000
> > >
> > > ipv4: Don't report stale pmtu values to userspace
> > >
> > > We report cached pmtu values even if they are already expired.
> > > Change this to not report these values after they are expired
> > > and fix a race in the expire time calculation, as suggested by
> > > Eric Dumazet.
> > >
> > > Still, PMTU information is not supposed to expire for 10 minutes...
> > >
> > >
> > With reverted commit there is no such problem on 3.7.1: IP_MTU is
> > updated and DF is set only for the first packet in case of
> > IP_PMTUDISC_WANT.
> [...]
>
> So it looks like something is going wrong with the expiry calculation
> here.
>
> This change shouldn't affect the PMTU actually used by the kernel, but
> could affect Onload since that relies on netlink route updates to keep
> in synch. You didn't say you were using Onload, but if you are then we
> should not bother netdev with this until we can demonstrate a problem
> that involves only the kernel stack.
>
I'm really surprised that this change can have such an effect,
it changes nothing at the kernels pmtu handling. When looking
at the code, I found that we may report a mtu value from a stale
dst_entry when we query the mtu value with the IP_MTU socket
option. But a subsequent send() should update the socket cached
dst_entry, so at most one packet should be affected.
Does the patch below change anything?
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c
index 3c9d208..1049ce0 100644
--- a/net/ipv4/ip_sockglue.c
+++ b/net/ipv4/ip_sockglue.c
@@ -1198,7 +1198,7 @@ static int do_ip_getsockopt(struct sock *sk, int level, int optname,
{
struct dst_entry *dst;
val = 0;
- dst = sk_dst_get(sk);
+ dst = sk_dst_check(sk, 0);
if (dst) {
val = dst_mtu(dst);
dst_release(dst);
^ permalink raw reply related
* Re: [PATCH net-next V4 08/13] bridge: Add netlink interface to configure vlans on bridge ports
From: Cong Wang @ 2012-12-20 7:48 UTC (permalink / raw)
To: netdev
In-Reply-To: <1355939304-21804-9-git-send-email-vyasevic@redhat.com>
On Wed, 19 Dec 2012 at 17:48 GMT, Vlad Yasevich <vyasevic@redhat.com> wrote:
> diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
> index c30fe29..33bc740 100644
> --- a/net/bridge/br_if.c
> +++ b/net/bridge/br_if.c
> @@ -23,6 +23,7 @@
> #include <linux/if_ether.h>
> #include <linux/slab.h>
> #include <net/sock.h>
> +#include <linux/if_vlan.h>
Huh??
>
> #include "br_private.h"
>
> diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
> index dead9df..84c6f04 100644
> --- a/net/bridge/br_netlink.c
> +++ b/net/bridge/br_netlink.c
> @@ -16,6 +16,7 @@
> #include <net/rtnetlink.h>
> #include <net/net_namespace.h>
> #include <net/sock.h>
> +#include <uapi/linux/if_bridge.h>
>
Please don't include UAPI headers directly, you should #include
<linux/if_bridge.h>.
^ permalink raw reply
* [patch] solos-pci: double lock in geos_gpio_store()
From: Dan Carpenter @ 2012-12-20 7:48 UTC (permalink / raw)
To: Chas Williams, Nathan Williams, David Woodhouse
Cc: linux-atm-general, netdev, kbuild
In-Reply-To: <50d25b88.0QAOhrb1a/eK/hR1%fengguang.wu@intel.com>
There is a typo here so we do a double lock instead of an unlock.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
Only needed in linux-next. Introduced in f9baad02e7411d9 [14/17]
solos-pci: add GPIO support for newer versions on Geos board
diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c
index 473d808..7b95736 100644
--- a/drivers/atm/solos-pci.c
+++ b/drivers/atm/solos-pci.c
@@ -531,7 +531,7 @@ static ssize_t geos_gpio_store(struct device *dev, struct device_attribute *attr
} else {
count = -EINVAL;
}
- spin_lock_irq(&card->param_queue_lock);
+ spin_unlock_irq(&card->param_queue_lock);
return count;
}
^ permalink raw reply related
* Re: [PATCH net-next V4 07/13] bridge: Add vlan id to multicast groups
From: Cong Wang @ 2012-12-20 8:05 UTC (permalink / raw)
To: netdev
In-Reply-To: <1355939304-21804-8-git-send-email-vyasevic@redhat.com>
On Wed, 19 Dec 2012 at 17:48 GMT, Vlad Yasevich <vyasevic@redhat.com> wrote:
> Add vlan_id to multicasts groups so that we know which vlan
> each group belongs to and can correctly forward to appropriate vlan.
>
I think you need to export VID to user-space as well?
^ permalink raw reply
* [PATCH] net: ipv4: route: fixed a coding style issues net: ipv4: tcp: fixed a coding style issues
From: Stefan Hasko @ 2012-12-20 8:08 UTC (permalink / raw)
To: David S. Miller, Alexey Kuznetsov, James Morris,
Hideaki YOSHIFUJI, Patrick McHardy, netdev
Cc: linux-kernel, Stefan Hasko
Fix a coding style issues.
Signed-off-by: Stefan Hasko <hasko.stevo@gmail.com>
---
net/ipv4/route.c | 125 ++++++++++++++++++-------------
net/ipv4/tcp.c | 218 +++++++++++++++++++++++++++++++-----------------------
2 files changed, 200 insertions(+), 143 deletions(-)
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 844a9ef..fff7ce6 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -20,7 +20,7 @@
* Alan Cox : Added BSD route gw semantics
* Alan Cox : Super /proc >4K
* Alan Cox : MTU in route table
- * Alan Cox : MSS actually. Also added the window
+ * Alan Cox : MSS actually. Also added the window
* clamper.
* Sam Lantinga : Fixed route matching in rt_del()
* Alan Cox : Routing cache support.
@@ -31,30 +31,35 @@
* Miquel van Smoorenburg : BSD API fixes.
* Miquel van Smoorenburg : Metrics.
* Alan Cox : Use __u32 properly
- * Alan Cox : Aligned routing errors more closely with BSD
+ * Alan Cox : Aligned routing errors more
+ * closely with BSD
* our system is still very different.
* Alan Cox : Faster /proc handling
- * Alexey Kuznetsov : Massive rework to support tree based routing,
+ * Alexey Kuznetsov : Massive rework to support
+ * tree based routing,
* routing caches and better behaviour.
*
* Olaf Erb : irtt wasn't being copied right.
* Bjorn Ekwall : Kerneld route support.
* Alan Cox : Multicast fixed (I hope)
- * Pavel Krauz : Limited broadcast fixed
+ * Pavel Krauz : Limited broadcast fixed
* Mike McLagan : Routing by source
* Alexey Kuznetsov : End of old history. Split to fib.c and
* route.c and rewritten from scratch.
* Andi Kleen : Load-limit warning messages.
- * Vitaly E. Lavrov : Transparent proxy revived after year coma.
+ * Vitaly E. Lavrov : Transparent proxy revived
+ * after year coma.
* Vitaly E. Lavrov : Race condition in ip_route_input_slow.
- * Tobias Ringstrom : Uninitialized res.type in ip_route_output_slow.
+ * Tobias Ringstrom : Uninitialized res.type in
+ * ip_route_output_slow.
* Vladimir V. Ivanov : IP rule info (flowid) is really useful.
* Marc Boucher : routing by fwmark
* Robert Olsson : Added rt_cache statistics
* Arnaldo C. Melo : Convert proc stuff to seq_file
- * Eric Dumazet : hashed spinlocks and rt_check_expire() fixes.
- * Ilia Sotnikov : Ignore TOS on PMTUD and Redirect
- * Ilia Sotnikov : Removed TOS from hash calculations
+ * Eric Dumazet : hashed spinlocks and
+ * rt_check_expire() fixes.
+ * Ilia Sotnikov : Ignore TOS on PMTUD and Redirect
+ * Ilia Sotnikov : Removed TOS from hash calculations
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -65,7 +70,7 @@
#define pr_fmt(fmt) "IPv4: " fmt
#include <linux/module.h>
-#include <asm/uaccess.h>
+#include <linux/uaccess.h>
#include <linux/bitops.h>
#include <linux/types.h>
#include <linux/kernel.h>
@@ -139,7 +144,8 @@ static unsigned int ipv4_default_advmss(const struct dst_entry *dst);
static unsigned int ipv4_mtu(const struct dst_entry *dst);
static struct dst_entry *ipv4_negative_advice(struct dst_entry *dst);
static void ipv4_link_failure(struct sk_buff *skb);
-static void ip_rt_update_pmtu(struct dst_entry *dst, struct sock *sk,
+static void ip_rt_update_pmtu(struct dst_entry *dst,
+ struct sock *sk,
struct sk_buff *skb, u32 mtu);
static void ip_do_redirect(struct dst_entry *dst, struct sock *sk,
struct sk_buff *skb);
@@ -291,12 +297,17 @@ static int rt_cpu_seq_show(struct seq_file *seq, void *v)
struct rt_cache_stat *st = v;
if (v == SEQ_START_TOKEN) {
- seq_printf(seq, "entries in_hit in_slow_tot in_slow_mc in_no_route in_brd in_martian_dst in_martian_src out_hit out_slow_tot out_slow_mc gc_total gc_ignored gc_goal_miss gc_dst_overflow in_hlist_search out_hlist_search\n");
+ seq_printf(seq, "entries in_hit in_slow_tot in_slow_mc "
+ "in_no_route in_brd in_martian_dst "
+ "in_martian_src out_hit out_slow_tot "
+ "out_slow_mc gc_total gc_ignored "
+ "gc_goal_miss gc_dst_overflow in_hlist_search "
+ "out_hlist_search\n");
return 0;
}
- seq_printf(seq,"%08x %08x %08x %08x %08x %08x %08x %08x "
- " %08x %08x %08x %08x %08x %08x %08x %08x %08x \n",
+ seq_printf(seq, "%08x %08x %08x %08x %08x %08x %08x %08x "
+ " %08x %08x %08x %08x %08x %08x %08x %08x %08x\n",
dst_entries_get_slow(&ipv4_dst_ops),
st->in_hit,
st->in_slow_tot,
@@ -657,8 +668,8 @@ out_unlock:
return;
}
-static void __ip_do_redirect(struct rtable *rt, struct sk_buff *skb, struct flowi4 *fl4,
- bool kill_route)
+static void __ip_do_redirect(struct rtable *rt, struct sk_buff *skb,
+ struct flowi4 *fl4, bool kill_route)
{
__be32 new_gw = icmp_hdr(skb)->un.gateway;
__be32 old_gw = ip_hdr(skb)->saddr;
@@ -695,7 +706,8 @@ static void __ip_do_redirect(struct rtable *rt, struct sk_buff *skb, struct flow
if (!IN_DEV_SHARED_MEDIA(in_dev)) {
if (!inet_addr_onlink(in_dev, new_gw, old_gw))
goto reject_redirect;
- if (IN_DEV_SEC_REDIRECTS(in_dev) && ip_fib_check_default(new_gw, dev))
+ if (IN_DEV_SEC_REDIRECTS(in_dev) &&
+ ip_fib_check_default(new_gw, dev))
goto reject_redirect;
} else {
if (inet_addr_type(net, new_gw) != RTN_UNICAST)
@@ -737,7 +749,8 @@ reject_redirect:
;
}
-static void ip_do_redirect(struct dst_entry *dst, struct sock *sk, struct sk_buff *skb)
+static void ip_do_redirect(struct dst_entry *dst, struct sock *sk,
+ struct sk_buff *skb)
{
struct rtable *rt;
struct flowi4 fl4;
@@ -1202,11 +1215,11 @@ static bool rt_cache_route(struct fib_nh *nh, struct rtable *rt)
struct rtable *orig, *prev, **p;
bool ret = true;
- if (rt_is_input_route(rt)) {
+ if (rt_is_input_route(rt))
p = (struct rtable **)&nh->nh_rth_input;
- } else {
+ else
p = (struct rtable **)__this_cpu_ptr(nh->nh_pcpu_rth_output);
- }
+
orig = *p;
prev = cmpxchg(p, orig, rt);
@@ -1359,17 +1372,17 @@ static int ip_route_input_mc(struct sk_buff *skb, __be32 daddr, __be32 saddr,
#endif
rth->dst.output = ip_rt_bug;
- rth->rt_genid = rt_genid(dev_net(dev));
- rth->rt_flags = RTCF_MULTICAST;
- rth->rt_type = RTN_MULTICAST;
- rth->rt_is_input= 1;
- rth->rt_iif = 0;
- rth->rt_pmtu = 0;
- rth->rt_gateway = 0;
+ rth->rt_genid = rt_genid(dev_net(dev));
+ rth->rt_flags = RTCF_MULTICAST;
+ rth->rt_type = RTN_MULTICAST;
+ rth->rt_is_input = 1;
+ rth->rt_iif = 0;
+ rth->rt_pmtu = 0;
+ rth->rt_gateway = 0;
rth->rt_uses_gateway = 0;
INIT_LIST_HEAD(&rth->rt_uncached);
if (our) {
- rth->dst.input= ip_local_deliver;
+ rth->dst.input = ip_local_deliver;
rth->rt_flags |= RTCF_LOCAL;
}
@@ -1488,8 +1501,8 @@ static int __mkroute_input(struct sk_buff *skb,
rth->rt_flags = flags;
rth->rt_type = res->type;
rth->rt_is_input = 1;
- rth->rt_iif = 0;
- rth->rt_pmtu = 0;
+ rth->rt_iif = 0;
+ rth->rt_pmtu = 0;
rth->rt_gateway = 0;
rth->rt_uses_gateway = 0;
INIT_LIST_HEAD(&rth->rt_uncached);
@@ -1649,25 +1662,25 @@ local_input:
if (!rth)
goto e_nobufs;
- rth->dst.input= ip_local_deliver;
- rth->dst.output= ip_rt_bug;
+ rth->dst.input = ip_local_deliver;
+ rth->dst.output = ip_rt_bug;
#ifdef CONFIG_IP_ROUTE_CLASSID
rth->dst.tclassid = itag;
#endif
rth->rt_genid = rt_genid(net);
- rth->rt_flags = flags|RTCF_LOCAL;
- rth->rt_type = res.type;
+ rth->rt_flags = flags|RTCF_LOCAL;
+ rth->rt_type = res.type;
rth->rt_is_input = 1;
- rth->rt_iif = 0;
- rth->rt_pmtu = 0;
+ rth->rt_iif = 0;
+ rth->rt_pmtu = 0;
rth->rt_gateway = 0;
rth->rt_uses_gateway = 0;
INIT_LIST_HEAD(&rth->rt_uncached);
if (res.type == RTN_UNREACHABLE) {
- rth->dst.input= ip_error;
- rth->dst.error= -err;
- rth->rt_flags &= ~RTCF_LOCAL;
+ rth->dst.input = ip_error;
+ rth->dst.error = -err;
+ rth->rt_flags &= ~RTCF_LOCAL;
}
if (do_cache)
rt_cache_route(&FIB_RES_NH(res), rth);
@@ -1772,7 +1785,8 @@ static struct rtable *__mkroute_output(const struct fib_result *res,
return ERR_PTR(-EINVAL);
if (likely(!IN_DEV_ROUTE_LOCALNET(in_dev)))
- if (ipv4_is_loopback(fl4->saddr) && !(dev_out->flags & IFF_LOOPBACK))
+ if (ipv4_is_loopback(fl4->saddr) &&
+ !(dev_out->flags & IFF_LOOPBACK))
return ERR_PTR(-EINVAL);
if (ipv4_is_lbcast(fl4->daddr))
@@ -1919,7 +1933,9 @@ struct rtable *__ip_route_output_key(struct net *net, struct flowi4 *fl4)
if (fl4->flowi4_oif == 0 &&
(ipv4_is_multicast(fl4->daddr) ||
ipv4_is_lbcast(fl4->daddr))) {
- /* It is equivalent to inet_addr_type(saddr) == RTN_LOCAL */
+ /* It is equivalent to
+ * inet_addr_type(saddr) == RTN_LOCAL
+ */
dev_out = __ip_dev_find(net, fl4->saddr, false);
if (dev_out == NULL)
goto out;
@@ -1944,7 +1960,9 @@ struct rtable *__ip_route_output_key(struct net *net, struct flowi4 *fl4)
}
if (!(fl4->flowi4_flags & FLOWI_FLAG_ANYSRC)) {
- /* It is equivalent to inet_addr_type(saddr) == RTN_LOCAL */
+ /* It is equivalent to
+ * inet_addr_type(saddr) == RTN_LOCAL
+ */
if (!__ip_dev_find(net, fl4->saddr, false))
goto out;
}
@@ -1972,7 +1990,7 @@ struct rtable *__ip_route_output_key(struct net *net, struct flowi4 *fl4)
if (fl4->saddr) {
if (ipv4_is_multicast(fl4->daddr))
fl4->saddr = inet_select_addr(dev_out, 0,
- fl4->flowi4_scope);
+ fl4->flowi4_scope);
else if (!fl4->daddr)
fl4->saddr = inet_select_addr(dev_out, 0,
RT_SCOPE_HOST);
@@ -2061,7 +2079,8 @@ out:
}
EXPORT_SYMBOL_GPL(__ip_route_output_key);
-static struct dst_entry *ipv4_blackhole_dst_check(struct dst_entry *dst, u32 cookie)
+static struct dst_entry *ipv4_blackhole_dst_check(struct dst_entry *dst,
+ u32 cookie)
{
return NULL;
}
@@ -2073,7 +2092,8 @@ static unsigned int ipv4_blackhole_mtu(const struct dst_entry *dst)
return mtu ? : dst->dev->mtu;
}
-static void ipv4_rt_blackhole_update_pmtu(struct dst_entry *dst, struct sock *sk,
+static void ipv4_rt_blackhole_update_pmtu(struct dst_entry *dst,
+ struct sock *sk,
struct sk_buff *skb, u32 mtu)
{
}
@@ -2101,7 +2121,8 @@ static struct dst_ops ipv4_dst_blackhole_ops = {
.neigh_lookup = ipv4_neigh_lookup,
};
-struct dst_entry *ipv4_blackhole_route(struct net *net, struct dst_entry *dst_orig)
+struct dst_entry *ipv4_blackhole_route(struct net *net,
+ struct dst_entry *dst_orig)
{
struct rtable *ort = (struct rtable *) dst_orig;
struct rtable *rt;
@@ -2265,7 +2286,8 @@ nla_put_failure:
return -EMSGSIZE;
}
-static int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh, void *arg)
+static int inet_rtm_getroute(struct sk_buff *in_skb,
+ struct nlmsghdr *nlh, void *arg)
{
struct net *net = sock_net(in_skb->sk);
struct rtmsg *rtm;
@@ -2297,7 +2319,9 @@ static int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh, void
skb_reset_mac_header(skb);
skb_reset_network_header(skb);
- /* Bugfix: need to give ip_route_input enough of an IP header to not gag. */
+ /* Bugfix: need to give ip_route_input enough
+ * of an IP header to not gag.
+ */
ip_hdr(skb)->protocol = IPPROTO_ICMP;
skb_reserve(skb, MAX_HEADER + sizeof(struct iphdr));
@@ -2596,7 +2620,8 @@ int __init ip_rt_init(void)
int rc = 0;
#ifdef CONFIG_IP_ROUTE_CLASSID
- ip_rt_acct = __alloc_percpu(256 * sizeof(struct ip_rt_acct), __alignof__(struct ip_rt_acct));
+ ip_rt_acct = __alloc_percpu(256 * sizeof(struct ip_rt_acct),
+ __alignof__(struct ip_rt_acct));
if (!ip_rt_acct)
panic("IP: failed to allocate ip_rt_acct\n");
#endif
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 1ca2536..12fadb2 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -45,7 +45,7 @@
* escape still
* Alan Cox : Fixed another acking RST frame bug.
* Should stop LAN workplace lockups.
- * Alan Cox : Some tidyups using the new skb list
+ * Alan Cox : Some tidyups using the new skb list
* facilities
* Alan Cox : sk->keepopen now seems to work
* Alan Cox : Pulls options out correctly on accepts
@@ -160,7 +160,8 @@
* generates them.
* Alan Cox : Cache last socket.
* Alan Cox : Per route irtt.
- * Matt Day : poll()->select() match BSD precisely on error
+ * Matt Day : poll()->select() match BSD precisely
+ * on error
* Alan Cox : New buffers
* Marc Tamsky : Various sk->prot->retransmits and
* sk->retransmits misupdating fixed.
@@ -168,9 +169,9 @@
* and TCP syn retries gets used now.
* Mark Yarvis : In tcp_read_wakeup(), don't send an
* ack if state is TCP_CLOSED.
- * Alan Cox : Look up device on a retransmit - routes may
- * change. Doesn't yet cope with MSS shrink right
- * but it's a start!
+ * Alan Cox : Look up device on a retransmit - routes
+ * may change. Doesn't yet cope with MSS
+ * shrink right but it's a start!
* Marc Tamsky : Closing in closing fixes.
* Mike Shaver : RFC1122 verifications.
* Alan Cox : rcv_saddr errors.
@@ -199,7 +200,7 @@
* tcp_do_sendmsg to avoid burstiness.
* Eric Schenk : Fix fast close down bug with
* shutdown() followed by close().
- * Andi Kleen : Make poll agree with SIGIO
+ * Andi Kleen : Make poll agree with SIGIO
* Salvatore Sanfilippo : Support SO_LINGER with linger == 1 and
* lingertime == 0 (RFC 793 ABORT Call)
* Hirokazu Takahashi : Use copy_from_user() instead of
@@ -268,6 +269,7 @@
#include <linux/crypto.h>
#include <linux/time.h>
#include <linux/slab.h>
+#include <linux/uaccess.h>
#include <net/icmp.h>
#include <net/inet_common.h>
@@ -277,7 +279,6 @@
#include <net/netdma.h>
#include <net/sock.h>
-#include <asm/uaccess.h>
#include <asm/ioctls.h>
int sysctl_tcp_fin_timeout __read_mostly = TCP_FIN_TIMEOUT;
@@ -286,22 +287,20 @@ struct percpu_counter tcp_orphan_count;
EXPORT_SYMBOL_GPL(tcp_orphan_count);
int sysctl_tcp_wmem[3] __read_mostly;
-int sysctl_tcp_rmem[3] __read_mostly;
+EXPORT_SYMBOL(sysctl_tcp_wmem);
+int sysctl_tcp_rmem[3] __read_mostly;
EXPORT_SYMBOL(sysctl_tcp_rmem);
-EXPORT_SYMBOL(sysctl_tcp_wmem);
atomic_long_t tcp_memory_allocated; /* Current allocated memory. */
EXPORT_SYMBOL(tcp_memory_allocated);
-/*
- * Current number of TCP sockets.
+/* Current number of TCP sockets.
*/
struct percpu_counter tcp_sockets_allocated;
EXPORT_SYMBOL(tcp_sockets_allocated);
-/*
- * TCP splice context
+/* TCP splice context
*/
struct tcp_splice_state {
struct pipe_inode_info *pipe;
@@ -309,8 +308,7 @@ struct tcp_splice_state {
unsigned int flags;
};
-/*
- * Pressure flag: try to collapse.
+/* Pressure flag: try to collapse.
* Technical note: it is used by multiple contexts non atomically.
* All the __sk_mem_schedule() is of this nature: accounting
* is strict, actions are advisory and have some latency.
@@ -430,8 +428,7 @@ void tcp_init_sock(struct sock *sk)
}
EXPORT_SYMBOL(tcp_init_sock);
-/*
- * Wait for a TCP event.
+/* Wait for a TCP event.
*
* Note that we don't need to lock the socket, as the upper poll layers
* take care of normal races (between the test and the event) and we don't
@@ -454,8 +451,7 @@ unsigned int tcp_poll(struct file *file, struct socket *sock, poll_table *wait)
mask = 0;
- /*
- * POLLHUP is certainly not done right. But poll() doesn't
+ /* POLLHUP is certainly not done right. But poll() doesn't
* have a notion of HUP in just one direction, and for a
* socket the read side is more interesting.
*
@@ -498,7 +494,8 @@ unsigned int tcp_poll(struct file *file, struct socket *sock, poll_table *wait)
/* Potential race condition. If read of tp below will
* escape above sk->sk_state, we can be illegally awaken
- * in SYN_* states. */
+ * in SYN_* states.
+ */
if (tp->rcv_nxt - tp->copied_seq >= target)
mask |= POLLIN | POLLRDNORM;
@@ -509,14 +506,15 @@ unsigned int tcp_poll(struct file *file, struct socket *sock, poll_table *wait)
set_bit(SOCK_ASYNC_NOSPACE,
&sk->sk_socket->flags);
set_bit(SOCK_NOSPACE, &sk->sk_socket->flags);
-
- /* Race breaker. If space is freed after
- * wspace test but before the flags are set,
- * IO signal will be lost.
- */
- if (sk_stream_wspace(sk) >= sk_stream_min_wspace(sk))
- mask |= POLLOUT | POLLWRNORM;
}
+
+ /* Race breaker. If space is freed after
+ * wspace test but before the flags are set,
+ * IO signal will be lost.
+ */
+ if (sk_stream_wspace(sk) >= sk_stream_min_wspace(sk)
+ && sk_stream_wspace(sk) >= sk_stream_min_wspace(sk))
+ mask |= POLLOUT | POLLWRNORM;
} else
mask |= POLLOUT | POLLWRNORM;
@@ -634,7 +632,7 @@ static inline void tcp_push(struct sock *sk, int flags, int mss_now,
tcp_mark_urg(tp, flags);
__tcp_push_pending_frames(sk, mss_now,
- (flags & MSG_MORE) ? TCP_NAGLE_CORK : nonagle);
+ (flags & MSG_MORE) ? TCP_NAGLE_CORK : nonagle);
}
}
@@ -839,6 +837,7 @@ static ssize_t do_tcp_sendpages(struct sock *sk, struct page *page, int offset,
int err;
ssize_t copied;
long timeo = sock_sndtimeo(sk, flags & MSG_DONTWAIT);
+ int ass_res = 0;
/* Wait for a connection to finish. One exception is TCP Fast Open
* (passive side) where data is allowed to be sent before a connection
@@ -846,7 +845,8 @@ static ssize_t do_tcp_sendpages(struct sock *sk, struct page *page, int offset,
*/
if (((1 << sk->sk_state) & ~(TCPF_ESTABLISHED | TCPF_CLOSE_WAIT)) &&
!tcp_passive_fastopen(sk)) {
- if ((err = sk_stream_wait_connect(sk, &timeo)) != 0)
+ ass_res = (err = sk_stream_wait_connect(sk, &timeo));
+ if (ass_res != 0)
goto out_err;
}
@@ -864,7 +864,8 @@ static ssize_t do_tcp_sendpages(struct sock *sk, struct page *page, int offset,
int copy, i;
bool can_coalesce;
- if (!tcp_send_head(sk) || (copy = size_goal - skb->len) <= 0) {
+ ass_res = (copy = size_goal - skb->len);
+ if (!tcp_send_head(sk) || ass_res <= 0) {
new_segment:
if (!sk_stream_memory_free(sk))
goto wait_for_sndbuf;
@@ -911,7 +912,9 @@ new_segment:
copied += copy;
offset += copy;
- if (!(size -= copy))
+
+ ass_res = (size -= copy);
+ if (!ass_res)
goto out;
if (skb->len < size_goal || (flags & MSG_OOB))
@@ -929,7 +932,8 @@ wait_for_sndbuf:
wait_for_memory:
tcp_push(sk, flags & ~MSG_MORE, mss_now, TCP_NAGLE_PUSH);
- if ((err = sk_stream_wait_memory(sk, &timeo)) != 0)
+ ass_res = (err = sk_stream_wait_memory(sk, &timeo));
+ if (ass_res != 0)
goto do_error;
mss_now = tcp_send_mss(sk, &size_goal, flags);
@@ -1029,6 +1033,7 @@ int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
int mss_now = 0, size_goal, copied_syn = 0, offset = 0;
bool sg;
long timeo;
+ int ass_res = 0;
lock_sock(sk);
@@ -1050,7 +1055,8 @@ int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
*/
if (((1 << sk->sk_state) & ~(TCPF_ESTABLISHED | TCPF_CLOSE_WAIT)) &&
!tcp_passive_fastopen(sk)) {
- if ((err = sk_stream_wait_connect(sk, &timeo)) != 0)
+ ass_res = (err = sk_stream_wait_connect(sk, &timeo));
+ if (ass_res != 0)
goto do_error;
}
@@ -1099,7 +1105,7 @@ int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
}
while (seglen > 0) {
- int copy = 0;
+ int copy = 0, ass_res = 0;
int max = size_goal;
skb = tcp_write_queue_tail(sk);
@@ -1123,8 +1129,7 @@ new_segment:
if (!skb)
goto wait_for_memory;
- /*
- * Check whether we can use HW checksum.
+ /* Check whether we can use HW checksum.
*/
if (sk->sk_route_caps & NETIF_F_ALL_CSUM)
skb->ip_summed = CHECKSUM_PARTIAL;
@@ -1162,7 +1167,8 @@ new_segment:
merge = false;
}
- copy = min_t(int, copy, pfrag->size - pfrag->offset);
+ copy = min_t(int, copy,
+ pfrag->size - pfrag->offset);
if (!sk_wmem_schedule(sk, copy))
goto wait_for_memory;
@@ -1176,7 +1182,8 @@ new_segment:
/* Update the skb. */
if (merge) {
- skb_frag_size_add(&skb_shinfo(skb)->frags[i - 1], copy);
+ skb_frag_size_add(
+ &skb_shinfo(skb)->frags[i - 1], copy);
} else {
skb_fill_page_desc(skb, i, pfrag->page,
pfrag->offset, copy);
@@ -1194,15 +1201,19 @@ new_segment:
from += copy;
copied += copy;
- if ((seglen -= copy) == 0 && iovlen == 0)
+ ass_res = (seglen -= copy);
+ if (ass_res == 0 && iovlen == 0)
goto out;
- if (skb->len < max || (flags & MSG_OOB) || unlikely(tp->repair))
+ if (skb->len < max ||
+ (flags & MSG_OOB) ||
+ unlikely(tp->repair))
continue;
if (forced_push(tp)) {
tcp_mark_push(tp, skb);
- __tcp_push_pending_frames(sk, mss_now, TCP_NAGLE_PUSH);
+ __tcp_push_pending_frames(sk, mss_now,
+ TCP_NAGLE_PUSH);
} else if (skb == tcp_send_head(sk))
tcp_push_one(sk, mss_now);
continue;
@@ -1211,9 +1222,11 @@ wait_for_sndbuf:
set_bit(SOCK_NOSPACE, &sk->sk_socket->flags);
wait_for_memory:
if (copied)
- tcp_push(sk, flags & ~MSG_MORE, mss_now, TCP_NAGLE_PUSH);
+ tcp_push(sk, flags & ~MSG_MORE,
+ mss_now, TCP_NAGLE_PUSH);
- if ((err = sk_stream_wait_memory(sk, &timeo)) != 0)
+ ass_res = (err = sk_stream_wait_memory(sk, &timeo));
+ if (ass_res != 0)
goto do_error;
mss_now = tcp_send_mss(sk, &size_goal, flags);
@@ -1246,8 +1259,7 @@ out_err:
}
EXPORT_SYMBOL(tcp_sendmsg);
-/*
- * Handle reading urgent data. BSD has very simple semantics for
+/* Handle reading urgent data. BSD has very simple semantics for
* this, no blocking and very strange errors 8)
*/
@@ -1333,7 +1345,8 @@ void tcp_cleanup_rbuf(struct sock *sk, int copied)
if (inet_csk_ack_scheduled(sk)) {
const struct inet_connection_sock *icsk = inet_csk(sk);
/* Delayed ACKs frequently hit locked sockets during bulk
- * receive. */
+ * receive.
+ */
if (icsk->icsk_ack.blocked ||
/* Once-per-two-segments ACK was not sent by tcp_input.c */
tp->rcv_nxt - tp->rcv_wup > icsk->icsk_ack.rcv_mss ||
@@ -1366,7 +1379,8 @@ void tcp_cleanup_rbuf(struct sock *sk, int copied)
/* Send ACK now, if this read freed lots of space
* in our buffer. Certainly, new_window is new window.
- * We can advertise it now, if it is not less than current one.
+ * We can advertise it now, if it is not less than
+ * current one.
* "Lots" means "at least twice" here.
*/
if (new_window && new_window >= 2 * rcv_window_now)
@@ -1385,7 +1399,8 @@ static void tcp_prequeue_process(struct sock *sk)
NET_INC_STATS_USER(sock_net(sk), LINUX_MIB_TCPPREQUEUED);
/* RX process wants to run with disabled BHs, though it is not
- * necessary */
+ * necessary
+ */
local_bh_disable();
while ((skb = __skb_dequeue(&tp->ucopy.prequeue)) != NULL)
sk_backlog_rcv(sk, skb);
@@ -1445,8 +1460,7 @@ static inline struct sk_buff *tcp_recv_skb(struct sock *sk, u32 seq, u32 *off)
return NULL;
}
-/*
- * This routine provides an alternative to tcp_recvmsg() for routines
+/* This routine provides an alternative to tcp_recvmsg() for routines
* that would like to handle copying from skbuffs directly in 'sendfile'
* fashion.
* Note:
@@ -1526,8 +1540,7 @@ int tcp_read_sock(struct sock *sk, read_descriptor_t *desc,
}
EXPORT_SYMBOL(tcp_read_sock);
-/*
- * This routine copies from a sock struct into the user buffer.
+/* This routine copies from a sock struct into the user buffer.
*
* Technical note: in 2.3 we work on _locked_ socket, so that
* tricks with *seq access order and skb->users are not required.
@@ -1610,12 +1623,15 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
do {
u32 offset;
- /* Are we at urgent data? Stop if we have read anything or have SIGURG pending. */
+ /* Are we at urgent data? Stop if we have read
+ * anything or have SIGURG pending.
+ */
if (tp->urg_data && tp->urg_seq == *seq) {
if (copied)
break;
if (signal_pending(current)) {
- copied = timeo ? sock_intr_errno(timeo) : -EAGAIN;
+ copied = timeo ?
+ sock_intr_errno(timeo) : -EAGAIN;
break;
}
}
@@ -1744,7 +1760,8 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
tcp_service_net_dma(sk, true);
tcp_cleanup_rbuf(sk, copied);
} else
- dma_async_memcpy_issue_pending(tp->ucopy.dma_chan);
+ dma_async_memcpy_issue_pending(
+ tp->ucopy.dma_chan);
}
#endif
if (copied >= target) {
@@ -1760,12 +1777,15 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
#endif
if (user_recv) {
- int chunk;
+ int chunk, ass_res = 0;
/* __ Restore normal policy in scheduler __ */
- if ((chunk = len - tp->ucopy.len) != 0) {
- NET_ADD_STATS_USER(sock_net(sk), LINUX_MIB_TCPDIRECTCOPYFROMBACKLOG, chunk);
+ ass_res = (chunk = len - tp->ucopy.len);
+ if (ass_res != 0) {
+ NET_ADD_STATS_USER(sock_net(sk),
+ LINUX_MIB_TCPDIRECTCOPYFROMBACKLOG,
+ chunk);
len -= chunk;
copied += chunk;
}
@@ -1775,8 +1795,11 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
do_prequeue:
tcp_prequeue_process(sk);
- if ((chunk = len - tp->ucopy.len) != 0) {
- NET_ADD_STATS_USER(sock_net(sk), LINUX_MIB_TCPDIRECTCOPYFROMPREQUEUE, chunk);
+ ass_res = (chunk = len - tp->ucopy.len);
+ if (ass_res != 0) {
+ NET_ADD_STATS_USER(sock_net(sk),
+ LINUX_MIB_TCPDIRECTCOPYFROMPREQUEUE,
+ chunk);
len -= chunk;
copied += chunk;
}
@@ -1791,7 +1814,7 @@ do_prequeue:
}
continue;
- found_ok_skb:
+found_ok_skb:
/* Ok so how much can we use? */
used = skb->len - offset;
if (len < used)
@@ -1800,19 +1823,18 @@ do_prequeue:
/* Do we have urgent data here? */
if (tp->urg_data) {
u32 urg_offset = tp->urg_seq - *seq;
- if (urg_offset < used) {
- if (!urg_offset) {
- if (!sock_flag(sk, SOCK_URGINLINE)) {
- ++*seq;
- urg_hole++;
- offset++;
- used--;
- if (!used)
- goto skip_copy;
- }
- } else
- used = urg_offset;
+ if (urg_offset < used && !urg_offset) {
+ if (!sock_flag(sk, SOCK_URGINLINE)) {
+ ++*seq;
+ urg_hole++;
+ offset++;
+ used--;
+ if (!used)
+ goto skip_copy;
+ }
}
+ if (urg_offset < used && urg_offset)
+ used = urg_offset;
}
if (!(flags & MSG_TRUNC)) {
@@ -1821,7 +1843,9 @@ do_prequeue:
tp->ucopy.dma_chan = net_dma_find_channel();
if (tp->ucopy.dma_chan) {
- tp->ucopy.dma_cookie = dma_skb_copy_datagram_iovec(
+ tp->ucopy.dma_cookie =
+ dma_skb_copy_datagram_iovec(
+
tp->ucopy.dma_chan, skb, offset,
msg->msg_iov, used,
tp->ucopy.pinned_list);
@@ -1837,7 +1861,8 @@ do_prequeue:
break;
}
- dma_async_memcpy_issue_pending(tp->ucopy.dma_chan);
+ dma_async_memcpy_issue_pending(
+ tp->ucopy.dma_chan);
if ((offset + used) == skb->len)
copied_early = true;
@@ -1878,7 +1903,7 @@ skip_copy:
}
continue;
- found_fin_ok:
+found_fin_ok:
/* Process the FIN. */
++*seq;
if (!(flags & MSG_PEEK)) {
@@ -1890,14 +1915,17 @@ skip_copy:
if (user_recv) {
if (!skb_queue_empty(&tp->ucopy.prequeue)) {
- int chunk;
+ int chunk, ass_res = 0;
tp->ucopy.len = copied > 0 ? len : 0;
tcp_prequeue_process(sk);
- if (copied > 0 && (chunk = len - tp->ucopy.len) != 0) {
- NET_ADD_STATS_USER(sock_net(sk), LINUX_MIB_TCPDIRECTCOPYFROMPREQUEUE, chunk);
+ ass_res = (chunk = len - tp->ucopy.len);
+ if (copied > 0 && ass_res != 0) {
+ NET_ADD_STATS_USER(sock_net(sk),
+ LINUX_MIB_TCPDIRECTCOPYFROMPREQUEUE,
+ chunk);
len -= chunk;
copied += chunk;
}
@@ -1971,13 +1999,13 @@ void tcp_set_state(struct sock *sk, int state)
sk->sk_state = state;
#ifdef STATE_TRACE
- SOCK_DEBUG(sk, "TCP sk=%p, State %s -> %s\n", sk, statename[oldstate], statename[state]);
+ SOCK_DEBUG(sk, "TCP sk=%p, State %s -> %s\n", sk,
+ statename[oldstate], statename[state]);
#endif
}
EXPORT_SYMBOL_GPL(tcp_set_state);
-/*
- * State processing on a close. This implements the state shift for
+/* State processing on a close. This implements the state shift for
* sending our FIN frame. Note that we only send a FIN for some
* states. A shutdown() may have already sent the FIN, or we may be
* closed.
@@ -2009,8 +2037,7 @@ static int tcp_close_state(struct sock *sk)
return next & TCP_ACTION_FIN;
}
-/*
- * Shutdown the sending side of a connection. Much like close except
+/* Shutdown the sending side of a connection. Much like close except
* that we don't receive shut down or sock_set_flag(sk, SOCK_DEAD).
*/
@@ -2125,7 +2152,7 @@ void tcp_close(struct sock *sk, long timeout)
* required by specs (TCP_ESTABLISHED, TCP_CLOSE_WAIT, when
* they look as CLOSING or LAST_ACK for Linux)
* Probably, I missed some more holelets.
- * --ANK
+ * --ANK
* XXX (TFO) - To start off we don't support SYN+ACK+FIN
* in a single packet! (May consider it later but will
* probably need API support or TCP_CORK SYN-ACK until
@@ -2235,6 +2262,7 @@ int tcp_disconnect(struct sock *sk, int flags)
struct inet_connection_sock *icsk = inet_csk(sk);
struct tcp_sock *tp = tcp_sk(sk);
int err = 0;
+ int ass_res = 0;
int old_state = sk->sk_state;
if (old_state != TCP_CLOSE)
@@ -2272,7 +2300,8 @@ int tcp_disconnect(struct sock *sk, int flags)
sk->sk_shutdown = 0;
sock_reset_flag(sk, SOCK_DONE);
tp->srtt = 0;
- if ((tp->write_seq += tp->max_window + 2) == 0)
+ ass_res = (tp->write_seq += tp->max_window + 2);
+ if (ass_res == 0)
tp->write_seq = 1;
icsk->icsk_backoff = 0;
tp->snd_cwnd = 2;
@@ -2358,8 +2387,7 @@ static int tcp_repair_options_est(struct tcp_sock *tp,
return 0;
}
-/*
- * Socket option code for TCP.
+/* Socket option code for TCP.
*/
static int do_tcp_setsockopt(struct sock *sk, int level,
int optname, char __user *optval, unsigned int optlen)
@@ -2491,7 +2519,9 @@ static int do_tcp_setsockopt(struct sock *sk, int level,
case TCP_MAXSEG:
/* Values greater than interface MTU won't take effect. However
* at the point when this call is done we typically don't yet
- * know which interface is going to be used */
+ * know which interface is going to be used
+ */
+
if (val < TCP_MIN_MSS || val > MAX_TCP_WINDOW) {
err = -EINVAL;
break;
@@ -2509,6 +2539,7 @@ static int do_tcp_setsockopt(struct sock *sk, int level,
* an explicit push, which overrides even TCP_CORK
* for currently queued segments.
*/
+
tp->nonagle |= TCP_NAGLE_OFF|TCP_NAGLE_PUSH;
tcp_push_pending_frames(sk);
} else {
@@ -2786,7 +2817,8 @@ void tcp_get_info(const struct sock *sk, struct tcp_info *info)
info->tcpi_fackets = tp->fackets_out;
info->tcpi_last_data_sent = jiffies_to_msecs(now - tp->lsndtime);
- info->tcpi_last_data_recv = jiffies_to_msecs(now - icsk->icsk_ack.lrcvtime);
+ info->tcpi_last_data_recv =
+ jiffies_to_msecs(now - icsk->icsk_ack.lrcvtime);
info->tcpi_last_ack_recv = jiffies_to_msecs(now - tp->rcv_tstamp);
info->tcpi_pmtu = icsk->icsk_pmtu_cookie;
@@ -3378,12 +3410,12 @@ int tcp_md5_hash_skb_data(struct tcp_md5sig_pool *hp,
}
EXPORT_SYMBOL(tcp_md5_hash_skb_data);
-int tcp_md5_hash_key(struct tcp_md5sig_pool *hp, const struct tcp_md5sig_key *key)
+int tcp_md5_hash_key(struct tcp_md5sig_pool *hp, const struct tcp_md5sig_key *k)
{
struct scatterlist sg;
- sg_init_one(&sg, key->key, key->keylen);
- return crypto_hash_update(&hp->md5_desc, &sg, key->keylen);
+ sg_init_one(&sg, k->key, k->keylen);
+ return crypto_hash_update(&hp->md5_desc, &sg, k->keylen);
}
EXPORT_SYMBOL(tcp_md5_hash_key);
--
1.7.10.4
^ permalink raw reply related
* Re: [PATCH] pkt_sched: act_xt support new Xtables interface
From: Yury Stankevich @ 2012-12-20 8:54 UTC (permalink / raw)
To: Jamal Hadi Salim
Cc: Hasan Chowdhury, Stephen Hemminger, Jan Engelhardt,
netdev@vger.kernel.org, pablo, netfilter-devel
In-Reply-To: <50D1AB7E.5060000@mojatatu.com>
19.12.2012 15:56, Jamal Hadi Salim пишет:
> Hasan/Yury, if you test this please use the latest iproute2 with only
> the first patch I posted (originally from Hasan). Hasan please use that
> patch not your version - if theres anything wrong we can find out sooner
> before the patch becomes final.
Hello,
3.7.1 kernel with 3.7.0 iproute,
patch-xt, xt-p1 + linkage fix was applyed
command successfully performed, but actually doesn't work.
command:
tc filter add dev $dev parent ffff: protocol ip u32 match u32 0 0 \
action xt -j CONNMARK --restore-mark \
action mirred egress redirect dev ifb0
then i use filter:
tc filter add dev ifb0 protocol ip parent 1: prio 2 handle 0xa fw flowid
1:102
iptables line:
iptable -t mangle -A POSTROUTING -p tcp --dport 80 -m connmark --mark 0
-m connbytes --connbytes 204800: --connbytes-dir both --connbytes-mode
bytes -j CONNMARK --set-mark 0xa
once i run a test to download 300K file,
from iptables counters i can see that rule in POSTROUTING is triggered,
but from `tc -s qdisc show dev ifb0` i see that no packets was sent to
1:102 flow.
btw,
tc -p -s filter show dev ifb0 parent 1:
do not show stats `(rule hit 416 success 0)` for this (filter protocol
ip pref 2 fw handle 0xa classid 1:102) rule.
--
Linux registered user #402966 // pub 1024D/E99AF373 <pgp.mit.edu>
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" 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
* Re: at91sam9260 MACB problem with IP fragmentation
From: Erwin Rol @ 2012-12-20 9:17 UTC (permalink / raw)
To: Nicolas Ferre
Cc: linux-kernel, Havard Skinnemoen, linux-arm-kernel, matteo.fortini,
netdev
In-Reply-To: <50C09D2E.8050608@atmel.com>
Hallo Nicolas,
On 6-12-2012 14:27, Nicolas Ferre wrote:
> Erwin,
>
> On 12/06/2012 12:32 PM, Erwin Rol :
>> Hello Nicolas, Havard, all,
>>
>> I have a very obscure problem with a at91sam9260 board (almost 1 to 1
>> copy of the Atmel EK).
>>
>> The MACB seems to stall when I use large (>2 * MTU) UDP datagrams. The
>> test case is that a udp echo client (PC) sends datagrams with increasing
>> length to the AT91 until the max length of the UDP datagram is reached.
>> When there is no IP fragmentation everything is fine, but when the
>> datagrams are starting to get fragmented the AT91 will not reply
>> anymore. But as soon as some network traffic happens it goes on again,
>> and non of the data is lost.
<snip>
>> I tried several kernels including the test version from Nicolas that he
>> posted on LKML in October. They all show the same effect.
>
> [..]
>
> It seems that Matteo has the same behavior: check here:
> http://www.spinics.net/lists/netdev/msg218951.html
I tried Matteo's patch and it seems to work. But I don't know if the
patch is really the right solution. I checked again with wireshark and
it really seems the sending that stalls not the receiving. But as soon
as a ethernet frame is received the sending "un-stalls". So maybe the
patch just causes an MACB IRQ at certain moments that causes the sending
to continue?
> I am working on the macb driver right now, so I will try to reproduce
> and track this issue on my side.
Any luck reproducing it ?
- Erwin
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox