* RE: INVESTMENT/ RELOCATION ASSISTANCE. 14th/10/2013
From: Mrs. Maryann Jamila Hussein. @ 2013-10-14 19:55 UTC (permalink / raw)
To: Recipients
Dear Beloved,
I am Mrs. Maryann Jamila Hussein a Teacher and a Muslim Convert here in Syria,i had sent a previous mail which i am not sure you got. I need your assistance to invest and help me relocate my 3 kids who are 17 years and below, so that they can get a better life there in your country due to the on going crises here in Syria.
I need your trust, before the death of my husband we had a savings with an Indian Bank, so money is not the issue.
I got your reference in my search for someone who suits my
purpose.If you can help me reply, let me know.
Regards,
Mrs. Maryann Jamila Hussein.
=====================================
^ permalink raw reply
* SW csum errors
From: Kyle Hubert @ 2013-10-14 20:13 UTC (permalink / raw)
To: netdev
My problem is rather specific. I am working on an RDMA device, and we
have full end to end reliability. However, one of the initial spins of
our chip had some errors, since fixed, where the csum was unreliable.
So, we did exactly what Dave Miller warned not to do in the linked
message. We ran outgoing IP packets through the SKB checksum
function.. Unfortunately, we occasionally saw NFS csum errors on full
MTU packets.
Here is his response:
http://marc.info/?l=linux-netdev&m=128286758300676&w=2
Relevant portion:
"
Paged SKBs can have references to page cache pages and similar. These
can be updated asynchronously to the transmit, there is no locking at
all to freeze the contents, and therefore full checksum offload is
required to support SG correctly.
So don't get the idea to do the checksum in software in the infiniband
layer, and advertize hw checksumming support, to get around this :-)
"
Now that those chips have long gone, I am left pondering about these
packets "corrupted" before the device transfers them. Can I get more
information about these paged SKBs with asynchronous modifications?
How does NFS use them?
Thanks for your time,
-Kyle
^ permalink raw reply
* [PATCH net-next] 8390 ei_debug : Reenable the use of debugging in 8390 based chips
From: Matthew Whitehead @ 2013-10-14 20:33 UTC (permalink / raw)
To: netdev; +Cc: Matthew Whitehead
Ethernet boards based on the 8390 chip had an '#ifdef notdef' disabling the
use of the debug variable ei_debug. Reenable it for those of us who still
occasionally use it.
Signed-off-by: Matthew Whitehead <tedheadster@gmail.com>
---
drivers/net/ethernet/8390/8390.h | 2 +-
drivers/net/ethernet/8390/axnet_cs.c | 5 -----
drivers/net/ethernet/8390/lib8390.c | 4 ++--
3 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/8390/8390.h b/drivers/net/ethernet/8390/8390.h
index ef325ff..2375087 100644
--- a/drivers/net/ethernet/8390/8390.h
+++ b/drivers/net/ethernet/8390/8390.h
@@ -21,7 +21,7 @@ struct e8390_pkt_hdr {
unsigned short count; /* header + packet length in bytes */
};
-#ifdef notdef
+#ifdef EI_DEBUG
extern int ei_debug;
#else
#define ei_debug 1
diff --git a/drivers/net/ethernet/8390/axnet_cs.c b/drivers/net/ethernet/8390/axnet_cs.c
index d801c141..581560c 100644
--- a/drivers/net/ethernet/8390/axnet_cs.c
+++ b/drivers/net/ethernet/8390/axnet_cs.c
@@ -810,11 +810,6 @@ module_pcmcia_driver(axnet_cs_driver);
#define ei_block_input (ei_local->block_input)
#define ei_get_8390_hdr (ei_local->get_8390_hdr)
-/* use 0 for production, 1 for verification, >2 for debug */
-#ifndef ei_debug
-int ei_debug = 1;
-#endif
-
/* Index to functions. */
static void ei_tx_intr(struct net_device *dev);
static void ei_tx_err(struct net_device *dev);
diff --git a/drivers/net/ethernet/8390/lib8390.c b/drivers/net/ethernet/8390/lib8390.c
index b329f5c..4ec5e38 100644
--- a/drivers/net/ethernet/8390/lib8390.c
+++ b/drivers/net/ethernet/8390/lib8390.c
@@ -100,8 +100,8 @@
#define ei_get_8390_hdr (ei_local->get_8390_hdr)
/* use 0 for production, 1 for verification, >2 for debug */
-#ifndef ei_debug
-int ei_debug = 1;
+#ifdef EI_DEBUG
+int ei_debug = EI_DEBUG;
#endif
/* Index to functions. */
--
1.7.2.5
^ permalink raw reply related
* Re: SW csum errors
From: Eric Dumazet @ 2013-10-14 20:40 UTC (permalink / raw)
To: Kyle Hubert; +Cc: netdev
In-Reply-To: <CAJoZ4U3yCrGW=5TO5z0FL2HQ+thZVzVfiPOTxTGKBuR=njadOg@mail.gmail.com>
On Mon, 2013-10-14 at 16:13 -0400, Kyle Hubert wrote:
> My problem is rather specific. I am working on an RDMA device, and we
> have full end to end reliability. However, one of the initial spins of
> our chip had some errors, since fixed, where the csum was unreliable.
> So, we did exactly what Dave Miller warned not to do in the linked
> message. We ran outgoing IP packets through the SKB checksum
> function.. Unfortunately, we occasionally saw NFS csum errors on full
> MTU packets.
>
> Here is his response:
>
> http://marc.info/?l=linux-netdev&m=128286758300676&w=2
>
> Relevant portion:
>
> "
> Paged SKBs can have references to page cache pages and similar. These
> can be updated asynchronously to the transmit, there is no locking at
> all to freeze the contents, and therefore full checksum offload is
> required to support SG correctly.
>
> So don't get the idea to do the checksum in software in the infiniband
> layer, and advertize hw checksumming support, to get around this :-)
> "
>
> Now that those chips have long gone, I am left pondering about these
> packets "corrupted" before the device transfers them. Can I get more
> information about these paged SKBs with asynchronous modifications?
> How does NFS use them?
For a start try :
git grep -n SKBTX_SHARED_FRAG
git grep -n skb_has_shared_frag
git show cef401de7be8c4e
git show c9af6db4c11ccc6
^ permalink raw reply
* Re: [PATCH -next] netdev: inet_timewait_sock.h missing semi-colon when KMEMCHECK is enabled
From: Randy Dunlap @ 2013-10-14 20:47 UTC (permalink / raw)
To: Joe Perches
Cc: Thierry Reding, linux-next, linux-kernel, Mark Brown,
netdev@vger.kernel.org, David Miller
In-Reply-To: <1381780437.12919.3.camel@joe-AO722>
On 10/14/13 12:53, Joe Perches wrote:
> On Mon, 2013-10-14 at 12:36 -0700, Randy Dunlap wrote:
>> From: Randy Dunlap <rdunlap@infradead.org>
>>
>> Fix (a few hundred) build errors due to missing semi-colon when
>> KMEMCHECK is enabled:
>>
>> include/net/inet_timewait_sock.h:139:2: error: expected ',', ';' or '}' before 'int'
>> include/net/inet_timewait_sock.h:148:28: error: 'const struct inet_timewait_sock' has no member named 'tw_death_node'
>>
>> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
>> ---
>> include/net/inet_timewait_sock.h | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> --- next-2013-1014.orig/include/net/inet_timewait_sock.h
>> +++ next-2013-1014/include/net/inet_timewait_sock.h
>> @@ -135,7 +135,7 @@ struct inet_timewait_sock {
>> tw_transparent : 1,
>> tw_pad : 6, /* 6 bits hole */
>> tw_tos : 8,
>> - tw_pad2 : 16 /* 16 bits hole */
>> + tw_pad2 : 16; /* 16 bits hole */
>> kmemcheck_bitfield_end(flags);
>> u32 tw_ttd;
>> struct inet_bind_bucket *tw_tb;
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>> Please read the FAQ at http://www.tux.org/lkml/
>
> Shouldn't this be done in kmemcheck.h?
This patch makes sense and probably should be merged
but it does not fix the build errors that I reported.
> include/linux/kmemcheck.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/kmemcheck.h b/include/linux/kmemcheck.h
> index 39f8453..b9ffad5 100644
> --- a/include/linux/kmemcheck.h
> +++ b/include/linux/kmemcheck.h
> @@ -62,10 +62,10 @@ bool kmemcheck_is_obj_initialized(unsigned long addr, size_t size);
> * kmemcheck_annotate_bitfield(a, flags);
> */
> #define kmemcheck_bitfield_begin(name) \
> - int name##_begin[0];
> + int name##_begin[0]
>
> #define kmemcheck_bitfield_end(name) \
> - int name##_end[0];
> + int name##_end[0]
>
> #define kmemcheck_annotate_bitfield(ptr, name) \
> do { \
>
>
> --
--
~Randy
^ permalink raw reply
* [PATCH net-next] net: Delete trailing semi-colon from definition of netdev_WARN()
From: Ben Hutchings @ 2013-10-14 20:49 UTC (permalink / raw)
To: David Miller; +Cc: netdev
Macro definitions should not normally end with a semi-colon, as this
makes it dangerous to use them an if...else statement. Happily this
has not happened yet.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
include/linux/netdevice.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 2e53b44..27f62f7 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -3049,7 +3049,7 @@ do { \
* file/line information and a backtrace.
*/
#define netdev_WARN(dev, format, args...) \
- WARN(1, "netdevice: %s\n" format, netdev_name(dev), ##args);
+ WARN(1, "netdevice: %s\n" format, netdev_name(dev), ##args)
/* netif printk helpers, similar to netdev_printk */
--
Ben Hutchings, Staff Engineer, Solarflare
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: SW csum errors
From: Stephen Hemminger @ 2013-10-14 20:58 UTC (permalink / raw)
To: Kyle Hubert; +Cc: netdev
In-Reply-To: <CAJoZ4U3yCrGW=5TO5z0FL2HQ+thZVzVfiPOTxTGKBuR=njadOg@mail.gmail.com>
On Mon, 14 Oct 2013 16:13:15 -0400
Kyle Hubert <khubert@gmail.com> wrote:
> My problem is rather specific. I am working on an RDMA device, and we
> have full end to end reliability. However, one of the initial spins of
> our chip had some errors, since fixed, where the csum was unreliable.
> So, we did exactly what Dave Miller warned not to do in the linked
> message. We ran outgoing IP packets through the SKB checksum
> function.. Unfortunately, we occasionally saw NFS csum errors on full
> MTU packets.
>
> Here is his response:
>
> http://marc.info/?l=linux-netdev&m=128286758300676&w=2
>
> Relevant portion:
>
> "
> Paged SKBs can have references to page cache pages and similar. These
> can be updated asynchronously to the transmit, there is no locking at
> all to freeze the contents, and therefore full checksum offload is
> required to support SG correctly.
>
> So don't get the idea to do the checksum in software in the infiniband
> layer, and advertize hw checksumming support, to get around this :-)
> "
>
> Now that those chips have long gone, I am left pondering about these
> packets "corrupted" before the device transfers them. Can I get more
> information about these paged SKBs with asynchronous modifications?
> How does NFS use them?
You would have to either mark the pages as copy on write or copy the data.
Setting COW is expensive because you have to coordinate with other CPU's
on SMP. Not sure exactly how.
You can demonstrate this with either sendfile() or NFS where underlying
file contents are being modified while packet is in the queue.
^ permalink raw reply
* [PATCH] net bridge: remove unused field
From: Jamal Hadi Salim @ 2013-10-14 21:11 UTC (permalink / raw)
To: David Miller; +Cc: Stephen Hemminger, netdev@vger.kernel.org
[-- Attachment #1: Type: text/plain, Size: 29 bytes --]
Trivial patch
cheers,
jamal
[-- Attachment #2: patch-1 --]
[-- Type: text/plain, Size: 649 bytes --]
commit 984b1bc7c51a1201707238f7aa5fa1a8b72fde90
Author: jamal <jhs@mojatatu.com>
Date: Mon Oct 14 17:04:16 2013 -0400
Remove unused enum
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
index 80394e8..f8dab16 100644
--- a/include/uapi/linux/if_link.h
+++ b/include/uapi/linux/if_link.h
@@ -209,11 +209,6 @@ enum {
#define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1)
enum {
- BRIDGE_MODE_UNSPEC,
- BRIDGE_MODE_HAIRPIN,
-};
-
-enum {
IFLA_BRPORT_UNSPEC,
IFLA_BRPORT_STATE, /* Spanning tree state */
IFLA_BRPORT_PRIORITY, /* " priority */
^ permalink raw reply related
* Re: [PATCH -next] netdev: inet_timewait_sock.h missing semi-colon when KMEMCHECK is enabled
From: Joe Perches @ 2013-10-14 21:24 UTC (permalink / raw)
To: Randy Dunlap
Cc: Thierry Reding, linux-next, linux-kernel, Mark Brown,
netdev@vger.kernel.org, David Miller
In-Reply-To: <525C5863.1000505@infradead.org>
On Mon, 2013-10-14 at 13:47 -0700, Randy Dunlap wrote:
> On 10/14/13 12:53, Joe Perches wrote:
> > On Mon, 2013-10-14 at 12:36 -0700, Randy Dunlap wrote:
> >> From: Randy Dunlap <rdunlap@infradead.org>
> >>
> >> Fix (a few hundred) build errors due to missing semi-colon when
> >> KMEMCHECK is enabled:
> >>
> >> include/net/inet_timewait_sock.h:139:2: error: expected ',', ';' or '}' before 'int'
> >> include/net/inet_timewait_sock.h:148:28: error: 'const struct inet_timewait_sock' has no member named 'tw_death_node'
> >>
> >> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> >> ---
> >> include/net/inet_timewait_sock.h | 2 +-
> >> 1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> --- next-2013-1014.orig/include/net/inet_timewait_sock.h
> >> +++ next-2013-1014/include/net/inet_timewait_sock.h
> >> @@ -135,7 +135,7 @@ struct inet_timewait_sock {
> >> tw_transparent : 1,
> >> tw_pad : 6, /* 6 bits hole */
> >> tw_tos : 8,
> >> - tw_pad2 : 16 /* 16 bits hole */
> >> + tw_pad2 : 16; /* 16 bits hole */
> >> kmemcheck_bitfield_end(flags);
> >> u32 tw_ttd;
> >> struct inet_bind_bucket *tw_tb;
> >> --
> >> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> >> the body of a message to majordomo@vger.kernel.org
> >> More majordomo info at http://vger.kernel.org/majordomo-info.html
> >> Please read the FAQ at http://www.tux.org/lkml/
> >
> > Shouldn't this be done in kmemcheck.h?
>
> This patch makes sense and probably should be merged
> but it does not fix the build errors that I reported.
You sure?
^ permalink raw reply
* Re: [PATCH -next] netdev: inet_timewait_sock.h missing semi-colon when KMEMCHECK is enabled
From: Joe Perches @ 2013-10-14 21:25 UTC (permalink / raw)
To: Randy Dunlap
Cc: Thierry Reding, linux-next, linux-kernel, Mark Brown,
netdev@vger.kernel.org, David Miller
In-Reply-To: <525C5863.1000505@infradead.org>
On Mon, 2013-10-14 at 13:47 -0700, Randy Dunlap wrote:
> On 10/14/13 12:53, Joe Perches wrote:
> > On Mon, 2013-10-14 at 12:36 -0700, Randy Dunlap wrote:
> >> From: Randy Dunlap <rdunlap@infradead.org>
> >>
> >> Fix (a few hundred) build errors due to missing semi-colon when
> >> KMEMCHECK is enabled:
keyword: enabled...
> > Shouldn't this be done in kmemcheck.h?
>
> This patch makes sense and probably should be merged
> but it does not fix the build errors that I reported.
Duh, enabled. Yeah, you're sure...
^ permalink raw reply
* [RFC] bridge and friends: reduce TheLinuxWay(tm)
From: Jamal Hadi Salim @ 2013-10-14 21:32 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Vlad Yasevich, netdev@vger.kernel.org
IOW, TheCutNpasteTrain.
There's a lot of clutter on the netlink interface used
by bridge and vxlan.
1) A lot of things which are boolean on/off end up using a uchar.
Example:
IFLA_BRPORT_MODE, IFLA_BRPORT_GUARD, IFLA_BRPORT_PROTECT,
IFLA_BRPORT_LEARNING, IFLA_BRPORT_UNICAST_FLOOD, BRIDGE_VLAN_INFO_PVID,
BRIDGE_VLAN_INFO_UNTAGGED, BRIDGE_MODE_VEPA,
IFLA_VXLAN_PROXY,IFLA_VXLAN_RSC, etc
2) There's a few fields which are basically intended to project the
same message to the kernel but are redefined a few times:
Example:
BRIDGE_VLAN_INFO_MASTER vs NTF_MASTER vs BRIDGE_FLAGS_MASTER
Also i am not sure why multicast snooping needs its own subheader.
Is it too late to make changes? git logs shows some of these feature
have only been on the last 2-3 months.
One approach to resolve this is introduce a new BRIDGE_FLAGS TLV
which will work like the ifi_flags/change and put all these flags in
one spot. New iproute will use these and the old one will continue using
the old approach. It would require to EOL the old interface at some
point.
If this is agreeable and it is not on someone todo list - I will send
patches later on.
cheers,
jamal
^ permalink raw reply
* Re: [RFC] bridge and friends: reduce TheLinuxWay(tm)
From: Stephen Hemminger @ 2013-10-14 21:41 UTC (permalink / raw)
To: Jamal Hadi Salim; +Cc: Stephen Hemminger, Vlad Yasevich, netdev@vger.kernel.org
In-Reply-To: <525C62D5.3090004@mojatatu.com>
On Mon, 14 Oct 2013 17:32:05 -0400
Jamal Hadi Salim <jhs@mojatatu.com> wrote:
> IOW, TheCutNpasteTrain.
>
> There's a lot of clutter on the netlink interface used
> by bridge and vxlan.
> 1) A lot of things which are boolean on/off end up using a uchar.
> Example:
> IFLA_BRPORT_MODE, IFLA_BRPORT_GUARD, IFLA_BRPORT_PROTECT,
> IFLA_BRPORT_LEARNING, IFLA_BRPORT_UNICAST_FLOOD, BRIDGE_VLAN_INFO_PVID,
> BRIDGE_VLAN_INFO_UNTAGGED, BRIDGE_MODE_VEPA,
> IFLA_VXLAN_PROXY,IFLA_VXLAN_RSC, etc
>
> 2) There's a few fields which are basically intended to project the
> same message to the kernel but are redefined a few times:
> Example:
> BRIDGE_VLAN_INFO_MASTER vs NTF_MASTER vs BRIDGE_FLAGS_MASTER
>
> Also i am not sure why multicast snooping needs its own subheader.
>
> Is it too late to make changes? git logs shows some of these feature
> have only been on the last 2-3 months.
> One approach to resolve this is introduce a new BRIDGE_FLAGS TLV
> which will work like the ifi_flags/change and put all these flags in
> one spot. New iproute will use these and the old one will continue using
> the old approach. It would require to EOL the old interface at some
> point.
Unfortunately, by now this is all set in ABI.
It was a side effect of the per-feature evolutionary style of development.
^ permalink raw reply
* iproute2/tc and major/minor limits
From: Nigel Kukard @ 2013-10-14 21:45 UTC (permalink / raw)
To: netdev
Hi guys,
I'm just curious if there is any specific reason why 32-bit integers are
used with tc imposing the limit of 0xfff maximum major and minor numbers
for classes? (more specifically architectural or algorithmic reasons)
-N
^ permalink raw reply
* Re: kernel policy routing table src ip not respected since 2.6.37 and commit 9fc3bbb4a752
From: Vincent Li @ 2013-10-14 22:12 UTC (permalink / raw)
To: netdev@vger.kernel.org; +Cc: Joel Sing
In-Reply-To: <CAK3+h2zGFnbC-hpPB8fPX7TC3rKCWbPYVY4WW4HDYbN+LXNXXw@mail.gmail.com>
here is the actual test output
[root@centos64-vm linux]# ip addr show dev eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast
state UP qlen 1000
link/ether 52:54:00:c4:bd:08 brd ff:ff:ff:ff:ff:ff
inet 10.1.1.1/24 scope global eth0 <======
inet 10.1.1.2/24 scope global secondary eth0 <======
inet6 fe80::5054:ff:fec4:bd08/64 scope link
valid_lft forever preferred_lft forever
[root@centos64-vm linux]# ip rule list
0: from all lookup local
245: from all lookup 245
32766: from all lookup main
32767: from all lookup default
[root@centos64-vm linux]# ip route list table 245
10.1.1.0/24 dev eth0 proto kernel scope link src 10.1.1.2 <====use
src 10.1.1.2
[root@centos64-vm linux]# ping 10.1.1.9
PING 10.1.1.9 (10.1.1.9) 56(84) bytes of data.
>From 10.1.1.1 icmp_seq=2 Destination Host Unreachable <==expecting
10.1.1.2 as before 2.6.37, but see 10.1.1.1
>From 10.1.1.1 icmp_seq=3 Destination Host Unreachable
Vincent
On Mon, Oct 14, 2013 at 9:13 AM, Vincent Li <vincent.mc.li@gmail.com> wrote:
> I had a simple bash script to test if the policy routing table src ip
> is respected or not, git bisect found the commit 9fc3bbb4a752 to
> change the policy routing table source ip behavior.
>
> commit 9fc3bbb4a752f108cf096d96640f3b548bbbce6c
> Author: Joel Sing <jsing@google.com>
> Date: Mon Jan 3 20:24:20 2011 +0000
>
> ipv4/route.c: respect prefsrc for local routes
>
> The preferred source address is currently ignored for local routes,
> which results in all local connections having a src address that is the
> same as the local dst address. Fix this by respecting the preferred source
> address when it is provided for local routes.
>
> test script:
>
> #!/bin/bash
> ip addr add 10.1.1.1/24 dev eth0
> ip addr add 10.1.1.2/24 dev eth0
> ip rule add priority 245 table 245
> ip route add 10.1.1.0/24 dev eth0 proto kernel scope link src
> 10.1.1.2 table 245 <===source ip 10.1.1.2 to be preferred
>
> ip addr show dev eth0
> ip route list table main
> ip route list table 245
>
>
> tcpdump -nn -i eth0 host 10.1.1.9 and icmp &
>
> ping 10.1.1.9
>
>
>
> --before commit 9fc3bbb4a752
>
> the source is from ip 10.1.1.2 as expected
>
> --after commit 9fc3bbb4a752
>
> the source is from ip 10.1.1.1 which not expected since I have high
> priority table 245 with source ip 10.1.1.2
>
> is this regression of commit 9fc3bbb4a752 ?
>
> Vincent
^ permalink raw reply
* [PATCH] iproute2 - Fix tc stats when using -batch mode
From: Nigel Kukard @ 2013-10-14 22:16 UTC (permalink / raw)
To: netdev
[-- Attachment #1.1: Type: text/plain, Size: 528 bytes --]
Hi,
There are two global variables in tc/tc_class.c:
__u32 filter_qdisc;
__u32 filter_classid;
These are not re-initialized for each line received in -batch mode:
# tc -force -batch -
class show dev eth0 parent 1: classid 1:1
class show dev eth0 parent 1: classid 1:1
Error: duplicate "classid": "1:1" is the second value.
This patch fixes the issue by initializing the two globals when we
enter print_class().
Attached a patch which fixes this by initializing them when
print_class() is called.
-N
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: batchfix.patch --]
[-- Type: text/x-patch; name="batchfix.patch", Size: 986 bytes --]
commit d04acab5a8c0267610e9ea21f8a42e54ed4585dc
Author: Nigel Kukard <nkukard@lbsd.net>
Date: Mon Oct 14 22:10:16 2013 +0000
Fix tc stats when using -batch mode
There are two global variables in tc/tc_class.c:
__u32 filter_qdisc;
__u32 filter_classid;
These are not re-initialized for each line received in -batch mode:
class show dev eth0 parent 1: classid 1:1
class show dev eth0 parent 1: classid 1:1
Error: duplicate "classid": "1:1" is the second value.
This patch fixes the issue by initializing the two globals when we
enter print_class().
diff --git a/tc/tc_class.c b/tc/tc_class.c
index 9d4eea5..8043448 100644
--- a/tc/tc_class.c
+++ b/tc/tc_class.c
@@ -241,6 +241,9 @@ int tc_class_list(int argc, char **argv)
t.tcm_family = AF_UNSPEC;
memset(d, 0, sizeof(d));
+ filter_qdisc = 0;
+ filter_classid = 0;
+
while (argc > 0) {
if (strcmp(*argv, "dev") == 0) {
NEXT_ARG();
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4052 bytes --]
^ permalink raw reply related
* Re: [RFC net] bridge: clean the nf_bridge status when forwarding the skb
From: Antonio Quartulli @ 2013-10-14 22:20 UTC (permalink / raw)
To: Stephen Hemminger
Cc: David S. Miller, bridge@lists.linux-foundation.org,
netdev@vger.kernel.org
In-Reply-To: <20130926220143.GC1228@open-mesh.com>
[-- Attachment #1: Type: text/plain, Size: 2351 bytes --]
On Fri, Sep 27, 2013 at 12:01:43AM +0200, Antonio Quartulli wrote:
> On Thu, Sep 26, 2013 at 02:32:48PM -0700, Stephen Hemminger wrote:
> > > > > diff --git a/net/bridge/br_forward.c b/net/bridge/br_forward.c
> > > > > index 4b81b14..65864bc 100644
> > > > > --- a/net/bridge/br_forward.c
> > > > > +++ b/net/bridge/br_forward.c
> > > > > @@ -49,6 +49,11 @@ int br_dev_queue_push_xmit(struct sk_buff *skb)
> > > > > } else {
> > > > > skb_push(skb, ETH_HLEN);
> > > > > br_drop_fake_rtable(skb);
> > > > > +
> > > > > + /* clean the NF bridge data */
> > > > > + nf_bridge_put(skb->nf_bridge);
> > > > > + skb->nf_bridge = NULL;
> > > > > +
> > > > > dev_queue_xmit(skb);
> > > > > }
> > > > >
> > >
> > > Regarding CONFIG_BRIDGE_NETFILTER you are right, thanks.
> > >
> > > >
> > > > I think the header will also be garbage if bridge on bridge with netfilter is used.
> > > > See nf_bridge_save_header.
> > >
> > > What header are you referring to? nf_bridge_save_header() saves the header in
> > > skb->nf_bridge->data, which is freed during nf_bridge_put() (assuming
> > > ->use reached 0).
> > >
> > >
> >
> > If bridge is stacked the original ether header will get overwritten by the second
> > call to save_header.
>
> Sorry, but I am not getting what you mean (I am new to the code and it is late here..):
> save_header() will store the Ethernet header in nf_bridge->data for
> later recover (if needed).
>
> By freeing nf_bridge I also destroy this header copy.
>
> When the skb enters the second bridge, save_header() will save again the header
> in nf_bridge->data. But I don't see how this can create a problem.
>
> The problem I had before this patch comes from the fact that
> nf_bridge_copy_header() is invoked in the second bridge with the nf_bridge state
> of the first. This was overwriting my the packet Ethernet header with what the
> first invocation of save_header() stored in nf_bridge->data.
>
> But by unsetting nf_bridge I think I am preventing this from happening again.
> no?
Hello Stephen,
do you have other comments about this patch? I know it is rather difficult that
a generic user hits this issue, but I'd like to see it fixed because other
people using batman-adv may incur in this problem.
Cheers,
--
Antonio Quartulli
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* Re: [RFC net] bridge: clean the nf_bridge status when forwarding the skb
From: Stephen Hemminger @ 2013-10-14 22:27 UTC (permalink / raw)
To: Antonio Quartulli
Cc: David S. Miller, bridge@lists.linux-foundation.org,
netdev@vger.kernel.org
In-Reply-To: <20131014222010.GB3873@neomailbox.net>
On Tue, 15 Oct 2013 00:20:10 +0200
Antonio Quartulli <antonio@meshcoding.com> wrote:
> On Fri, Sep 27, 2013 at 12:01:43AM +0200, Antonio Quartulli wrote:
> > On Thu, Sep 26, 2013 at 02:32:48PM -0700, Stephen Hemminger wrote:
> > > > > > diff --git a/net/bridge/br_forward.c b/net/bridge/br_forward.c
> > > > > > index 4b81b14..65864bc 100644
> > > > > > --- a/net/bridge/br_forward.c
> > > > > > +++ b/net/bridge/br_forward.c
> > > > > > @@ -49,6 +49,11 @@ int br_dev_queue_push_xmit(struct sk_buff *skb)
> > > > > > } else {
> > > > > > skb_push(skb, ETH_HLEN);
> > > > > > br_drop_fake_rtable(skb);
> > > > > > +
> > > > > > + /* clean the NF bridge data */
> > > > > > + nf_bridge_put(skb->nf_bridge);
> > > > > > + skb->nf_bridge = NULL;
> > > > > > +
> > > > > > dev_queue_xmit(skb);
> > > > > > }
> > > > > >
> > > >
> > > > Regarding CONFIG_BRIDGE_NETFILTER you are right, thanks.
> > > >
> > > > >
> > > > > I think the header will also be garbage if bridge on bridge with netfilter is used.
> > > > > See nf_bridge_save_header.
> > > >
> > > > What header are you referring to? nf_bridge_save_header() saves the header in
> > > > skb->nf_bridge->data, which is freed during nf_bridge_put() (assuming
> > > > ->use reached 0).
> > > >
> > > >
> > >
> > > If bridge is stacked the original ether header will get overwritten by the second
> > > call to save_header.
> >
> > Sorry, but I am not getting what you mean (I am new to the code and it is late here..):
> > save_header() will store the Ethernet header in nf_bridge->data for
> > later recover (if needed).
> >
> > By freeing nf_bridge I also destroy this header copy.
> >
> > When the skb enters the second bridge, save_header() will save again the header
> > in nf_bridge->data. But I don't see how this can create a problem.
> >
> > The problem I had before this patch comes from the fact that
> > nf_bridge_copy_header() is invoked in the second bridge with the nf_bridge state
> > of the first. This was overwriting my the packet Ethernet header with what the
> > first invocation of save_header() stored in nf_bridge->data.
> >
> > But by unsetting nf_bridge I think I am preventing this from happening again.
> > no?
>
> Hello Stephen,
>
> do you have other comments about this patch? I know it is rather difficult that
> a generic user hits this issue, but I'd like to see it fixed because other
> people using batman-adv may incur in this problem.
>
> Cheers,
>
>
The patch content is fine, but it needs necessary ifdef's.
I would also prefer to have the clean done as a function that can be stubbed out
like the other bridge netfilter stuff.
^ permalink raw reply
* Re: [PATCH 02/07] r8169: Support for byte queue limits
From: Francois Romieu @ 2013-10-14 22:28 UTC (permalink / raw)
To: Tino Reichardt; +Cc: netdev, Realtek linux nic maintainers, Igor Maravic
In-Reply-To: <1381775183-24866-3-git-send-email-milky-kernel@mcmilk.de>
Tino Reichardt <milky-kernel@mcmilk.de> :
[...]
> I have tested this patch on a small server in home use and it's working with
> no problems for about two weeks now. (kernel 3.10.10 and fq_codel enabled)
>
> Original-Patch-By: Igor Maravic <igorm@etf.rs>
> Signed-off-by: Tino Reichardt <milky-kernel@mcmilk.de>
It seems fine. Please include 'net-next' in the Subject field.
--
Ueimor
^ permalink raw reply
* Re: [RFC net] bridge: clean the nf_bridge status when forwarding the skb
From: Antonio Quartulli @ 2013-10-14 22:35 UTC (permalink / raw)
To: Stephen Hemminger
Cc: David S. Miller, bridge@lists.linux-foundation.org,
netdev@vger.kernel.org
In-Reply-To: <20131014152756.7b83dcc0@nehalam.linuxnetplumber.net>
[-- Attachment #1: Type: text/plain, Size: 410 bytes --]
On Mon, Oct 14, 2013 at 03:27:56PM -0700, Stephen Hemminger wrote:
> The patch content is fine, but it needs necessary ifdef's.
> I would also prefer to have the clean done as a function that can be stubbed out
> like the other bridge netfilter stuff.
>
Ok, I will apply those changes and I will send it as PATCH.
Thank you very much for your feedback!
Regards,
--
Antonio Quartulli
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* [PATCH] libertas: move firmware lifetime handling to firmware.c
From: Dan Williams @ 2013-10-14 22:51 UTC (permalink / raw)
To: Dr. H. Nikolaus Schaller
Cc: libertas-dev, NeilBrown Brown, netdev, linux-wireless, Harro Haan,
John W. Linville, Belisko Marek, LKML
In-Reply-To: <47ACD120-9393-41EA-BF8A-4E5E316A0C79@goldelico.com>
Previously, each bus type was responsible for freeing the firmware
structure, but some did that badly. Move responsibility for freeing
firmware into firmware.c so that it's done once and correctly, instead
of happening in multiple places in bus-specific code.
This fixes a use-after-free bug found by Dr. H. Nikolaus Schaller where
the SDIO code forgot to NULL priv->helper_fw after freeing it.
Signed-off-by: Dan Williams <dcbw@redhat.com>
---
Tested firmware loading on USB (8388), CS (8385), and SDIO (8686).
diff --git a/drivers/net/wireless/libertas/firmware.c b/drivers/net/wireless/libertas/firmware.c
index c0f9e7e..51b92b5 100644
--- a/drivers/net/wireless/libertas/firmware.c
+++ b/drivers/net/wireless/libertas/firmware.c
@@ -49,14 +49,19 @@ static void main_firmware_cb(const struct firmware *firmware, void *context)
/* Failed to find firmware: try next table entry */
load_next_firmware_from_table(priv);
return;
}
/* Firmware found! */
lbs_fw_loaded(priv, 0, priv->helper_fw, firmware);
+ if (priv->helper_fw) {
+ release_firmware (priv->helper_fw);
+ priv->helper_fw = NULL;
+ }
+ release_firmware (firmware);
}
static void helper_firmware_cb(const struct firmware *firmware, void *context)
{
struct lbs_private *priv = context;
if (!firmware) {
diff --git a/drivers/net/wireless/libertas/if_cs.c b/drivers/net/wireless/libertas/if_cs.c
index c94dd68..ef8c98e 100644
--- a/drivers/net/wireless/libertas/if_cs.c
+++ b/drivers/net/wireless/libertas/if_cs.c
@@ -750,22 +750,22 @@ static void if_cs_prog_firmware(struct lbs_private *priv, int ret,
}
/* Load the firmware */
ret = if_cs_prog_helper(card, helper);
if (ret == 0 && (card->model != MODEL_8305))
ret = if_cs_prog_real(card, mainfw);
if (ret)
- goto out;
+ return;
/* Now actually get the IRQ */
ret = request_irq(card->p_dev->irq, if_cs_interrupt,
IRQF_SHARED, DRV_NAME, card);
if (ret) {
pr_err("error in request_irq\n");
- goto out;
+ return;
}
/*
* Clear any interrupt cause that happened while sending
* firmware/initializing card
*/
if_cs_write16(card, IF_CS_CARD_INT_CAUSE, IF_CS_BIT_MASK);
@@ -773,18 +773,14 @@ static void if_cs_prog_firmware(struct lbs_private *priv, int ret,
/* And finally bring the card up */
priv->fw_ready = 1;
if (lbs_start_card(priv) != 0) {
pr_err("could not activate card\n");
free_irq(card->p_dev->irq, card);
}
-
-out:
- release_firmware(helper);
- release_firmware(mainfw);
}
/********************************************************************/
/* Callback functions for libertas.ko */
/********************************************************************/
diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c
index 4557833..991238a 100644
--- a/drivers/net/wireless/libertas/if_sdio.c
+++ b/drivers/net/wireless/libertas/if_sdio.c
@@ -704,28 +704,24 @@ static void if_sdio_do_prog_firmware(struct lbs_private *priv, int ret,
if (ret) {
pr_err("failed to find firmware (%d)\n", ret);
return;
}
ret = if_sdio_prog_helper(card, helper);
if (ret)
- goto out;
+ return;
lbs_deb_sdio("Helper firmware loaded\n");
ret = if_sdio_prog_real(card, mainfw);
if (ret)
- goto out;
+ return;
lbs_deb_sdio("Firmware loaded\n");
if_sdio_finish_power_on(card);
-
-out:
- release_firmware(helper);
- release_firmware(mainfw);
}
static int if_sdio_prog_firmware(struct if_sdio_card *card)
{
int ret;
u16 scratch;
diff --git a/drivers/net/wireless/libertas/if_spi.c b/drivers/net/wireless/libertas/if_spi.c
index 4bb6574..87ff0ca 100644
--- a/drivers/net/wireless/libertas/if_spi.c
+++ b/drivers/net/wireless/libertas/if_spi.c
@@ -1090,19 +1090,15 @@ static int if_spi_init_card(struct if_spi_card *card)
}
err = spu_set_interrupt_mode(card, 0, 1);
if (err)
goto out;
out:
- release_firmware(helper);
- release_firmware(mainfw);
-
lbs_deb_leave_args(LBS_DEB_SPI, "err %d\n", err);
-
return err;
}
static void if_spi_resume_worker(struct work_struct *work)
{
struct if_spi_card *card;
diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c
index 2798077..dff08a2 100644
--- a/drivers/net/wireless/libertas/if_usb.c
+++ b/drivers/net/wireless/libertas/if_usb.c
@@ -840,15 +840,15 @@ static void if_usb_prog_firmware(struct lbs_private *priv, int ret,
pr_err("failed to find firmware (%d)\n", ret);
goto done;
}
cardp->fw = fw;
if (check_fwfile_format(cardp->fw->data, cardp->fw->size)) {
ret = -EINVAL;
- goto release_fw;
+ goto done;
}
/* Cancel any pending usb business */
usb_kill_urb(cardp->rx_urb);
usb_kill_urb(cardp->tx_urb);
cardp->fwlastblksent = 0;
@@ -857,15 +857,15 @@ static void if_usb_prog_firmware(struct lbs_private *priv, int ret,
cardp->fwfinalblk = 0;
cardp->bootcmdresp = 0;
restart:
if (if_usb_submit_rx_urb_fwload(cardp) < 0) {
lbs_deb_usbd(&cardp->udev->dev, "URB submission is failed\n");
ret = -EIO;
- goto release_fw;
+ goto done;
}
cardp->bootcmdresp = 0;
do {
int j = 0;
i++;
if_usb_issue_boot_command(cardp, BOOT_CMD_FW_BY_USB);
@@ -879,22 +879,22 @@ restart:
if (cardp->bootcmdresp == BOOT_CMD_RESP_NOT_SUPPORTED) {
/* Return to normal operation */
ret = -EOPNOTSUPP;
usb_kill_urb(cardp->rx_urb);
usb_kill_urb(cardp->tx_urb);
if (if_usb_submit_rx_urb(cardp) < 0)
ret = -EIO;
- goto release_fw;
+ goto done;
} else if (cardp->bootcmdresp <= 0) {
if (--reset_count >= 0) {
if_usb_reset_device(cardp);
goto restart;
}
ret = -EIO;
- goto release_fw;
+ goto done;
}
i = 0;
cardp->totalbytes = 0;
cardp->fwlastblksent = 0;
cardp->CRC_OK = 1;
@@ -917,37 +917,34 @@ restart:
if (--reset_count >= 0) {
if_usb_reset_device(cardp);
goto restart;
}
pr_info("FW download failure, time = %d ms\n", i * 100);
ret = -EIO;
- goto release_fw;
+ goto done;
}
cardp->priv->fw_ready = 1;
if_usb_submit_rx_urb(cardp);
if (lbs_start_card(priv))
- goto release_fw;
+ goto done;
if_usb_setup_firmware(priv);
/*
* EHS_REMOVE_WAKEUP is not supported on all versions of the firmware.
*/
priv->wol_criteria = EHS_REMOVE_WAKEUP;
if (lbs_host_sleep_cfg(priv, priv->wol_criteria, NULL))
priv->ehs_remove_supported = false;
- release_fw:
- release_firmware(cardp->fw);
- cardp->fw = NULL;
-
done:
+ cardp->fw = NULL;
lbs_deb_leave(LBS_DEB_USB);
}
#ifdef CONFIG_PM
static int if_usb_suspend(struct usb_interface *intf, pm_message_t message)
{
^ permalink raw reply related
* [PATCH net] bridge: clean the nf_bridge status when forwarding the skb
From: Antonio Quartulli @ 2013-10-14 22:51 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Antonio Quartulli, Stephen Hemminger
From: Antonio Quartulli <antonio@open-mesh.com>
Even if it is forbidden to enslave a bridge interface into
another one, it is still possible to create a chain of
virtual interfaces including two distinct bridges.
In this case, the skb entering the second bridge could have
the nf_bridge field already set due to a previous operation
and consequently lead to wrong a processing of the packet
itself.
To prevent this behaviour release and set to NULL the
nf_bridge field of the skb when forwarding the packet.
Cc: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>
---
I know that not using "extern" when declaring the prototype is not consistent
with the surrounding code, but checkpatch complaints about using "extern" in .h
file and I prefer to not do something "wrong" even if stylistically ugly.
Cheers,
net/bridge/br_forward.c | 2 ++
net/bridge/br_netfilter.c | 10 ++++++++++
net/bridge/br_private.h | 2 ++
3 files changed, 14 insertions(+)
diff --git a/net/bridge/br_forward.c b/net/bridge/br_forward.c
index 4b81b14..62955f3 100644
--- a/net/bridge/br_forward.c
+++ b/net/bridge/br_forward.c
@@ -49,6 +49,8 @@ int br_dev_queue_push_xmit(struct sk_buff *skb)
} else {
skb_push(skb, ETH_HLEN);
br_drop_fake_rtable(skb);
+ br_netfilter_skb_free(skb);
+
dev_queue_xmit(skb);
}
diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c
index f877362..7cad3e2 100644
--- a/net/bridge/br_netfilter.c
+++ b/net/bridge/br_netfilter.c
@@ -1086,3 +1086,13 @@ void br_netfilter_fini(void)
#endif
dst_entries_destroy(&fake_dst_ops);
}
+
+/**
+ * br_netfilter_skb_free - clean the NF bridge data in an skb
+ * @skb: the skb which the data to free belongs to
+ */
+void br_netfilter_skb_free(struct sk_buff *skb)
+{
+ nf_bridge_put(skb->nf_bridge);
+ skb->nf_bridge = NULL;
+}
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index efb57d9..2a5f637 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -730,10 +730,12 @@ static inline u16 br_get_pvid(const struct net_port_vlans *v)
extern int br_netfilter_init(void);
extern void br_netfilter_fini(void);
extern void br_netfilter_rtable_init(struct net_bridge *);
+void br_netfilter_skb_free(struct sk_buff *skb);
#else
#define br_netfilter_init() (0)
#define br_netfilter_fini() do { } while(0)
#define br_netfilter_rtable_init(x)
+#define br_netfilter_skb_free(x)
#endif
/* br_stp.c */
--
1.8.3.2
^ permalink raw reply related
* [PATCH RFC 0/5] Ethernet support for Zynq
From: Soren Brinkmann @ 2013-10-14 23:58 UTC (permalink / raw)
To: Nicolas Ferre; +Cc: netdev, linux-kernel, Michal Simek, Soren Brinkmann
Hi,
I am trying to make Ethernet work on Zynq, whose Ethernet core is a
cadence macb.
I came across two issues: The first is, that Ethernet does not work on
the Zedboard platform, but on zc702 and zc706. In both cases the probing
looks good as far as I can tell:
zc706:
[ 1.754502] libphy: MACB_mii_bus: probed
[ 2.775957] macb e000b000.ethernet eth0: Cadence GEM at 0xe000b000 irq 54 (00:0a:35:00:01:22)
[ 2.784638] macb e000b000.ethernet eth0: attached PHY driver [Marvell 88E1116R] (mii_bus:phy_addr=e000b000.etherne:07, irq=-1)
zed:
[ 1.755202] libphy: MACB_mii_bus: probed
[ 1.771422] macb e000b000.ethernet eth0: Cadence GEM at 0xe000b000 irq 54 (00:0a:35:00:01:22)
[ 1.780141] macb e000b000.ethernet eth0: attached PHY driver [Marvell 88E1510] (mii_bus:phy_addr=e000b000.etherne:00, irq=-1)
But on the Zed no actual connection can be established:
zc706:
# udhcpc
udhcpc (v1.21.1) started
grep: /etc/resolv.conf: No such file or directory
Sending discover...
Sending discover...
[ 50.769745] macb e000b000.ethernet eth0: link up (1000/Full)
Sending discover...
Sending select for 10.10.70.4...
Lease of 10.10.70.4 obtained, lease time 600
deleting routers
route: SIOCDELRT: No such process
adding dns 172.19.128.1
adding dns 172.19.129.1
# ping 10.10.70.101
PING 10.10.70.101 (10.10.70.101): 56 data bytes
64 bytes from 10.10.70.101: seq=0 ttl=64 time=0.848 ms
64 bytes from 10.10.70.101: seq=1 ttl=64 time=0.350 ms
On Zed this just loops indefinitely printing "Sending discover...
The main difference is the different phy used on the Zed. Does
anybody have an idea what might go wrong here?
And my second issue is related to the macb clocks:
Currently the macb driver expects two input clocks - pclk and hclk. At
the same time the actual Ethernet clock - tx_clk - is not handled in the
driver at all.
On Zynq's implementation of the macb, pclk and hclk are the same clock
and we provide a tx_clk separately and the driver needs to adjust it
according to the negotiated link speed (at least in some/most use-cases).
Handling this is sketched out in 5/5. But it does not really look nice.
- How do other SOCs handle tx_clk adjustments?
- the bindings do not really fit Zynq's implementation. How can we
ensure that clocks are mandatory or optional as required by the SOC
this core is implemented in?
The first four patches in this series are probably good to go.
Thanks,
Sören
Soren Brinkmann (5):
net: macb: Migrate to dev_pm_ops
net: macb: Migrate to devm clock interface
net: macb: Use devm_ioremap()
net: macb: Use devm_request_irq()
net: macb: Adjust tx_clk when link speed changes
drivers/net/ethernet/cadence/macb.c | 128 ++++++++++++++++++++++++++++--------
drivers/net/ethernet/cadence/macb.h | 1 +
2 files changed, 100 insertions(+), 29 deletions(-)
--
1.8.4
^ permalink raw reply
* [PATCH RFC 1/5] net: macb: Migrate to dev_pm_ops
From: Soren Brinkmann @ 2013-10-14 23:58 UTC (permalink / raw)
To: Nicolas Ferre; +Cc: netdev, linux-kernel, Michal Simek, Soren Brinkmann
In-Reply-To: <1381795140-10792-1-git-send-email-soren.brinkmann@xilinx.com>
Migrate the suspend/resume functions to use the dev_pm_ops PM interface.
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
---
drivers/net/ethernet/cadence/macb.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
index 92578690f6de..389ccf1362d5 100644
--- a/drivers/net/ethernet/cadence/macb.c
+++ b/drivers/net/ethernet/cadence/macb.c
@@ -1946,8 +1946,9 @@ static int __exit macb_remove(struct platform_device *pdev)
}
#ifdef CONFIG_PM
-static int macb_suspend(struct platform_device *pdev, pm_message_t state)
+static int macb_suspend(struct device *dev)
{
+ struct platform_device *pdev = to_platform_device(dev);
struct net_device *netdev = platform_get_drvdata(pdev);
struct macb *bp = netdev_priv(netdev);
@@ -1960,8 +1961,9 @@ static int macb_suspend(struct platform_device *pdev, pm_message_t state)
return 0;
}
-static int macb_resume(struct platform_device *pdev)
+static int macb_resume(struct device *dev)
{
+ struct platform_device *pdev = to_platform_device(dev);
struct net_device *netdev = platform_get_drvdata(pdev);
struct macb *bp = netdev_priv(netdev);
@@ -1972,19 +1974,17 @@ static int macb_resume(struct platform_device *pdev)
return 0;
}
-#else
-#define macb_suspend NULL
-#define macb_resume NULL
#endif
+static SIMPLE_DEV_PM_OPS(macb_pm_ops, macb_suspend, macb_resume);
+
static struct platform_driver macb_driver = {
.remove = __exit_p(macb_remove),
- .suspend = macb_suspend,
- .resume = macb_resume,
.driver = {
.name = "macb",
.owner = THIS_MODULE,
.of_match_table = of_match_ptr(macb_dt_ids),
+ .pm = &macb_pm_ops,
},
};
--
1.8.4
^ permalink raw reply related
* [PATCH RFC 2/5] net: macb: Migrate to devm clock interface
From: Soren Brinkmann @ 2013-10-14 23:58 UTC (permalink / raw)
To: Nicolas Ferre; +Cc: netdev, linux-kernel, Michal Simek, Soren Brinkmann
In-Reply-To: <1381795140-10792-1-git-send-email-soren.brinkmann@xilinx.com>
Migrate to using the device managed intreface for clocks and clean up
the associated error paths.
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
---
drivers/net/ethernet/cadence/macb.c | 32 ++++++++++++++++++++------------
1 file changed, 20 insertions(+), 12 deletions(-)
diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
index 389ccf1362d5..62aa136889a4 100644
--- a/drivers/net/ethernet/cadence/macb.c
+++ b/drivers/net/ethernet/cadence/macb.c
@@ -1790,19 +1790,31 @@ static int __init macb_probe(struct platform_device *pdev)
spin_lock_init(&bp->lock);
INIT_WORK(&bp->tx_error_task, macb_tx_error_task);
- bp->pclk = clk_get(&pdev->dev, "pclk");
+ bp->pclk = devm_clk_get(&pdev->dev, "pclk");
if (IS_ERR(bp->pclk)) {
- dev_err(&pdev->dev, "failed to get macb_clk\n");
+ err = PTR_ERR(bp->pclk);
+ dev_err(&pdev->dev, "failed to get macb_clk (%u)\n", err);
goto err_out_free_dev;
}
- clk_prepare_enable(bp->pclk);
- bp->hclk = clk_get(&pdev->dev, "hclk");
+ bp->hclk = devm_clk_get(&pdev->dev, "hclk");
if (IS_ERR(bp->hclk)) {
- dev_err(&pdev->dev, "failed to get hclk\n");
- goto err_out_put_pclk;
+ err = PTR_ERR(bp->hclk);
+ dev_err(&pdev->dev, "failed to get hclk (%u)\n", err);
+ goto err_out_free_dev;
+ }
+
+ err = clk_prepare_enable(bp->pclk);
+ if (err) {
+ dev_err(&pdev->dev, "failed to enable pclk (%u)\n", err);
+ goto err_out_free_dev;
+ }
+
+ err = clk_prepare_enable(bp->hclk);
+ if (err) {
+ dev_err(&pdev->dev, "failed to enable hclk (%u)\n", err);
+ goto err_out_disable_pclk;
}
- clk_prepare_enable(bp->hclk);
bp->regs = ioremap(regs->start, resource_size(regs));
if (!bp->regs) {
@@ -1908,10 +1920,8 @@ err_out_iounmap:
iounmap(bp->regs);
err_out_disable_clocks:
clk_disable_unprepare(bp->hclk);
- clk_put(bp->hclk);
+err_out_disable_pclk:
clk_disable_unprepare(bp->pclk);
-err_out_put_pclk:
- clk_put(bp->pclk);
err_out_free_dev:
free_netdev(dev);
err_out:
@@ -1936,9 +1946,7 @@ static int __exit macb_remove(struct platform_device *pdev)
free_irq(dev->irq, dev);
iounmap(bp->regs);
clk_disable_unprepare(bp->hclk);
- clk_put(bp->hclk);
clk_disable_unprepare(bp->pclk);
- clk_put(bp->pclk);
free_netdev(dev);
}
--
1.8.4
^ permalink raw reply related
* [PATCH RFC 3/5] net: macb: Use devm_ioremap()
From: Soren Brinkmann @ 2013-10-14 23:58 UTC (permalink / raw)
To: Nicolas Ferre; +Cc: netdev, linux-kernel, Michal Simek, Soren Brinkmann
In-Reply-To: <1381795140-10792-1-git-send-email-soren.brinkmann@xilinx.com>
Use the device managed version of ioremap to remap IO memory,
simplifying error paths.
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
---
drivers/net/ethernet/cadence/macb.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
index 62aa136889a4..436aecc31732 100644
--- a/drivers/net/ethernet/cadence/macb.c
+++ b/drivers/net/ethernet/cadence/macb.c
@@ -17,6 +17,7 @@
#include <linux/circ_buf.h>
#include <linux/slab.h>
#include <linux/init.h>
+#include <linux/io.h>
#include <linux/gpio.h>
#include <linux/interrupt.h>
#include <linux/netdevice.h>
@@ -1816,7 +1817,7 @@ static int __init macb_probe(struct platform_device *pdev)
goto err_out_disable_pclk;
}
- bp->regs = ioremap(regs->start, resource_size(regs));
+ bp->regs = devm_ioremap(&pdev->dev, regs->start, resource_size(regs));
if (!bp->regs) {
dev_err(&pdev->dev, "failed to map registers, aborting.\n");
err = -ENOMEM;
@@ -1828,7 +1829,7 @@ static int __init macb_probe(struct platform_device *pdev)
if (err) {
dev_err(&pdev->dev, "Unable to request IRQ %d (error %d)\n",
dev->irq, err);
- goto err_out_iounmap;
+ goto err_out_disable_clocks;
}
dev->netdev_ops = &macb_netdev_ops;
@@ -1916,8 +1917,6 @@ err_out_unregister_netdev:
unregister_netdev(dev);
err_out_free_irq:
free_irq(dev->irq, dev);
-err_out_iounmap:
- iounmap(bp->regs);
err_out_disable_clocks:
clk_disable_unprepare(bp->hclk);
err_out_disable_pclk:
@@ -1944,7 +1943,6 @@ static int __exit macb_remove(struct platform_device *pdev)
mdiobus_free(bp->mii_bus);
unregister_netdev(dev);
free_irq(dev->irq, dev);
- iounmap(bp->regs);
clk_disable_unprepare(bp->hclk);
clk_disable_unprepare(bp->pclk);
free_netdev(dev);
--
1.8.4
^ 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