Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH 2/2] drivers/net/ax88796.c: Return error code in failure
From: David Miller @ 2010-10-21 11:31 UTC (permalink / raw)
  To: julia; +Cc: p_gortmaker, kernel-janitors, netdev, linux-kernel
In-Reply-To: <1287411074-19825-2-git-send-email-julia@diku.dk>

From: Julia Lawall <julia@diku.dk>
Date: Mon, 18 Oct 2010 16:11:14 +0200

> In this code, 0 is returned on failure, even though other
> failures return -ENOMEM or other similar values.
> 
> A simplified version of the semantic match that finds this problem is as
> follows: (http://coccinelle.lip6.fr/)
 ...
> Signed-off-by: Julia Lawall <julia@diku.dk>

Applied.

^ permalink raw reply

* Re: [PATCH v2 1/9] tproxy: split off ipv6 defragmentation to a separate module
From: Patrick McHardy @ 2010-10-21 11:30 UTC (permalink / raw)
  To: KOVACS Krisztian; +Cc: netdev, netfilter-devel, Balazs Scheidler, David Miller
In-Reply-To: <20101021104709.5192.64336.stgit@este.odu>

Am 21.10.2010 12:47, schrieb KOVACS Krisztian:
> diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c
> index 138a8b3..bb669b4 100644
> --- a/net/ipv6/netfilter/nf_conntrack_reasm.c
> +++ b/net/ipv6/netfilter/nf_conntrack_reasm.c
> @@ -73,7 +73,7 @@ static struct inet_frags nf_frags;
>  static struct netns_frags nf_init_frags;
>  
>  #ifdef CONFIG_SYSCTL
> -struct ctl_table nf_ct_ipv6_sysctl_table[] = {
> +struct ctl_table nf_ct_frag6_sysctl_table[] = {
>  	{
>  		.procname	= "nf_conntrack_frag6_timeout",
>  		.data		= &nf_init_frags.timeout,
> @@ -97,6 +97,8 @@ struct ctl_table nf_ct_ipv6_sysctl_table[] = {
>  	},
>  	{ }
>  };
> +
> +static struct ctl_table_header *nf_ct_frag6_sysctl_header;
>  #endif
>  
>  static unsigned int nf_hashfn(struct inet_frag_queue *q)
> @@ -623,11 +625,19 @@ int nf_ct_frag6_init(void)
>  	inet_frags_init_net(&nf_init_frags);
>  	inet_frags_init(&nf_frags);
>  
> +	nf_ct_frag6_sysctl_header = register_sysctl_paths(nf_net_netfilter_sysctl_path,
> +							  nf_ct_frag6_sysctl_table);
> +	if (!nf_ct_frag6_sysctl_header)
> +		return -ENOMEM;


This needs to call inet_frags_fini() on errors since inet_frags_init()
starts a timer to recalculate the secret.


> +
>  	return 0;
>  }
>  
>  void nf_ct_frag6_cleanup(void)
>  {
> +	unregister_sysctl_table(nf_ct_frag6_sysctl_header);
> +	nf_ct_frag6_sysctl_header = NULL;
> +
>  	inet_frags_fini(&nf_frags);
>  
>  	nf_init_frags.low_thresh = 0;
> diff --git a/net/ipv6/netfilter/nf_defrag_ipv6_hooks.c b/net/ipv6/netfilter/nf_defrag_ipv6_hooks.c
> new file mode 100644
> index 0000000..99abfb5
> --- /dev/null
> +++ b/net/ipv6/netfilter/nf_defrag_ipv6_hooks.c
> @@ -0,0 +1,131 @@
> +/* (C) 1999-2001 Paul `Rusty' Russell
> + * (C) 2002-2004 Netfilter Core Team <coreteam@netfilter.org>
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +
> +#include <linux/types.h>
> +#include <linux/ipv6.h>
> +#include <linux/in6.h>
> +#include <linux/netfilter.h>
> +#include <linux/module.h>
> +#include <linux/skbuff.h>
> +#include <linux/icmp.h>
> +#include <linux/sysctl.h>
> +#include <net/ipv6.h>
> +#include <net/inet_frag.h>
> +
> +#include <linux/netfilter_ipv6.h>
> +#include <linux/netfilter_bridge.h>
> +#include <net/netfilter/nf_conntrack.h>
> +#include <net/netfilter/nf_conntrack_helper.h>
> +#include <net/netfilter/nf_conntrack_l4proto.h>
> +#include <net/netfilter/nf_conntrack_l3proto.h>
> +#include <net/netfilter/nf_conntrack_core.h>
> +#include <net/netfilter/nf_conntrack_zones.h>
> +#include <net/netfilter/ipv6/nf_conntrack_ipv6.h>
> +#include <net/netfilter/ipv6/nf_defrag_ipv6.h>
> +
> +static enum ip6_defrag_users nf_ct6_defrag_user(unsigned int hooknum,
> +						struct sk_buff *skb)
> +{
> +	u16 zone = NF_CT_DEFAULT_ZONE;
> +
> +	if (skb->nfct)
> +		zone = nf_ct_zone((struct nf_conn *)skb->nfct);
> +
> +#ifdef CONFIG_BRIDGE_NETFILTER
> +	if (skb->nf_bridge &&
> +	    skb->nf_bridge->mask & BRNF_NF_BRIDGE_PREROUTING)
> +		return IP6_DEFRAG_CONNTRACK_BRIDGE_IN + zone;
> +#endif
> +	if (hooknum == NF_INET_PRE_ROUTING)
> +		return IP6_DEFRAG_CONNTRACK_IN + zone;
> +	else
> +		return IP6_DEFRAG_CONNTRACK_OUT + zone;
> +
> +}
> +
> +static unsigned int ipv6_defrag(unsigned int hooknum,
> +				struct sk_buff *skb,
> +				const struct net_device *in,
> +				const struct net_device *out,
> +				int (*okfn)(struct sk_buff *))
> +{
> +	struct sk_buff *reasm;
> +
> +	/* Previously seen (loopback)?	*/
> +	if (skb->nfct && !nf_ct_is_template((struct nf_conn *)skb->nfct))
> +		return NF_ACCEPT;
> +
> +	reasm = nf_ct_frag6_gather(skb, nf_ct6_defrag_user(hooknum, skb));
> +	/* queued */
> +	if (reasm == NULL)
> +		return NF_STOLEN;
> +
> +	/* error occured or not fragmented */
> +	if (reasm == skb)
> +		return NF_ACCEPT;
> +
> +	nf_ct_frag6_output(hooknum, reasm, (struct net_device *)in,
> +			   (struct net_device *)out, okfn);
> +
> +	return NF_STOLEN;
> +}
> +
> +static struct nf_hook_ops ipv6_defrag_ops[] = {
> +	{
> +		.hook		= ipv6_defrag,
> +		.owner		= THIS_MODULE,
> +		.pf		= NFPROTO_IPV6,
> +		.hooknum	= NF_INET_PRE_ROUTING,
> +		.priority	= NF_IP6_PRI_CONNTRACK_DEFRAG,
> +	},
> +	{
> +		.hook		= ipv6_defrag,
> +		.owner		= THIS_MODULE,
> +		.pf		= NFPROTO_IPV6,
> +		.hooknum	= NF_INET_LOCAL_OUT,
> +		.priority	= NF_IP6_PRI_CONNTRACK_DEFRAG,
> +	},
> +};
> +
> +static int __init nf_defrag_init(void)
> +{
> +	int ret = 0;
> +
> +	ret = nf_ct_frag6_init();
> +	if (ret < 0) {
> +		pr_err("nf_defrag_ipv6: can't initialize frag6.\n");
> +		return ret;
> +	}
> +	ret = nf_register_hooks(ipv6_defrag_ops, ARRAY_SIZE(ipv6_defrag_ops));
> +	if (ret < 0) {
> +		pr_err("nf_defrag_ipv6: can't register hooks\n");
> +		goto cleanup_frag6;
> +	}
> +	return ret;
> +
> +cleanup_frag6:
> +	nf_ct_frag6_cleanup();
> +	return ret;
> +
> +}
> +
> +static void __exit nf_defrag_fini(void)
> +{
> +	nf_unregister_hooks(ipv6_defrag_ops, ARRAY_SIZE(ipv6_defrag_ops));
> +	nf_ct_frag6_cleanup();
> +}
> +
> +void nf_defrag_ipv6_enable(void)
> +{
> +}
> +EXPORT_SYMBOL_GPL(nf_defrag_ipv6_enable);
> +
> +module_init(nf_defrag_init);
> +module_exit(nf_defrag_fini);
> +
> +MODULE_LICENSE("GPL");
> 
> 


^ permalink raw reply

* Re: [PATCH v2] b44: fix resume, request_irq after hw reset
From: David Miller @ 2010-10-21 11:30 UTC (permalink / raw)
  To: james
  Cc: zambrano, jpirko, fujita.tomonori, hauke, Larry.Finger, netdev,
	linux-kernel, akpm
In-Reply-To: <201010171249.00485.james@albanarts.com>

From: James Hogan <james@albanarts.com>
Date: Sun, 17 Oct 2010 12:48:59 +0100

> On resume, call request_irq() after resetting the hardware rather than
> before. It's a shared interrupt so the handler could be called
> immediately if another device on the same irq interrupts (and will be
> called immediately if CONFIG_DEBUG_SHIRQ=y), but unless the hardware is
> reinitialised with b44_init_hw() the read of the interrupt status
> register will hang the system.
> 
> Signed-off-by: James Hogan <james@albanarts.com>

Applied.

^ permalink raw reply

* Re: [PATCH 2/3] cxgb4: function namespace cleanup (v3)
From: David Miller @ 2010-10-21 11:30 UTC (permalink / raw)
  To: dm; +Cc: shemminger, swise, divy, leedom, netdev
In-Reply-To: <4CBCD548.3030005@chelsio.com>

From: Dimitris Michailidis <dm@chelsio.com>
Date: Mon, 18 Oct 2010 16:16:24 -0700

> Stephen Hemminger wrote:
>> Make functions only used in one file local.
>> Remove lots of dead code, relating to unsupported functions
>> in mainline driver like RSS, IPv6, and TCP offload.
>> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> 
> Acked-by: Dimitris Michailidis <dm@chelsio.com>

Applied.

^ permalink raw reply

* Re: [PATCH v2] CAPI: Silence lockdep warning on get_capi_appl_by_nr usage
From: David Miller @ 2010-10-21 11:29 UTC (permalink / raw)
  To: jan.kiszka; +Cc: linux-kernel, i4ldeveloper, netdev, isdn, peterz
In-Reply-To: <4CBB13B7.8080705@web.de>

From: Jan Kiszka <jan.kiszka@web.de>
Date: Sun, 17 Oct 2010 17:18:15 +0200

> As long as we hold capi_controller_lock, we can safely access
> capi_applications without RCU protection as no one can modify the
> application list underneath us. Introduce an RCU-free
> __get_capi_appl_by_nr for this purpose. This silences lockdep warnings
> on suspicious rcu_dereference usage.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@web.de>

Applied.

^ permalink raw reply

* Re: [PATCH] ipv4: synchronize bind() with RTM_NEWADDR notifications
From: Timo Teräs @ 2010-10-21 11:29 UTC (permalink / raw)
  To: David Miller; +Cc: eric.dumazet, netdev
In-Reply-To: <20101021.040319.191412436.davem@davemloft.net>

On 10/21/2010 02:03 PM, David Miller wrote:
> From: Timo Teräs <timo.teras@iki.fi>
> Date: Thu, 21 Oct 2010 13:58:08 +0300
> 
>> On 10/21/2010 01:50 PM, David Miller wrote:
>>> From: Timo Teräs <timo.teras@iki.fi>
>>> Date: Thu, 21 Oct 2010 13:41:37 +0300
>>>
>>>> Is inet_bind() called from non-userland context? If yes, then this is a
>>>> bad idea. Otherwise I don't think it's that hot path...
>>>
>>> It is.
>>
>> Yet, almost immediately after that there is lock_sock() which can also
>> sleep. How does that work then?
> 
> RTNL interlocks globally with a heavy primitive, a mutex, lock_sock()
> grabs a spinlcok which is local to the socket's context.
> 
> So if we have 100,000 sockets binding we'll suck with you're change
> whereas the lock_sock() does not cause that problem.
> 
> Is this so difficult for you to comprehend?

I was confused with Dave's original reply "It is." as referring to that
inet_bind() can get called from non-userland context. But apparently you
just meant that "It is (bad idea regardless)."

I thought the problem was possible sleeping, and not contention. Which
became very obvious from Eric's example. I didn't realize that many do
bind()/recv()/send() as general workload.

Sorry for not seeing the obvious.

This is the third time asking, what would be a good way to fix the
problem described in the original commit log?

Changing RTM_NEWADDR after FIB update would break Netlink event
ordering. And this breaks performance. I can't really use RTN_LOCAL
RTM_NEWROUTE events since (at least IPv6 side) has incorrect ifindex.

Should inet_addr_type() be rewritten to not use FIB lookups?

^ permalink raw reply

* mmotm 2010-10-20 - netfilter Kconfig whinge
From: Valdis.Kletnieks @ 2010-10-21 11:14 UTC (permalink / raw)
  To: Andrew Morton, Patrick McHardy; +Cc: linux-kernel, netfilter, netdev
In-Reply-To: <201010202233.o9KMXNoL008303@imap1.linux-foundation.org>

[-- Attachment #1: Type: text/plain, Size: 633 bytes --]

On Wed, 20 Oct 2010 15:01:43 PDT, akpm@linux-foundation.org said:
> The mm-of-the-moment snapshot 2010-10-20-15-01 has been uploaded to
> 
>    http://userweb.kernel.org/~akpm/mmotm/

Seen during 'make oldconfig':

      Input subsystem LEDs Trigger (LEDS_TRIGGER_INPUT) [N/m/y/?] (NEW) m
      *
      * iptables trigger is under Netfilter config (LED target)
      *
warning: (NETFILTER_XT_MATCH_REALM && NET && INET && NETFILTER && NETFILTER_XTABLES && NETFILTER_ADVANCED || NET_CLS_ROUTE4 && NET && NET_SCHED) selects NET_CLS_ROUTE which has unmet direct dependencies (NET && NET_SCHED)
#
# configuration written to .config
#




[-- Attachment #2: Type: application/pgp-signature, Size: 227 bytes --]

^ permalink raw reply

* Re: [PATCH] bridge: Forward reserved group addresses if !STP
From: David Miller @ 2010-10-21 11:29 UTC (permalink / raw)
  To: shemminger
  Cc: benjamin.poirier, herbert, eric.dumazet, jpirko, bridge, netdev,
	linux-kernel
In-Reply-To: <20101018202858.7342f2cb@nehalam>

From: Stephen Hemminger <shemminger@linux-foundation.org>
Date: Mon, 18 Oct 2010 20:28:58 -0700

> On Mon, 18 Oct 2010 22:09:35 -0400
> Benjamin Poirier <benjamin.poirier@polymtl.ca> wrote:
> 
>> Make all frames sent to reserved group MAC addresses (01:80:c2:00:00:00 to
>> 01:80:c2:00:00:0f) be forwarded if STP is disabled. This enables
>> forwarding EAPOL frames, among other things.
>> 
>> Signed-off-by: Benjamin Poirier <benjamin.poirier@polymtl.ca>
> 
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH v2.6.36-rc7] net/neighbour: cancel_delayed_work() + flush_scheduled_work() -> cancel_delayed_work_sync()
From: David Miller @ 2010-10-21 11:29 UTC (permalink / raw)
  To: tj; +Cc: netdev, linux-kernel
In-Reply-To: <4CBDC19A.60709@kernel.org>

From: Tejun Heo <tj@kernel.org>
Date: Tue, 19 Oct 2010 18:04:42 +0200

> flush_scheduled_work() is going away.  Prepare for it.
> 
> Signed-off-by: Tejun Heo <tj@kernel.org>

Applied.

^ permalink raw reply

* Re: [PATCH net-next-2.6] be2net: Changes to use only priority codes allowed by f/w
From: David Miller @ 2010-10-21 11:27 UTC (permalink / raw)
  To: somnath.kotur; +Cc: netdev
In-Reply-To: <20101019085114.GA352@emulex.com>

From: Somnath Kotur <somnath.kotur@emulex.com>
Date: Tue, 19 Oct 2010 14:21:14 +0530

> Changes to use one of the priority codes allowed by CNA f/w for NIC traffic
> from host. The driver gets the bit map of the priority codes allowed for
> host traffic through a asynchronous message from the f/w that the driver
> subscribes to.
> 
> Signed-off-by: Somnath Kotur <somnath.kotur@emulex.com>

This patch does not apply to the current tree.

^ permalink raw reply

* Re: [RFC PATCH 5/9] ipvs network name space aware
From: Eric Dumazet @ 2010-10-21 11:26 UTC (permalink / raw)
  To: Simon Horman
  Cc: Hans Schillstrom, lvs-devel, netdev, netfilter-devel, ja, wensong,
	daniel.lezcano
In-Reply-To: <20101021111644.GA25555@verge.net.au>

Le jeudi 21 octobre 2010 à 13:16 +0200, Simon Horman a écrit :

> > @@ -2680,10 +2664,15 @@ static int ip_vs_genl_dump_services(struct sk_buff *skb,
> >  	int idx = 0, i;
> >  	int start = cb->args[0];
> >  	struct ip_vs_service *svc;
> > -
> > +	struct net *net = skb->sk->sk_net;
> 
> skb->sk->sk_net needs CONFIG_NS_NET.
> Is your plan for IPVS to unconditionally depend on CONFIG_NS_NET?
> It would be nice to avoid that, but I fear it will be too messy.
> 


struct net *net = sock_net(skb->sk);

is your friend ;)


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

^ permalink raw reply

* Re: [RFC PATCH 5/9] ipvs network name space aware
From: Simon Horman @ 2010-10-21 11:16 UTC (permalink / raw)
  To: Hans Schillstrom
  Cc: lvs-devel, netdev, netfilter-devel, ja, wensong, daniel.lezcano
In-Reply-To: <201010081317.04167.hans.schillstrom@ericsson.com>

On Fri, Oct 08, 2010 at 01:17:02PM +0200, Hans Schillstrom wrote:
> This patch just contains ip_vs_ctl
> 
> Signed-off-by:Hans Schillstrom <hans.schillstrom@ericsson.com>
> 
> diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
> index ca8ec8c..7e99cbc 100644
> --- a/net/netfilter/ipvs/ip_vs_ctl.c
> +++ b/net/netfilter/ipvs/ip_vs_ctl.c

[ snip ]

> @@ -2680,10 +2664,15 @@ static int ip_vs_genl_dump_services(struct sk_buff *skb,
>  	int idx = 0, i;
>  	int start = cb->args[0];
>  	struct ip_vs_service *svc;
> -
> +	struct net *net = skb->sk->sk_net;

skb->sk->sk_net needs CONFIG_NS_NET.
Is your plan for IPVS to unconditionally depend on CONFIG_NS_NET?
It would be nice to avoid that, but I fear it will be too messy.

> +	struct netns_ipvs *ipvs;
> +	if (!net)
> +		net = dev_net(skb->dev);
> +	BUG_ON(!net);
> +	ipvs = net->ipvs;
>  	mutex_lock(&__ip_vs_mutex);
>  	for (i = 0; i < IP_VS_SVC_TAB_SIZE; i++) {
> -		list_for_each_entry(svc, &ip_vs_svc_table[i], s_list) {
> +		list_for_each_entry(svc, &ipvs->ctl_svc_table[i], s_list) {
>  			if (++idx <= start)
>  				continue;
>  			if (ip_vs_genl_dump_service(skb, svc, cb) < 0) {

[ snip ]

^ permalink raw reply

* Re: [PATCH] ipv4: synchronize bind() with RTM_NEWADDR notifications
From: Eric Dumazet @ 2010-10-21 11:12 UTC (permalink / raw)
  To: Timo Teräs; +Cc: David Miller, netdev
In-Reply-To: <4CC01CC0.7090101@iki.fi>

Le jeudi 21 octobre 2010 à 13:58 +0300, Timo Teräs a écrit :
> On 10/21/2010 01:50 PM, David Miller wrote:
> > From: Timo Teräs <timo.teras@iki.fi>
> > Date: Thu, 21 Oct 2010 13:41:37 +0300
> > 
> >> Is inet_bind() called from non-userland context? If yes, then this is a
> >> bad idea. Otherwise I don't think it's that hot path...
> > 
> > It is.
> 
> Yet, almost immediately after that there is lock_sock() which can also
> sleep. How does that work then?
> 

I am not sure I understand your question. Maybe my answer wont be clear.

rtnl_lock() can take ages on some setups, because its using one single
and shared mutex. Its use should be restricted to administrative
purposes.

bind() is a pretty hot path on many workloads, this is hardly what we
call an administrative task.

lock_sock() uses a per socket lock, and it is a _bit_ more scalable, you
can have 4096 cpus all using bind()/recv()/send()/... at the same time,
it just works.




^ permalink raw reply

* Re: [PATCH 2/2] Revert d88dca79d3852a3623f606f781e013d61486828a
From: David Miller @ 2010-10-21 11:11 UTC (permalink / raw)
  To: nhorman; +Cc: netdev, jon.maloy, paul.gortmaker, tipc-discussion, luca
In-Reply-To: <1287659176-14504-3-git-send-email-nhorman@tuxdriver.com>

From: nhorman@tuxdriver.com
Date: Thu, 21 Oct 2010 07:06:16 -0400

> From: Neil Horman <nhorman@tuxdriver.com>
> 
> TIPC needs to have its endianess issues fixed.  Unfortunately, the format of a
> subscriber message is passed in directly from user space, so requiring this
> message to be in network byte order breaks user space ABI.  Revert this change
> until such time as we can determine how to do this in a backwards compatible
> manner.
> 
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>

Applied and queued up for -stable.

^ permalink raw reply

* Re: [PATCH 1/2] Revert c6537d6742985da1fbf12ae26cde6a096fd35b5c
From: David Miller @ 2010-10-21 11:11 UTC (permalink / raw)
  To: nhorman; +Cc: netdev, jon.maloy, paul.gortmaker, tipc-discussion, luca
In-Reply-To: <1287659176-14504-2-git-send-email-nhorman@tuxdriver.com>

From: nhorman@tuxdriver.com
Date: Thu, 21 Oct 2010 07:06:15 -0400

> From: Neil Horman <nhorman@tuxdriver.com>
> 
> Backout the tipc changes to the flags int he subscription message.  These
> changees, while reasonable on the surface, interefere with user space ABI
> compatibility which is a no-no.  This was part of the changes to fix the
> endianess issues in the TIPC protocol, which would be really nice to do but we
> need to do so in a way that is backwards compatible with user space.
> 
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>

Applied and queued up for -stable.

^ permalink raw reply

* Re: [PATCH 3/3] tproxy: fix hash locking issue when using port redirection in __inet_inherit_port()
From: Patrick McHardy @ 2010-10-21 11:08 UTC (permalink / raw)
  To: KOVACS Krisztian; +Cc: netdev, netfilter-devel, David Miller
In-Reply-To: <20101020112142.6538.40476.stgit@este.odu>

Am 20.10.2010 13:21, schrieb KOVACS Krisztian:
> When __inet_inherit_port() is called on a tproxy connection the wrong locks are
> held for the inet_bind_bucket it is added to. __inet_inherit_port() made an
> implicit assumption that the listener's port number (and thus its bind bucket).
> Unfortunately, if you're using the TPROXY target to redirect skbs to a
> transparent proxy that assumption is not true anymore and things break.
> 
> This patch adds code to __inet_inherit_port() so that it can handle this case
> by looking up or creating a new bind bucket for the child socket and updates
> callers of __inet_inherit_port() to gracefully handle __inet_inherit_port()
> failing.
> 
> Reported by and original patch from Stephen Buck <stephen.buck@exinda.com>.
> See http://marc.info/?t=128169268200001&r=1&w=2 for the original discussion.

Applied, thanks.

^ permalink raw reply

* [PATCH 2/2] Revert d88dca79d3852a3623f606f781e013d61486828a
From: nhorman @ 2010-10-21 11:06 UTC (permalink / raw)
  To: netdev; +Cc: davem, jon.maloy, paul.gortmaker, tipc-discussion, luca, nhorman
In-Reply-To: <1287659176-14504-1-git-send-email-nhorman@tuxdriver.com>

From: Neil Horman <nhorman@tuxdriver.com>

TIPC needs to have its endianess issues fixed.  Unfortunately, the format of a
subscriber message is passed in directly from user space, so requiring this
message to be in network byte order breaks user space ABI.  Revert this change
until such time as we can determine how to do this in a backwards compatible
manner.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
---
 net/tipc/subscr.c |   57 ++++++++++++++++++++++++++++++++--------------------
 net/tipc/subscr.h |    2 +
 2 files changed, 37 insertions(+), 22 deletions(-)

diff --git a/net/tipc/subscr.c b/net/tipc/subscr.c
index ecccfdb..3331396 100644
--- a/net/tipc/subscr.c
+++ b/net/tipc/subscr.c
@@ -76,6 +76,19 @@ struct top_srv {
 static struct top_srv topsrv = { 0 };
 
 /**
+ * htohl - convert value to endianness used by destination
+ * @in: value to convert
+ * @swap: non-zero if endianness must be reversed
+ *
+ * Returns converted value
+ */
+
+static u32 htohl(u32 in, int swap)
+{
+	return swap ? swab32(in) : in;
+}
+
+/**
  * subscr_send_event - send a message containing a tipc_event to the subscriber
  *
  * Note: Must not hold subscriber's server port lock, since tipc_send() will
@@ -94,11 +107,11 @@ static void subscr_send_event(struct subscription *sub,
 	msg_sect.iov_base = (void *)&sub->evt;
 	msg_sect.iov_len = sizeof(struct tipc_event);
 
-	sub->evt.event = htonl(event);
-	sub->evt.found_lower = htonl(found_lower);
-	sub->evt.found_upper = htonl(found_upper);
-	sub->evt.port.ref = htonl(port_ref);
-	sub->evt.port.node = htonl(node);
+	sub->evt.event = htohl(event, sub->swap);
+	sub->evt.found_lower = htohl(found_lower, sub->swap);
+	sub->evt.found_upper = htohl(found_upper, sub->swap);
+	sub->evt.port.ref = htohl(port_ref, sub->swap);
+	sub->evt.port.node = htohl(node, sub->swap);
 	tipc_send(sub->server_ref, 1, &msg_sect);
 }
 
@@ -274,23 +287,16 @@ static void subscr_cancel(struct tipc_subscr *s,
 {
 	struct subscription *sub;
 	struct subscription *sub_temp;
-	__u32 type, lower, upper;
 	int found = 0;
 
 	/* Find first matching subscription, exit if not found */
 
-	type = ntohl(s->seq.type);
-	lower = ntohl(s->seq.lower);
-	upper = ntohl(s->seq.upper);
-
 	list_for_each_entry_safe(sub, sub_temp, &subscriber->subscription_list,
 				 subscription_list) {
-			if ((type == sub->seq.type) &&
-			    (lower == sub->seq.lower) &&
-			    (upper == sub->seq.upper)) {
-				found = 1;
-				break;
-			}
+		if (!memcmp(s, &sub->evt.s, sizeof(struct tipc_subscr))) {
+			found = 1;
+			break;
+		}
 	}
 	if (!found)
 		return;
@@ -319,10 +325,16 @@ static struct subscription *subscr_subscribe(struct tipc_subscr *s,
 					     struct subscriber *subscriber)
 {
 	struct subscription *sub;
+	int swap;
+
+	/* Determine subscriber's endianness */
+
+	swap = !(s->filter & (TIPC_SUB_PORTS | TIPC_SUB_SERVICE));
 
 	/* Detect & process a subscription cancellation request */
 
-	if (ntohl(s->filter) & TIPC_SUB_CANCEL) {
+	if (s->filter & htohl(TIPC_SUB_CANCEL, swap)) {
+		s->filter &= ~htohl(TIPC_SUB_CANCEL, swap);
 		subscr_cancel(s, subscriber);
 		return NULL;
 	}
@@ -347,11 +359,11 @@ static struct subscription *subscr_subscribe(struct tipc_subscr *s,
 
 	/* Initialize subscription object */
 
-	sub->seq.type = ntohl(s->seq.type);
-	sub->seq.lower = ntohl(s->seq.lower);
-	sub->seq.upper = ntohl(s->seq.upper);
-	sub->timeout = ntohl(s->timeout);
-	sub->filter = ntohl(s->filter);
+	sub->seq.type = htohl(s->seq.type, swap);
+	sub->seq.lower = htohl(s->seq.lower, swap);
+	sub->seq.upper = htohl(s->seq.upper, swap);
+	sub->timeout = htohl(s->timeout, swap);
+	sub->filter = htohl(s->filter, swap);
 	if ((!(sub->filter & TIPC_SUB_PORTS) ==
 	     !(sub->filter & TIPC_SUB_SERVICE)) ||
 	    (sub->seq.lower > sub->seq.upper)) {
@@ -364,6 +376,7 @@ static struct subscription *subscr_subscribe(struct tipc_subscr *s,
 	INIT_LIST_HEAD(&sub->nameseq_list);
 	list_add(&sub->subscription_list, &subscriber->subscription_list);
 	sub->server_ref = subscriber->port_ref;
+	sub->swap = swap;
 	memcpy(&sub->evt.s, s, sizeof(struct tipc_subscr));
 	atomic_inc(&topsrv.subscription_count);
 	if (sub->timeout != TIPC_WAIT_FOREVER) {
diff --git a/net/tipc/subscr.h b/net/tipc/subscr.h
index c20f496..45d89bf 100644
--- a/net/tipc/subscr.h
+++ b/net/tipc/subscr.h
@@ -53,6 +53,7 @@ typedef void (*tipc_subscr_event) (struct subscription *sub,
  * @nameseq_list: adjacent subscriptions in name sequence's subscription list
  * @subscription_list: adjacent subscriptions in subscriber's subscription list
  * @server_ref: object reference of server port associated with subscription
+ * @swap: indicates if subscriber uses opposite endianness in its messages
  * @evt: template for events generated by subscription
  */
 
@@ -65,6 +66,7 @@ struct subscription {
 	struct list_head nameseq_list;
 	struct list_head subscription_list;
 	u32 server_ref;
+	int swap;
 	struct tipc_event evt;
 };
 
-- 
1.7.2.3


^ permalink raw reply related

* Re: [PATCH] net/core: Allow tagged VLAN packets to flow through VETH devices.
From: David Miller @ 2010-10-21 11:07 UTC (permalink / raw)
  To: greearb; +Cc: netdev
In-Reply-To: <1287167705-28583-1-git-send-email-greearb@candelatech.com>

From: Ben Greear <greearb@candelatech.com>
Date: Fri, 15 Oct 2010 11:35:05 -0700

> When there are VLANs on a VETH device, the packets being transmitted
> through the VETH device may be 4 bytes bigger than MTU.  A check
> in dev_forward_skb did not take this into account and so dropped
> these packets.
> 
> This patch is needed at least as far back as 2.6.34.7 and should
> be considered for -stable.
> 
> Signed-off-by: Ben Greear <greearb@candelatech.com>

Applied, although a check of the vlan-capable netdev flag
might be appropriate to add.

^ permalink raw reply

* [PATCH 1/2] Revert c6537d6742985da1fbf12ae26cde6a096fd35b5c
From: nhorman @ 2010-10-21 11:06 UTC (permalink / raw)
  To: netdev; +Cc: davem, jon.maloy, paul.gortmaker, tipc-discussion, luca, nhorman
In-Reply-To: <1287659176-14504-1-git-send-email-nhorman@tuxdriver.com>

From: Neil Horman <nhorman@tuxdriver.com>

Backout the tipc changes to the flags int he subscription message.  These
changees, while reasonable on the surface, interefere with user space ABI
compatibility which is a no-no.  This was part of the changes to fix the
endianess issues in the TIPC protocol, which would be really nice to do but we
need to do so in a way that is backwards compatible with user space.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
---
 include/linux/tipc.h |   30 ++++++++++++++++++------------
 net/tipc/subscr.c    |   15 +++++----------
 2 files changed, 23 insertions(+), 22 deletions(-)

diff --git a/include/linux/tipc.h b/include/linux/tipc.h
index 181c8d0..d10614b 100644
--- a/include/linux/tipc.h
+++ b/include/linux/tipc.h
@@ -127,17 +127,23 @@ static inline unsigned int tipc_node(__u32 addr)
  * TIPC topology subscription service definitions
  */
 
-#define TIPC_SUB_SERVICE     	0x00  	/* Filter for service availability    */
-#define TIPC_SUB_PORTS     	0x01  	/* Filter for port availability  */
-#define TIPC_SUB_CANCEL         0x04    /* Cancel a subscription         */
+#define TIPC_SUB_PORTS     	0x01  	/* filter for port availability */
+#define TIPC_SUB_SERVICE     	0x02  	/* filter for service availability */
+#define TIPC_SUB_CANCEL         0x04    /* cancel a subscription */
+#if 0
+/* The following filter options are not currently implemented */
+#define TIPC_SUB_NO_BIND_EVTS	0x04	/* filter out "publish" events */
+#define TIPC_SUB_NO_UNBIND_EVTS	0x08	/* filter out "withdraw" events */
+#define TIPC_SUB_SINGLE_EVT	0x10	/* expire after first event */
+#endif
 
 #define TIPC_WAIT_FOREVER	~0	/* timeout for permanent subscription */
 
 struct tipc_subscr {
-	struct tipc_name_seq seq;	/* NBO. Name sequence of interest */
-	__u32 timeout;			/* NBO. Subscription duration (in ms) */
-        __u32 filter;   		/* NBO. Bitmask of filter options */
-	char usr_handle[8];		/* Opaque. Available for subscriber use */
+	struct tipc_name_seq seq;	/* name sequence of interest */
+	__u32 timeout;			/* subscription duration (in ms) */
+        __u32 filter;   		/* bitmask of filter options */
+	char usr_handle[8];		/* available for subscriber use */
 };
 
 #define TIPC_PUBLISHED		1	/* publication event */
@@ -145,11 +151,11 @@ struct tipc_subscr {
 #define TIPC_SUBSCR_TIMEOUT	3	/* subscription timeout event */
 
 struct tipc_event {
-	__u32 event;			/* NBO. Event type, as defined above */
-	__u32 found_lower;		/* NBO. Matching name seq instances  */
-	__u32 found_upper;		/*  "      "       "   "    "        */
-	struct tipc_portid port;	/* NBO. Associated port              */
-	struct tipc_subscr s;		/* Original, associated subscription */
+	__u32 event;			/* event type */
+	__u32 found_lower;		/* matching name seq instances */
+	__u32 found_upper;		/*    "      "    "     "      */
+	struct tipc_portid port;	/* associated port */
+	struct tipc_subscr s;		/* associated subscription */
 };
 
 /*
diff --git a/net/tipc/subscr.c b/net/tipc/subscr.c
index 18813ac..ecccfdb 100644
--- a/net/tipc/subscr.c
+++ b/net/tipc/subscr.c
@@ -274,7 +274,7 @@ static void subscr_cancel(struct tipc_subscr *s,
 {
 	struct subscription *sub;
 	struct subscription *sub_temp;
-	__u32 type, lower, upper, timeout, filter;
+	__u32 type, lower, upper;
 	int found = 0;
 
 	/* Find first matching subscription, exit if not found */
@@ -282,18 +282,12 @@ static void subscr_cancel(struct tipc_subscr *s,
 	type = ntohl(s->seq.type);
 	lower = ntohl(s->seq.lower);
 	upper = ntohl(s->seq.upper);
-	timeout = ntohl(s->timeout);
-	filter = ntohl(s->filter) & ~TIPC_SUB_CANCEL;
 
 	list_for_each_entry_safe(sub, sub_temp, &subscriber->subscription_list,
 				 subscription_list) {
 			if ((type == sub->seq.type) &&
 			    (lower == sub->seq.lower) &&
-			    (upper == sub->seq.upper) &&
-			    (timeout == sub->timeout) &&
-                            (filter == sub->filter) &&
-                             !memcmp(s->usr_handle,sub->evt.s.usr_handle,
-				     sizeof(s->usr_handle)) ){
+			    (upper == sub->seq.upper)) {
 				found = 1;
 				break;
 			}
@@ -310,7 +304,7 @@ static void subscr_cancel(struct tipc_subscr *s,
 		k_term_timer(&sub->timer);
 		spin_lock_bh(subscriber->lock);
 	}
-	dbg("Cancel: removing sub %u,%u,%u from subscriber %p list\n",
+	dbg("Cancel: removing sub %u,%u,%u from subscriber %x list\n",
 	    sub->seq.type, sub->seq.lower, sub->seq.upper, subscriber);
 	subscr_del(sub);
 }
@@ -358,7 +352,8 @@ static struct subscription *subscr_subscribe(struct tipc_subscr *s,
 	sub->seq.upper = ntohl(s->seq.upper);
 	sub->timeout = ntohl(s->timeout);
 	sub->filter = ntohl(s->filter);
-	if ((sub->filter && (sub->filter != TIPC_SUB_PORTS)) ||
+	if ((!(sub->filter & TIPC_SUB_PORTS) ==
+	     !(sub->filter & TIPC_SUB_SERVICE)) ||
 	    (sub->seq.lower > sub->seq.upper)) {
 		warn("Subscription rejected, illegal request\n");
 		kfree(sub);
-- 
1.7.2.3


^ permalink raw reply related

* [PATCH] tipc: revert some previously ABI breaking changes to the user space tipc interface
From: nhorman @ 2010-10-21 11:06 UTC (permalink / raw)
  To: netdev; +Cc: davem, jon.maloy, paul.gortmaker, tipc-discussion, luca, nhorman

Based on discussions with Leandro Lucarella and Jon Maloy, it appears we've
managed to break the TIPC user space ABI.  While it would be really nice to have
some level of consistency in regards to on the wire byte order, we can't do that
if it breaks user space.  This patch series reverts the offending patches that
caused this, and puts us back in a state that allows user space to work
properly.  We can now go back and look at methods to get consistent on the wire
byte order while maintaining host byte order in the user space API.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>

^ permalink raw reply

* Re: [PATCH] ipv4: synchronize bind() with RTM_NEWADDR notifications
From: David Miller @ 2010-10-21 11:03 UTC (permalink / raw)
  To: timo.teras; +Cc: eric.dumazet, netdev
In-Reply-To: <4CC01CC0.7090101@iki.fi>

From: Timo Teräs <timo.teras@iki.fi>
Date: Thu, 21 Oct 2010 13:58:08 +0300

> On 10/21/2010 01:50 PM, David Miller wrote:
>> From: Timo Teräs <timo.teras@iki.fi>
>> Date: Thu, 21 Oct 2010 13:41:37 +0300
>> 
>>> Is inet_bind() called from non-userland context? If yes, then this is a
>>> bad idea. Otherwise I don't think it's that hot path...
>> 
>> It is.
> 
> Yet, almost immediately after that there is lock_sock() which can also
> sleep. How does that work then?

RTNL interlocks globally with a heavy primitive, a mutex, lock_sock()
grabs a spinlcok which is local to the socket's context.

So if we have 100,000 sockets binding we'll suck with you're change
whereas the lock_sock() does not cause that problem.

Is this so difficult for you to comprehend?

^ permalink raw reply

* [PATCH 08/10] can: at91_can: convert readl, writel their __raw pendants
From: Marc Kleine-Budde @ 2010-10-21 11:01 UTC (permalink / raw)
  To: socketcan-core; +Cc: netdev, Marc Kleine-Budde, Russell King
In-Reply-To: <1287658882-26914-1-git-send-email-mkl@pengutronix.de>

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: Russell King <rmk@arm.linux.org.uk>
---
 drivers/net/can/at91_can.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/can/at91_can.c b/drivers/net/can/at91_can.c
index ace9c08..12bd615 100644
--- a/drivers/net/can/at91_can.c
+++ b/drivers/net/can/at91_can.c
@@ -199,13 +199,13 @@ static inline int get_tx_echo_mb(const struct at91_priv *priv)
 
 static inline u32 at91_read(const struct at91_priv *priv, enum at91_reg reg)
 {
-	return readl(priv->reg_base + reg);
+	return __raw_readl(priv->reg_base + reg);
 }
 
 static inline void at91_write(const struct at91_priv *priv, enum at91_reg reg,
 		u32 value)
 {
-	writel(value, priv->reg_base + reg);
+	__raw_writel(value, priv->reg_base + reg);
 }
 
 static inline void set_mb_mode_prio(const struct at91_priv *priv,
-- 
1.7.0.4


^ permalink raw reply related

* [PATCH 10/10] can: at91_can: add KBUILD_MODNAME to bittiming constant
From: Marc Kleine-Budde @ 2010-10-21 11:01 UTC (permalink / raw)
  To: socketcan-core; +Cc: netdev, Marc Kleine-Budde
In-Reply-To: <1287658882-26914-1-git-send-email-mkl@pengutronix.de>

While there replace all usage of self defined DRV_NAME by KBUILD_MODNAME.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/at91_can.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/can/at91_can.c b/drivers/net/can/at91_can.c
index 7149a86..cee98fa 100644
--- a/drivers/net/can/at91_can.c
+++ b/drivers/net/can/at91_can.c
@@ -40,7 +40,6 @@
 
 #include <mach/board.h>
 
-#define DRV_NAME		"at91_can"
 #define AT91_NAPI_WEIGHT	12
 
 /*
@@ -172,6 +171,7 @@ struct at91_priv {
 };
 
 static struct can_bittiming_const at91_bittiming_const = {
+	.name		= KBUILD_MODNAME,
 	.tseg1_min	= 4,
 	.tseg1_max	= 16,
 	.tseg2_min	= 2,
@@ -1148,7 +1148,7 @@ static struct platform_driver at91_can_driver = {
 	.probe		= at91_can_probe,
 	.remove		= __devexit_p(at91_can_remove),
 	.driver		= {
-		.name	= DRV_NAME,
+		.name	= KBUILD_MODNAME,
 		.owner	= THIS_MODULE,
 	},
 };
@@ -1168,4 +1168,4 @@ module_exit(at91_can_module_exit);
 
 MODULE_AUTHOR("Marc Kleine-Budde <mkl@pengutronix.de>");
 MODULE_LICENSE("GPL v2");
-MODULE_DESCRIPTION(DRV_NAME " CAN netdevice driver");
+MODULE_DESCRIPTION(KBUILD_MODNAME " CAN netdevice driver");
-- 
1.7.0.4


^ permalink raw reply related

* [PATCH 09/10] can: at91_can: convert dev_<level> printing to netdev_<level>
From: Marc Kleine-Budde @ 2010-10-21 11:01 UTC (permalink / raw)
  To: socketcan-core; +Cc: netdev, Marc Kleine-Budde
In-Reply-To: <1287658882-26914-1-git-send-email-mkl@pengutronix.de>

While there, remove "printk()" on driver loading.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/at91_can.c |   35 ++++++++++++++++-------------------
 1 files changed, 16 insertions(+), 19 deletions(-)

diff --git a/drivers/net/can/at91_can.c b/drivers/net/can/at91_can.c
index 12bd615..7149a86 100644
--- a/drivers/net/can/at91_can.c
+++ b/drivers/net/can/at91_can.c
@@ -268,7 +268,7 @@ static int at91_set_bittiming(struct net_device *dev)
 		((bt->prop_seg - 1) << 8) | ((bt->phase_seg1 - 1) << 4) |
 		((bt->phase_seg2 - 1) << 0);
 
-	dev_info(dev->dev.parent, "writing AT91_BR: 0x%08x\n", reg_br);
+	netdev_info(dev, "writing AT91_BR: 0x%08x\n", reg_br);
 
 	at91_write(priv, AT91_BR, reg_br);
 
@@ -369,8 +369,7 @@ static netdev_tx_t at91_start_xmit(struct sk_buff *skb, struct net_device *dev)
 	if (unlikely(!(at91_read(priv, AT91_MSR(mb)) & AT91_MSR_MRDY))) {
 		netif_stop_queue(dev);
 
-		dev_err(dev->dev.parent,
-			"BUG! TX buffer full when queue awake!\n");
+		netdev_err(dev, "BUG! TX buffer full when queue awake!\n");
 		return NETDEV_TX_BUSY;
 	}
 
@@ -454,7 +453,7 @@ static void at91_rx_overflow_err(struct net_device *dev)
 	struct sk_buff *skb;
 	struct can_frame *cf;
 
-	dev_dbg(dev->dev.parent, "RX buffer overflow\n");
+	netdev_dbg(dev, "RX buffer overflow\n");
 	stats->rx_over_errors++;
 	stats->rx_errors++;
 
@@ -587,8 +586,8 @@ static int at91_poll_rx(struct net_device *dev, int quota)
 
 	if (priv->rx_next > AT91_MB_RX_LOW_LAST &&
 	    reg_sr & AT91_MB_RX_LOW_MASK)
-		dev_info(dev->dev.parent,
-			 "order of incoming frames cannot be guaranteed\n");
+		netdev_info(dev,
+			"order of incoming frames cannot be guaranteed\n");
 
  again:
 	for (mb = find_next_bit(addr, AT91_MB_RX_NUM, priv->rx_next);
@@ -626,7 +625,7 @@ static void at91_poll_err_frame(struct net_device *dev,
 
 	/* CRC error */
 	if (reg_sr & AT91_IRQ_CERR) {
-		dev_dbg(dev->dev.parent, "CERR irq\n");
+		netdev_dbg(dev, "CERR irq\n");
 		dev->stats.rx_errors++;
 		priv->can.can_stats.bus_error++;
 		cf->can_id |= CAN_ERR_PROT | CAN_ERR_BUSERROR;
@@ -634,7 +633,7 @@ static void at91_poll_err_frame(struct net_device *dev,
 
 	/* Stuffing Error */
 	if (reg_sr & AT91_IRQ_SERR) {
-		dev_dbg(dev->dev.parent, "SERR irq\n");
+		netdev_dbg(dev, "SERR irq\n");
 		dev->stats.rx_errors++;
 		priv->can.can_stats.bus_error++;
 		cf->can_id |= CAN_ERR_PROT | CAN_ERR_BUSERROR;
@@ -643,14 +642,14 @@ static void at91_poll_err_frame(struct net_device *dev,
 
 	/* Acknowledgement Error */
 	if (reg_sr & AT91_IRQ_AERR) {
-		dev_dbg(dev->dev.parent, "AERR irq\n");
+		netdev_dbg(dev, "AERR irq\n");
 		dev->stats.tx_errors++;
 		cf->can_id |= CAN_ERR_ACK;
 	}
 
 	/* Form error */
 	if (reg_sr & AT91_IRQ_FERR) {
-		dev_dbg(dev->dev.parent, "FERR irq\n");
+		netdev_dbg(dev, "FERR irq\n");
 		dev->stats.rx_errors++;
 		priv->can.can_stats.bus_error++;
 		cf->can_id |= CAN_ERR_PROT | CAN_ERR_BUSERROR;
@@ -659,7 +658,7 @@ static void at91_poll_err_frame(struct net_device *dev,
 
 	/* Bit Error */
 	if (reg_sr & AT91_IRQ_BERR) {
-		dev_dbg(dev->dev.parent, "BERR irq\n");
+		netdev_dbg(dev, "BERR irq\n");
 		dev->stats.tx_errors++;
 		priv->can.can_stats.bus_error++;
 		cf->can_id |= CAN_ERR_PROT | CAN_ERR_BUSERROR;
@@ -791,7 +790,7 @@ static void at91_irq_err_state(struct net_device *dev,
 		 */
 		if (new_state >= CAN_STATE_ERROR_WARNING &&
 		    new_state <= CAN_STATE_BUS_OFF) {
-			dev_dbg(dev->dev.parent, "Error Warning IRQ\n");
+			netdev_dbg(dev, "Error Warning IRQ\n");
 			priv->can.can_stats.error_warning++;
 
 			cf->can_id |= CAN_ERR_CRTL;
@@ -807,7 +806,7 @@ static void at91_irq_err_state(struct net_device *dev,
 		 */
 		if (new_state >= CAN_STATE_ERROR_PASSIVE &&
 		    new_state <= CAN_STATE_BUS_OFF) {
-			dev_dbg(dev->dev.parent, "Error Passive IRQ\n");
+			netdev_dbg(dev, "Error Passive IRQ\n");
 			priv->can.can_stats.error_passive++;
 
 			cf->can_id |= CAN_ERR_CRTL;
@@ -824,7 +823,7 @@ static void at91_irq_err_state(struct net_device *dev,
 		if (new_state <= CAN_STATE_ERROR_PASSIVE) {
 			cf->can_id |= CAN_ERR_RESTARTED;
 
-			dev_dbg(dev->dev.parent, "restarted\n");
+			netdev_dbg(dev, "restarted\n");
 			priv->can.can_stats.restarts++;
 
 			netif_carrier_on(dev);
@@ -845,7 +844,7 @@ static void at91_irq_err_state(struct net_device *dev,
 		 * circumstances. so just enable AT91_IRQ_ERRP, thus
 		 * the "fallthrough"
 		 */
-		dev_dbg(dev->dev.parent, "Error Active\n");
+		netdev_dbg(dev, "Error Active\n");
 		cf->can_id |= CAN_ERR_PROT;
 		cf->data[2] = CAN_ERR_PROT_ACTIVE;
 	case CAN_STATE_ERROR_WARNING:	/* fallthrough */
@@ -863,7 +862,7 @@ static void at91_irq_err_state(struct net_device *dev,
 
 		cf->can_id |= CAN_ERR_BUSOFF;
 
-		dev_dbg(dev->dev.parent, "bus-off\n");
+		netdev_dbg(dev, "bus-off\n");
 		netif_carrier_off(dev);
 		priv->can.can_stats.bus_off++;
 
@@ -901,7 +900,7 @@ static void at91_irq_err(struct net_device *dev)
 	else if (likely(reg_sr & AT91_IRQ_ERRA))
 		new_state = CAN_STATE_ERROR_ACTIVE;
 	else {
-		dev_err(dev->dev.parent, "BUG! hardware in undefined state\n");
+		netdev_err(dev, "BUG! hardware in undefined state\n");
 		return;
 	}
 
@@ -1156,14 +1155,12 @@ static struct platform_driver at91_can_driver = {
 
 static int __init at91_can_module_init(void)
 {
-	printk(KERN_INFO "%s netdevice driver\n", DRV_NAME);
 	return platform_driver_register(&at91_can_driver);
 }
 
 static void __exit at91_can_module_exit(void)
 {
 	platform_driver_unregister(&at91_can_driver);
-	printk(KERN_INFO "%s: driver removed\n", DRV_NAME);
 }
 
 module_init(at91_can_module_init);
-- 
1.7.0.4


^ permalink raw reply related

* [PATCH 05/10] can: at91_can: fix section mismatch warning
From: Marc Kleine-Budde @ 2010-10-21 11:01 UTC (permalink / raw)
  To: socketcan-core; +Cc: netdev, Marc Kleine-Budde
In-Reply-To: <1287658882-26914-1-git-send-email-mkl@pengutronix.de>

...by adding the correct annotation "__devinit" to the driver's probe
function.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/net/can/at91_can.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/can/at91_can.c b/drivers/net/can/at91_can.c
index 1954ab0..6187813 100644
--- a/drivers/net/can/at91_can.c
+++ b/drivers/net/can/at91_can.c
@@ -1027,7 +1027,7 @@ static const struct net_device_ops at91_netdev_ops = {
 	.ndo_start_xmit	= at91_start_xmit,
 };
 
-static int __init at91_can_probe(struct platform_device *pdev)
+static int __devinit at91_can_probe(struct platform_device *pdev)
 {
 	struct net_device *dev;
 	struct at91_priv *priv;
-- 
1.7.0.4


^ permalink raw reply related


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