* [RFC patch net/next] net: Hoist assigns from if?
From: Joe Perches @ 2010-06-15 0:20 UTC (permalink / raw)
To: netdev; +Cc: David Miller
Awhile back I posted a script to reformat source code,
similar to Lindent, but able to select in a piecemeal
manner what source code style to convert.
http://lkml.org/lkml/2010/3/24/447
One of the options is to convert code from:
if ((err = function(args)) != NULL) {
to:
err = function(args);
if (err != NULL) {
I ran this script against net/ and get this result:
$ grep -rPl --include=*.[ch] "\bif\s*\(\s*\(" net/ | \
grep -v netfilter | \
xargs ./scripts/cvt_kernel_style.pl -o -convert=hoist_assigns_from_if
and after a little cleanup, compilation verification, etc
I get the diffstat below. Should I post the actual patch?
net/802/tr.c | 3 +-
net/appletalk/ddp.c | 15 +++++---
net/ax25/af_ax25.c | 34 ++++++++++++------
net/ax25/ax25_addr.c | 3 +-
net/ax25/ax25_dev.c | 18 ++++++---
net/ax25/ax25_ds_subr.c | 3 +-
net/ax25/ax25_iface.c | 3 +-
net/ax25/ax25_in.c | 12 ++++--
net/ax25/ax25_ip.c | 9 +++--
net/ax25/ax25_out.c | 21 +++++++----
net/ax25/ax25_route.c | 27 +++++++++-----
net/ax25/ax25_subr.c | 6 ++-
net/ax25/ax25_uid.c | 3 +-
net/ax25/sysctl_net_ax25.c | 3 +-
net/bluetooth/cmtp/capi.c | 3 +-
net/bluetooth/cmtp/core.c | 9 +++--
net/bluetooth/hci_conn.c | 21 +++++++----
net/bluetooth/hci_core.c | 45 ++++++++++++++++--------
net/bluetooth/hci_event.c | 18 ++++++---
net/bluetooth/hci_sock.c | 15 +++++---
net/bluetooth/rfcomm/sock.c | 3 +-
net/bluetooth/rfcomm/tty.c | 15 +++++---
net/bluetooth/sco.c | 15 +++++---
net/bridge/br_ioctl.c | 9 +++--
net/core/datagram.c | 24 ++++++++----
net/core/net-sysfs.c | 3 +-
net/core/netpoll.c | 30 +++++++++++-----
net/core/skbuff.c | 36 +++++++++++++------
net/dccp/ccids/ccid3.c | 3 +-
net/dccp/ipv4.c | 3 +-
net/dccp/proto.c | 6 ++-
net/decnet/af_decnet.c | 6 ++-
net/decnet/dn_dev.c | 36 +++++++++++++------
net/decnet/dn_fib.c | 15 +++++---
net/decnet/dn_nsp_in.c | 6 ++-
net/decnet/dn_nsp_out.c | 30 +++++++++++-----
net/decnet/dn_route.c | 24 ++++++++----
net/decnet/dn_table.c | 6 ++-
net/econet/af_econet.c | 17 +++++----
net/ipv4/ah4.c | 6 ++-
net/ipv4/arp.c | 18 ++++++---
net/ipv4/esp4.c | 6 ++-
net/ipv4/fib_hash.c | 3 +-
net/ipv4/fib_rules.c | 3 +-
net/ipv4/fib_semantics.c | 15 +++++---
net/ipv4/ip_fragment.c | 6 ++-
net/ipv4/ip_gre.c | 20 +++++++----
net/ipv4/ip_input.c | 3 +-
net/ipv4/ip_output.c | 21 +++++++----
net/ipv4/ipconfig.c | 45 ++++++++++++++++--------
net/ipv4/ipip.c | 20 +++++++----
net/ipv4/ipmr.c | 9 +++--
net/ipv4/route.c | 6 ++-
net/ipv4/tcp.c | 24 ++++++++----
net/ipv4/tcp_ipv4.c | 3 +-
net/ipv4/tcp_minisocks.c | 3 +-
net/ipv4/tcp_output.c | 6 ++-
net/ipv4/udp.c | 3 +-
net/ipv6/addrconf.c | 12 ++++--
net/ipv6/addrlabel.c | 8 +++--
net/ipv6/af_inet6.c | 12 ++++--
net/ipv6/ah6.c | 6 ++-
net/ipv6/datagram.c | 3 +-
net/ipv6/esp6.c | 6 ++-
net/ipv6/icmp.c | 6 ++-
net/ipv6/inet6_connection_sock.c | 3 +-
net/ipv6/ip6_input.c | 6 ++-
net/ipv6/ip6_output.c | 18 ++++++---
net/ipv6/ip6_tunnel.c | 23 +++++++-----
net/ipv6/raw.c | 3 +-
net/ipv6/reassembly.c | 3 +-
net/ipv6/sit.c | 15 +++++---
net/ipv6/tcp_ipv6.c | 12 ++++--
net/ipv6/udp.c | 6 ++-
net/ipx/af_ipx.c | 3 +-
net/irda/af_irda.c | 12 ++++--
net/irda/ircomm/ircomm_tty.c | 3 +-
net/irda/irlap_frame.c | 6 ++-
net/irda/irnet/irnet_irda.c | 6 ++-
net/irda/irqueue.c | 3 +-
net/key/af_key.c | 42 +++++++++++++++-------
net/lapb/lapb_out.c | 3 +-
net/lapb/lapb_subr.c | 6 ++-
net/netrom/af_netrom.c | 24 ++++++++----
net/netrom/nr_in.c | 3 +-
net/netrom/nr_loopback.c | 6 ++-
net/netrom/nr_out.c | 12 ++++--
net/netrom/nr_route.c | 30 +++++++++++-----
net/netrom/nr_subr.c | 6 ++-
net/packet/af_packet.c | 3 +-
net/rose/af_rose.c | 21 +++++++----
net/rose/rose_dev.c | 3 +-
net/rose/rose_link.c | 9 +++--
net/rose/rose_loopback.c | 3 +-
net/rose/rose_out.c | 3 +-
net/rose/rose_route.c | 39 ++++++++++++++-------
net/rose/rose_subr.c | 3 +-
net/sched/act_api.c | 3 +-
net/sched/act_ipt.c | 3 +-
net/sched/cls_api.c | 9 +++--
net/sched/cls_route.c | 21 +++++++----
net/sched/cls_rsvp.h | 6 ++-
net/sched/cls_u32.c | 3 +-
net/sched/sch_api.c | 30 +++++++++++-----
net/sched/sch_cbq.c | 33 +++++++++++------
net/sched/sch_gred.c | 3 +-
net/sched/sch_hfsc.c | 12 ++++--
net/sched/sch_htb.c | 24 ++++++++----
net/sched/sch_prio.c | 3 +-
net/sched/sch_teql.c | 9 +++--
net/sctp/input.c | 3 +-
net/sctp/inqueue.c | 3 +-
net/sctp/ipv6.c | 3 +-
net/sctp/protocol.c | 6 ++-
net/sctp/sm_make_chunk.c | 3 +-
net/sctp/socket.c | 4 +-
net/sunrpc/auth.c | 9 +++--
net/sunrpc/auth_gss/auth_gss.c | 9 +++--
net/sunrpc/auth_gss/gss_generic_token.c | 20 +++++++----
net/sunrpc/auth_gss/gss_krb5_seqnum.c | 3 +-
net/sunrpc/auth_gss/gss_mech_switch.c | 3 +-
net/sunrpc/auth_gss/gss_spkm3_token.c | 3 +-
net/sunrpc/auth_gss/gss_spkm3_unseal.c | 3 +-
net/sunrpc/clnt.c | 9 +++--
net/sunrpc/svcsock.c | 17 ++++++---
net/sunrpc/xdr.c | 3 +-
net/sunrpc/xprtsock.c | 18 ++++++---
net/tipc/bearer.c | 3 +-
net/tipc/core.c | 3 +-
net/tipc/link.c | 15 +++++---
net/tipc/net.c | 3 +-
net/tipc/socket.c | 18 ++++++---
net/tipc/user_reg.c | 3 +-
net/wireless/wext-core.c | 3 +-
net/x25/af_x25.c | 9 +++--
net/x25/x25_dev.c | 6 ++-
net/x25/x25_forward.c | 21 +++++++----
net/x25/x25_in.c | 3 +-
net/x25/x25_link.c | 6 ++-
net/x25/x25_out.c | 10 +++--
net/x25/x25_subr.c | 3 +-
net/xfrm/xfrm_policy.c | 21 +++++++----
net/xfrm/xfrm_state.c | 3 +-
net/xfrm/xfrm_user.c | 58 ++++++++++++++----------------
144 files changed, 1071 insertions(+), 564 deletions(-)
^ permalink raw reply
* Re: [PATCH] KVM: add schedule check to napi_enable call
From: Bruce Rogers @ 2010-06-14 20:44 UTC (permalink / raw)
To: Herbert Xu; +Cc: rusty, netdev
In-Reply-To: <20100606094048.GA1979@gondor.apana.org.au>
>>> On 6/6/2010 at 03:40 AM, Herbert Xu <herbert@gondor.apana.org.au> wrote:
> Bruce Rogers <brogers@novell.com> wrote:
>> Please consider this patch for the 2.6.32, 2.6.33, and 2.6.34 stable trees
> as well as current development trees. (I've only tested on 2.6.32 however)
>>
>> virtio_net: Add schedule check to napi_enable call
>> Under harsh testing conditions, including low memory, the guest would
>> stop receiving packets. With this patch applied we no longer see any
>> problems in the driver while performing these tests for extended periods
>> of time.
>>
>> Make sure napi is scheduled subsequent to each napi_enable.
>>
>> Signed-off-by: Bruce Rogers <brogers@novell.com>
>> Signed-off-by: Olaf Kirch <okir@suse.de>
>> Acked-by: Rusty Russell <rusty@rustcorp.com.au>
>> Cc: stable@kernel.org
>
> Looks good to me.
>
> Thanks!
Thanks for the review.
We are hoping to get this into our 2.6.32 based sle11 sp1 maintenance update. Are there any concerns with this patch?
Bruce
^ permalink raw reply
* Re: [PATCH] vlan_dev: VLAN 0 should be treated as "no vlan tag" (802.1p packet)
From: Eric Dumazet @ 2010-06-14 20:03 UTC (permalink / raw)
To: Joe Perches; +Cc: Pedro Garcia, Patrick McHardy, Ben Hutchings, netdev
In-Reply-To: <1276544573.4897.6.camel@Joe-Laptop.home>
Le lundi 14 juin 2010 à 12:42 -0700, Joe Perches a écrit :
> On Mon, 2010-06-14 at 19:11 +0200, Patrick McHardy wrote:
> > Additionally:
> > - the pr_debug statements may be useful for debugging, but are
> > a bit excessive for the final version
>
> Patrick, what's wrong with pr_debug?
> Do you prefer pr_devel?
In the patch context, this pr_debug() is not necessary.
Just remove it, since its a normal situation, no need to log anything,
ever.
^ permalink raw reply
* Re: [PATCH] vlan_dev: VLAN 0 should be treated as "no vlan tag" (802.1p packet)
From: Joe Perches @ 2010-06-14 19:42 UTC (permalink / raw)
To: Pedro Garcia, Patrick McHardy; +Cc: Ben Hutchings, netdev
In-Reply-To: <4C1662C3.3070708@trash.net>
On Mon, 2010-06-14 at 19:11 +0200, Patrick McHardy wrote:
> Ben Hutchings wrote:
> > On Mon, 2010-06-14 at 18:49 +0200, Pedro Garcia wrote:
> >> On Sun, 13 Jun 2010 22:56:30 +0100, Ben Hutchings
> >> <bhutchings@solarflare.com> wrote:
> >>> I have no particular opinion on this change, but you need to read and
> >>> follow Documentation/SubmittingPatches.
> >> Sorry, first kernel patch, and I did not know about it. I resubmit with
> >> the correct style / format:
> > Sorry, no you haven't.
> > - Networking changes go through David Miller's net-next-2.6 tree so you
> > need to use that as the baseline, not 2.6.26
> > - Patches should be applicable with -p1, not -p0 (so if you use diff,
> > you should run it from one directory level up)
> > - The patch was word-wrapped
Pedro, you could use git format-patch and git send-email
http://linux.yyz.us/git-howto.html
http://www.kernel.org/pub/software/scm/git/docs/git-format-patch.html
> Additionally:
> - the pr_debug statements may be useful for debugging, but are
> a bit excessive for the final version
Patrick, what's wrong with pr_debug?
Do you prefer pr_devel?
> - Please CC the maintainer (which is me)
scripts/get_maintainer.pl
^ permalink raw reply
* Re: [2.6.35-rc3 regression] TCP connections on 'lo' interface randomly stall
From: Thomas Bächler @ 2010-06-14 19:36 UTC (permalink / raw)
To: Randy Dunlap; +Cc: David S. Miller, John Fastabend, netdev, linux-kernel
In-Reply-To: <20100614112319.9a2758f2.randy.dunlap@oracle.com>
[-- Attachment #1: Type: text/plain, Size: 1073 bytes --]
Am 14.06.2010 20:23, schrieb Randy Dunlap:
> On Mon, 14 Jun 2010 20:10:27 +0200 Thomas Bächler wrote:
>
>> With 2.6.35-rc3, I cannot use TCP over the 'lo' interface any more. This
>> is reproduced easily by running 'ssh localhost' and executing a few
>> commands inside the ssh session (if you are able to log in, 'ls -lhFR /'
>> does a good job) - the connection will stall completely after a very
>> short time. As far as I can see, all applications are affected.
>>
>> It also seems that once a service is "stalled", I cannot open a new
>> connection to the same TCP port anymore. However, I can open a
>> connection to a different port until that one is stalled, too.
>>
>> Running wireshark, I can see that TCP retransmissions are sent, but
>> never acknowledged.
>>
>> Bisection (starting with 7908a9e as good and v2.6.35-rc3 as bad) leads
>> to the following commit. Please CC me on replies to this issue. Thanks
>> for your help.
>
> Does this patch fix it for you?
> http://lkml.org/lkml/2010/6/13/155
Yes, it seems to fix it. Thanks.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
^ permalink raw reply
* [RFC] [PATCH] ethtool: Flags for fibre speed switching
From: Ben Hutchings @ 2010-06-14 19:26 UTC (permalink / raw)
To: netdev; +Cc: Jeff Garzik, sf-linux-drivers
ethtool.h currently defines only SUPPORTED_FIBRE to cover all fibre
modes. However, SFP+ slots support both 1G and 10G fibre modules and
some modules are dual-speed. Some drivers use the BASE-T flags for SFP+
modules of all media types, but this is strictly incorrect and can be
confusing as there are real BASE-T modules for SFP+. There should be
distinct flags for fibre modes. However I'm not sure whether it's worth
defining flags for each fibre mode (there are quite a few) or only for
each speed.
Similarly there is only ADVERTISED_FIBRE to cover all fibre modes.
Although there is no AN protocol for fibre, an SFP+ NIC effectively
autonegotiates its speed with the module. By default, an SFP+ NIC will
accept both 1G and 10G modules and switch speed automatically. With a
dual-speed module, the NIC driver can allow forcing the speed through
ethtool, but unless it maintains some hidden state it must reset the
speed whenever the module is hotplugged (perhaps accidentally). So it
should be possible for the administrator to control speed selection in a
sticky way through the advertising mask.
Ben.
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index 2c8af09..e3decb9 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -664,6 +664,9 @@ struct ethtool_ops {
#define SUPPORTED_10000baseKX4_Full (1 << 18)
#define SUPPORTED_10000baseKR_Full (1 << 19)
#define SUPPORTED_10000baseR_FEC (1 << 20)
+#define SUPPORTED_1000_FIBRE (1 << 21)
+#define SUPPORTED_10000_FIBRE (1 << 22)
+#define SUPPORTED_40000_FIBRE (1 << 23)
/* Indicates what features are advertised by the interface. */
#define ADVERTISED_10baseT_Half (1 << 0)
@@ -687,6 +690,9 @@ struct ethtool_ops {
#define ADVERTISED_10000baseKX4_Full (1 << 18)
#define ADVERTISED_10000baseKR_Full (1 << 19)
#define ADVERTISED_10000baseR_FEC (1 << 20)
+#define ADVERTISED_1000_FIBRE (1 << 21)
+#define ADVERTISED_10000_FIBRE (1 << 22)
+#define ADVERTISED_40000_FIBRE (1 << 23)
/* The following are all involved in forcing a particular link
* mode for the device for setting things. When getting the
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply related
* Re: [PATCH] vlan_dev: VLAN 0 should be treated as "no vlan tag" (802.1p packet)
From: Eric Dumazet @ 2010-06-14 19:12 UTC (permalink / raw)
To: Patrick McHardy; +Cc: Ben Hutchings, Pedro Garcia, netdev
In-Reply-To: <4C1662C3.3070708@trash.net>
Le lundi 14 juin 2010 à 19:11 +0200, Patrick McHardy a écrit :
> Ben Hutchings wrote:
> > On Mon, 2010-06-14 at 18:49 +0200, Pedro Garcia wrote:
> >
> >> On Sun, 13 Jun 2010 22:56:30 +0100, Ben Hutchings
> >> <bhutchings@solarflare.com> wrote:
> >>
> >>> I have no particular opinion on this change, but you need to read and
> >>> follow Documentation/SubmittingPatches.
> >>>
> >>> Ben.
> >>>
> >> Sorry, first kernel patch, and I did not know about it. I resubmit with
> >> the correct style / format:
> >>
> > [...]
> >
> > Sorry, no you haven't.
> >
> > - Networking changes go through David Miller's net-next-2.6 tree so you
> > need to use that as the baseline, not 2.6.26
> > - Patches should be applicable with -p1, not -p0 (so if you use diff,
> > you should run it from one directory level up)
> > - The patch was word-wrapped
>
> Additionally:
>
> - please use the proper comment style, meaning each line begins
> with a '*'
>
> - the pr_debug statements may be useful for debugging, but are
> a bit excessive for the final version
>
> - + /* 2010-06-13: Pedro Garcia
>
> We have changelogs for this, simply explaining what the code
> does is enough.
>
> - Please CC the maintainer (which is me)
> --
Pedro, we have two kind of vlan setups :
accelerated and non accelerated ones.
Your patch address non accelated ones only, since you only touch
vlan_skb_recv()
Accelerated vlan can follow these paths :
1) NAPI devices
vlan_gro_receive() -> vlan_gro_common()
2) non NAPI devices
__vlan_hwaccel_rx()
So you might also patch __vlan_hwaccel_rx() and vlan_gro_common()
Please merge following bits to your patch submission :
http://kerneltrap.org/mailarchive/linux-netdev/2010/5/23/6277868
Good luck for your first patch !
^ permalink raw reply
* [PATCH] ethtool: Revert incorrect indentation changes
From: Ben Hutchings @ 2010-06-14 18:53 UTC (permalink / raw)
To: David Miller; +Cc: laurent chavey, netdev
commit 97f8aefbbfb5aa5c9944e5fa8149f1fdaf71c7b6 "net: fix ethtool
coding style errors and warnings" changed the indentation of several
macro definitions in ethtool.h. These definitions line up in the diff
where there is an extra character at the start of each line, but not
in the resulting file.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
include/linux/ethtool.h | 40 ++++++++++++++++++++--------------------
1 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index 276b40a..2c8af09 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -586,29 +586,29 @@ struct ethtool_ops {
#define ETHTOOL_GREGS 0x00000004 /* Get NIC registers. */
#define ETHTOOL_GWOL 0x00000005 /* Get wake-on-lan options. */
#define ETHTOOL_SWOL 0x00000006 /* Set wake-on-lan options. */
-#define ETHTOOL_GMSGLVL 0x00000007 /* Get driver message level */
-#define ETHTOOL_SMSGLVL 0x00000008 /* Set driver msg level. */
+#define ETHTOOL_GMSGLVL 0x00000007 /* Get driver message level */
+#define ETHTOOL_SMSGLVL 0x00000008 /* Set driver msg level. */
#define ETHTOOL_NWAY_RST 0x00000009 /* Restart autonegotiation. */
#define ETHTOOL_GLINK 0x0000000a /* Get link status (ethtool_value) */
-#define ETHTOOL_GEEPROM 0x0000000b /* Get EEPROM data */
-#define ETHTOOL_SEEPROM 0x0000000c /* Set EEPROM data. */
+#define ETHTOOL_GEEPROM 0x0000000b /* Get EEPROM data */
+#define ETHTOOL_SEEPROM 0x0000000c /* Set EEPROM data. */
#define ETHTOOL_GCOALESCE 0x0000000e /* Get coalesce config */
#define ETHTOOL_SCOALESCE 0x0000000f /* Set coalesce config. */
#define ETHTOOL_GRINGPARAM 0x00000010 /* Get ring parameters */
#define ETHTOOL_SRINGPARAM 0x00000011 /* Set ring parameters. */
#define ETHTOOL_GPAUSEPARAM 0x00000012 /* Get pause parameters */
#define ETHTOOL_SPAUSEPARAM 0x00000013 /* Set pause parameters. */
-#define ETHTOOL_GRXCSUM 0x00000014 /* Get RX hw csum enable (ethtool_value) */
-#define ETHTOOL_SRXCSUM 0x00000015 /* Set RX hw csum enable (ethtool_value) */
-#define ETHTOOL_GTXCSUM 0x00000016 /* Get TX hw csum enable (ethtool_value) */
-#define ETHTOOL_STXCSUM 0x00000017 /* Set TX hw csum enable (ethtool_value) */
+#define ETHTOOL_GRXCSUM 0x00000014 /* Get RX hw csum enable (ethtool_value) */
+#define ETHTOOL_SRXCSUM 0x00000015 /* Set RX hw csum enable (ethtool_value) */
+#define ETHTOOL_GTXCSUM 0x00000016 /* Get TX hw csum enable (ethtool_value) */
+#define ETHTOOL_STXCSUM 0x00000017 /* Set TX hw csum enable (ethtool_value) */
#define ETHTOOL_GSG 0x00000018 /* Get scatter-gather enable
* (ethtool_value) */
#define ETHTOOL_SSG 0x00000019 /* Set scatter-gather enable
* (ethtool_value). */
#define ETHTOOL_TEST 0x0000001a /* execute NIC self-test. */
#define ETHTOOL_GSTRINGS 0x0000001b /* get specified string set */
-#define ETHTOOL_PHYS_ID 0x0000001c /* identify the NIC */
+#define ETHTOOL_PHYS_ID 0x0000001c /* identify the NIC */
#define ETHTOOL_GSTATS 0x0000001d /* get NIC-specific statistics */
#define ETHTOOL_GTSO 0x0000001e /* Get TSO enable (ethtool_value) */
#define ETHTOOL_STSO 0x0000001f /* Set TSO enable (ethtool_value) */
@@ -619,8 +619,8 @@ struct ethtool_ops {
#define ETHTOOL_SGSO 0x00000024 /* Set GSO enable (ethtool_value) */
#define ETHTOOL_GFLAGS 0x00000025 /* Get flags bitmap(ethtool_value) */
#define ETHTOOL_SFLAGS 0x00000026 /* Set flags bitmap(ethtool_value) */
-#define ETHTOOL_GPFLAGS 0x00000027 /* Get driver-private flags bitmap */
-#define ETHTOOL_SPFLAGS 0x00000028 /* Set driver-private flags bitmap */
+#define ETHTOOL_GPFLAGS 0x00000027 /* Get driver-private flags bitmap */
+#define ETHTOOL_SPFLAGS 0x00000028 /* Set driver-private flags bitmap */
#define ETHTOOL_GRXFH 0x00000029 /* Get RX flow hash configuration */
#define ETHTOOL_SRXFH 0x0000002a /* Set RX flow hash configuration */
@@ -645,18 +645,18 @@ struct ethtool_ops {
/* Indicates what features are supported by the interface. */
#define SUPPORTED_10baseT_Half (1 << 0)
#define SUPPORTED_10baseT_Full (1 << 1)
-#define SUPPORTED_100baseT_Half (1 << 2)
-#define SUPPORTED_100baseT_Full (1 << 3)
+#define SUPPORTED_100baseT_Half (1 << 2)
+#define SUPPORTED_100baseT_Full (1 << 3)
#define SUPPORTED_1000baseT_Half (1 << 4)
#define SUPPORTED_1000baseT_Full (1 << 5)
#define SUPPORTED_Autoneg (1 << 6)
#define SUPPORTED_TP (1 << 7)
#define SUPPORTED_AUI (1 << 8)
#define SUPPORTED_MII (1 << 9)
-#define SUPPORTED_FIBRE (1 << 10)
+#define SUPPORTED_FIBRE (1 << 10)
#define SUPPORTED_BNC (1 << 11)
#define SUPPORTED_10000baseT_Full (1 << 12)
-#define SUPPORTED_Pause (1 << 13)
+#define SUPPORTED_Pause (1 << 13)
#define SUPPORTED_Asym_Pause (1 << 14)
#define SUPPORTED_2500baseX_Full (1 << 15)
#define SUPPORTED_Backplane (1 << 16)
@@ -666,8 +666,8 @@ struct ethtool_ops {
#define SUPPORTED_10000baseR_FEC (1 << 20)
/* Indicates what features are advertised by the interface. */
-#define ADVERTISED_10baseT_Half (1 << 0)
-#define ADVERTISED_10baseT_Full (1 << 1)
+#define ADVERTISED_10baseT_Half (1 << 0)
+#define ADVERTISED_10baseT_Full (1 << 1)
#define ADVERTISED_100baseT_Half (1 << 2)
#define ADVERTISED_100baseT_Full (1 << 3)
#define ADVERTISED_1000baseT_Half (1 << 4)
@@ -706,12 +706,12 @@ struct ethtool_ops {
#define DUPLEX_FULL 0x01
/* Which connector port. */
-#define PORT_TP 0x00
+#define PORT_TP 0x00
#define PORT_AUI 0x01
#define PORT_MII 0x02
#define PORT_FIBRE 0x03
#define PORT_BNC 0x04
-#define PORT_DA 0x05
+#define PORT_DA 0x05
#define PORT_NONE 0xef
#define PORT_OTHER 0xff
@@ -725,7 +725,7 @@ struct ethtool_ops {
/* Enable or disable autonegotiation. If this is set to enable,
* the forced link modes above are completely ignored.
*/
-#define AUTONEG_DISABLE 0x00
+#define AUTONEG_DISABLE 0x00
#define AUTONEG_ENABLE 0x01
/* Mode MDI or MDI-X */
--
1.6.2.5
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply related
* Re: [2.6.35-rc3 regression] TCP connections on 'lo' interface randomly stall
From: Randy Dunlap @ 2010-06-14 18:23 UTC (permalink / raw)
To: Thomas Bächler; +Cc: David S. Miller, John Fastabend, netdev, linux-kernel
In-Reply-To: <4C167093.2030308@archlinux.org>
On Mon, 14 Jun 2010 20:10:27 +0200 Thomas Bächler wrote:
> With 2.6.35-rc3, I cannot use TCP over the 'lo' interface any more. This
> is reproduced easily by running 'ssh localhost' and executing a few
> commands inside the ssh session (if you are able to log in, 'ls -lhFR /'
> does a good job) - the connection will stall completely after a very
> short time. As far as I can see, all applications are affected.
>
> It also seems that once a service is "stalled", I cannot open a new
> connection to the same TCP port anymore. However, I can open a
> connection to a different port until that one is stalled, too.
>
> Running wireshark, I can see that TCP retransmissions are sent, but
> never acknowledged.
>
> Bisection (starting with 7908a9e as good and v2.6.35-rc3 as bad) leads
> to the following commit. Please CC me on replies to this issue. Thanks
> for your help.
Does this patch fix it for you?
http://lkml.org/lkml/2010/6/13/155
> commit 597a264b1a9c7e36d1728f677c66c5c1f7e3b837
> Author: John Fastabend <john.r.fastabend@intel.com>
> Date: Thu Jun 3 09:30:11 2010 +0000
>
> net: deliver skbs on inactive slaves to exact matches
>
> Currently, the accelerated receive path for VLAN's will
> drop packets if the real device is an inactive slave and
> is not one of the special pkts tested for in
> skb_bond_should_drop(). This behavior is different then
> the non-accelerated path and for pkts over a bonded vlan.
>
> For example,
>
> vlanx -> bond0 -> ethx
>
> will be dropped in the vlan path and not delivered to any
> packet handlers at all. However,
>
> bond0 -> vlanx -> ethx
>
> and
>
> bond0 -> ethx
>
> will be delivered to handlers that match the exact dev,
> because the VLAN path checks the real_dev which is not a
> slave and netif_recv_skb() doesn't drop frames but only
> delivers them to exact matches.
>
> This patch adds a sk_buff flag which is used for tagging
> skbs that would previously been dropped and allows the
> skb to continue to skb_netif_recv(). Here we add
> logic to check for the deliver_no_wcard flag and if it
> is set only deliver to handlers that match exactly. This
> makes both paths above consistent and gives pkt handlers
> a way to identify skbs that come from inactive slaves.
> Without this patch in some configurations skbs will be
> delivered to handlers with exact matches and in others
> be dropped out right in the vlan path.
>
> I have tested the following 4 configurations in failover modes
> and load balancing modes.
>
> # bond0 -> ethx
>
> # vlanx -> bond0 -> ethx
>
> # bond0 -> vlanx -> ethx
>
> # bond0 -> ethx
> |
> vlanx -> --
>
> Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
> Signed-off-by: David S. Miller <davem@davemloft.net>
>
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
^ permalink raw reply
* [2.6.35-rc3 regression] TCP connections on 'lo' interface randomly stall
From: Thomas Bächler @ 2010-06-14 18:10 UTC (permalink / raw)
To: David S. Miller, John Fastabend, netdev, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 2711 bytes --]
With 2.6.35-rc3, I cannot use TCP over the 'lo' interface any more. This
is reproduced easily by running 'ssh localhost' and executing a few
commands inside the ssh session (if you are able to log in, 'ls -lhFR /'
does a good job) - the connection will stall completely after a very
short time. As far as I can see, all applications are affected.
It also seems that once a service is "stalled", I cannot open a new
connection to the same TCP port anymore. However, I can open a
connection to a different port until that one is stalled, too.
Running wireshark, I can see that TCP retransmissions are sent, but
never acknowledged.
Bisection (starting with 7908a9e as good and v2.6.35-rc3 as bad) leads
to the following commit. Please CC me on replies to this issue. Thanks
for your help.
commit 597a264b1a9c7e36d1728f677c66c5c1f7e3b837
Author: John Fastabend <john.r.fastabend@intel.com>
Date: Thu Jun 3 09:30:11 2010 +0000
net: deliver skbs on inactive slaves to exact matches
Currently, the accelerated receive path for VLAN's will
drop packets if the real device is an inactive slave and
is not one of the special pkts tested for in
skb_bond_should_drop(). This behavior is different then
the non-accelerated path and for pkts over a bonded vlan.
For example,
vlanx -> bond0 -> ethx
will be dropped in the vlan path and not delivered to any
packet handlers at all. However,
bond0 -> vlanx -> ethx
and
bond0 -> ethx
will be delivered to handlers that match the exact dev,
because the VLAN path checks the real_dev which is not a
slave and netif_recv_skb() doesn't drop frames but only
delivers them to exact matches.
This patch adds a sk_buff flag which is used for tagging
skbs that would previously been dropped and allows the
skb to continue to skb_netif_recv(). Here we add
logic to check for the deliver_no_wcard flag and if it
is set only deliver to handlers that match exactly. This
makes both paths above consistent and gives pkt handlers
a way to identify skbs that come from inactive slaves.
Without this patch in some configurations skbs will be
delivered to handlers with exact matches and in others
be dropped out right in the vlan path.
I have tested the following 4 configurations in failover modes
and load balancing modes.
# bond0 -> ethx
# vlanx -> bond0 -> ethx
# bond0 -> vlanx -> ethx
# bond0 -> ethx
|
vlanx -> --
Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
^ permalink raw reply
* Re: [PATCH] vlan_dev: VLAN 0 should be treated as "no vlan tag" (802.1p packet)
From: Patrick McHardy @ 2010-06-14 17:11 UTC (permalink / raw)
To: Ben Hutchings; +Cc: Pedro Garcia, netdev
In-Reply-To: <1276534945.2074.11.camel@achroite.uk.solarflarecom.com>
Ben Hutchings wrote:
> On Mon, 2010-06-14 at 18:49 +0200, Pedro Garcia wrote:
>
>> On Sun, 13 Jun 2010 22:56:30 +0100, Ben Hutchings
>> <bhutchings@solarflare.com> wrote:
>>
>>> I have no particular opinion on this change, but you need to read and
>>> follow Documentation/SubmittingPatches.
>>>
>>> Ben.
>>>
>> Sorry, first kernel patch, and I did not know about it. I resubmit with
>> the correct style / format:
>>
> [...]
>
> Sorry, no you haven't.
>
> - Networking changes go through David Miller's net-next-2.6 tree so you
> need to use that as the baseline, not 2.6.26
> - Patches should be applicable with -p1, not -p0 (so if you use diff,
> you should run it from one directory level up)
> - The patch was word-wrapped
Additionally:
- please use the proper comment style, meaning each line begins
with a '*'
- the pr_debug statements may be useful for debugging, but are
a bit excessive for the final version
- + /* 2010-06-13: Pedro Garcia
We have changelogs for this, simply explaining what the code
does is enough.
- Please CC the maintainer (which is me)
^ permalink raw reply
* Re: [PATCH] vlan_dev: VLAN 0 should be treated as "no vlan tag" (802.1p packet)
From: Ben Hutchings @ 2010-06-14 17:02 UTC (permalink / raw)
To: Pedro Garcia; +Cc: netdev
In-Reply-To: <5c6d1ac43fd8ad25661ebfba57c02174@dondevamos.com>
On Mon, 2010-06-14 at 18:49 +0200, Pedro Garcia wrote:
> On Sun, 13 Jun 2010 22:56:30 +0100, Ben Hutchings
> <bhutchings@solarflare.com> wrote:
> > I have no particular opinion on this change, but you need to read and
> > follow Documentation/SubmittingPatches.
> >
> > Ben.
>
> Sorry, first kernel patch, and I did not know about it. I resubmit with
> the correct style / format:
[...]
Sorry, no you haven't.
- Networking changes go through David Miller's net-next-2.6 tree so you
need to use that as the baseline, not 2.6.26
- Patches should be applicable with -p1, not -p0 (so if you use diff,
you should run it from one directory level up)
- The patch was word-wrapped
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: [PATCH] vlan_dev: VLAN 0 should be treated as "no vlan tag" (802.1p packet)
From: Pedro Garcia @ 2010-06-14 16:49 UTC (permalink / raw)
To: netdev; +Cc: Ben Hutchings
In-Reply-To: <1276466190.14011.223.camel@localhost>
On Sun, 13 Jun 2010 22:56:30 +0100, Ben Hutchings
<bhutchings@solarflare.com> wrote:
> I have no particular opinion on this change, but you need to read and
> follow Documentation/SubmittingPatches.
>
> Ben.
Sorry, first kernel patch, and I did not know about it. I resubmit with
the correct style / format:
I am using kernel 2.6.26 in a linux box, and I have another box in the
network using 802.1p (priority tagging, but no VLAN).
Without the 8021q module loaded in the kernel, all 802.1p packets are
silently discarded (probably as expected, as the protocol is not loaded in
the kernel).
When I load 8021q module, these packets are forwarded to the module, but
they are discarded also as VLAN 0 is not configured.
I think this should not be the default behaviour, as VLAN 0 is not really
a VLAN, so it should be treated differently.
I could define the VLAN 0 (ip link add link eth0 name eth0.dot1p type vlan
id 0), but then I have a lot of issues with the ARP table entries, as to
ping the other box, outgoing traffic goes through eth0, but incoming arp
reply ends up in eth0.dot1p. In the end this means I can not communicate
with the box using 802.1p unless I use 802.1p tagging for all traffic in
the network (the linux box and all other), which is not a must of the
spec.
I have developed a patch for vlan_dev.c which makes VLAN 0 to be just
reintroduced to netif_rx but with no VLAN tagging if VLAN 0 has not been
defined, so the default behaviour is to ignore the VLAN tagging and accept
the packet as if it was not tagged, and one can still define something
different for VLAN 0 if desired (so it is backwards compatible).
Signed-off-by: Pedro Garcia <pedro.netdev@dondevamos.com>
--- net/8021q/vlan_dev.c.orig 2008-07-13 23:51:29.000000000 +0200
+++ net/8021q/vlan_dev.c 2010-06-14 18:07:35.000000000 +0200
@@ -151,6 +151,7 @@ int vlan_skb_recv(struct sk_buff *skb, s
struct vlan_hdr *vhdr;
unsigned short vid;
struct net_device_stats *stats;
+ struct net_device *vlan_dev;
unsigned short vlan_TCI;
skb = skb_share_check(skb, GFP_ATOMIC);
@@ -165,11 +166,23 @@ int vlan_skb_recv(struct sk_buff *skb, s
vid = (vlan_TCI & VLAN_VID_MASK);
rcu_read_lock();
- skb->dev = __find_vlan_dev(dev, vid);
- if (!skb->dev) {
+ vlan_dev = __find_vlan_dev(dev, vid);
+ if (vlan_dev) {
+ skb->dev = vlan_dev;
+ } else if (vid) {
pr_debug("%s: ERROR: No net_device for VID: %u on dev:
%s\n",
__func__, (unsigned int)vid, dev->name);
goto err_unlock;
+ } else {
+ /* 2010-06-13: Pedro Garcia
+ The packet is VLAN tagged, but VID is 0 and the user
has
+ not defined anything for VLAN 0, so it is a 802.1p
packet.
+ We will just netif_rx it later to the original
interface,
+ but with the skb->proto set to the wrapped proto, so we
do
+ nothing here. */
+
+ pr_debug("%s: INFO: VLAN 0 used as default VLAN on dev:
%s\n",
+ __func__, dev->name);
}
skb->dev->last_rx = jiffies;
^ permalink raw reply
* Re: New issues in 2.6.35-rc{1,2}
From: Borislav Petkov @ 2010-06-14 16:43 UTC (permalink / raw)
To: Nico Schottelius; +Cc: LKML, netdev
In-Reply-To: <20100614161904.GE31910@schottelius.org>
From: Nico Schottelius <nico-linux-20100614@schottelius.org>
Date: Mon, Jun 14, 2010 at 06:19:04PM +0200
Ccing netdev.
> Hey devs!
>
> In both of these versions, the update of the carrier flag seems
> to be "different" than before (linux-2.6.34-08528-gb3f2f6c):
>
> wlan0 (iwlagn) does not recognize it's disconnected
> and eth0 (e1000e) does only react correctly after I restarted
> dhcpcd (isc):
>
> [11:20] kr:pm# dhcpcd eth0
> dhcpcd: version 5.2.2 starting
> dhcpcd: eth0: waiting for carrier
> ^Cdhcpcd: received SIGINT, stopping
> dhcpcd: eth0: removing interface
> [11:20] kr:pm# dhcpcd eth0
> dhcpcd: version 5.2.2 starting
> dhcpcd: eth0: broadcasting for a lease
> dhcpcd: eth0: offered 129.132.102.115 from 129.132.65.12
> dhcpcd: eth0: ignoring offer of 129.132.102.115 from 129.132.57.97
> dhcpcd: eth0: acknowledged 129.132.102.115 from 129.132.65.12
> dhcpcd: eth0: checking for 129.132.102.115
> dhcpcd: eth0: leased 129.132.102.115 for 86400 seconds
> dhcpcd: forking to background
>
> It's known that iwlagn has problems after suspend/resume,
> but new is that both nics do not notify dhcpcd that the link
> has gone. I'm not sure what / where broke here, just see that
> dhcpcd noticed it before and now doesn't anymore.
Had the same dhcpcd issue here both with e1000e and bnx2 and definitely
after the .35 merge window. dhclient doesn't seem affected.
--
Regards/Gruss,
Boris.
^ permalink raw reply
* [PATCH v2] ucc_geth: fix for RX skb buffers recycling
From: Sergey Matyukevich @ 2010-06-14 16:35 UTC (permalink / raw)
To: David Miller; +Cc: netdev, leoli, avorontsov
In-Reply-To: <20100609.180240.59675642.davem@davemloft.net>
Hello David,
Could you please consider the second, simplified, version of the patch
for ucc_geth driver regarding proper RX error skb buffer recycling.
This patch implements a proper modification of RX skb buffers before
recycling. Adjusting only skb->data is not enough because after that
skb->tail and skb->len become incorrect.
Signed-off-by: Sergey Matyukevich <geomatsi@gmail.com>
---
drivers/net/ucc_geth.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index 4a34833..807470e 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -3215,6 +3215,8 @@ static int ucc_geth_rx(struct ucc_geth_private *ugeth, u8 rxQ, int rx_work_limit
__func__, __LINE__, (u32) skb);
if (skb) {
skb->data = skb->head + NET_SKB_PAD;
+ skb->len = 0;
+ skb_reset_tail_pointer(skb);
__skb_queue_head(&ugeth->rx_recycle, skb);
}
--
1.6.2.5
^ permalink raw reply related
* Re: [PATCH 1/4] net/phy/marvell: Expose IDs and flags in a .h and add dns323 LEDs setup flag
From: David Miller @ 2010-06-14 16:13 UTC (permalink / raw)
To: benh; +Cc: w.sang, netdev, hvr, linux-arm-kernel, nico
In-Reply-To: <1276408955.1962.578.camel@pasglop>
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: Sun, 13 Jun 2010 16:02:35 +1000
> On Sun, 2010-06-13 at 07:28 +0200, Wolfram Sang wrote:
>> On Sun, Jun 13, 2010 at 11:10:23AM +1000, Benjamin Herrenschmidt wrote:
>> > This moves the various known Marvell PHY IDs to include/linux/marvell_phy.h
>> > along with dev_flags definitions for use by the driver.
>> >
>> > I then added a flag that changes the PHY init code to setup the LEDs
>> > config to the values needed to operate a dns323 rev C1 NAS.
>> >
>> > I moved the existing "resistance" flag to the .h as well, though I've
>> > been unable to find whoever sets this to convert it to use that constant.
>> >
>> > Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>>
>> That should do for now.
>>
>> Reviewed-by: Wolfram Sang <w.sang@pengutronix.de>
>
> Thanks.
>
> Dave, any objection to having that go via the arm tree along with the
> rest of my patches to support the dns323 since they depend on this one ?
No problem:
Acked-by: David S. Miller <davem@davemloft.net>
^ permalink raw reply
* [PATCH net-next-2.6] loopback: Implement 64bit stats on 32bit arches
From: Eric Dumazet @ 2010-06-14 15:59 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Ben Hutchings
Uses a seqcount_t to synchronize stat producer and consumer, for packets
and bytes counter, now u64 types.
(dropped counter being rarely used, stay a native "unsigned long" type)
No noticeable performance impact on x86, as it only adds two increments
per frame. It might be more expensive on arches where smp_wmb() is not
free.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
drivers/net/loopback.c | 61 ++++++++++++++++++++++++++++++++-------
1 file changed, 51 insertions(+), 10 deletions(-)
diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c
index 72b7949..09334f8 100644
--- a/drivers/net/loopback.c
+++ b/drivers/net/loopback.c
@@ -60,11 +60,51 @@
#include <net/net_namespace.h>
struct pcpu_lstats {
- unsigned long packets;
- unsigned long bytes;
+ u64 packets;
+ u64 bytes;
+#if BITS_PER_LONG==32 && defined(CONFIG_SMP)
+ seqcount_t seq;
+#endif
unsigned long drops;
};
+#if BITS_PER_LONG==32 && defined(CONFIG_SMP)
+static void inline lstats_update_begin(struct pcpu_lstats *lstats)
+{
+ write_seqcount_begin(&lstats->seq);
+}
+static void inline lstats_update_end(struct pcpu_lstats *lstats)
+{
+ write_seqcount_end(&lstats->seq);
+}
+static void inline lstats_fetch_and_add(u64 *packets, u64 *bytes, const struct pcpu_lstats *lstats)
+{
+ u64 tpackets, tbytes;
+ unsigned int seq;
+
+ do {
+ seq = read_seqcount_begin(&lstats->seq);
+ tpackets = lstats->packets;
+ tbytes = lstats->bytes;
+ } while (read_seqcount_retry(&lstats->seq, seq));
+
+ *packets += tpackets;
+ *bytes += tbytes;
+}
+#else
+static void inline lstats_update_begin(struct pcpu_lstats *lstats)
+{
+}
+static void inline lstats_update_end(struct pcpu_lstats *lstats)
+{
+}
+static void inline lstats_fetch_and_add(u64 *packets, u64 *bytes, const struct pcpu_lstats *lstats)
+{
+ *packets += lstats->packets;
+ *bytes += lstats->bytes;
+}
+#endif
+
/*
* The higher levels take care of making this non-reentrant (it's
* called with bh's disabled).
@@ -86,21 +126,23 @@ static netdev_tx_t loopback_xmit(struct sk_buff *skb,
len = skb->len;
if (likely(netif_rx(skb) == NET_RX_SUCCESS)) {
+ lstats_update_begin(lb_stats);
lb_stats->bytes += len;
lb_stats->packets++;
+ lstats_update_end(lb_stats);
} else
lb_stats->drops++;
return NETDEV_TX_OK;
}
-static struct net_device_stats *loopback_get_stats(struct net_device *dev)
+static struct rtnl_link_stats64 *loopback_get_stats64(struct net_device *dev)
{
const struct pcpu_lstats __percpu *pcpu_lstats;
- struct net_device_stats *stats = &dev->stats;
- unsigned long bytes = 0;
- unsigned long packets = 0;
- unsigned long drops = 0;
+ struct rtnl_link_stats64 *stats = &dev->stats64;
+ u64 bytes = 0;
+ u64 packets = 0;
+ u64 drops = 0;
int i;
pcpu_lstats = (void __percpu __force *)dev->ml_priv;
@@ -108,8 +150,7 @@ static struct net_device_stats *loopback_get_stats(struct net_device *dev)
const struct pcpu_lstats *lb_stats;
lb_stats = per_cpu_ptr(pcpu_lstats, i);
- bytes += lb_stats->bytes;
- packets += lb_stats->packets;
+ lstats_fetch_and_add(&packets, &bytes, lb_stats);
drops += lb_stats->drops;
}
stats->rx_packets = packets;
@@ -158,7 +199,7 @@ static void loopback_dev_free(struct net_device *dev)
static const struct net_device_ops loopback_ops = {
.ndo_init = loopback_dev_init,
.ndo_start_xmit= loopback_xmit,
- .ndo_get_stats = loopback_get_stats,
+ .ndo_get_stats64 = loopback_get_stats64,
};
/*
^ permalink raw reply related
* [PATCH] net: Fix error in comment on net_device_ops::ndo_get_stats
From: Ben Hutchings @ 2010-06-14 15:19 UTC (permalink / raw)
To: David Miller; +Cc: netdev, linux-net-drivers
ndo_get_stats still returns struct net_device_stats *; there is
no struct net_device_stats64.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
include/linux/netdevice.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index d85a38e..4164285 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -671,7 +671,7 @@ struct netdev_rx_queue {
* 1. Define @ndo_get_stats64 to update a rtnl_link_stats64 structure
* (which should normally be dev->stats64) and return a ponter to
* it. The structure must not be changed asynchronously.
- * 2. Define @ndo_get_stats to update a net_device_stats64 structure
+ * 2. Define @ndo_get_stats to update a net_device_stats structure
* (which should normally be dev->stats) and return a pointer to
* it. The structure may be changed asynchronously only if each
* field is written atomically.
--
1.6.2.5
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply related
* Re: [PATCH net-next-2.6] ipv6: RCU changes in ipv6_get_mtu() and ip6_dst_hoplimit()
From: YOSHIFUJI Hideaki @ 2010-06-14 15:18 UTC (permalink / raw)
To: David Miller, netdev; +Cc: Eric Dumazet, YOSHIFUJI Hideaki
In-Reply-To: <1276526780.2478.101.camel@edumazet-laptop>
(2010/06/14 23:46), Eric Dumazet wrote:
> Use RCU to avoid atomic ops on idev refcnt in ipv6_get_mtu()
> and ip6_dst_hoplimit()
>
> Signed-off-by: Eric Dumazet<eric.dumazet@gmail.com>
Acked-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
--yoshfuji
^ permalink raw reply
* Re: [PATCH v4] netfilter: Xtables: idletimer target implementation
From: Luciano Coelho @ 2010-06-14 14:59 UTC (permalink / raw)
To: ext Patrick McHardy
Cc: netfilter@vger.kernel.org, netdev@vger.kernel.org, Jan Engelhardt,
Timo Teras
In-Reply-To: <4C164152.8080103@trash.net>
On Mon, 2010-06-14 at 16:48 +0200, ext Patrick McHardy wrote:
> Luciano Coelho wrote:
> > +static int idletimer_tg_create(struct idletimer_tg_info *info)
> > +{
> > + int ret;
> > +
> > + info->timer = kmalloc(sizeof(*info->timer), GFP_ATOMIC);
> > + if (!info->timer) {
> > + pr_debug("couldn't alloc timer\n");
> > + ret = -ENOMEM;
> > + goto out;
> > + }
> > +
> > + info->timer->attr.attr.name = kstrdup(info->label, GFP_ATOMIC);
> >
>
> These two allocations don't need GFP_ATOMIC AFAICT.
You're right, I'll fix it in v5.
>
> > + if (!info->timer->attr.attr.name) {
> > + pr_debug("couldn't alloc attribute name\n");
> > + ret = -ENOMEM;
> > + goto out_free_timer;
> > + }
> > + info->timer->attr.attr.mode = S_IRUGO;
> > + info->timer->attr.show = idletimer_tg_show;
> > +
> > + ret = sysfs_create_file(idletimer_tg_kobj, &info->timer->attr.attr);
> > + if (ret < 0) {
> > + pr_debug("couldn't add file to sysfs");
> > + goto out_free_attr;
> > + }
> > +
> > + list_add(&info->timer->entry, &idletimer_tg_list);
> > +
> > + setup_timer(&info->timer->timer, idletimer_tg_expired,
> > + (unsigned long) info->timer);
> > + info->timer->refcnt = 1;
> > +
> > + mod_timer(&info->timer->timer,
> > + msecs_to_jiffies(info->timeout * 1000) + jiffies);
> > +
> > + INIT_WORK(&info->timer->work, idletimer_tg_work);
> > +
> > + return 0;
> > +
> > +out_free_attr:
> > + kfree(info->timer->attr.attr.name);
> > +out_free_timer:
> > + kfree(info->timer);
> > +out:
> > + return ret;
> > +}
> > +
> > +/*
> > + * The actual xt_tables plugin.
> > + */
> > +static unsigned int idletimer_tg_target(struct sk_buff *skb,
> > + const struct xt_action_param *par)
> > +{
> > + const struct idletimer_tg_info *info = par->targinfo;
> > +
> > + pr_debug("resetting timer %s, timeout period %u\n",
> > + info->label, info->timeout);
> > +
> > + mutex_lock(&list_mutex);
> >
>
> You can't take the mutex in the target function. What is it supposed to
> protect again?
Hmmmm... I was thinking that info->timer could be freed while this
function is executing. But I guess the call to this function is already
protected against that, right?
I'll remove the mutex from here.
> > +
> > + BUG_ON(!info->timer);
> > +
> > + mod_timer(&info->timer->timer,
> > + msecs_to_jiffies(info->timeout * 1000) + jiffies);
> > +
> > + mutex_unlock(&list_mutex);
> > +
> > + return XT_CONTINUE;
> > +}
> > +
>
--
Cheers,
Luca.
^ permalink raw reply
* [PATCH net-next-2.6] be2net: enable ipv6 tso support
From: Ajit Khaparde @ 2010-06-14 14:56 UTC (permalink / raw)
To: David Miller, netdev
Add ipv6 support to the be2net driver.
Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
---
drivers/net/benet/be_hw.h | 2 +-
drivers/net/benet/be_main.c | 6 ++++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/net/benet/be_hw.h b/drivers/net/benet/be_hw.h
index 063026d..0683967 100644
--- a/drivers/net/benet/be_hw.h
+++ b/drivers/net/benet/be_hw.h
@@ -192,7 +192,7 @@ struct amap_eth_hdr_wrb {
u8 event;
u8 crc;
u8 forward;
- u8 ipsec;
+ u8 lso6;
u8 mgmt;
u8 ipcs;
u8 udpcs;
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
index 3225774..01eb447 100644
--- a/drivers/net/benet/be_main.c
+++ b/drivers/net/benet/be_main.c
@@ -373,10 +373,12 @@ static void wrb_fill_hdr(struct be_eth_hdr_wrb *hdr, struct sk_buff *skb,
AMAP_SET_BITS(struct amap_eth_hdr_wrb, crc, hdr, 1);
- if (skb_shinfo(skb)->gso_segs > 1 && skb_shinfo(skb)->gso_size) {
+ if (skb_is_gso(skb)) {
AMAP_SET_BITS(struct amap_eth_hdr_wrb, lso, hdr, 1);
AMAP_SET_BITS(struct amap_eth_hdr_wrb, lso_mss,
hdr, skb_shinfo(skb)->gso_size);
+ if (skb_is_gso_v6(skb))
+ AMAP_SET_BITS(struct amap_eth_hdr_wrb, lso6, hdr, 1);
} else if (skb->ip_summed == CHECKSUM_PARTIAL) {
if (is_tcp_pkt(skb))
AMAP_SET_BITS(struct amap_eth_hdr_wrb, tcpcs, hdr, 1);
@@ -2186,7 +2188,7 @@ static void be_netdev_init(struct net_device *netdev)
netdev->features |= NETIF_F_SG | NETIF_F_HW_VLAN_RX | NETIF_F_TSO |
NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_FILTER | NETIF_F_HW_CSUM |
- NETIF_F_GRO;
+ NETIF_F_GRO | NETIF_F_TSO6;
netdev->vlan_features |= NETIF_F_SG | NETIF_F_TSO | NETIF_F_HW_CSUM;
--
1.7.0.4
^ permalink raw reply related
* Re: [PATCH v4] netfilter: Xtables: idletimer target implementation
From: Patrick McHardy @ 2010-06-14 14:48 UTC (permalink / raw)
To: Luciano Coelho; +Cc: netfilter, netdev, Jan Engelhardt, Timo Teras
In-Reply-To: <1276264913-429-1-git-send-email-luciano.coelho@nokia.com>
Luciano Coelho wrote:
> +static int idletimer_tg_create(struct idletimer_tg_info *info)
> +{
> + int ret;
> +
> + info->timer = kmalloc(sizeof(*info->timer), GFP_ATOMIC);
> + if (!info->timer) {
> + pr_debug("couldn't alloc timer\n");
> + ret = -ENOMEM;
> + goto out;
> + }
> +
> + info->timer->attr.attr.name = kstrdup(info->label, GFP_ATOMIC);
>
These two allocations don't need GFP_ATOMIC AFAICT.
> + if (!info->timer->attr.attr.name) {
> + pr_debug("couldn't alloc attribute name\n");
> + ret = -ENOMEM;
> + goto out_free_timer;
> + }
> + info->timer->attr.attr.mode = S_IRUGO;
> + info->timer->attr.show = idletimer_tg_show;
> +
> + ret = sysfs_create_file(idletimer_tg_kobj, &info->timer->attr.attr);
> + if (ret < 0) {
> + pr_debug("couldn't add file to sysfs");
> + goto out_free_attr;
> + }
> +
> + list_add(&info->timer->entry, &idletimer_tg_list);
> +
> + setup_timer(&info->timer->timer, idletimer_tg_expired,
> + (unsigned long) info->timer);
> + info->timer->refcnt = 1;
> +
> + mod_timer(&info->timer->timer,
> + msecs_to_jiffies(info->timeout * 1000) + jiffies);
> +
> + INIT_WORK(&info->timer->work, idletimer_tg_work);
> +
> + return 0;
> +
> +out_free_attr:
> + kfree(info->timer->attr.attr.name);
> +out_free_timer:
> + kfree(info->timer);
> +out:
> + return ret;
> +}
> +
> +/*
> + * The actual xt_tables plugin.
> + */
> +static unsigned int idletimer_tg_target(struct sk_buff *skb,
> + const struct xt_action_param *par)
> +{
> + const struct idletimer_tg_info *info = par->targinfo;
> +
> + pr_debug("resetting timer %s, timeout period %u\n",
> + info->label, info->timeout);
> +
> + mutex_lock(&list_mutex);
>
You can't take the mutex in the target function. What is it supposed to
protect again?
> +
> + BUG_ON(!info->timer);
> +
> + mod_timer(&info->timer->timer,
> + msecs_to_jiffies(info->timeout * 1000) + jiffies);
> +
> + mutex_unlock(&list_mutex);
> +
> + return XT_CONTINUE;
> +}
> +
^ permalink raw reply
* [PATCH net-next-2.6] ipv6: RCU changes in ipv6_get_mtu() and ip6_dst_hoplimit()
From: Eric Dumazet @ 2010-06-14 14:46 UTC (permalink / raw)
To: David Miller; +Cc: netdev
Use RCU to avoid atomic ops on idev refcnt in ipv6_get_mtu()
and ip6_dst_hoplimit()
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
net/ipv6/route.c | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index f770285..8f2d040 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1084,11 +1084,11 @@ static int ipv6_get_mtu(struct net_device *dev)
int mtu = IPV6_MIN_MTU;
struct inet6_dev *idev;
- idev = in6_dev_get(dev);
- if (idev) {
+ rcu_read_lock();
+ idev = __in6_dev_get(dev);
+ if (idev)
mtu = idev->cnf.mtu6;
- in6_dev_put(idev);
- }
+ rcu_read_unlock();
return mtu;
}
@@ -1097,12 +1097,15 @@ int ip6_dst_hoplimit(struct dst_entry *dst)
int hoplimit = dst_metric(dst, RTAX_HOPLIMIT);
if (hoplimit < 0) {
struct net_device *dev = dst->dev;
- struct inet6_dev *idev = in6_dev_get(dev);
- if (idev) {
+ struct inet6_dev *idev;
+
+ rcu_read_lock();
+ idev = __in6_dev_get(dev);
+ if (idev)
hoplimit = idev->cnf.hop_limit;
- in6_dev_put(idev);
- } else
+ else
hoplimit = dev_net(dev)->ipv6.devconf_all->hop_limit;
+ rcu_read_unlock();
}
return hoplimit;
}
^ permalink raw reply related
* Re: [PATCH v4] netfilter: Xtables: idletimer target implementation
From: Luciano Coelho @ 2010-06-14 14:39 UTC (permalink / raw)
To: netfilter-devel@vger.kernel.org
Cc: netdev@vger.kernel.org, Jan Engelhardt, Patrick McHardy,
Timo Teras
In-Reply-To: <1276264913-429-1-git-send-email-luciano.coelho@nokia.com>
On Fri, 2010-06-11 at 16:01 +0200, Coelho Luciano (Nokia-D/Helsinki)
wrote:
> v4: Fixed according to Jan's and Patrick's comments to v3
> Changed to mutex locking instead of spin locks
> Save the timer in the target info struct to avoid extra reads
> Other small clean-ups
Does the patch look okay now? Any further comments?
--
Cheers,
Luca.
^ permalink raw reply
* [PATCH net-next-2.6] ipv6: avoid two atomics in ipv6_rthdr_rcv()
From: Eric Dumazet @ 2010-06-14 14:39 UTC (permalink / raw)
To: David Miller; +Cc: netdev
Use __in6_dev_get() instead of in6_dev_get()/in6_dev_put()
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
net/ipv6/exthdrs.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c
index 853a633..262f105 100644
--- a/net/ipv6/exthdrs.c
+++ b/net/ipv6/exthdrs.c
@@ -312,6 +312,7 @@ static int ipv6_destopt_rcv(struct sk_buff *skb)
Routing header.
********************************/
+/* called with rcu_read_lock() */
static int ipv6_rthdr_rcv(struct sk_buff *skb)
{
struct inet6_skb_parm *opt = IP6CB(skb);
@@ -324,12 +325,9 @@ static int ipv6_rthdr_rcv(struct sk_buff *skb)
struct net *net = dev_net(skb->dev);
int accept_source_route = net->ipv6.devconf_all->accept_source_route;
- idev = in6_dev_get(skb->dev);
- if (idev) {
- if (accept_source_route > idev->cnf.accept_source_route)
- accept_source_route = idev->cnf.accept_source_route;
- in6_dev_put(idev);
- }
+ idev = __in6_dev_get(skb->dev);
+ if (idev && accept_source_route > idev->cnf.accept_source_route)
+ accept_source_route = idev->cnf.accept_source_route;
if (!pskb_may_pull(skb, skb_transport_offset(skb) + 8) ||
!pskb_may_pull(skb, (skb_transport_offset(skb) +
^ permalink raw reply related
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