]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/log
linux-2.6-omap-h63xx.git
16 years agomac80211: filter scan results on unusable channels
Johannes Berg [Sun, 16 Mar 2008 17:42:44 +0000 (18:42 +0100)]
mac80211: filter scan results on unusable channels

When you have an AP on channel 13, it will currently often enough
be listed in scan results even when the regulatory domain restricts
to channels 1-11. This is due to channel overlap. To avoid getting
very strange failures, don't show such APs in the scan results. The
failure mode will now go from "I can see the AP but not associate"
to "I can't see the AP although I know it's there" which is easier
to debug.

This problem was first really noticed by Jes Sorensen.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Cc: Jes Sorensen <jes@trained-monkey.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agomac80211: use ieee80211_get_channel
Johannes Berg [Sun, 16 Mar 2008 17:35:56 +0000 (18:35 +0100)]
mac80211: use ieee80211_get_channel

Use the new ieee80211_get_channel() function instead of open-coding it.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agowireless: add wiphy channel freq to channel struct lookup helper
Johannes Berg [Sun, 16 Mar 2008 17:34:33 +0000 (18:34 +0100)]
wireless: add wiphy channel freq to channel struct lookup helper

Add ieee80211_get_channel() which gets you a channel struct for a
specific wiphy if that channel is present in that wiphy.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: move host command sending functions to core module
Tomas Winkler [Fri, 21 Mar 2008 20:53:44 +0000 (13:53 -0700)]
iwlwifi: move host command sending functions to core module

1. Host command sending functions moved from iwl4965-base.c to iwl-hcmd.c
in iwlcore module
2. enqueue_hcmd function currently stays in iwl4965-base.c. It is invoked
   through the new 'utils' field in priv's ops.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Assaf Krauss <assaf.krauss@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: rename iwl4965_get_channel_info to iwl_get_channel_info
Assaf Krauss [Fri, 21 Mar 2008 20:53:43 +0000 (13:53 -0700)]
iwlwifi: rename iwl4965_get_channel_info to iwl_get_channel_info

iwl4965_get_channel_info was moved to iwlcore module
4965 needs to be stripped off

Signed-off-by: Assaf Krauss <assaf.krauss@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: iwl3945 remove 4965 commands
Tomas Winkler [Fri, 21 Mar 2008 20:53:42 +0000 (13:53 -0700)]
iwlwifi: iwl3945 remove 4965 commands

This patch removes 4965 host commands from iwl-3945-commands.h

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi-2.6: enables RX TKIP decryption in HW
Emmanuel Grumbach [Thu, 20 Mar 2008 13:06:43 +0000 (15:06 +0200)]
iwlwifi-2.6: enables RX TKIP decryption in HW

This patch enables RX TKIP decryption in HW.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi-2.6: enables HW TKIP encryption
Emmanuel Grumbach [Wed, 19 Mar 2008 23:41:45 +0000 (16:41 -0700)]
iwlwifi-2.6: enables HW TKIP encryption

This patch add support for TKIP encryption (TX) in HW.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agomac80211: allows driver to request a Phase 1 RX key
Emmanuel Grumbach [Thu, 20 Mar 2008 13:06:42 +0000 (15:06 +0200)]
mac80211: allows driver to request a Phase 1 RX key

This patch makes mac80211 able to send a phase1 key for TKIP
decryption.
This is needed for drivers that don't do the rekeying by themselves
(i.e. iwlwifi). Upon IV16 wrap around, the packet is decrypted in SW,
if decryption is ok, mac80211 calls to update_tkip_key  with a new
phase 1 RX key.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agomac80211: get a TKIP phase key from skb
Emmanuel Grumbach [Thu, 20 Mar 2008 13:06:41 +0000 (15:06 +0200)]
mac80211: get a TKIP phase key from skb

This patch makes mac80211 able to compute a TKIP key from an skb.
The requested key can be a phase 1 or a phase 2 key.
This is useful for drivers who need to provide tkip key to their
HW to enable HW encryption.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi-2.6: RX status translation to old scheme
Emmanuel Grumbach [Wed, 19 Mar 2008 23:41:42 +0000 (16:41 -0700)]
iwlwifi-2.6: RX status translation to old scheme

This patch adds translation for the RX status of an incoming packet.
The incoming status has to be translated to the old scheme in order to know
if the decryption has been done, MIC failure has occured, TTAK is valid etc...
This translation is mandatory for all RX packets when using 5300 and for
all HT packets using 4965.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi-2.6: Cleans up set_key flow
Emmanuel Grumbach [Wed, 19 Mar 2008 23:41:41 +0000 (16:41 -0700)]
iwlwifi-2.6: Cleans up set_key flow

This patch cleans up the set_key flow. Rxon with hw encryption bit set is
not sent upon each call to set_key. Separation is made between global key
(WEP) and dynamic key (TKIP + CCMP and WEP in some cases).

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: Probe Flow - Extracting hw and priv init
Assaf Krauss [Fri, 14 Mar 2008 17:38:49 +0000 (10:38 -0700)]
iwlwifi: Probe Flow - Extracting hw and priv init

1. Extracting hw and priv initialization from probe function.
2. Moving some initialization functions to core module.

Signed-off-by: Assaf Krauss <assaf.krauss@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: Probe Flow - Performing allocation in a separate function
Assaf Krauss [Fri, 14 Mar 2008 17:38:48 +0000 (10:38 -0700)]
iwlwifi: Probe Flow - Performing allocation in a separate function

