* Re: [PATCH] net: rds: fix const array syntax
From: David Miller @ 2011-07-01 23:15 UTC (permalink / raw)
To: gregory.dietsche; +Cc: andy.grover, netdev, rds-devel, kernel-janitors
In-Reply-To: <4E0E546B.3000106@cuw.edu>
From: Greg Dietsche <gregory.dietsche@cuw.edu>
Date: Fri, 01 Jul 2011 18:12:43 -0500
> On 07/01/2011 05:50 PM, Greg Dietsche wrote:
>> Correct the syntax so that both array and pointer are const.
>>
>> Signed-off-by: Greg Dietsche<Gregory.Dietsche@cuw.edu>
>> ---
>> net/rds/tcp_stats.c | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/net/rds/tcp_stats.c b/net/rds/tcp_stats.c
>> index d5898d0..f8a7954 100644
>> --- a/net/rds/tcp_stats.c
>> +++ b/net/rds/tcp_stats.c
>> @@ -40,7 +40,7 @@
>> DEFINE_PER_CPU(struct rds_tcp_statistics, rds_tcp_stats)
>> ____cacheline_aligned;
>>
>> -static const char const *rds_tcp_stat_names[] = {
>> +static const char * const rds_tcp_stat_names[] = {
>> "tcp_data_ready_calls",
>> "tcp_write_space_calls",
>> "tcp_sndbuf_full",
>>
> Andy's email is bouncing (Recipient unknown)... if someone else could
> pick this up, that'd be great!
I'll take care of it.
^ permalink raw reply
* Re: [PATCH 00/12] net switch/case reformatting
From: David Miller @ 2011-07-01 23:15 UTC (permalink / raw)
To: joe
Cc: linux-decnet-user, netfilter-devel, netfilter, coreteam, netdev,
linux-x25, linux-hams, linux-sctp, linux-nfs, linux-kernel
In-Reply-To: <cover.1309549243.git.joe@perches.com>
From: Joe Perches <joe@perches.com>
Date: Fri, 1 Jul 2011 12:43:01 -0700
> Just whitespace cleanups with a couple trivial corrections
All applied, thanks Joe.
^ permalink raw reply
* Re: [PATCH] net: rds: fix const array syntax
From: David Miller @ 2011-07-01 23:16 UTC (permalink / raw)
To: Gregory.Dietsche; +Cc: andy.grover, netdev, rds-devel, kernel-janitors
In-Reply-To: <1309560635-17514-1-git-send-email-Gregory.Dietsche@cuw.edu>
From: Greg Dietsche <Gregory.Dietsche@cuw.edu>
Date: Fri, 1 Jul 2011 17:50:35 -0500
> Correct the syntax so that both array and pointer are const.
>
> Signed-off-by: Greg Dietsche <Gregory.Dietsche@cuw.edu>
Applied.
^ permalink raw reply
* Re: [NEXT][PATCH 0/5] Updates for net-next for IEEE 802.15.4 code
From: David Miller @ 2011-07-01 23:17 UTC (permalink / raw)
To: dbaryshkov; +Cc: netdev
In-Reply-To: <1309437468-31021-1-git-send-email-dbaryshkov@gmail.com>
From: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Date: Thu, 30 Jun 2011 16:37:43 +0400
> The following changes since commit 1049f6413f6e52572a768ca1590fa479ef0a48e8:
>
> myri10ge: Update MAINTAINERS (2011-06-29 06:02:05 -0700)
>
> are available in the git repository at:
> git://git2.kernel.org/pub/scm/linux/kernel/git/lowpan/lowpan.git for-next
Pulled, thanks Dmitry.
^ permalink raw reply
* Re: [PATCH] net: rds: fix const array syntax
From: Greg Dietsche @ 2011-07-01 23:12 UTC (permalink / raw)
To: Greg Dietsche; +Cc: andy.grover, davem, netdev, rds-devel, kernel-janitors
In-Reply-To: <1309560635-17514-1-git-send-email-Gregory.Dietsche@cuw.edu>
On 07/01/2011 05:50 PM, Greg Dietsche wrote:
> Correct the syntax so that both array and pointer are const.
>
> Signed-off-by: Greg Dietsche<Gregory.Dietsche@cuw.edu>
> ---
> net/rds/tcp_stats.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/net/rds/tcp_stats.c b/net/rds/tcp_stats.c
> index d5898d0..f8a7954 100644
> --- a/net/rds/tcp_stats.c
> +++ b/net/rds/tcp_stats.c
> @@ -40,7 +40,7 @@
> DEFINE_PER_CPU(struct rds_tcp_statistics, rds_tcp_stats)
> ____cacheline_aligned;
>
> -static const char const *rds_tcp_stat_names[] = {
> +static const char * const rds_tcp_stat_names[] = {
> "tcp_data_ready_calls",
> "tcp_write_space_calls",
> "tcp_sndbuf_full",
>
Andy's email is bouncing (Recipient unknown)... if someone else could
pick this up, that'd be great!
Greg
^ permalink raw reply
* Re: [PATCH] 6pack,mkiss: fix lock inconsistency
From: David Miller @ 2011-07-02 0:30 UTC (permalink / raw)
To: arnd; +Cc: f6bvp, ralf, linux-kernel, netdev, linux-hams
In-Reply-To: <201107012328.46256.arnd@arndb.de>
From: Arnd Bergmann <arnd@arndb.de>
Date: Fri, 1 Jul 2011 23:28:46 +0200
> Lockdep found a locking inconsistency in the mkiss_close function:
>
>> kernel: [ INFO: inconsistent lock state ]
>> kernel: 2.6.39.1 #3
>> kernel: ---------------------------------
>> kernel: inconsistent {IN-SOFTIRQ-R} -> {SOFTIRQ-ON-W} usage.
>> kernel: ax25ipd/2813 [HC0[0]:SC0[0]:HE1:SE1] takes:
>> kernel: (disc_data_lock){+++?.-}, at: [<ffffffffa018552b>] mkiss_close+0x1b/0x90 [mkiss]
>> kernel: {IN-SOFTIRQ-R} state was registered at:
>
> The message hints that disc_data_lock is aquired with softirqs disabled,
> but does not itself disable softirqs, which can in rare circumstances
> lead to a deadlock.
> The same problem is present in the 6pack driver, this patch fixes both
> by using write_lock_bh instead of write_lock.
>
> Reported-by: Bernard F6BVP <f6bvp@free.fr>
> Tested-by: Bernard F6BVP <f6bvp@free.fr>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Acked-by: Ralf Baechle<ralf@linux-mips.org>
> Cc: stable@kernel.org
Applied, thanks!
^ permalink raw reply
* Re: [PATCH 1/3] xfrm: Remove family arg from xfrm_bundle_ok
From: David Miller @ 2011-07-02 0:34 UTC (permalink / raw)
To: steffen.klassert; +Cc: herbert, netdev
In-Reply-To: <20110630091820.GB13201@secunet.com>
From: Steffen Klassert <steffen.klassert@secunet.com>
Date: Thu, 30 Jun 2011 11:18:20 +0200
> The family arg is not used any more, so remove it.
>
> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Applied.
^ permalink raw reply
* Re: [PATCH 2/3] ipv4: Don't use ufo handling on later transformed packets
From: David Miller @ 2011-07-02 0:34 UTC (permalink / raw)
To: steffen.klassert; +Cc: herbert, netdev
In-Reply-To: <20110630091932.GC13201@secunet.com>
From: Steffen Klassert <steffen.klassert@secunet.com>
Date: Thu, 30 Jun 2011 11:19:32 +0200
> We might call ip_ufo_append_data() for packets that will be IPsec
> transformed later. This function should be used just for real
> udp packets. So we check for rt->dst.header_len which is only
> nonzero on IPsec handling and call ip_ufo_append_data() just
> if rt->dst.header_len is zero.
>
> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Applied.
^ permalink raw reply
* Re: [PATCH 3/3] xfrm4: Don't call icmp_send on local error
From: David Miller @ 2011-07-02 0:34 UTC (permalink / raw)
To: steffen.klassert; +Cc: herbert, netdev
In-Reply-To: <20110630092041.GD13201@secunet.com>
From: Steffen Klassert <steffen.klassert@secunet.com>
Date: Thu, 30 Jun 2011 11:20:41 +0200
> Calling icmp_send() on a local message size error leads to
> an incorrect update of the path mtu. So use ip_local_error()
> instead to notify the socket about the error.
>
> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Applied.
^ permalink raw reply
* Re: [net-2.6 PATCH 1/3] qlge:Fix crash caused by mailbox execution on wedged chip.
From: David Miller @ 2011-07-02 0:36 UTC (permalink / raw)
To: ron.mercer; +Cc: netdev, jitendra.kalsaria, ameen.rahman
In-Reply-To: <1309464127-14797-1-git-send-email-ron.mercer@qlogic.com>
From: Ron Mercer <ron.mercer@qlogic.com>
Date: Thu, 30 Jun 2011 13:02:05 -0700
> From: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
>
> When we are in a recover process from a chip fatal error,
> driver should skip over execution of mailbox commands during
> resetting chip.
>
> Signed-off-by: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
> Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Applied.
^ permalink raw reply
* Re: [net-2.6 PATCH 2/3] qlge: Fix printk priority so chip fatal errors are always reported.
From: David Miller @ 2011-07-02 0:36 UTC (permalink / raw)
To: ron.mercer; +Cc: netdev, jitendra.kalsaria, ameen.rahman
In-Reply-To: <1309464127-14797-2-git-send-email-ron.mercer@qlogic.com>
From: Ron Mercer <ron.mercer@qlogic.com>
Date: Thu, 30 Jun 2011 13:02:06 -0700
> From: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
>
> Precedence of the printk should be at higher level so chip fatal
> errors are always reported.
>
> Signed-off-by: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
> Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Applied.
^ permalink raw reply
* Re: [net-2.6 PATCH 3/3] qlge:Version change to v1.00.00.29
From: David Miller @ 2011-07-02 0:36 UTC (permalink / raw)
To: ron.mercer; +Cc: netdev, jitendra.kalsaria, ameen.rahman
In-Reply-To: <1309464127-14797-3-git-send-email-ron.mercer@qlogic.com>
From: Ron Mercer <ron.mercer@qlogic.com>
Date: Thu, 30 Jun 2011 13:02:07 -0700
> From: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
>
> Signed-off-by: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
> Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Applied.
^ permalink raw reply
* Re: [PATCH] gianfar: code cleanups
From: David Miller @ 2011-07-02 0:46 UTC (permalink / raw)
To: sebastian.belden; +Cc: netdev, joe, sebastian.poehn
In-Reply-To: <1309510843.10177.10.camel@DENEC1DT0191>
From: "Sebastian Pöhn" <sebastian.belden@googlemail.com>
Date: Fri, 01 Jul 2011 11:00:43 +0200
> # moves if_vlan.h include from gianfar.c to gianfar.h
Please don't do this, keep the explicit includes as close
to the actual dependencies as possible. With your change
all of the other source files will load in and parse if_vlan.h
even though they have no need for it.
^ permalink raw reply
* Re: [PATCH] [v3][net][bna] Fix call trace when interrupts are disabled while sleeping function kzalloc is called
From: David Miller @ 2011-07-02 0:50 UTC (permalink / raw)
To: rmody; +Cc: shyam.iyer.t, netdev, ddutt, huangj, shyam_iyer
In-Reply-To: <E5313AF6F2BFD14293E5FD0F94750F86A82D66F782@HQ1-EXCH01.corp.brocade.com>
From: Rasesh Mody <rmody@brocade.com>
Date: Tue, 28 Jun 2011 16:32:58 -0700
>>From: Shyam Iyer [mailto:shyam.iyer.t@gmail.com]
>>Sent: Tuesday, June 28, 2011 11:58 AM
>>
>>request_threaded irq will call kzalloc that can sleep. Initializing the
>>flags variable outside of spin_lock_irqsave/restore in
>>bnad_mbox_irq_alloc will avoid call traces like below.
...
> Patch looks fine.
>
> Acked-by: Rasesh Mody <rmody@brocade.com>
Applied, thanks
^ permalink raw reply
* Re: [RFC][NET-NEXT PATCH 2/2] net: Add GSO to vlan_features initialization
From: Shan Wei @ 2011-07-02 7:07 UTC (permalink / raw)
To: Ben Hutchings
Cc: David Miller, netdev, Eric Dumazet, Michał Mirosław,
therbert@google.com
In-Reply-To: <4E094EE7.1000203@cn.fujitsu.com>
Hi Ben:
Shan Wei wrote, at 06/28/2011 11:47 AM:
> Hi Ben:
>
> Ben Hutchings wrote, at 06/25/2011 12:51 AM:
>> Have you verified that GSO works correctly for VLAN devices if the
>> underlying device does not support VLAN tag insertion?
>
> OK. I will do some test in future days.
> Then report test results.
Results is coming....
GSO works correctly for VLAN devices when
underlying device is Realtek NIC with 8139too driver.
Network tracepoint shows as following:
<Begin:
tcpclient-5915 [000] 2114.246780: net_dev_queue: dev=eth1.44 skbaddr=f3051bc0 len=74
tcpclient-5915 [000] 2114.246790: net_dev_queue: dev=eth1 skbaddr=f3051bc0 len=74
tcpclient-5915 [000] 2114.246798: net_dev_xmit: dev=eth1 skbaddr=f3051bc0 len=78 rc=0
tcpclient-5915 [000] 2114.246799: net_dev_xmit: dev=eth1.44 skbaddr=f3051bc0 len=74 rc=0
<idle>-0 [000] 2114.246905: net_dev_queue: dev=eth1.44 skbaddr=f73cc480 len=66
<idle>-0 [000] 2114.246908: net_dev_queue: dev=eth1 skbaddr=f73cc480 len=66
<idle>-0 [000] 2114.246911: net_dev_xmit: dev=eth1 skbaddr=f73cc480 len=70 rc=0
<idle>-0 [000] 2114.246912: net_dev_xmit: dev=eth1.44 skbaddr=f73cc480 len=66 rc=0
tcpclient-5915 [000] 2114.247109: net_dev_queue: dev=eth1.44 skbaddr=f3051bc0 len=2962
tcpclient-5915 [000] 2114.247121: net_dev_queue: dev=eth1 skbaddr=f73cc380 len=1514
tcpclient-5915 [000] 2114.247130: net_dev_xmit: dev=eth1 skbaddr=f73cc380 len=1518 rc=0
tcpclient-5915 [000] 2114.247131: net_dev_xmit: dev=eth1.44 skbaddr=f73cc380 len=1514 rc=0
tcpclient-5915 [000] 2114.247132: net_dev_queue: dev=eth1 skbaddr=f73cc480 len=1514
tcpclient-5915 [000] 2114.247138: net_dev_xmit: dev=eth1 skbaddr=f73cc480 len=1518 rc=0
tcpclient-5915 [000] 2114.247139: net_dev_xmit: dev=eth1.44 skbaddr=f73cc480 len=1514 rc=0
end:>
But, test case requires following two patches:
1. Fix broken vlan GSO setting
[PATCH 1/2] net: vlan: enable GSO by default
http://patchwork.ozlabs.org/patch/101714/
2. Fix my 8139too NIC driver that does not initial vlan_features.
diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c
--- a/drivers/net/8139too.c
+++ b/drivers/net/8139too.c
@@ -993,6 +993,7 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev,
* features
*/
dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_HIGHDMA;
+ dev->vlan_features = dev->features;
--
Best Regards
-----
Shan Wei
^ permalink raw reply
* [PATCH] net: 8139too: Initial necessary vlan_features to support vlan
From: Shan Wei @ 2011-07-02 8:06 UTC (permalink / raw)
To: David Miller, 单卫, netdev, Alexey Dobriyan, tj
Offload setting of vlan device requires
vlan_features to be initialed.
Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
---
drivers/net/8139too.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c
index ed6355c..c2672c6 100644
--- a/drivers/net/8139too.c
+++ b/drivers/net/8139too.c
@@ -993,6 +993,7 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev,
* features
*/
dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_HIGHDMA;
+ dev->vlan_features = dev->features;
dev->irq = pdev->irq;
--
1.7.4.1
^ permalink raw reply related
* Re: [PATCH] Disable router anycast address for /127 prefixes
From: Bjørn Mork @ 2011-07-02 9:38 UTC (permalink / raw)
To: Brian Haley; +Cc: netdev
In-Reply-To: <4E0E1B85.1080906@hp.com>
Brian Haley <brian.haley@hp.com> writes:
> On 07/01/2011 02:26 PM, Bjørn Mork wrote:
>> Brian Haley <brian.haley@hp.com> writes:
>>
>>> I'm not sure you'd need this part as there shouldn't be a /127 in the list to remove.
>>
>> I don't understand exactly what you mean here....
>
> If you never add an anycast address when the prefix length is 127, the address
> wouldn't be there when you went to remove it. In other words, the call to
> __ipv6_dev_ac_dec() would return -ENOENT, which is ignored anyways.
Doh! Of course. Sorry for being that slow...
And thanks for taking the time to feed it to me with a small enough
spoon :-)
> It's not a common codepath so the two lines of code wouldn't hurt anything
> I guess...
Personally I prefer "symmetric" coding because it leaves fewer questions
unanswered (necessary for the slow among us, as demonstrated above).
But I think that's for those actually maintaining this code to decide.
I can post an updated patch if required, or feel free to apply only the
first hunk.
Bjørn
^ permalink raw reply
* Re: [PATCH] net: 8139too: Initial necessary vlan_features to support vlan
From: Francois Romieu @ 2011-07-02 9:51 UTC (permalink / raw)
To: Shan Wei; +Cc: David Miller, netdev, Alexey Dobriyan, tj
In-Reply-To: <4E0ED194.2030103@cn.fujitsu.com>
Shan Wei <shanwei@cn.fujitsu.com> :
> Offload setting of vlan device requires
> vlan_features to be initialed.
[...]
> @@ -993,6 +993,7 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev,
> * features
> */
> dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_HIGHDMA;
> + dev->vlan_features = dev->features;
/* note: the hardware is not capable of sg/csum/highdma, however
* through the use of skb_copy_and_csum_dev we enable these
* features
*/
The commit message is a bit misleading wrt hardware capabilities but the
patch makes sense.
Acked-by: Francois Romieu <romieu@fr.zoreil.com>
--
Ueimor
^ permalink raw reply
* [PATCH] sctp: fix missing send up SCTP_SENDER_DRY_EVENT when subscribe it
From: Wei Yongjun @ 2011-07-02 19:18 UTC (permalink / raw)
To: David Miller; +Cc: netdev, linux-sctp, Michael Tüxen, Robin Seggelmann
From: Wei Yongjun<yjwei@cn.fujitsu.com>
We forgot to send up SCTP_SENDER_DRY_EVENT notification when
user app subscribes to this event, and there is no data to be
sent or retransmit.
This is required by the Socket API and used by the DTLS/SCTP
implementation.
Reported-by: Michael Tüxen<Michael.Tuexen@lurchi.franken.de>
Signed-off-by: Wei Yongjun<yjwei@cn.fujitsu.com>
Tested-by: Robin Seggelmann<seggelmann@fh-muenster.de>
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 6766913..99e25de 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -2073,10 +2073,33 @@ static int sctp_setsockopt_disable_fragments(struct sock *sk,
static int sctp_setsockopt_events(struct sock *sk, char __user *optval,
unsigned int optlen)
{
+ struct sctp_association *asoc;
+ struct sctp_ulpevent *event;
+
if (optlen> sizeof(struct sctp_event_subscribe))
return -EINVAL;
if (copy_from_user(&sctp_sk(sk)->subscribe, optval, optlen))
return -EFAULT;
+
+ /*
+ * At the time when a user app subscribes to SCTP_SENDER_DRY_EVENT,
+ * if there is no data to be sent or retransmit, the stack will
+ * immediately send up this notification.
+ */
+ if (sctp_ulpevent_type_enabled(SCTP_SENDER_DRY_EVENT,
+ &sctp_sk(sk)->subscribe)) {
+ asoc = sctp_id2assoc(sk, 0);
+
+ if (asoc&& sctp_outq_is_empty(&asoc->outqueue)) {
+ event = sctp_ulpevent_make_sender_dry_event(asoc,
+ GFP_ATOMIC);
+ if (!event)
+ return -ENOMEM;
+
+ sctp_ulpq_tail_event(&asoc->ulpq, event);
+ }
+ }
+
return 0;
}
--
1.7.5.1
^ permalink raw reply related
* [PATCH v2] sctp: fix missing send up SCTP_SENDER_DRY_EVENT when subscribe it
From: Wei Yongjun @ 2011-07-02 19:28 UTC (permalink / raw)
To: David Miller; +Cc: netdev, linux-sctp, Michael Tüxen, Robin Seggelmann
From: Wei Yongjun <yjwei@cn.fujitsu.com>
We forgot to send up SCTP_SENDER_DRY_EVENT notification when
user app subscribes to this event, and there is no data to be
sent or retransmit.
This is required by the Socket API and used by the DTLS/SCTP
implementation.
Reported-by: Michael Tüxen <Michael.Tuexen@lurchi.franken.de>
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Tested-by: Robin Seggelmann <seggelmann@fh-muenster.de>
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 6766913..99e25de 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -2073,10 +2073,33 @@ static int sctp_setsockopt_disable_fragments(struct sock *sk,
static int sctp_setsockopt_events(struct sock *sk, char __user *optval,
unsigned int optlen)
{
+ struct sctp_association *asoc;
+ struct sctp_ulpevent *event;
+
if (optlen > sizeof(struct sctp_event_subscribe))
return -EINVAL;
if (copy_from_user(&sctp_sk(sk)->subscribe, optval, optlen))
return -EFAULT;
+
+ /*
+ * At the time when a user app subscribes to SCTP_SENDER_DRY_EVENT,
+ * if there is no data to be sent or retransmit, the stack will
+ * immediately send up this notification.
+ */
+ if (sctp_ulpevent_type_enabled(SCTP_SENDER_DRY_EVENT,
+ &sctp_sk(sk)->subscribe)) {
+ asoc = sctp_id2assoc(sk, 0);
+
+ if (asoc && sctp_outq_is_empty(&asoc->outqueue)) {
+ event = sctp_ulpevent_make_sender_dry_event(asoc,
+ GFP_ATOMIC);
+ if (!event)
+ return -ENOMEM;
+
+ sctp_ulpq_tail_event(&asoc->ulpq, event);
+ }
+ }
+
return 0;
}
--
1.7.5.1
^ permalink raw reply related
* Re: [PATCH] sctp: fix missing send up SCTP_SENDER_DRY_EVENT when subscribe it
From: David Miller @ 2011-07-02 11:55 UTC (permalink / raw)
To: weiyj.lk; +Cc: netdev, linux-sctp, Michael.Tuexen, seggelmann
In-Reply-To: <4E0F6F20.5020505@gmail.com>
From: Wei Yongjun <weiyj.lk@gmail.com>
Date: Sun, 03 Jul 2011 03:18:56 +0800
> @@ -2073,10 +2073,33 @@ static int
> sctp_setsockopt_disable_fragments(struct sock *sk,
Patch corrupted by your email client.
^ permalink raw reply
* [net-next PATCH 1/2] dcbnl: Aggregated CEE GET operation
From: Shmulik Ravid @ 2011-07-02 16:33 UTC (permalink / raw)
To: davem; +Cc: John Fastabend, netdev
The following couple of patches add dcbnl an unsolicited notification of
the the DCB configuration for the CEE flavor of the DCBX protocol. This
is useful when the user-mode DCB client is not responsible for
conducting and resolving the DCBX negotiation (either because the DCBX
stack is embedded in the HW or the negotiation is handled by another
agent in he host), but still needs to get the negotiated parameters.
This functionality already exists for the IEEE flavor of the DCBX
protocol and these patches add it to the older CEE flavor.
The first patch extends the CEE attribute GET operation to include not
only the peer information, but also all the pertinent local
configuration (negotiated parameters). The second patch adds and export
a CEE specific notification routine.
Signed-off-by: Shmulik Ravid <shmulikr@broadcom.com>
---
include/linux/dcbnl.h | 20 ++++++-
net/dcb/dcbnl.c | 156 ++++++++++++++++++++++++++++++++++++++++++++++--
2 files changed, 168 insertions(+), 8 deletions(-)
diff --git a/include/linux/dcbnl.h b/include/linux/dcbnl.h
index 66a6723..c875244 100644
--- a/include/linux/dcbnl.h
+++ b/include/linux/dcbnl.h
@@ -333,15 +333,26 @@ enum ieee_attrs_app {
#define DCB_ATTR_IEEE_APP_MAX (__DCB_ATTR_IEEE_APP_MAX - 1)
/**
- * enum cee_attrs - CEE DCBX get attributes
+ * enum cee_attrs - CEE DCBX get attributes. An aggregated collection of the
+ * cee std negotiated parameters
*
* @DCB_ATTR_CEE_UNSPEC: unspecified
+ * @DCB_ATTR_CEE_FEAT: DCBX features flags (DCB_CMD_GFEATCFG)
+ * @DCB_ATTR_CEE_RX_PG: RX PG configuration (DCB_CMD_PGRX_GCFG)
+ * @DCB_ATTR_CEE_TX_PG: TX PG configuration (DCB_CMD_PGTX_GCFG)
+ * @DCB_ATTR_CEE_PFC: PFC configuration (DCB_CMD_PFC_GCFG)
+ * @DCB_ATTR_CEE_APP_TABLE: APP configuration (multi DCB_CMD_GAPP)
* @DCB_ATTR_CEE_PEER_PG: peer PG configuration - get only
* @DCB_ATTR_CEE_PEER_PFC: peer PFC configuration - get only
* @DCB_ATTR_CEE_PEER_APP: peer APP tlv - get only
*/
enum cee_attrs {
DCB_ATTR_CEE_UNSPEC,
+ DCB_ATTR_CEE_TX_PG,
+ DCB_ATTR_CEE_RX_PG,
+ DCB_ATTR_CEE_PFC,
+ DCB_ATTR_CEE_APP_TABLE,
+ DCB_ATTR_CEE_FEAT,
DCB_ATTR_CEE_PEER_PG,
DCB_ATTR_CEE_PEER_PFC,
DCB_ATTR_CEE_PEER_APP_TABLE,
@@ -357,6 +368,13 @@ enum peer_app_attr {
};
#define DCB_ATTR_CEE_PEER_APP_MAX (__DCB_ATTR_CEE_PEER_APP_MAX - 1)
+enum cee_attrs_app {
+ DCB_ATTR_CEE_APP_UNSPEC,
+ DCB_ATTR_CEE_APP,
+ __DCB_ATTR_CEE_APP_MAX
+};
+#define DCB_ATTR_CEE_APP_MAX (__DCB_ATTR_CEE_APP_MAX - 1)
+
/**
* enum dcbnl_pfc_attrs - DCB Priority Flow Control user priority nested attrs
*
diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c
index fc56e85..5b75ed7 100644
--- a/net/dcb/dcbnl.c
+++ b/net/dcb/dcbnl.c
@@ -1642,6 +1642,58 @@ err:
return ret;
}
+static int dcbnl_cee_pg_fill(struct sk_buff *skb, struct net_device *dev,
+ int dir)
+{
+ u8 pgid, up_map, prio, tc_pct;
+ const struct dcbnl_rtnl_ops *ops = dev->dcbnl_ops;
+ int i = dir ? DCB_ATTR_CEE_TX_PG : DCB_ATTR_CEE_RX_PG;
+ struct nlattr *pg = nla_nest_start(skb, i);
+ if (!pg)
+ goto nla_put_failure;
+
+ for (i = DCB_PG_ATTR_TC_0; i <= DCB_PG_ATTR_TC_7; i++) {
+ struct nlattr *tc_nest = nla_nest_start(skb, i);
+ if (!tc_nest)
+ goto nla_put_failure;
+
+ pgid = DCB_ATTR_VALUE_UNDEFINED;
+ prio = DCB_ATTR_VALUE_UNDEFINED;
+ tc_pct = DCB_ATTR_VALUE_UNDEFINED;
+ up_map = DCB_ATTR_VALUE_UNDEFINED;
+
+ if (!dir)
+ ops->getpgtccfgrx(dev, i - DCB_PG_ATTR_TC_0,
+ &prio, &pgid, &tc_pct, &up_map);
+ else
+ ops->getpgtccfgtx(dev, i - DCB_PG_ATTR_TC_0,
+ &prio, &pgid, &tc_pct, &up_map);
+
+ NLA_PUT_U8(skb, DCB_TC_ATTR_PARAM_PGID, pgid);
+ NLA_PUT_U8(skb, DCB_TC_ATTR_PARAM_UP_MAPPING, up_map);
+ NLA_PUT_U8(skb, DCB_TC_ATTR_PARAM_STRICT_PRIO, prio);
+ NLA_PUT_U8(skb, DCB_TC_ATTR_PARAM_BW_PCT, tc_pct);
+ nla_nest_end(skb, tc_nest);
+ }
+
+ for (i = DCB_PG_ATTR_BW_ID_0; i <= DCB_PG_ATTR_BW_ID_7; i++) {
+ tc_pct = DCB_ATTR_VALUE_UNDEFINED;
+
+ if (!dir)
+ ops->getpgbwgcfgrx(dev, i - DCB_PG_ATTR_BW_ID_0,
+ &tc_pct);
+ else
+ ops->getpgbwgcfgtx(dev, i - DCB_PG_ATTR_BW_ID_0,
+ &tc_pct);
+ NLA_PUT_U8(skb, i, tc_pct);
+ }
+ nla_nest_end(skb, pg);
+ return 0;
+
+nla_put_failure:
+ return -EMSGSIZE;
+}
+
/* Handle CEE DCBX GET commands. */
static int dcbnl_cee_get(struct net_device *netdev, struct nlattr **tb,
u32 pid, u32 seq, u16 flags)
@@ -1649,9 +1701,11 @@ static int dcbnl_cee_get(struct net_device *netdev, struct nlattr **tb,
struct sk_buff *skb;
struct nlmsghdr *nlh;
struct dcbmsg *dcb;
- struct nlattr *cee;
+ struct nlattr *cee, *app;
+ struct dcb_app_type *itr;
const struct dcbnl_rtnl_ops *ops = netdev->dcbnl_ops;
- int err;
+ int dcbx, i, err = -EMSGSIZE;
+ u8 value;
if (!ops)
return -EOPNOTSUPP;
@@ -1672,7 +1726,87 @@ static int dcbnl_cee_get(struct net_device *netdev, struct nlattr **tb,
if (!cee)
goto nla_put_failure;
- /* get peer info if available */
+ /* local pg */
+ if (ops->getpgtccfgtx && ops->getpgbwgcfgtx) {
+ err = dcbnl_cee_pg_fill(skb, netdev, 1);
+ if (err)
+ goto nla_put_failure;
+ }
+
+ if (ops->getpgtccfgrx && ops->getpgbwgcfgrx) {
+ err = dcbnl_cee_pg_fill(skb, netdev, 0);
+ if (err)
+ goto nla_put_failure;
+ }
+
+ /* local pfc */
+ if (ops->getpfccfg) {
+ struct nlattr *pfc_nest = nla_nest_start(skb, DCB_ATTR_CEE_PFC);
+ if (!pfc_nest)
+ goto nla_put_failure;
+
+ for (i = DCB_PFC_UP_ATTR_0; i <= DCB_PFC_UP_ATTR_7; i++) {
+ ops->getpfccfg(netdev, i - DCB_PFC_UP_ATTR_0, &value);
+ NLA_PUT_U8(skb, i, value);
+ }
+ nla_nest_end(skb, pfc_nest);
+ }
+
+ /* local app */
+ spin_lock(&dcb_lock);
+ app = nla_nest_start(skb, DCB_ATTR_CEE_APP_TABLE);
+ if (!app)
+ goto nla_put_failure;
+
+ list_for_each_entry(itr, &dcb_app_list, list) {
+ if (strncmp(itr->name, netdev->name, IFNAMSIZ) == 0) {
+ struct nlattr *app_nest = nla_nest_start(skb,
+ DCB_ATTR_APP);
+ if (!app_nest)
+ goto dcb_unlock;
+
+ err = nla_put_u8(skb, DCB_APP_ATTR_IDTYPE,
+ itr->app.selector);
+ if (err)
+ goto dcb_unlock;
+
+ err = nla_put_u16(skb, DCB_APP_ATTR_ID,
+ itr->app.protocol);
+ if (err)
+ goto dcb_unlock;
+
+ err = nla_put_u8(skb, DCB_APP_ATTR_PRIORITY,
+ itr->app.priority);
+ if (err)
+ goto dcb_unlock;
+
+ nla_nest_end(skb, app_nest);
+ }
+ }
+ nla_nest_end(skb, app);
+
+ if (netdev->dcbnl_ops->getdcbx)
+ dcbx = netdev->dcbnl_ops->getdcbx(netdev);
+ else
+ dcbx = -EOPNOTSUPP;
+
+ spin_unlock(&dcb_lock);
+
+ /* features flags */
+ if (ops->getfeatcfg) {
+ struct nlattr *feat = nla_nest_start(skb, DCB_ATTR_CEE_FEAT);
+ if (!feat)
+ goto nla_put_failure;
+
+ for (i = DCB_FEATCFG_ATTR_ALL + 1; i <= DCB_FEATCFG_ATTR_MAX;
+ i++)
+ if (!ops->getfeatcfg(netdev, i, &value))
+ NLA_PUT_U8(skb, i, value);
+
+ nla_nest_end(skb, feat);
+ }
+
+ /* peer info if available */
if (ops->cee_peer_getpg) {
struct cee_pg pg;
err = ops->cee_peer_getpg(netdev, &pg);
@@ -1695,16 +1829,24 @@ static int dcbnl_cee_get(struct net_device *netdev, struct nlattr **tb,
if (err)
goto nla_put_failure;
}
-
nla_nest_end(skb, cee);
- nlmsg_end(skb, nlh);
+ /* DCBX state */
+ if (dcbx >= 0) {
+ err = nla_put_u8(skb, DCB_ATTR_DCBX, dcbx);
+ if (err)
+ goto nla_put_failure;
+ }
+ nlmsg_end(skb, nlh);
return rtnl_unicast(skb, &init_net, pid);
+
+dcb_unlock:
+ spin_unlock(&dcb_lock);
nla_put_failure:
nlmsg_cancel(skb, nlh);
nlmsg_failure:
- kfree_skb(skb);
- return -1;
+ nlmsg_free(skb);
+ return err;
}
static int dcb_doit(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
--
1.7.3.5
^ permalink raw reply related
* [net-next PATCH 2/2] dcbnl: Add CEE notification
From: Shmulik Ravid @ 2011-07-02 16:38 UTC (permalink / raw)
To: davem; +Cc: John Fastabend, netdev
This patch add an unsolicited notification of the DCBX negotiated
parameters for the CEE flavor of the DCBX protocol. The notification
message is identical to the aggregated CEE get operation and holds all
the pertinent local and peer information. The notification routine is
exported so it can be invoked by drivers supporting an embedded DCBX
stack.
Signed-off-by: Shmulik Ravid <shmulikr@broadcom.com>
---
include/net/dcbnl.h | 5 +-
net/dcb/dcbnl.c | 409 ++++++++++++++++++++++++++++-----------------------
2 files changed, 226 insertions(+), 188 deletions(-)
diff --git a/include/net/dcbnl.h b/include/net/dcbnl.h
index d5bbb79..f5aa399 100644
--- a/include/net/dcbnl.h
+++ b/include/net/dcbnl.h
@@ -34,7 +34,10 @@ int dcb_ieee_setapp(struct net_device *, struct dcb_app *);
int dcb_ieee_delapp(struct net_device *, struct dcb_app *);
u8 dcb_ieee_getapp_mask(struct net_device *, struct dcb_app *);
-int dcbnl_notify(struct net_device *dev, int event, int cmd, u32 seq, u32 pid);
+int dcbnl_ieee_notify(struct net_device *dev, int event, int cmd,
+ u32 seq, u32 pid);
+int dcbnl_cee_notify(struct net_device *dev, int event, int cmd,
+ u32 seq, u32 pid);
/*
* Ops struct for the netlink callbacks. Used by DCB-enabled drivers through
diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c
index 5b75ed7..1937f92 100644
--- a/net/dcb/dcbnl.c
+++ b/net/dcb/dcbnl.c
@@ -1310,8 +1310,193 @@ nla_put_failure:
return err;
}
-int dcbnl_notify(struct net_device *dev, int event, int cmd,
- u32 seq, u32 pid)
+static int dcbnl_cee_pg_fill(struct sk_buff *skb, struct net_device *dev,
+ int dir)
+{
+ u8 pgid, up_map, prio, tc_pct;
+ const struct dcbnl_rtnl_ops *ops = dev->dcbnl_ops;
+ int i = dir ? DCB_ATTR_CEE_TX_PG : DCB_ATTR_CEE_RX_PG;
+ struct nlattr *pg = nla_nest_start(skb, i);
+ if (!pg)
+ goto nla_put_failure;
+
+ for (i = DCB_PG_ATTR_TC_0; i <= DCB_PG_ATTR_TC_7; i++) {
+ struct nlattr *tc_nest = nla_nest_start(skb, i);
+ if (!tc_nest)
+ goto nla_put_failure;
+
+ pgid = DCB_ATTR_VALUE_UNDEFINED;
+ prio = DCB_ATTR_VALUE_UNDEFINED;
+ tc_pct = DCB_ATTR_VALUE_UNDEFINED;
+ up_map = DCB_ATTR_VALUE_UNDEFINED;
+
+ if (!dir)
+ ops->getpgtccfgrx(dev, i - DCB_PG_ATTR_TC_0,
+ &prio, &pgid, &tc_pct, &up_map);
+ else
+ ops->getpgtccfgtx(dev, i - DCB_PG_ATTR_TC_0,
+ &prio, &pgid, &tc_pct, &up_map);
+
+ NLA_PUT_U8(skb, DCB_TC_ATTR_PARAM_PGID, pgid);
+ NLA_PUT_U8(skb, DCB_TC_ATTR_PARAM_UP_MAPPING, up_map);
+ NLA_PUT_U8(skb, DCB_TC_ATTR_PARAM_STRICT_PRIO, prio);
+ NLA_PUT_U8(skb, DCB_TC_ATTR_PARAM_BW_PCT, tc_pct);
+ nla_nest_end(skb, tc_nest);
+ }
+
+ for (i = DCB_PG_ATTR_BW_ID_0; i <= DCB_PG_ATTR_BW_ID_7; i++) {
+ tc_pct = DCB_ATTR_VALUE_UNDEFINED;
+
+ if (!dir)
+ ops->getpgbwgcfgrx(dev, i - DCB_PG_ATTR_BW_ID_0,
+ &tc_pct);
+ else
+ ops->getpgbwgcfgtx(dev, i - DCB_PG_ATTR_BW_ID_0,
+ &tc_pct);
+ NLA_PUT_U8(skb, i, tc_pct);
+ }
+ nla_nest_end(skb, pg);
+ return 0;
+
+nla_put_failure:
+ return -EMSGSIZE;
+}
+
+static int dcbnl_cee_fill(struct sk_buff *skb, struct net_device *netdev)
+{
+ struct nlattr *cee, *app;
+ struct dcb_app_type *itr;
+ const struct dcbnl_rtnl_ops *ops = netdev->dcbnl_ops;
+ int dcbx, i, err = -EMSGSIZE;
+ u8 value;
+
+ NLA_PUT_STRING(skb, DCB_ATTR_IFNAME, netdev->name);
+
+ cee = nla_nest_start(skb, DCB_ATTR_CEE);
+ if (!cee)
+ goto nla_put_failure;
+
+ /* local pg */
+ if (ops->getpgtccfgtx && ops->getpgbwgcfgtx) {
+ err = dcbnl_cee_pg_fill(skb, netdev, 1);
+ if (err)
+ goto nla_put_failure;
+ }
+
+ if (ops->getpgtccfgrx && ops->getpgbwgcfgrx) {
+ err = dcbnl_cee_pg_fill(skb, netdev, 0);
+ if (err)
+ goto nla_put_failure;
+ }
+
+ /* local pfc */
+ if (ops->getpfccfg) {
+ struct nlattr *pfc_nest = nla_nest_start(skb, DCB_ATTR_CEE_PFC);
+ if (!pfc_nest)
+ goto nla_put_failure;
+
+ for (i = DCB_PFC_UP_ATTR_0; i <= DCB_PFC_UP_ATTR_7; i++) {
+ ops->getpfccfg(netdev, i - DCB_PFC_UP_ATTR_0, &value);
+ NLA_PUT_U8(skb, i, value);
+ }
+ nla_nest_end(skb, pfc_nest);
+ }
+
+ /* local app */
+ spin_lock(&dcb_lock);
+ app = nla_nest_start(skb, DCB_ATTR_CEE_APP_TABLE);
+ if (!app)
+ goto nla_put_failure;
+
+ list_for_each_entry(itr, &dcb_app_list, list) {
+ if (strncmp(itr->name, netdev->name, IFNAMSIZ) == 0) {
+ struct nlattr *app_nest = nla_nest_start(skb,
+ DCB_ATTR_APP);
+ if (!app_nest)
+ goto dcb_unlock;
+
+ err = nla_put_u8(skb, DCB_APP_ATTR_IDTYPE,
+ itr->app.selector);
+ if (err)
+ goto dcb_unlock;
+
+ err = nla_put_u16(skb, DCB_APP_ATTR_ID,
+ itr->app.protocol);
+ if (err)
+ goto dcb_unlock;
+
+ err = nla_put_u8(skb, DCB_APP_ATTR_PRIORITY,
+ itr->app.priority);
+ if (err)
+ goto dcb_unlock;
+
+ nla_nest_end(skb, app_nest);
+ }
+ }
+ nla_nest_end(skb, app);
+
+ if (netdev->dcbnl_ops->getdcbx)
+ dcbx = netdev->dcbnl_ops->getdcbx(netdev);
+ else
+ dcbx = -EOPNOTSUPP;
+
+ spin_unlock(&dcb_lock);
+
+ /* features flags */
+ if (ops->getfeatcfg) {
+ struct nlattr *feat = nla_nest_start(skb, DCB_ATTR_CEE_FEAT);
+ if (!feat)
+ goto nla_put_failure;
+
+ for (i = DCB_FEATCFG_ATTR_ALL + 1; i <= DCB_FEATCFG_ATTR_MAX;
+ i++)
+ if (!ops->getfeatcfg(netdev, i, &value))
+ NLA_PUT_U8(skb, i, value);
+
+ nla_nest_end(skb, feat);
+ }
+
+ /* peer info if available */
+ if (ops->cee_peer_getpg) {
+ struct cee_pg pg;
+ err = ops->cee_peer_getpg(netdev, &pg);
+ if (!err)
+ NLA_PUT(skb, DCB_ATTR_CEE_PEER_PG, sizeof(pg), &pg);
+ }
+
+ if (ops->cee_peer_getpfc) {
+ struct cee_pfc pfc;
+ err = ops->cee_peer_getpfc(netdev, &pfc);
+ if (!err)
+ NLA_PUT(skb, DCB_ATTR_CEE_PEER_PFC, sizeof(pfc), &pfc);
+ }
+
+ if (ops->peer_getappinfo && ops->peer_getapptable) {
+ err = dcbnl_build_peer_app(netdev, skb,
+ DCB_ATTR_CEE_PEER_APP_TABLE,
+ DCB_ATTR_CEE_PEER_APP_INFO,
+ DCB_ATTR_CEE_PEER_APP);
+ if (err)
+ goto nla_put_failure;
+ }
+ nla_nest_end(skb, cee);
+
+ /* DCBX state */
+ if (dcbx >= 0) {
+ err = nla_put_u8(skb, DCB_ATTR_DCBX, dcbx);
+ if (err)
+ goto nla_put_failure;
+ }
+ return 0;
+
+dcb_unlock:
+ spin_unlock(&dcb_lock);
+nla_put_failure:
+ return err;
+}
+
+static int dcbnl_notify(struct net_device *dev, int event, int cmd,
+ u32 seq, u32 pid, int dcbx_ver)
{
struct net *net = dev_net(dev);
struct sk_buff *skb;
@@ -1337,7 +1522,11 @@ int dcbnl_notify(struct net_device *dev, int event, int cmd,
dcb->dcb_family = AF_UNSPEC;
dcb->cmd = cmd;
- err = dcbnl_ieee_fill(skb, dev);
+ if (dcbx_ver == DCB_CAP_DCBX_VER_IEEE)
+ err = dcbnl_ieee_fill(skb, dev);
+ else
+ err = dcbnl_cee_fill(skb, dev);
+
if (err < 0) {
/* Report error to broadcast listeners */
nlmsg_cancel(skb, nlh);
@@ -1351,7 +1540,20 @@ int dcbnl_notify(struct net_device *dev, int event, int cmd,
return err;
}
-EXPORT_SYMBOL(dcbnl_notify);
+
+int dcbnl_ieee_notify(struct net_device *dev, int event, int cmd,
+ u32 seq, u32 pid)
+{
+ return dcbnl_notify(dev, event, cmd, seq, pid, DCB_CAP_DCBX_VER_IEEE);
+}
+EXPORT_SYMBOL(dcbnl_ieee_notify);
+
+int dcbnl_cee_notify(struct net_device *dev, int event, int cmd,
+ u32 seq, u32 pid)
+{
+ return dcbnl_notify(dev, event, cmd, seq, pid, DCB_CAP_DCBX_VER_CEE);
+}
+EXPORT_SYMBOL(dcbnl_cee_notify);
/* Handle IEEE 802.1Qaz SET commands. If any requested operation can not
* be completed the entire msg is aborted and error value is returned.
@@ -1411,7 +1613,7 @@ static int dcbnl_ieee_set(struct net_device *netdev, struct nlattr **tb,
err:
dcbnl_reply(err, RTM_SETDCB, DCB_CMD_IEEE_SET, DCB_ATTR_IEEE,
pid, seq, flags);
- dcbnl_notify(netdev, RTM_SETDCB, DCB_CMD_IEEE_SET, seq, 0);
+ dcbnl_ieee_notify(netdev, RTM_SETDCB, DCB_CMD_IEEE_SET, seq, 0);
return err;
}
@@ -1495,7 +1697,7 @@ static int dcbnl_ieee_del(struct net_device *netdev, struct nlattr **tb,
err:
dcbnl_reply(err, RTM_SETDCB, DCB_CMD_IEEE_DEL, DCB_ATTR_IEEE,
pid, seq, flags);
- dcbnl_notify(netdev, RTM_SETDCB, DCB_CMD_IEEE_DEL, seq, 0);
+ dcbnl_ieee_notify(netdev, RTM_SETDCB, DCB_CMD_IEEE_DEL, seq, 0);
return err;
}
@@ -1642,70 +1844,16 @@ err:
return ret;
}
-static int dcbnl_cee_pg_fill(struct sk_buff *skb, struct net_device *dev,
- int dir)
-{
- u8 pgid, up_map, prio, tc_pct;
- const struct dcbnl_rtnl_ops *ops = dev->dcbnl_ops;
- int i = dir ? DCB_ATTR_CEE_TX_PG : DCB_ATTR_CEE_RX_PG;
- struct nlattr *pg = nla_nest_start(skb, i);
- if (!pg)
- goto nla_put_failure;
-
- for (i = DCB_PG_ATTR_TC_0; i <= DCB_PG_ATTR_TC_7; i++) {
- struct nlattr *tc_nest = nla_nest_start(skb, i);
- if (!tc_nest)
- goto nla_put_failure;
-
- pgid = DCB_ATTR_VALUE_UNDEFINED;
- prio = DCB_ATTR_VALUE_UNDEFINED;
- tc_pct = DCB_ATTR_VALUE_UNDEFINED;
- up_map = DCB_ATTR_VALUE_UNDEFINED;
-
- if (!dir)
- ops->getpgtccfgrx(dev, i - DCB_PG_ATTR_TC_0,
- &prio, &pgid, &tc_pct, &up_map);
- else
- ops->getpgtccfgtx(dev, i - DCB_PG_ATTR_TC_0,
- &prio, &pgid, &tc_pct, &up_map);
-
- NLA_PUT_U8(skb, DCB_TC_ATTR_PARAM_PGID, pgid);
- NLA_PUT_U8(skb, DCB_TC_ATTR_PARAM_UP_MAPPING, up_map);
- NLA_PUT_U8(skb, DCB_TC_ATTR_PARAM_STRICT_PRIO, prio);
- NLA_PUT_U8(skb, DCB_TC_ATTR_PARAM_BW_PCT, tc_pct);
- nla_nest_end(skb, tc_nest);
- }
-
- for (i = DCB_PG_ATTR_BW_ID_0; i <= DCB_PG_ATTR_BW_ID_7; i++) {
- tc_pct = DCB_ATTR_VALUE_UNDEFINED;
-
- if (!dir)
- ops->getpgbwgcfgrx(dev, i - DCB_PG_ATTR_BW_ID_0,
- &tc_pct);
- else
- ops->getpgbwgcfgtx(dev, i - DCB_PG_ATTR_BW_ID_0,
- &tc_pct);
- NLA_PUT_U8(skb, i, tc_pct);
- }
- nla_nest_end(skb, pg);
- return 0;
-
-nla_put_failure:
- return -EMSGSIZE;
-}
-
/* Handle CEE DCBX GET commands. */
static int dcbnl_cee_get(struct net_device *netdev, struct nlattr **tb,
u32 pid, u32 seq, u16 flags)
{
+ struct net *net = dev_net(netdev);
struct sk_buff *skb;
struct nlmsghdr *nlh;
struct dcbmsg *dcb;
- struct nlattr *cee, *app;
- struct dcb_app_type *itr;
const struct dcbnl_rtnl_ops *ops = netdev->dcbnl_ops;
- int dcbx, i, err = -EMSGSIZE;
- u8 value;
+ int err;
if (!ops)
return -EOPNOTSUPP;
@@ -1714,138 +1862,25 @@ static int dcbnl_cee_get(struct net_device *netdev, struct nlattr **tb,
if (!skb)
return -ENOBUFS;
- nlh = NLMSG_NEW(skb, pid, seq, RTM_GETDCB, sizeof(*dcb), flags);
+ nlh = nlmsg_put(skb, pid, seq, RTM_GETDCB, sizeof(*dcb), flags);
+ if (nlh == NULL) {
+ nlmsg_free(skb);
+ return -EMSGSIZE;
+ }
dcb = NLMSG_DATA(nlh);
dcb->dcb_family = AF_UNSPEC;
dcb->cmd = DCB_CMD_CEE_GET;
- NLA_PUT_STRING(skb, DCB_ATTR_IFNAME, netdev->name);
-
- cee = nla_nest_start(skb, DCB_ATTR_CEE);
- if (!cee)
- goto nla_put_failure;
-
- /* local pg */
- if (ops->getpgtccfgtx && ops->getpgbwgcfgtx) {
- err = dcbnl_cee_pg_fill(skb, netdev, 1);
- if (err)
- goto nla_put_failure;
- }
-
- if (ops->getpgtccfgrx && ops->getpgbwgcfgrx) {
- err = dcbnl_cee_pg_fill(skb, netdev, 0);
- if (err)
- goto nla_put_failure;
- }
-
- /* local pfc */
- if (ops->getpfccfg) {
- struct nlattr *pfc_nest = nla_nest_start(skb, DCB_ATTR_CEE_PFC);
- if (!pfc_nest)
- goto nla_put_failure;
-
- for (i = DCB_PFC_UP_ATTR_0; i <= DCB_PFC_UP_ATTR_7; i++) {
- ops->getpfccfg(netdev, i - DCB_PFC_UP_ATTR_0, &value);
- NLA_PUT_U8(skb, i, value);
- }
- nla_nest_end(skb, pfc_nest);
- }
-
- /* local app */
- spin_lock(&dcb_lock);
- app = nla_nest_start(skb, DCB_ATTR_CEE_APP_TABLE);
- if (!app)
- goto nla_put_failure;
-
- list_for_each_entry(itr, &dcb_app_list, list) {
- if (strncmp(itr->name, netdev->name, IFNAMSIZ) == 0) {
- struct nlattr *app_nest = nla_nest_start(skb,
- DCB_ATTR_APP);
- if (!app_nest)
- goto dcb_unlock;
-
- err = nla_put_u8(skb, DCB_APP_ATTR_IDTYPE,
- itr->app.selector);
- if (err)
- goto dcb_unlock;
-
- err = nla_put_u16(skb, DCB_APP_ATTR_ID,
- itr->app.protocol);
- if (err)
- goto dcb_unlock;
-
- err = nla_put_u8(skb, DCB_APP_ATTR_PRIORITY,
- itr->app.priority);
- if (err)
- goto dcb_unlock;
-
- nla_nest_end(skb, app_nest);
- }
- }
- nla_nest_end(skb, app);
-
- if (netdev->dcbnl_ops->getdcbx)
- dcbx = netdev->dcbnl_ops->getdcbx(netdev);
- else
- dcbx = -EOPNOTSUPP;
-
- spin_unlock(&dcb_lock);
-
- /* features flags */
- if (ops->getfeatcfg) {
- struct nlattr *feat = nla_nest_start(skb, DCB_ATTR_CEE_FEAT);
- if (!feat)
- goto nla_put_failure;
+ err = dcbnl_cee_fill(skb, netdev);
- for (i = DCB_FEATCFG_ATTR_ALL + 1; i <= DCB_FEATCFG_ATTR_MAX;
- i++)
- if (!ops->getfeatcfg(netdev, i, &value))
- NLA_PUT_U8(skb, i, value);
-
- nla_nest_end(skb, feat);
- }
-
- /* peer info if available */
- if (ops->cee_peer_getpg) {
- struct cee_pg pg;
- err = ops->cee_peer_getpg(netdev, &pg);
- if (!err)
- NLA_PUT(skb, DCB_ATTR_CEE_PEER_PG, sizeof(pg), &pg);
- }
-
- if (ops->cee_peer_getpfc) {
- struct cee_pfc pfc;
- err = ops->cee_peer_getpfc(netdev, &pfc);
- if (!err)
- NLA_PUT(skb, DCB_ATTR_CEE_PEER_PFC, sizeof(pfc), &pfc);
- }
-
- if (ops->peer_getappinfo && ops->peer_getapptable) {
- err = dcbnl_build_peer_app(netdev, skb,
- DCB_ATTR_CEE_PEER_APP_TABLE,
- DCB_ATTR_CEE_PEER_APP_INFO,
- DCB_ATTR_CEE_PEER_APP);
- if (err)
- goto nla_put_failure;
- }
- nla_nest_end(skb, cee);
-
- /* DCBX state */
- if (dcbx >= 0) {
- err = nla_put_u8(skb, DCB_ATTR_DCBX, dcbx);
- if (err)
- goto nla_put_failure;
+ if (err < 0) {
+ nlmsg_cancel(skb, nlh);
+ nlmsg_free(skb);
+ } else {
+ nlmsg_end(skb, nlh);
+ err = rtnl_unicast(skb, net, pid);
}
- nlmsg_end(skb, nlh);
- return rtnl_unicast(skb, &init_net, pid);
-
-dcb_unlock:
- spin_unlock(&dcb_lock);
-nla_put_failure:
- nlmsg_cancel(skb, nlh);
-nlmsg_failure:
- nlmsg_free(skb);
return err;
}
--
1.7.3.5
^ permalink raw reply related
* Re: [PATCH 03/12] econet: Reduce switch/case indent
From: Phil Blundell @ 2011-07-02 17:04 UTC (permalink / raw)
To: Joe Perches; +Cc: linux-kernel, David S. Miller, netdev
In-Reply-To: <e2f659cf95b88abbdf35c7447d8a4d00d5c424dc.1309549244.git.joe@perches.com>
On Fri, 2011-07-01 at 12:43 -0700, Joe Perches wrote:
> Make the case labels the same indent as the switch.
>
> Simplify a default case / return (unreached)
> Remove unnecessary break after return.
>
> Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Phil Blundell <philb@gnu.org>
Thanks.
p.
^ permalink raw reply
* Re: [Bugme-new] [Bug 38102] New: BUG kmalloc-2048: Poison overwritten
From: Alexey Zaytsev @ 2011-07-02 21:25 UTC (permalink / raw)
To: Andrew Morton
Cc: netdev, Gary Zambrano, bugme-daemon, David S. Miller,
Pekka Pietikainen, Florian Schirmer, Felix Fietkau,
Michael Buesch
In-Reply-To: <BANLkTi=PxH8V58k-VycsM=1ZiE9hPqCN4Q@mail.gmail.com>
On Fri, Jul 1, 2011 at 10:01, Alexey Zaytsev <alexey.zaytsev@gmail.com> wrote:
> On Thu, Jun 30, 2011 at 01:51, Andrew Morton <akpm@linux-foundation.org> wrote:
>>
>> (switched to email. Please respond via emailed reply-to-all, not via the
>> bugzilla web interface).
>>
>> On Thu, 23 Jun 2011 17:33:54 GMT
>> bugzilla-daemon@bugzilla.kernel.org wrote:
>>
>>> https://bugzilla.kernel.org/show_bug.cgi?id=38102
>>>
>>> Summary: BUG kmalloc-2048: Poison overwritten
>>> Product: Drivers
>>> Version: 2.5
>>> Kernel Version: 3.0.0-rc4
>>
>> Looks like a 2.6.38->2.6.39 regression, perhaps a memory scribble in b44.
>
> Actually, not sure about the version. 39 was the first one I've been
> using in the scenario. Checking older versions now.
> And git-log does not show a lot of changes to the b44 driver, so it
> might be something unrelated.
>
I've checked back as far as 2.6.27, and the problem is still there.
I've also looked through the allocation-related code, and it seemed
sane. I'm not sure I understand the 1GB dma workaround, but this path
is never hit in my case. So adding the driver authors to CC. This
could be something different, but I've been unable to reproduce using
an other machine with an rtl8139 nic.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox