* [patch] net,bonding: fix bond_options.c direct rwlock.h include
From: Mike Galbraith @ 2014-02-14 7:21 UTC (permalink / raw)
To: netdev; +Cc: LKML
drivers/net/bonding/bond_options.c includes rwlock.h directly,
which is a nono, and which also breaks RT kernel build.
Signed-off-by: Mike Galbraith <bitbucket@online.de>
---
diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c
index 11cb943222d5..c37878432717 100644
--- a/drivers/net/bonding/bond_options.c
+++ b/drivers/net/bonding/bond_options.c
@@ -14,7 +14,7 @@
#include <linux/errno.h>
#include <linux/if.h>
#include <linux/netdevice.h>
-#include <linux/rwlock.h>
+#include <linux/spinlock.h>
#include <linux/rcupdate.h>
#include <linux/ctype.h>
#include <linux/inet.h>
^ permalink raw reply related
* Re: [PATCH net-next v5 00/10] Support for the Broadcom GENET driver
From: Florian Fainelli @ 2014-02-14 7:07 UTC (permalink / raw)
To: David Miller; +Cc: netdev, devicetree, cernekee, mark.rutland, romieu
In-Reply-To: <20140214.002901.293996041341946875.davem@davemloft.net>
Le 13/02/2014 21:29, David Miller a écrit :
> From: Florian Fainelli <f.fainelli@gmail.com>
> Date: Thu, 13 Feb 2014 16:08:41 -0800
>
>> This patchset adds support for the Broadcom GENET Gigabit Ethernet MAC
>> controller. This controller is found on the Broadcom BCM7xxx Set Top Box
>> System-on-a-chips.
>>
>> Changes since v4:
>> - add dependency on CONFIG_OF
>>
>> Changes since v3:
>> - fixed Kconfig dependency on FIXED_PHY
>>
>> Changes since v2:
>> - dropped the patch that adds an "internal" phy-mode
>
> Series applied, thanks.
Great, thanks David!
--
Florian
^ permalink raw reply
* Re: Re: [PATCH] Fix Default to 'y' for SR9800 Device Driver, settingto 'n'
From: liujunliang_ljl @ 2014-02-14 6:43 UTC (permalink / raw)
To: David Miller, sergei.shtylyov
Cc: thierry.reding, horms, joe, romieu, gregkh, netdev, linux-usb,
linux-kernel, sunhecheng
In-Reply-To: <20140213.184221.1712626655601756449.davem@davemloft.net>
Dear David :
Thanks all the same.
2014-02-14
liujunliang_ljl
发件人: David Miller
发送时间: 2014-02-14 07:42:24
收件人: sergei.shtylyov
抄送: liujunliang_ljl; thierry.reding; horms; joe; romieu; gregkh; netdev; linux-usb; linux-kernel; sunhecheng
主题: Re: [PATCH] Fix Default to 'y' for SR9800 Device Driver, settingto 'n'
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date: Fri, 14 Feb 2014 03:38:17 +0300
> Hello.
>
> On 02/14/2014 02:32 AM, David Miller wrote:
>
>>> From: Liu Junliang <liujunliang_ljl@163.com>
>
>>> Signed-off-by: Liu Junliang <liujunliang_ljl@163.com>
>
>> I think it's more canonical to specify no default at all.
>
> That's what he did, no?
Indeed, my bad, patch applied, thanks!
.
^ permalink raw reply
* Re: [PATCH net] packet: check for ndo_select_queue during queue selection
From: David Miller @ 2014-02-14 5:40 UTC (permalink / raw)
To: dborkman; +Cc: mathias.kretschmer, netdev, brouer
In-Reply-To: <1392311935-10275-1-git-send-email-dborkman@redhat.com>
From: Daniel Borkmann <dborkman@redhat.com>
Date: Thu, 13 Feb 2014 18:18:55 +0100
> The original pktgen scenario for which PACKET_QDISC_BYPASS was
> designed for is still intact with this change anyway. We think
I guess you have no intention of using this feature on bnx2x, ixgbe,
or mlx4 devices then? That covers a rather large component of gigabit
ethernet devices out there, doesn't it?
They both hook up an ndo_select_queue method.
^ permalink raw reply
* Re: [PATCH net,v3] hyperv: Fix the carrier status setting
From: David Miller @ 2014-02-14 5:37 UTC (permalink / raw)
To: haiyangz; +Cc: olaf, netdev, jasowang, driverdev-devel, linux-kernel
In-Reply-To: <1392252867-21146-1-git-send-email-haiyangz@microsoft.com>
From: Haiyang Zhang <haiyangz@microsoft.com>
Date: Wed, 12 Feb 2014 16:54:27 -0800
> Without this patch, the "cat /sys/class/net/ethN/operstate" shows
> "unknown", and "ethtool ethN" shows "Link detected: yes", when VM
> boots up with or without vNIC connected.
>
> This patch fixed the problem.
>
> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
> Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>
Applied and queued up for -stable, thanks.
^ permalink raw reply
* Re: [PATCH 1/1] dccp: re-enable debug macro
From: David Miller @ 2014-02-14 5:35 UTC (permalink / raw)
To: gerrit; +Cc: netdev
In-Reply-To: <20140213190233.0f0889a4@liptov.cs.ualberta.ca>
From: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Date: Thu, 13 Feb 2014 19:02:33 -0700
> dccp tfrc: revert
>
> This reverts 6aee49c558de (Jan 4, 2014) since the variable tfrc_debug is
> referenced by the tfrc_pr_debug(fmt, ...) macro when TFRC debugging is
> enabled. If it is enabled, use of the macro produces a compilation error.
>
> Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Applied, thanks Gerrit.
^ permalink raw reply
* Re: [PATCH net-next v5 00/10] Support for the Broadcom GENET driver
From: David Miller @ 2014-02-14 5:29 UTC (permalink / raw)
To: f.fainelli-Re5JQEeQqe8AvxtiuMwx3w
Cc: netdev-u79uwXL29TY76Z2rM5mHXA, devicetree-u79uwXL29TY76Z2rM5mHXA,
cernekee-Re5JQEeQqe8AvxtiuMwx3w, mark.rutland-5wv7dgnIgG8,
romieu-W8zweXLXuWQS+FvcfC7Uqw
In-Reply-To: <1392336531-28875-1-git-send-email-f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
From: Florian Fainelli <f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Date: Thu, 13 Feb 2014 16:08:41 -0800
> This patchset adds support for the Broadcom GENET Gigabit Ethernet MAC
> controller. This controller is found on the Broadcom BCM7xxx Set Top Box
> System-on-a-chips.
>
> Changes since v4:
> - add dependency on CONFIG_OF
>
> Changes since v3:
> - fixed Kconfig dependency on FIXED_PHY
>
> Changes since v2:
> - dropped the patch that adds an "internal" phy-mode
Series applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH] virtio_net: fix the potential NULL pointer in xmit_skb()
From: Zhi Yong Wu @ 2014-02-14 5:25 UTC (permalink / raw)
To: David Miller; +Cc: Zhi Yong Wu, Linux Netdev List
In-Reply-To: <20140214.001252.1994875881466995036.davem@davemloft.net>
On Fri, Feb 14, 2014 at 1:12 PM, David Miller <davem@davemloft.net> wrote:
> From: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
> Date: Fri, 14 Feb 2014 12:00:08 +0800
>
>> The pointer hdr isn't assigned before hdr->mhdr and hdr->hdr
>> are used, so it could be one invalid pointer.
>>
>> Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
>
> sizeof(x) does not evaluate any dereferences made by 'x'
thanks for your explanation.
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Regards,
Zhi Yong Wu
^ permalink raw reply
* Re: [PATCH net-next v2 0/3] sch_netem: some improvements and cleanups.
From: David Miller @ 2014-02-14 5:15 UTC (permalink / raw)
To: yangyingliang; +Cc: netdev, stephen
In-Reply-To: <1392345043-12208-1-git-send-email-yangyingliang@huawei.com>
From: Yang Yingliang <yangyingliang@huawei.com>
Date: Fri, 14 Feb 2014 10:30:40 +0800
> v1 -> v2:
> remove patch #4.
>
> patch 1/3: To avoid breaking old settings when we change failed,
> do return errcode before doing setup.
> pacth 2/3: Replace some functions' parameters, these functions
> only need struct netem_sched_data *q.
> patch 3/3: Replace magic numbers with enumerate for better readability.
Series applied.
^ permalink raw reply
* Re: [PATCH] virtio_net: fix the potential NULL pointer in xmit_skb()
From: David Miller @ 2014-02-14 5:12 UTC (permalink / raw)
To: wuzhy; +Cc: netdev
In-Reply-To: <1392350408-3811-1-git-send-email-wuzhy@linux.vnet.ibm.com>
From: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
Date: Fri, 14 Feb 2014 12:00:08 +0800
> The pointer hdr isn't assigned before hdr->mhdr and hdr->hdr
> are used, so it could be one invalid pointer.
>
> Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
sizeof(x) does not evaluate any dereferences made by 'x'
^ permalink raw reply
* Re: [PATCH net 1/3] kref: add kref_sub_return
From: David Miller @ 2014-02-14 5:10 UTC (permalink / raw)
To: gregkh
Cc: virtio-dev, anatol.pomozov, mst, netdev, linux-kernel,
virtualization, qinchuanyu, joern
In-Reply-To: <20140214000320.GC15564@kroah.com>
From: Greg KH <gregkh@linuxfoundation.org>
Date: Thu, 13 Feb 2014 16:03:20 -0800
> So how about just "open coding" a kref for this structure, as it wants
> something that doesn't fit into the kref model, and should be pretty
> simple to do (you can ensure you get the locking right, unlike almost
> all users of krefs, as Al Viro constantly points out to me...)
They redid their patches meanwhile to use their own atomic_t.
^ permalink raw reply
* Re: [RFC PATCH v2 tip 0/7] 64-bit BPF insn set and tracing filters
From: Alexei Starovoitov @ 2014-02-14 4:47 UTC (permalink / raw)
To: Daniel Borkmann
Cc: Ingo Molnar, David S. Miller, Steven Rostedt, Peter Zijlstra,
H. Peter Anvin, Thomas Gleixner, Masami Hiramatsu, Tom Zanussi,
Jovi Zhangwei, Eric Dumazet, Linus Torvalds, Andrew Morton,
Frederic Weisbecker, Arnaldo Carvalho de Melo, Pekka Enberg,
Arjan van de Ven, Christoph Hellwig, linux-kernel, netdev
In-Reply-To: <52FD2908.8000009@redhat.com>
On Thu, Feb 13, 2014 at 12:20 PM, Daniel Borkmann <dborkman@redhat.com> wrote:
> On 02/07/2014 02:20 AM, Alexei Starovoitov wrote:
> ...
>>
>> Hi Daniel,
>
>
> Thanks for your answer and sorry for the late reply.
>
>
>> Thank you for taking a look. Good questions. I had the same concerns.
>> Old BPF was carefully extended in specific places.
>> End result may look big at first glance, but every extension has specific
>> reason behind it. I tried to explain the reasoning in
>> Documentation/bpf_jit.txt
>>
>> I'm planning to write an on-the-fly converter from old BPF to BPF64
>> when BPF64 manages to demonstrate that it is equally safe.
>> It is straight forward to convert. Encoding is very similar.
>> Core concepts are the same.
>> Try diff include/uapi/linux/filter.h include/linux/bpf.h
>> to see how much is reused.
>>
>> I believe that old BPF outlived itself and BPF64 should
>> replace it in all current use cases plus a lot more.
>> It just cannot happen at once.
>> BPF64 can come in. bpf32->bpf64 converter functioning.
>> JIT from bpf64->aarch64 and may be sparc64 needs to be in place.
>> Then old bpf can fade away.
>
>
> Do you see a possibility to integrate your work step by step? That is,
Sure. let's see how we can do it.
> to first integrate the interpreter part only; meaning, to detect "old"
> BPF programs e.g. coming from SO_ATTACH_FILTER et al and run them in
> compatibility mode while extended BPF is fully integrated and replaces
> the old engine in net/core/filter.c. Maybe, "old" programs can be
do you mean drop bfp64_jit, checker and just have bpf32->bpf64 converter
and bpf64 interpreter as phase 1 ?
Checking is done by old bpf32,
all existing bpf32 jits, if available, can convert bpf32 to native,
but interpreter will be running on bpf64 ?
phase 2 to introduce bpf64_x86 jit and so on?
Sounds fine.
Today I didn't try to optimize bpf64 interpreter, since insn set is designed
for eventual JITing and interpreter is there to support archs that don't
have jit yet.
I guess I have to tweak it to perform at bpf32 interpreter speeds.
> transformed transparently to the new representation and then would be
> good to execute in eBPF. If possible, in such a way that in the first
> step JIT compilers won't need any upgrades. Once that is resolved,
> JIT compilers could successively migrate, arch by arch, to compile the
> new code? And last but not least the existing tools as well for handling
> eBPF. I think, if possible, that would be great. Also, I unfortunately
> haven't looked into your code too deeply yet due to time constraints,
> but I'm wondering e.g. for accessing some skb fields we currently use
> the "hack" to "overload" load instructions with negative arguments. Do
> we have a sort of "meta" instruction that is extendible in eBPF to avoid
> such things in future?
Exactly.
This 'negative offset' hack of bpf32 isn't very clean, since jits for all archs
need to change when new offsets added.
For bpf64 I'm proposing a customizable 'bpf_context' and variable set
of bpf-callable functions, so JITs don't need to change and verifier
stays the same.
That's the idea behind 'bpf_callbacks' in include/linux/bpf_jit.h
Some meta data makes sense to pass as input into bpf program.
Like for seccomp 'bpf_context' can be 'struct seccomp_data'
For networking, bpf_context can be 'skb',
then bpf_s_anc_protocol becomes a normal 2-byte bpf64 load
from skb->protocol field. Allowing access to other fields of skb
is just a matter of defining permissions of 'struct bpf_context' in
bpf_callback->get_context_access()
Some other meta data and extensions are cleaner when defined
as function calls from bpf, since calls are free.
I think bpf_table_lookup() is a fundamental one that allows to define
arbitrary tables within bpf and access them from the program.
(here I need feedback the most whether to access tables
via netlink from userspace or via debugfs...)
It probably will be easier to read the code of bpf32-bpf64 converter
to understand the differences between the two.
I guess I have to start working on the converter sooner than I thought...
Thanks
Alexei
^ permalink raw reply
* [PATCH] virtio_net: fix the potential NULL pointer in xmit_skb()
From: Zhi Yong Wu @ 2014-02-14 4:00 UTC (permalink / raw)
To: netdev; +Cc: Zhi Yong Wu
The pointer hdr isn't assigned before hdr->mhdr and hdr->hdr
are used, so it could be one invalid pointer.
Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
---
drivers/net/virtio_net.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index d75f8ed..bf6397f 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -807,9 +807,9 @@ static int xmit_skb(struct send_queue *sq, struct sk_buff *skb)
pr_debug("%s: xmit %p %pM\n", vi->dev->name, skb, dest);
if (vi->mergeable_rx_bufs)
- hdr_len = sizeof hdr->mhdr;
+ hdr_len = sizeof(struct virtio_net_hdr_mrg_rxbuf);
else
- hdr_len = sizeof hdr->hdr;
+ hdr_len = sizeof(struct virtio_net_hdr);
can_push = vi->any_header_sg &&
!((unsigned long)skb->data & (__alignof__(*hdr) - 1)) &&
--
1.8.4.2
^ permalink raw reply related
* Re: linux-next: manual merge of the devicetree tree with the net-next tree
From: Florian Fainelli @ 2014-02-14 3:47 UTC (permalink / raw)
To: Stephen Rothwell, Grant Likely, David Miller, netdev
Cc: linux-next, linux-kernel
In-Reply-To: <20140214141639.74ea45728f39a8ee874ce986@canb.auug.org.au>
Hi Stephen,
Le 13/02/2014 19:16, Stephen Rothwell a écrit :
> Hi Grant,
>
> Today's linux-next merge of the devicetree tree got a conflict in
> drivers/of/of_net.c between commit 8a2fe56e8827 ("net: phy: re-design
> phy_modes to be self-contained") from the net-next tree and commit
> cf4c9eb5a451 ("of: make of_get_phy_mode parse 'phy-connection-type'")
> from the devicetree tree.
>
> I fixed it up (I applied the following merge fix patch) and can carry the
> fix as necessary (no action is required).
Looks good to me, thanks for fixing that!
>
> From: Stephen Rothwell <sfr@canb.auug.org.au>
> Date: Fri, 14 Feb 2014 14:14:31 +1100
> Subject: [PATCH] net: of: merges fix for a moved comment
>
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> ---
> include/linux/phy.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/phy.h b/include/linux/phy.h
> index 42f1bc7eaeb0..bc77c174e0a3 100644
> --- a/include/linux/phy.h
> +++ b/include/linux/phy.h
> @@ -79,8 +79,8 @@ typedef enum {
>
> /**
> * It maps 'enum phy_interface_t' found in include/linux/phy.h
> - * into the device tree binding of 'phy-mode', so that Ethernet
> - * device driver can get phy interface from device tree.
> + * into the device tree binding of 'phy-mode' or 'phy-connection-type',
> + * so that Ethernet device driver can get phy interface from device tree.
> */
> static inline const char *phy_modes(phy_interface_t interface)
> {
>
^ permalink raw reply
* linux-next: manual merge of the devicetree tree with the net-next tree
From: Stephen Rothwell @ 2014-02-14 3:16 UTC (permalink / raw)
To: Grant Likely, David Miller, netdev
Cc: linux-next, linux-kernel, Florian Fainelli
[-- Attachment #1: Type: text/plain, Size: 1428 bytes --]
Hi Grant,
Today's linux-next merge of the devicetree tree got a conflict in
drivers/of/of_net.c between commit 8a2fe56e8827 ("net: phy: re-design
phy_modes to be self-contained") from the net-next tree and commit
cf4c9eb5a451 ("of: make of_get_phy_mode parse 'phy-connection-type'")
from the devicetree tree.
I fixed it up (I applied the following merge fix patch) and can carry the
fix as necessary (no action is required).
From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Fri, 14 Feb 2014 14:14:31 +1100
Subject: [PATCH] net: of: merges fix for a moved comment
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
include/linux/phy.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 42f1bc7eaeb0..bc77c174e0a3 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -79,8 +79,8 @@ typedef enum {
/**
* It maps 'enum phy_interface_t' found in include/linux/phy.h
- * into the device tree binding of 'phy-mode', so that Ethernet
- * device driver can get phy interface from device tree.
+ * into the device tree binding of 'phy-mode' or 'phy-connection-type',
+ * so that Ethernet device driver can get phy interface from device tree.
*/
static inline const char *phy_modes(phy_interface_t interface)
{
--
1.9.0.rc3
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply related
* RE: RTL8153 fails to get link after applying c7de7dec2 to 3.8 kernel
From: hayeswang @ 2014-02-14 3:13 UTC (permalink / raw)
To: 'Grant Grundler'
Cc: 'Inki Yoo', 'netdev', 'David Miller'
In-Reply-To: <CANEJEGtGSHAACM=Bk0BAHrM=-1q4pHoboO5FYN7YM4wquMMmXA@mail.gmail.com>
Grant Grundler [mailto:grundler@google.com]
> Sent: Friday, February 14, 2014 6:23 AM
> To: hayeswang
> Cc: Inki Yoo; netdev; David Miller
> Subject: Re: RTL8153 fails to get link after applying
> c7de7dec2 to 3.8 kernel
[...]
> That makes sense. How can I check that?
The simple way is to see the led on the device to check the linking
with the cable attatched before any driver is loaded. Normally, I
would see the linking before running the OS when I plug the dangle
and then power on the PC. If you couldn't see the led on the device,
you could check the one on the switch.
> > I think you should create a udev rule to change the configuration
> > to 1 when the dangle is plugged. Then, it could load the
> vendor mode driver.
>
> Which "configuration" are you referring to?
Configuration 1. That has more power saving features.
> Something like this?
> /sys/devices/12110000.usb/usb3/3-2/bConfigurationValue
Yes. Modify the value from 2 to 1.
> I'm happy to try any command line you give me.
>
> If that command works, I can write the udev rule for future testing
> with these devices.
My udev rule (50-usb-realtek-net.rules) likes the following.
ACTION!="add", GOTO="usb_realtek_net_end"
SUBSYSTEM!="usb", GOTO="usb_realtek_net_end"
ENV{DEVTYPE}!="usb_device", GOTO="usb_realtek_net_end"
ATTR{idVendor}=="0bda", ATTR{idProduct}=="8153", ATTR{bConfigurationValue}!="1", ATTR{bConfigurationValue}="1"
LABEL="usb_realtek_net_end"
Best Regards,
Hayes
^ permalink raw reply
* [PATCH net-next v2 0/3] sch_netem: some improvements and cleanups.
From: Yang Yingliang @ 2014-02-14 2:30 UTC (permalink / raw)
To: netdev; +Cc: davem, stephen
v1 -> v2:
remove patch #4.
patch 1/3: To avoid breaking old settings when we change failed,
do return errcode before doing setup.
pacth 2/3: Replace some functions' parameters, these functions
only need struct netem_sched_data *q.
patch 3/3: Replace magic numbers with enumerate for better readability.
Yang Yingliang (3):
sch_netem: return errcode before setting params
sch_netem: change some func's param from "struct Qdisc *" to "struct
netem_sched_data *"
sch_netem: replace magic numbers with enumerate in GE model
net/sched/sch_netem.c | 75 ++++++++++++++++++++++++++++++++-------------------
1 file changed, 47 insertions(+), 28 deletions(-)
--
1.8.0
^ permalink raw reply
* [PATCH net-next v2 2/3] sch_netem: change some func's param from "struct Qdisc *" to "struct netem_sched_data *"
From: Yang Yingliang @ 2014-02-14 2:30 UTC (permalink / raw)
To: netdev; +Cc: davem, stephen
In-Reply-To: <1392345043-12208-1-git-send-email-yangyingliang@huawei.com>
In netem_change(), we have already get "struct netem_sched_data *q".
Replace params of get_correlation() and other similar functions with
"struct netem_sched_data *q".
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
net/sched/sch_netem.c | 25 ++++++++++---------------
1 file changed, 10 insertions(+), 15 deletions(-)
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c
index b341943..4a5eb28 100644
--- a/net/sched/sch_netem.c
+++ b/net/sched/sch_netem.c
@@ -689,9 +689,8 @@ static int get_dist_table(struct Qdisc *sch, const struct nlattr *attr)
return 0;
}
-static void get_correlation(struct Qdisc *sch, const struct nlattr *attr)
+static void get_correlation(struct netem_sched_data *q, const struct nlattr *attr)
{
- struct netem_sched_data *q = qdisc_priv(sch);
const struct tc_netem_corr *c = nla_data(attr);
init_crandom(&q->delay_cor, c->delay_corr);
@@ -699,27 +698,24 @@ static void get_correlation(struct Qdisc *sch, const struct nlattr *attr)
init_crandom(&q->dup_cor, c->dup_corr);
}
-static void get_reorder(struct Qdisc *sch, const struct nlattr *attr)
+static void get_reorder(struct netem_sched_data *q, const struct nlattr *attr)
{
- struct netem_sched_data *q = qdisc_priv(sch);
const struct tc_netem_reorder *r = nla_data(attr);
q->reorder = r->probability;
init_crandom(&q->reorder_cor, r->correlation);
}
-static void get_corrupt(struct Qdisc *sch, const struct nlattr *attr)
+static void get_corrupt(struct netem_sched_data *q, const struct nlattr *attr)
{
- struct netem_sched_data *q = qdisc_priv(sch);
const struct tc_netem_corrupt *r = nla_data(attr);
q->corrupt = r->probability;
init_crandom(&q->corrupt_cor, r->correlation);
}
-static void get_rate(struct Qdisc *sch, const struct nlattr *attr)
+static void get_rate(struct netem_sched_data *q, const struct nlattr *attr)
{
- struct netem_sched_data *q = qdisc_priv(sch);
const struct tc_netem_rate *r = nla_data(attr);
q->rate = r->rate;
@@ -732,9 +728,8 @@ static void get_rate(struct Qdisc *sch, const struct nlattr *attr)
q->cell_size_reciprocal = (struct reciprocal_value) { 0 };
}
-static int get_loss_clg(struct Qdisc *sch, const struct nlattr *attr)
+static int get_loss_clg(struct netem_sched_data *q, const struct nlattr *attr)
{
- struct netem_sched_data *q = qdisc_priv(sch);
const struct nlattr *la;
int rem;
@@ -838,7 +833,7 @@ static int netem_change(struct Qdisc *sch, struct nlattr *opt)
old_loss_model = q->loss_model;
if (tb[TCA_NETEM_LOSS]) {
- ret = get_loss_clg(sch, tb[TCA_NETEM_LOSS]);
+ ret = get_loss_clg(q, tb[TCA_NETEM_LOSS]);
if (ret) {
q->loss_model = old_loss_model;
return ret;
@@ -877,16 +872,16 @@ static int netem_change(struct Qdisc *sch, struct nlattr *opt)
q->reorder = ~0;
if (tb[TCA_NETEM_CORR])
- get_correlation(sch, tb[TCA_NETEM_CORR]);
+ get_correlation(q, tb[TCA_NETEM_CORR]);
if (tb[TCA_NETEM_REORDER])
- get_reorder(sch, tb[TCA_NETEM_REORDER]);
+ get_reorder(q, tb[TCA_NETEM_REORDER]);
if (tb[TCA_NETEM_CORRUPT])
- get_corrupt(sch, tb[TCA_NETEM_CORRUPT]);
+ get_corrupt(q, tb[TCA_NETEM_CORRUPT]);
if (tb[TCA_NETEM_RATE])
- get_rate(sch, tb[TCA_NETEM_RATE]);
+ get_rate(q, tb[TCA_NETEM_RATE]);
if (tb[TCA_NETEM_RATE64])
q->rate = max_t(u64, q->rate,
--
1.8.0
^ permalink raw reply related
* [PATCH net-next v2 3/3] sch_netem: replace magic numbers with enumerate in GE model
From: Yang Yingliang @ 2014-02-14 2:30 UTC (permalink / raw)
To: netdev; +Cc: davem, stephen
In-Reply-To: <1392345043-12208-1-git-send-email-yangyingliang@huawei.com>
Replace some magic numbers which describe states of GE model
loss generator with enumerate.
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
net/sched/sch_netem.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c
index 4a5eb28..4fced67 100644
--- a/net/sched/sch_netem.c
+++ b/net/sched/sch_netem.c
@@ -117,6 +117,11 @@ struct netem_sched_data {
LOST_IN_BURST_PERIOD,
} _4_state_model;
+ enum {
+ GOOD_STATE = 1,
+ BAD_STATE,
+ } GE_state_model;
+
/* Correlated Loss Generation models */
struct clgstate {
/* state of the Markov chain */
@@ -272,15 +277,15 @@ static bool loss_gilb_ell(struct netem_sched_data *q)
struct clgstate *clg = &q->clg;
switch (clg->state) {
- case 1:
+ case GOOD_STATE:
if (prandom_u32() < clg->a1)
- clg->state = 2;
+ clg->state = BAD_STATE;
if (prandom_u32() < clg->a4)
return true;
break;
- case 2:
+ case BAD_STATE:
if (prandom_u32() < clg->a2)
- clg->state = 1;
+ clg->state = GOOD_STATE;
if (prandom_u32() > clg->a3)
return true;
}
--
1.8.0
^ permalink raw reply related
* [PATCH net-next v2 1/3] sch_netem: return errcode before setting params
From: Yang Yingliang @ 2014-02-14 2:30 UTC (permalink / raw)
To: netdev; +Cc: davem, stephen
In-Reply-To: <1392345043-12208-1-git-send-email-yangyingliang@huawei.com>
get_dist_table() and get_loss_clg() may be failed. These
two functions should be called after setting the members
of qdisc_priv(sch), or it will break the old settings while
either of them is failed.
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
net/sched/sch_netem.c | 39 +++++++++++++++++++++++++++++----------
1 file changed, 29 insertions(+), 10 deletions(-)
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c
index de1059a..b341943 100644
--- a/net/sched/sch_netem.c
+++ b/net/sched/sch_netem.c
@@ -821,6 +821,8 @@ static int netem_change(struct Qdisc *sch, struct nlattr *opt)
struct netem_sched_data *q = qdisc_priv(sch);
struct nlattr *tb[TCA_NETEM_MAX + 1];
struct tc_netem_qopt *qopt;
+ struct clgstate old_clg;
+ int old_loss_model = CLG_RANDOM;
int ret;
if (opt == NULL)
@@ -831,6 +833,33 @@ static int netem_change(struct Qdisc *sch, struct nlattr *opt)
if (ret < 0)
return ret;
+ /* backup q->clg and q->loss_model */
+ old_clg = q->clg;
+ old_loss_model = q->loss_model;
+
+ if (tb[TCA_NETEM_LOSS]) {
+ ret = get_loss_clg(sch, tb[TCA_NETEM_LOSS]);
+ if (ret) {
+ q->loss_model = old_loss_model;
+ return ret;
+ }
+ } else {
+ q->loss_model = CLG_RANDOM;
+ }
+
+ if (tb[TCA_NETEM_DELAY_DIST]) {
+ ret = get_dist_table(sch, tb[TCA_NETEM_DELAY_DIST]);
+ if (ret) {
+ /* recover clg and loss_model, in case of
+ * q->clg and q->loss_model were modified
+ * in get_loss_clg()
+ */
+ q->clg = old_clg;
+ q->loss_model = old_loss_model;
+ return ret;
+ }
+ }
+
sch->limit = qopt->limit;
q->latency = qopt->latency;
@@ -850,12 +879,6 @@ static int netem_change(struct Qdisc *sch, struct nlattr *opt)
if (tb[TCA_NETEM_CORR])
get_correlation(sch, tb[TCA_NETEM_CORR]);
- if (tb[TCA_NETEM_DELAY_DIST]) {
- ret = get_dist_table(sch, tb[TCA_NETEM_DELAY_DIST]);
- if (ret)
- return ret;
- }
-
if (tb[TCA_NETEM_REORDER])
get_reorder(sch, tb[TCA_NETEM_REORDER]);
@@ -872,10 +895,6 @@ static int netem_change(struct Qdisc *sch, struct nlattr *opt)
if (tb[TCA_NETEM_ECN])
q->ecn = nla_get_u32(tb[TCA_NETEM_ECN]);
- q->loss_model = CLG_RANDOM;
- if (tb[TCA_NETEM_LOSS])
- ret = get_loss_clg(sch, tb[TCA_NETEM_LOSS]);
-
return ret;
}
--
1.8.0
^ permalink raw reply related
* suspicious code in net/rxrpc/ar-error.c
From: Dave Jones @ 2014-02-14 2:28 UTC (permalink / raw)
To: netdev; +Cc: dhowells
While looking through old coverity reports, I came across this..
84 if (mtu == 0) {
85 /* they didn't give us a size, estimate one */
86 if (mtu > 1500) {
87 mtu >>= 1;
88 if (mtu < 1500)
89 mtu = 1500;
90 } else {
91 mtu -= 100;
92 if (mtu < peer->hdrsize)
93 mtu = peer->hdrsize + 4;
94 }
95 }
What was intended here ? Perhaps one of those mtu comparisons should be
comparing peer->mtu ?
Dave
^ permalink raw reply
* Re: [PATCH net,v3] hyperv: Fix the carrier status setting
From: Jason Wang @ 2014-02-14 2:19 UTC (permalink / raw)
To: Haiyang Zhang, davem@davemloft.net, netdev@vger.kernel.org
Cc: driverdev-devel@linuxdriverproject.org, olaf@aepfle.de,
linux-kernel@vger.kernel.org
In-Reply-To: <900caa9031c345a6a21604ca7bb02174@DFM-DB3MBX15-06.exchange.corp.microsoft.com>
On 02/13/2014 11:04 PM, Haiyang Zhang wrote:
>
>> -----Original Message-----
>> From: Jason Wang [mailto:jasowang@redhat.com]
>> Sent: Wednesday, February 12, 2014 10:52 PM
>> To: Haiyang Zhang; davem@davemloft.net; netdev@vger.kernel.org
>> Cc: KY Srinivasan; olaf@aepfle.de; linux-kernel@vger.kernel.org; driverdev-
>> devel@linuxdriverproject.org
>> Subject: Re: [PATCH net,v3] hyperv: Fix the carrier status setting
>>
>> On 02/13/2014 08:54 AM, Haiyang Zhang wrote:
>>> Without this patch, the "cat /sys/class/net/ethN/operstate" shows
>>> "unknown", and "ethtool ethN" shows "Link detected: yes", when VM
>>> boots up with or without vNIC connected.
>>>
>>> This patch fixed the problem.
>>>
>>> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
>>> Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>
>>> ---
>>> drivers/net/hyperv/netvsc_drv.c | 53
>> ++++++++++++++++++++++++++++-----------
>>> 1 files changed, 38 insertions(+), 15 deletions(-)
>>>
>>> diff --git a/drivers/net/hyperv/netvsc_drv.c
>>> b/drivers/net/hyperv/netvsc_drv.c index 7756118..7141a19 100644
>>> --- a/drivers/net/hyperv/netvsc_drv.c
>>> +++ b/drivers/net/hyperv/netvsc_drv.c
>>> @@ -88,8 +88,12 @@ static int netvsc_open(struct net_device *net) {
>>> struct net_device_context *net_device_ctx = netdev_priv(net);
>>> struct hv_device *device_obj = net_device_ctx->device_ctx;
>>> + struct netvsc_device *nvdev;
>>> + struct rndis_device *rdev;
>>> int ret = 0;
>>>
>>> + netif_carrier_off(net);
>>> +
>>> /* Open up the device */
>>> ret = rndis_filter_open(device_obj);
>>> if (ret != 0) {
>>> @@ -99,6 +103,11 @@ static int netvsc_open(struct net_device *net)
>>>
>>> netif_start_queue(net);
>>>
>>> + nvdev = hv_get_drvdata(device_obj);
>>> + rdev = nvdev->extension;
>>> + if (!rdev->link_state)
>>> + netif_carrier_on(net);
>>> +
>> Maybe you can just schedule the work here and then you can drop the
>> rtnl_lock in netvsc_link_change() ?
> The rtnl_lock will still be necessary in the netvsc_link_change(), because
> we want to prevent it getting wrong rdev pointer when netvsc_change_mtu
> is removing/adding rndis device.
Ok.
>>> +
>>> + if (notify)
>>> + netdev_notify_peers(net);
>>> }
>>>
>> Looks like this forces arp_notify here. Is it expected?
> Yes, this is expected. It's required after live migration.
>
> Thanks,
> - Haiyang
Yes, this does not change the current behaviour. (arp_notify is
meaningless for netvsc).
Acked-by: Jason Wang <jasowang@redhat.com>
The patch is also needed for stable.
Thanks
>
> --
> 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/
^ permalink raw reply
* Re: [PATCH v3 2/2] sctp: optimize the sctp_sysctl_net_register
From: Wang Weidong @ 2014-02-14 2:18 UTC (permalink / raw)
To: Neil Horman; +Cc: davem, vyasevich, dborkman, sergei.shtylyov, netdev
In-Reply-To: <20140213124434.GA27319@hmsreliant.think-freely.org>
On 2014/2/13 20:44, Neil Horman wrote:
> On Thu, Feb 13, 2014 at 09:19:25AM +0800, Wang Weidong wrote:
>> On 2014/2/12 19:53, Neil Horman wrote:
>>> On Wed, Feb 12, 2014 at 09:44:44AM +0800, Wang Weidong wrote:
>>>> Here, when the net is init_net, we needn't to kmemdup the ctl_table
>>>> again. So add a check for net. Also we can save some memory.
>>>>
>>>> Signed-off-by: Wang Weidong <wangweidong1@huawei.com>
>>>> ---
>>>> net/sctp/sysctl.c | 17 ++++++++++-------
>>>> 1 file changed, 10 insertions(+), 7 deletions(-)
>>>>
>>>> diff --git a/net/sctp/sysctl.c b/net/sctp/sysctl.c
>>>> index d354de5..35c8923 100644
>>>> --- a/net/sctp/sysctl.c
>>>> +++ b/net/sctp/sysctl.c
>>>> @@ -402,15 +402,18 @@ static int proc_sctp_do_rto_max(struct ctl_table *ctl, int write,
>>>>
>>>> int sctp_sysctl_net_register(struct net *net)
>>>> {
>>>> - struct ctl_table *table;
>>>> - int i;
>>>> + struct ctl_table *table = sctp_net_table;
>>>> +
>>>> + if (!net_eq(net, &init_net)) {
>>>> + int i;
>>>>
>>>> - table = kmemdup(sctp_net_table, sizeof(sctp_net_table), GFP_KERNEL);
>>>> - if (!table)
>>>> - return -ENOMEM;
>>>> + table = kmemdup(sctp_net_table, sizeof(sctp_net_table), GFP_KERNEL);
>>>> + if (!table)
>>>> + return -ENOMEM;
>>>>
>>>> - for (i = 0; table[i].data; i++)
>>>> - table[i].data += (char *)(&net->sctp) - (char *)&init_net.sctp;
>>>> + for (i = 0; table[i].data; i++)
>>>> + table[i].data += (char *)(&net->sctp) - (char *)&init_net.sctp;
>>>> + }
>>>>
>>> In the first version of this patch you complained about a lockdep issue. Did
>>> you figure out what that was, and if it related to these changes?
>>>
>>> Neil
>>>
>>>
>> Hi Neil,
>>
>> The lockdep issue doesn't relate to these changes. I should send it
>> by the another email. Sorry for confusing you.
>>
>> Regards
>> Wang
>>
> Then you probably don't need to mention it in the same note that you're
> proposing changes.
>
Ok. Got it!
Thanks
Wang
> Acked-by: Neil Horman <nhorman@tuxdriver.com>
>
>
> .
>
^ permalink raw reply
* [PATCH 1/1] dccp: re-enable debug macro
From: Gerrit Renker @ 2014-02-14 2:02 UTC (permalink / raw)
To: davem, netdev
dccp tfrc: revert
This reverts 6aee49c558de (Jan 4, 2014) since the variable tfrc_debug is
referenced by the tfrc_pr_debug(fmt, ...) macro when TFRC debugging is
enabled. If it is enabled, use of the macro produces a compilation error.
Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
---
net/dccp/ccids/lib/tfrc.c | 2 +-
net/dccp/ccids/lib/tfrc.h | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
--- a/net/dccp/ccids/lib/tfrc.c
+++ b/net/dccp/ccids/lib/tfrc.c
@@ -8,7 +8,7 @@
#include "tfrc.h"
#ifdef CONFIG_IP_DCCP_TFRC_DEBUG
-static bool tfrc_debug;
+bool tfrc_debug;
module_param(tfrc_debug, bool, 0644);
MODULE_PARM_DESC(tfrc_debug, "Enable TFRC debug messages");
#endif
--- a/net/dccp/ccids/lib/tfrc.h
+++ b/net/dccp/ccids/lib/tfrc.h
@@ -21,6 +21,7 @@
#include "packet_history.h"
#ifdef CONFIG_IP_DCCP_TFRC_DEBUG
+extern bool tfrc_debug;
#define tfrc_pr_debug(format, a...) DCCP_PR_DEBUG(tfrc_debug, format, ##a)
#else
#define tfrc_pr_debug(format, a...)
^ permalink raw reply
* Re: [PATCH net-next 4/4] sch_netem: replace spin_(un)lock_bh with sch_tree_(un)lock
From: Yang Yingliang @ 2014-02-14 1:32 UTC (permalink / raw)
To: David Miller; +Cc: netdev, stephen
In-Reply-To: <20140213.174606.334208738068503053.davem@davemloft.net>
On 2014/2/14 6:46, David Miller wrote:
> From: Yang Yingliang <yangyingliang@huawei.com>
> Date: Wed, 12 Feb 2014 10:58:15 +0800
>
>> spin_(un)lock_bh(root_lock) is same as sch_tree_(un)lock.
>>
>> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ...
>> @@ -684,11 +683,9 @@ static int get_dist_table(struct Qdisc *sch, const struct nlattr *attr)
>> for (i = 0; i < n; i++)
>> d->table[i] = data[i];
>>
>> - root_lock = qdisc_root_sleeping_lock(sch);
>> -
>> - spin_lock_bh(root_lock);
>> + sch_tree_lock(sch);
>> swap(q->delay_dist, d);
>> - spin_unlock_bh(root_lock);
>> + sch_tree_unlock(sch);
>>
>> dist_free(d);
>> return 0;
>
> This is more expensive than the existing code.
>
> We will now calculate qdisc_root_sleeping_lock() twice which is at
> least two pointer dereferences each.
>
> Without explicitly open-coding this, the compiler cannot cache the
> result, because the spin lock operations have memory barriers (if
> implemented inline) or are considered to potentially modify all memory
> (if implemented as function calls).
>
>
OK, thanks!
I'll send v2 without this patch.
^ 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