Performing allocation in a separate function (previously handled in
'probe')

Signed-off-by: Assaf Krauss <assaf.krauss@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: Packing all 4965 parameters
Assaf Krauss [Fri, 14 Mar 2008 17:38:47 +0000 (10:38 -0700)]
iwlwifi: Packing all 4965 parameters

This patch defines a package struct for iwlwifi parameters, and uses a
single instance of this struct to group all iwl4965 module parameters
together.

Signed-off-by: Assaf Krauss <assaf.krauss@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: Re-ordering probe flow (4965)
Assaf Krauss [Fri, 14 Mar 2008 17:38:46 +0000 (10:38 -0700)]
iwlwifi: Re-ordering probe flow (4965)

This patch re-orders the iwl4965_pci_probe function.

Signed-off-by: Assaf Krauss <assaf.krauss@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: remove macros containing offsets from eeprom struct
Reinette Chatre [Fri, 14 Mar 2008 17:38:45 +0000 (10:38 -0700)]
iwlwifi: remove macros containing offsets from eeprom struct

A user needing to access these fields can use offsetof() for
access. The comments still contain the offset to assist with
debugging.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
CC: Michael Buesch <mb@bu3sch.de>
Signed-off-by: Assaf Krauss <assaf.krauss@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agolibertas: store rssi as an u32
Holger Schurig [Wed, 19 Mar 2008 16:08:32 +0000 (17:08 +0100)]
libertas: store rssi as an u32

Don't store an (hardware base) u8 value in bss_descriptor, but just an
unsigned int (RSSI is really unsigned). Compilers generate more efficent
code for ints than for bytes.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agolibertas: remove lots of unused stuff
Holger Schurig [Wed, 19 Mar 2008 13:25:58 +0000 (14:25 +0100)]
libertas: remove lots of unused stuff

This removes many unused function parameters as well as some not-implemented
functions, e.g. CMD_802_11_GET_STATS. The silly lbs_set_cmd_ctrl_node()
function is now also gone.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agolibertas: misc power saving adjusts
Holger Schurig [Wed, 19 Mar 2008 13:25:18 +0000 (14:25 +0100)]
libertas: misc power saving adjusts

* firmware for the CF card supports power saving
* the driver currenly only accept "iwconfig ethX power on|off", so
  I fixed what the range wext ioctl reports.
* initialize value/flags in lbs_get_power()
* get rid of unused parameter psmode in lbs_ps_confirm_sleep()
* some minor debug output tweaks

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agolibertas: convert GET_LOG to a direct command
Holger Schurig [Mon, 17 Mar 2008 11:45:58 +0000 (12:45 +0100)]
libertas: convert GET_LOG to a direct command

Now uses __lbs_cmd() to get the "log" (it's actually more a snapshot of
various counters, not a sequential log). Besides the "mechanical" convertion
the patch add the following logical changes:

* Removes the priv->logmsg variable, it was only used in one place anyway,
  also don't blindly get the counters when associating. Getting the
  counters then the user asks via WEXT for them is good enought.
* don't set wstats.discard.fragment with log.rxfrag, because the latter is
  a counter for successfully received packets, not for fragmented packets.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agolibertas: fix scheduling while atomic bug in CMD_MAC_CONTROL
Holger Schurig [Tue, 18 Mar 2008 10:20:21 +0000 (11:20 +0100)]
libertas: fix scheduling while atomic bug in CMD_MAC_CONTROL

The old code incorrectly used lbs_cmd_with_response() and now uses
lbs_cmd_async().

While there I noticed that there is no real useful return values for
asynchronous command functions, so I made the function "void".

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agolibertas: make a handy lbs_cmd_async() command
Holger Schurig [Wed, 19 Mar 2008 09:11:00 +0000 (10:11 +0100)]
libertas: make a handy lbs_cmd_async() command

This uses a static lbs_cmd_async_callback function, which is a
noop. Just setting the callback argument to __lbs_cmd_async()
to NULL won't work, because then the cmdnode wouldn't be
released.

This also makes __lbs_cmd_async() a static method, which is
now only used by lbs_cmd() and lbs_cmd_async().

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: Add debugfs to iwl core
Tomas Winkler [Wed, 12 Mar 2008 23:58:52 +0000 (16:58 -0700)]
iwlwifi: Add debugfs to iwl core

This patch adds debugfs support to iwl core
currently only iwl4965 is supported

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: Add TX/RX statistcs to driver
Tomas Winkler [Wed, 12 Mar 2008 23:58:51 +0000 (16:58 -0700)]
iwlwifi: Add TX/RX statistcs to driver

This patch supports collecting of TX and RX statistics in the driver.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: rename struct iwl4965_priv to struct iwl_priv
Tomas Winkler [Wed, 12 Mar 2008 23:58:50 +0000 (16:58 -0700)]
iwlwifi: rename struct iwl4965_priv to struct iwl_priv

This patch renames iwl4965_priv to iwl_priv. iwl_priv  will
be shared by more hw.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: rename iwl-4965-debug.h back to iwl-debug.h
Tomas Winkler [Wed, 12 Mar 2008 23:58:49 +0000 (16:58 -0700)]
iwlwifi: rename iwl-4965-debug.h back to iwl-debug.h

This patch removes iwl-4965-debug.h to iwl-debug.h
It will be used by more NICs

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: Bug fix, CCMP with HW encryption with AGG
Max Stepanov [Wed, 12 Mar 2008 23:58:48 +0000 (16:58 -0700)]
iwlwifi: Bug fix, CCMP with HW encryption with AGG

This patch fixes a bug in security. Enables CCMP HW encryption with
aggregations.

Signed-off-by: Max Stepanov <max.stepanov@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agolibertas: remove some unused commands
Holger Schurig [Wed, 12 Mar 2008 16:06:09 +0000 (17:06 +0100)]
libertas: remove some unused commands

Neither CMD_802_11_PAIRWISE_TSC nor CMD_802_11_GROUP_TSC is used or
documented. It might have something to do with TKIP sequence counters,
but that's just an educated guess. Remove all occurences of them.

CMD_CODE_DNLD is also neither used nor documented.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agolibertas: rename packetfilter to mac_control
Holger Schurig [Wed, 12 Mar 2008 15:06:43 +0000 (16:06 +0100)]
libertas: rename packetfilter to mac_control

The CMD_MAC_CONTROL can be used for other things than just filtering
packets, e.g. to enable and disable WMM. This uses the same term mac_control
for the define, the function and the shadow value in struct lbs_private.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agolibertas: convert CMD_MAC_CONTROL to a direct command
Holger Schurig [Wed, 12 Mar 2008 15:05:40 +0000 (16:05 +0100)]
libertas: convert CMD_MAC_CONTROL to a direct command

convert CMD_MAC_CONTROL to a direct command

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years ago[NET] NETNS: Omit namespace comparision without CONFIG_NET_NS.
YOSHIFUJI Hideaki [Tue, 25 Mar 2008 18:57:35 +0000 (03:57 +0900)]
[NET] NETNS: Omit namespace comparision without CONFIG_NET_NS.

Introduce an inline net_eq() to compare two namespaces.
Without CONFIG_NET_NS, since no namespace other than &init_net
exists, it is always 1.

We do not need to convert 1) inline vs inline and
2) inline vs &init_net comparisons.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
16 years ago[NET] NETNS: Omit neigh_parms->net and pneigh_entry->net without CONFIG_NET_NS.
YOSHIFUJI Hideaki [Tue, 25 Mar 2008 18:49:59 +0000 (03:49 +0900)]
[NET] NETNS: Omit neigh_parms->net and pneigh_entry->net without CONFIG_NET_NS.

Introduce neigh_parms/pneigh_entry inlines: neigh_parms_net(), pneigh_net().
Without CONFIG_NET_NS, no namespace other than &init_net exists.
Let's explicitly define them to help compiler optimizations.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
16 years ago[NET] NETNS: Omit seq_net_private->net without CONFIG_NET_NS.
YOSHIFUJI Hideaki [Tue, 25 Mar 2008 17:36:06 +0000 (02:36 +0900)]
[NET] NETNS: Omit seq_net_private->net without CONFIG_NET_NS.

Without CONFIG_NET_NS, no namespace other than &init_net exists,
no need to store net in seq_net_private.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
16 years ago[NET] NETNS: Omit sock->sk_net without CONFIG_NET_NS.
YOSHIFUJI Hideaki [Tue, 25 Mar 2008 17:26:21 +0000 (02:26 +0900)]
[NET] NETNS: Omit sock->sk_net without CONFIG_NET_NS.

Introduce per-sock inlines: sock_net(), sock_net_set()
and per-inet_timewait_sock inlines: twsk_net(), twsk_net_set().
Without CONFIG_NET_NS, no namespace other than &init_net exists.
Let's explicitly define them to help compiler optimizations.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
16 years ago[NET] NETNS: Omit net_device->nd_net without CONFIG_NET_NS.
YOSHIFUJI Hideaki [Tue, 25 Mar 2008 12:47:49 +0000 (21:47 +0900)]
[NET] NETNS: Omit net_device->nd_net without CONFIG_NET_NS.

Introduce per-net_device inlines: dev_net(), dev_net_set().
Without CONFIG_NET_NS, no namespace other than &init_net exists.
Let's explicitly define them to help compiler optimizations.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
16 years ago[IPV6]: Support Source Address Selection API (RFC5014).
YOSHIFUJI Hideaki [Tue, 25 Mar 2008 00:37:42 +0000 (09:37 +0900)]
[IPV6]: Support Source Address Selection API (RFC5014).

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
16 years ago[IPV6]: Use bitfields for hop_limit and mcast_hops.
YOSHIFUJI Hideaki [Mon, 10 Mar 2008 14:56:55 +0000 (10:56 -0400)]
[IPV6]: Use bitfields for hop_limit and mcast_hops.

Save some bits for future extensions.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
16 years ago[IPV6]: Optimize hop-limit determination.
YOSHIFUJI Hideaki [Mon, 10 Mar 2008 10:00:30 +0000 (06:00 -0400)]
[IPV6]: Optimize hop-limit determination.

Last part of hop-limit determination is always:
    hoplimit = dst_metric(dst, RTAX_HOPLIMIT);
    if (hoplimit < 0)
        hoplimit = ipv6_get_hoplimit(dst->dev).

Let's consolidate it as ip6_dst_hoplimit(dst).

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
16 years ago[IPV6]: Convert cork.hop_limit and cork.tclass into u8 instead of int.
YOSHIFUJI Hideaki [Mon, 10 Mar 2008 08:41:33 +0000 (04:41 -0400)]
[IPV6]: Convert cork.hop_limit and cork.tclass into u8 instead of int.

Values of those fields are always between 0 and 255 (inclusive),
so use u8 and save some memory on 32bit systems.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
16 years ago[IPV4,IPV6]: Share cork.rt between IPv4 and IPv6.
YOSHIFUJI Hideaki [Mon, 10 Mar 2008 08:30:37 +0000 (04:30 -0400)]
[IPV4,IPV6]: Share cork.rt between IPv4 and IPv6.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
16 years ago[IPV6] ADDRCONF: Clean-up ipv6_dev_get_saddr().
YOSHIFUJI Hideaki [Sun, 2 Mar 2008 01:48:21 +0000 (10:48 +0900)]
[IPV6] ADDRCONF: Clean-up ipv6_dev_get_saddr().

old:
|    text    data     bss     dec     hex filename
|   28599    1416      96   30111    759f net/ipv6/addrconf.o

new:
|    text    data     bss     dec     hex filename
|   28007    1416      96   29519    734f net/ipv6/addrconf.o

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
16 years ago[XFRM] MIP6: Fix address keys for routing search.
YOSHIFUJI Hideaki [Fri, 22 Feb 2008 05:48:22 +0000 (14:48 +0900)]
[XFRM] MIP6: Fix address keys for routing search.

Each MIPv6 XFRM state (DSTOPT/RH2) holds either destination or source
address to be mangled in the IPv6 header (that is "CoA").
On Inter-MN communication after both nodes binds each other,
they use route optimized traffic two MIPv6 states applied, and
both source and destination address in the IPv6 header
are replaced by the states respectively.
The packet format is correct, however, next-hop routing search
are not.
This patch fixes it by remembering address pairs for later states.

Based on patch from Masahide NAKAMURA <nakam@linux-ipv6.org>.

Signed-off-by: Masahide NAKAMURA <nakam@linux-ipv6.org>
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
16 years ago[XFRM] IPV6: Optimize __xfrm_tunnel_alloc_spi().
YOSHIFUJI Hideaki [Tue, 19 Feb 2008 13:54:00 +0000 (22:54 +0900)]
[XFRM] IPV6: Optimize __xfrm_tunnel_alloc_spi().

| % size old/net/ipv6/xfrm6_tunnel.o new/net/ipv6/xfrm6_tunnel.o
|    text    data     bss     dec     hex filename
|    1606      40    2080    3726     e8e old/net/ipv6/xfrm6_tunnel.o
|    1574      40    2080    3694     e6e new/net/ipv6/xfrm6_tunnel.o

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
16 years ago[XFRM] IPV6: Optimize xfrm6_input_addr().
YOSHIFUJI Hideaki [Tue, 19 Feb 2008 08:24:33 +0000 (17:24 +0900)]
[XFRM] IPV6: Optimize xfrm6_input_addr().

| % size old/net/ipv6/xfrm6_input.o new/net/ipv6/xfrm6_input.o
|    text    data     bss     dec     hex filename
|    1026       0       0    1026     402 old/net/ipv6/xfrm6_input.o
|     947       0       0     947     3b3 new/net/ipv6/xfrm6_input.o

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
16 years ago[XFRM] IPV6: Use distribution counting sort for xfrm_state/xfrm_tmpl chain.
YOSHIFUJI Hideaki [Tue, 19 Feb 2008 01:15:27 +0000 (10:15 +0900)]
[XFRM] IPV6: Use distribution counting sort for xfrm_state/xfrm_tmpl chain.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
16 years ago[NETNS]: Enable TCP/UDP/ICMP inside namespace.
Denis V. Lunev [Mon, 24 Mar 2008 22:34:06 +0000 (15:34 -0700)]
[NETNS]: Enable TCP/UDP/ICMP inside namespace.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETNS]: Allow to create sockets in non-initial namespace.
Denis V. Lunev [Mon, 24 Mar 2008 22:33:42 +0000 (15:33 -0700)]
[NETNS]: Allow to create sockets in non-initial namespace.

Allow to create sockets in the namespace if the protocol ok with this.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETNS]: Drop packets in the non-initial namespace on the per/protocol basis.
Denis V. Lunev [Mon, 24 Mar 2008 22:33:00 +0000 (15:33 -0700)]
[NETNS]: Drop packets in the non-initial namespace on the per/protocol basis.

IP layer now can handle multiple namespaces normally. So, process such
packets normally and drop them only if the transport layer is not
aware about namespaces.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETNS]: Process netfilter hooks in initial namespace only.
Denis V. Lunev [Mon, 24 Mar 2008 22:32:09 +0000 (15:32 -0700)]
[NETNS]: Process netfilter hooks in initial namespace only.

There were no packets in the namespace other than initial
previously. This will be changed in the neareast future. Netfilters
are not namespace aware and should be processed in the initial
namespace only for now.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETNS]: Process INET socket layer in the correct namespace.
Denis V. Lunev [Mon, 24 Mar 2008 22:31:35 +0000 (15:31 -0700)]
[NETNS]: Process INET socket layer in the correct namespace.

Replace all the reast of the init_net with a proper net on the socket
layer.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETNS]: Process IP layer in the context of the correct namespace.
Denis V. Lunev [Mon, 24 Mar 2008 22:31:00 +0000 (15:31 -0700)]
[NETNS]: Process IP layer in the context of the correct namespace.

Replace all the rest of the init_net with a proper net on the IP layer.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETNS]: Add namespace parameter to ip_cmsg_send.
Denis V. Lunev [Mon, 24 Mar 2008 22:30:27 +0000 (15:30 -0700)]
[NETNS]: Add namespace parameter to ip_cmsg_send.

Pass the init_net there for now.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETNS]: Add namespace parameter to ip_options_get(...).
Denis V. Lunev [Mon, 24 Mar 2008 22:29:55 +0000 (15:29 -0700)]
[NETNS]: Add namespace parameter to ip_options_get(...).

Pass the init_net there for now.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETNS]: Add namespace parameter to ip_options_compile.
Denis V. Lunev [Mon, 24 Mar 2008 22:29:23 +0000 (15:29 -0700)]
[NETNS]: Add namespace parameter to ip_options_compile.

ip_options_compile uses inet_addr_type which requires a namespace. The
packet argument is optional, so parameter is the only way to obtain
it. Pass the init_net there for now.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETNS]: /proc/net/arp namespacing.
Denis V. Lunev [Mon, 24 Mar 2008 22:28:43 +0000 (15:28 -0700)]
[NETNS]: /proc/net/arp namespacing.

Seqfile operation showing /proc/net/arp are already namespace
aware. All we need is to register this file for each namespace.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETNS]: Process ARP in the context of the correct namespace.
Denis V. Lunev [Mon, 24 Mar 2008 22:28:12 +0000 (15:28 -0700)]
[NETNS]: Process ARP in the context of the correct namespace.

Get namespace from a device and pass it to the routing engine. Enable
ARP packet processing and device notifiers after that.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETNS]: Minor information leak via /proc/net/ptype file.
Pavel Emelyanov [Mon, 24 Mar 2008 21:57:45 +0000 (14:57 -0700)]
[NETNS]: Minor information leak via /proc/net/ptype file.

This file displays the registered packet types, but some of them
(packet sockets creates such) can be bound to a net device and showing
them in a wrong namespace is not correct.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETNS][UDP-Lite]: Register /proc/net/udplite(6) in a namespace.
Pavel Emelyanov [Mon, 24 Mar 2008 21:56:57 +0000 (14:56 -0700)]
[NETNS][UDP-Lite]: Register /proc/net/udplite(6) in a namespace.

UDP-Lite sockets are displayed in another files, rather than
UDP ones, so make the present in namespaces as well.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[UDP-Lite]: Clean up proc creation a bit.
Pavel Emelyanov [Mon, 24 Mar 2008 21:56:34 +0000 (14:56 -0700)]
[UDP-Lite]: Clean up proc creation a bit.

Just introduce a helper to remove ifdefs from inside the
udplite4_register function. This will help to make the next patch
nicer.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETNS][TCP]: Register /proc/net/tcp in a namespace.
Pavel Emelyanov [Mon, 24 Mar 2008 21:56:02 +0000 (14:56 -0700)]
[NETNS][TCP]: Register /proc/net/tcp in a namespace.

After the commit f40c8174d3c21bf178283f3ef3aa8c7bf238fdec ([NETNS][IPV4]
tcp - make proc handle the network namespaces) it is now possible to make
this file present in newly created namespaces.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETNS][UDP]: Register /proc/net/udp in a namespace.
Pavel Emelyanov [Mon, 24 Mar 2008 21:53:49 +0000 (14:53 -0700)]
[NETNS][UDP]: Register /proc/net/udp in a namespace.

After the commit a91275eff43a527e1a25d6d034cbcd19ee323e64 ([NETNS][IPV6]
udp - make proc handle the network namespace) it is now possible to make
this file present in newly created namespaces.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoMerge branch 'master' of ../net-2.6/
David S. Miller [Mon, 24 Mar 2008 05:54:03 +0000 (22:54 -0700)]
Merge branch 'master' of ../net-2.6/

Conflicts:

net/ipv6/ndisc.c

16 years ago[CASSINI]: Use shorter list_splice_init() macro for brevity.
Robert P. J. Day [Mon, 24 Mar 2008 05:47:53 +0000 (22:47 -0700)]
[CASSINI]: Use shorter list_splice_init() macro for brevity.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[SCTP]: Remove redundant wrapper functions.
Florian Westphal [Mon, 24 Mar 2008 05:47:08 +0000 (22:47 -0700)]
[SCTP]: Remove redundant wrapper functions.

sctp_datamsg_free and sctp_datamsg_track are just aliases for
sctp_datamsg_put and sctp_chunk_hold, respectively.

Saves 32 Bytes on x86.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[SCTP]: Replace char msg[] with static const char[].
Florian Westphal [Mon, 24 Mar 2008 05:46:34 +0000 (22:46 -0700)]
[SCTP]: Replace char msg[] with static const char[].

133886    2004     220  136110   213ae sctp.new/sctp.o
134018    2004     220  136242   21432 sctp.old/sctp.o

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agofib_trie: print information on all routing tables
Stephen Hemminger [Mon, 24 Mar 2008 05:43:56 +0000 (22:43 -0700)]
fib_trie: print information on all routing tables

Make /proc/net/fib_trie and /proc/net/fib_triestat display
all routing tables, not just local and main.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[AF_PACKET]: Remove unused variable.
Jiri Olsa [Mon, 24 Mar 2008 05:42:34 +0000 (22:42 -0700)]
[AF_PACKET]: Remove unused variable.

Signed-off-by: Jiri Olsa <olsajiri@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[TCP]: Shrink syncookie_secret by 8 byte.
Florian Westphal [Mon, 24 Mar 2008 05:21:28 +0000 (22:21 -0700)]
[TCP]: Shrink syncookie_secret by 8 byte.

the first u32 copied from syncookie_secret is overwritten by the
minute-counter four lines below.  After adjusting the destination
address, the size of syncookie_secret can be reduced accordingly.

AFAICS, the only other user of syncookie_secret[] is the ipv6
syncookie support.  Because ipv6 syncookies only grab 44 bytes from
syncookie_secret[], this shouldn't affect them in any way.

With fixes from Glenn Griffin.

Signed-off-by: Florian Westphal <fw@strlen.de>
Acked-by: Glenn Griffin <ggriffin.kernel@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NET]: include/linux/udp.h - remove duplicate include
Joe Perches [Mon, 24 Mar 2008 05:06:51 +0000 (22:06 -0700)]
[NET]: include/linux/udp.h - remove duplicate include

Remove duplicate #include <linux/types.h>
Combine #ifdef __KERNEL__ blocks

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NET]: include/linux/igmp.h - remove duplicate include
Joe Perches [Mon, 24 Mar 2008 05:05:44 +0000 (22:05 -0700)]
[NET]: include/linux/igmp.h - remove duplicate include

Removed duplicate #include <linux/skbuff.h>
Combined #ifdef __KERNEL__ blocks

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NET]: include/linux/atalk.h - remove duplicate include
Joe Perches [Mon, 24 Mar 2008 05:04:31 +0000 (22:04 -0700)]
[NET]: include/linux/atalk.h - remove duplicate include

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NET]: include/net/route.h - remove duplicate include
Joe Perches [Mon, 24 Mar 2008 05:03:56 +0000 (22:03 -0700)]
[NET]: include/net/route.h - remove duplicate include

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agosch_htb: fix "too many events" situation
Martin Devera [Mon, 24 Mar 2008 05:00:38 +0000 (22:00 -0700)]
sch_htb: fix "too many events" situation

HTB is event driven algorithm and part of its work is to apply
scheduled events at proper times. It tried to defend itself from
livelock by processing only limited number of events per dequeue.
Because of faster computers some users already hit this hardcoded
limit.

This patch limits processing up to 2 jiffies (why not 1 jiffie ?
because it might stop prematurely when only fraction of jiffie
remains).

Signed-off-by: Martin Devera <devik@cdi.cz>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[IPV6]: Remove unused code in ndisc_send_redirect().
Rami Rosen [Mon, 24 Mar 2008 04:58:44 +0000 (21:58 -0700)]
[IPV6]: Remove unused code in ndisc_send_redirect().

This patches removes unused code in ndisc_send_redirect() method in
net/ipv6/ndisc.c.

Signed-off-by: Rami Rosen <ramirose@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoconnector: convert to single-threaded workqueue
Evgeniy Polyakov [Mon, 24 Mar 2008 04:51:12 +0000 (21:51 -0700)]
connector: convert to single-threaded workqueue

From: Evgeniy Polyakov <johnpol@2ka.mipt.ru>

We don't need one cqueue thread for each CPU.  cqueue is used for
receiving userspace datagrams, which are very rare and thus will
happily live with a single queue.

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[ATM]: When proc_create() fails, do some error handling work and return -ENOMEM.
Wang Chen [Mon, 24 Mar 2008 04:45:36 +0000 (21:45 -0700)]
[ATM]: When proc_create() fails, do some error handling work and return -ENOMEM.

Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[SUNGEM]: Fix NAPI assertion failure.
David S. Miller [Sun, 23 Mar 2008 10:35:12 +0000 (03:35 -0700)]
[SUNGEM]: Fix NAPI assertion failure.

As reported by Johannes Berg:

I started getting this warning with recent kernels:

[  773.908927] ------------[ cut here ]------------
[  773.908954] Badness at net/core/dev.c:2204
 ...

If we loop more than once in gem_poll(), we'll
use more than the real budget in our gem_rx()
calls, thus eventually trigger the caller's
assertions in net_rx_action().

Subtract "work_done" from "budget" for the second
arg to gem_rx() to fix the bug.

Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoBNX2X: prevent ethtool from setting port type
Eliezer Tamir [Sun, 23 Mar 2008 10:07:45 +0000 (03:07 -0700)]
BNX2X: prevent ethtool from setting port type

On 10GBaseT boards setting the type to TP will cause the driver to try
to configure 1GBaseT.
Since there are currently no boards that support setting of the port
type, disable this for now.

Signed-off-by: Eliezer Tamir <eliezert@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[8390]: Fix build error.
David S. Miller [Sun, 23 Mar 2008 01:33:28 +0000 (18:33 -0700)]
[8390]: Fix build error.

module_init() function reference is wrong.

Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoMerge branch 'upstream-net26' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik...
David S. Miller [Sun, 23 Mar 2008 01:22:42 +0000 (18:22 -0700)]
Merge branch 'upstream-net26' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6

Conflicts:

drivers/s390/net/qeth_main.c

16 years ago[9P] net/9p/trans_fd.c: remove unused variable
Julia Lawall [Sun, 23 Mar 2008 01:05:33 +0000 (18:05 -0700)]
[9P] net/9p/trans_fd.c: remove unused variable

The variable cb is initialized but never used otherwise.

The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@@
type T;
identifier i;
constant C;
@@

(
extern T i;
|
- T i;
  <+... when != i
- i = C;
  ...+>
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[IPV6] net/ipv6/ndisc.c: remove unused variable
Julia Lawall [Sun, 23 Mar 2008 01:04:16 +0000 (18:04 -0700)]
[IPV6] net/ipv6/ndisc.c: remove unused variable

The variable hlen is initialized but never used otherwise.

The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@@
type T;
identifier i;
constant C;
@@

(
extern T i;
|
- T i;
  <+... when != i
- i = C;
  ...+>
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[IPV4] fib_trie: fix warning from rcu_assign_poinger
Stephen Hemminger [Sun, 23 Mar 2008 00:59:58 +0000 (17:59 -0700)]
[IPV4] fib_trie: fix warning from rcu_assign_poinger

This gets rid of a warning caused by the test in rcu_assign_pointer.
I tried to fix rcu_assign_pointer, but that devolved into a long set
of discussions about doing it right that came to no real solution.
Since the test in rcu_assign_pointer for constant NULL would never
succeed in fib_trie, just open code instead.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[IPV4] route: use read_mostly
Stephen Hemminger [Sun, 23 Mar 2008 00:43:59 +0000 (17:43 -0700)]
[IPV4] route: use read_mostly

The route table parameters are set based on system memory and sysctl
values that almost never change. Also the genid only changes every
10 minutes.

RTprint is defined by never used.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[IPV4]: sk parameter is unused in ipv4_dst_blackhole.
Denis V. Lunev [Sun, 23 Mar 2008 00:42:37 +0000 (17:42 -0700)]
[IPV4]: sk parameter is unused in ipv4_dst_blackhole.

Just remove it.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NET]: NPROTO is redundant; it's equal to AF_MAX/PF_MAX.
Rusty Russell [Sun, 23 Mar 2008 00:18:47 +0000 (17:18 -0700)]
[NET]: NPROTO is redundant; it's equal to AF_MAX/PF_MAX.

DaveM pointed out NPROTO exposed to userspace, so keep it around,
just make sure it stays in sync.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[RAW]: Add raw_hashinfo member on struct proto.
Pavel Emelyanov [Sat, 22 Mar 2008 23:56:51 +0000 (16:56 -0700)]
[RAW]: Add raw_hashinfo member on struct proto.

Sorry for the patch sequence confusion :| but I found that the similar
thing can be done for raw sockets easily too late.

Expand the proto.h union with the raw_hashinfo member and use it in
raw_prot and rawv6_prot. This allows to drop the protocol specific
versions of hash and unhash callbacks.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[UDP]: Make full use of proto.h.udp_hash innovation.
Pavel Emelyanov [Sat, 22 Mar 2008 23:51:21 +0000 (16:51 -0700)]
[UDP]: Make full use of proto.h.udp_hash innovation.

After this we have only udp_lib_get_port to get the port and two
stubs for ipv4 and ipv6. No difference in udp and udplite except
for initialized h.udp_hash member.

I tried to find a graceful way to drop the only difference between
udp_v4_get_port and udp_v6_get_port (i.e. the rcv_saddr comparison
routine), but adding one more callback on the struct proto didn't
appear such :( Maybe later.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[SOCK]: Add udp_hash member to struct proto.
Pavel Emelyanov [Sat, 22 Mar 2008 23:50:58 +0000 (16:50 -0700)]
[SOCK]: Add udp_hash member to struct proto.

Inspired by the commit ab1e0a13 ([SOCK] proto: Add hashinfo member to
struct proto) from Arnaldo, I made similar thing for UDP/-Lite IPv4
and -v6 protocols.

The result is not that exciting, but it removes some levels of
indirection in udpxxx_get_port and saves some space in code and text.

The first step is to union existing hashinfo and new udp_hash on the
struct proto and give a name to this union, since future initialization
of tcpxxx_prot, dccp_vx_protinfo and udpxxx_protinfo will cause gcc
warning about inability to initialize anonymous member this way.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[IPV4]: Always pass ip_options pointer into ip_options_compile.
Denis V. Lunev [Sat, 22 Mar 2008 23:36:20 +0000 (16:36 -0700)]
[IPV4]: Always pass ip_options pointer into ip_options_compile.

This makes code a bit more uniform and straigthforward.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[IPV4]: Remove unused ip_options->is_data.
Denis V. Lunev [Sat, 22 Mar 2008 23:35:29 +0000 (16:35 -0700)]
[IPV4]: Remove unused ip_options->is_data.

ip_options->is_data is assigned only and never checked. The structure is
not a part of kernel interface to the userspace. So, it is safe to remove
this field.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[IPV4]: Remove unnecessary check for opt->is_data in ip_options_compile.
Denis V. Lunev [Sat, 22 Mar 2008 23:35:00 +0000 (16:35 -0700)]
[IPV4]: Remove unnecessary check for opt->is_data in ip_options_compile.

There is the only way to reach ip_options compile with opt != NULL:

ip_options_get_finish
    opt->is_data = 1;
    ip_options_compile(opt, NULL)

So, checking for is_data inside opt != NULL branch is not needed.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[TCP]: Let skbs grow over a page on fast peers
Herbert Xu [Sat, 22 Mar 2008 22:47:05 +0000 (15:47 -0700)]
[TCP]: Let skbs grow over a page on fast peers

While testing the virtio-net driver on KVM with TSO I noticed
that TSO performance with a 1500 MTU is significantly worse
compared to the performance of non-TSO with a 16436 MTU.  The
packet dump shows that most of the packets sent are smaller
than a page.

Looking at the code this actually is quite obvious as it always
stop extending the packet if it's the first packet yet to be
sent and if it's larger than the MSS.  Since each extension is
bound by the page size, this means that (given a 1500 MTU) we're
very unlikely to construct packets greater than a page, provided
that the receiver and the path is fast enough so that packets can
always be sent immediately.

The fix is also quite obvious.  The push calls inside the loop
is just an optimisation so that we don't end up doing all the
sending at the end of the loop.  Therefore there is no specific
reason why it has to do so at MSS boundaries.  For TSO, the
most natural extension of this optimisation is to do the pushing
once the skb exceeds the TSO size goal.

This is what the patch does and testing with KVM shows that the
TSO performance with a 1500 MTU easily surpasses that of a 16436
MTU and indeed the packet sizes sent are generally larger than
16436.

I don't see any obvious downsides for slower peers or connections,
but it would be prudent to test this extensively to ensure that
those cases don't regress.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[TCP]: TCP_DEFER_ACCEPT updates - process as established
Patrick McManus [Fri, 21 Mar 2008 23:33:01 +0000 (16:33 -0700)]
[TCP]: TCP_DEFER_ACCEPT updates - process as established

Change TCP_DEFER_ACCEPT implementation so that it transitions a
connection to ESTABLISHED after handshake is complete instead of
leaving it in SYN-RECV until some data arrvies. Place connection in
accept queue when first data packet arrives from slow path.

Benefits:
  - established connection is now reset if it never makes it
   to the accept queue

 - diagnostic state of established matches with the packet traces
   showing completed handshake

 - TCP_DEFER_ACCEPT timeouts are expressed in seconds and can now be
   enforced with reasonable accuracy instead of rounding up to next
   exponential back-off of syn-ack retry.

Signed-off-by: Patrick McManus <mcmanus@ducksong.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[TCP]: TCP_DEFER_ACCEPT updates - dont retxmt synack
Patrick McManus [Fri, 21 Mar 2008 23:29:22 +0000 (16:29 -0700)]
[TCP]: TCP_DEFER_ACCEPT updates - dont retxmt synack

a socket in LISTEN that had completed its 3 way handshake, but not notified
userspace because of SO_DEFER_ACCEPT, would retransmit the already
acked syn-ack during the time it was waiting for the first data byte
from the peer.

Signed-off-by: Patrick McManus <mcmanus@ducksong.com>
Acked-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[TCP]: TCP_DEFER_ACCEPT updates - defer timeout conflicts with max_thresh
Patrick McManus [Fri, 21 Mar 2008 23:27:38 +0000 (16:27 -0700)]
[TCP]: TCP_DEFER_ACCEPT updates - defer timeout conflicts with max_thresh

timeout associated with SO_DEFER_ACCEPT wasn't being honored if it was
less than the timeout allowed by the maximum syn-recv queue size
algorithm. Fix by using the SO_DEFER_ACCEPT value if the ack has
arrived.

Signed-off-by: Patrick McManus <mcmanus@ducksong.com>
Acked-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[DLCI]: Fix tiny race between module unload and sock_ioctl.
Pavel Emelyanov [Fri, 21 Mar 2008 22:58:52 +0000 (15:58 -0700)]
[DLCI]: Fix tiny race between module unload and sock_ioctl.

This is a narrow pedantry :) but the dlci_ioctl_hook check and call
should not be parted with the mutex lock.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agosocket: SOCK_DEBUG type checking
Stephen Hemminger [Fri, 21 Mar 2008 22:54:53 +0000 (15:54 -0700)]
socket: SOCK_DEBUG type checking

Use the inline trick (same as pr_debug) to get checking of debug
statements even if no code is generated.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NET]: NULL pointer dereference and other nasty things in /proc/net/(tcp|udp)[6]
Pavel Emelyanov [Fri, 21 Mar 2008 22:52:00 +0000 (15:52 -0700)]
[NET]: NULL pointer dereference and other nasty things in /proc/net/(tcp|udp)[6]

Commits f40c81 ([NETNS][IPV4] tcp - make proc handle the network
namespaces) and a91275 ([NETNS][IPV6] udp - make proc handle the
network namespace) both introduced bad checks on sockets and tw
buckets to belong to proper net namespace.

I.e. when checking for socket to belong to given net and family the

do {
sk = sk_next(sk);
} while (sk && sk->sk_net != net && sk->sk_family != family);

constructions were used. This is wrong, since as soon as the
sk->sk_net fits the net the socket is immediately returned, even if it
belongs to other family.

As the result four /proc/net/(udp|tcp)[6] entries show wrong info.
The udp6 entry even oopses when dereferencing inet6_sk(sk) pointer:

static void udp6_sock_seq_show(struct seq_file *seq, struct sock *sp, int bucket)
{
...
        struct ipv6_pinfo *np = inet6_sk(sp);
...

        dest  = &np->daddr; /* will be NULL for AF_INET sockets */
...
seq_printf(...
           dest->s6_addr32[0], dest->s6_addr32[1],
                   dest->s6_addr32[2], dest->s6_addr32[3],
...

Fix it by converting && to ||.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>