Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next 4/4] appletalk: fix checkpatch error with indent
From: Wang Weidong @ 2014-02-14  7:43 UTC (permalink / raw)
  To: acme, davem; +Cc: netdev
In-Reply-To: <1392363826-8256-1-git-send-email-wangweidong1@huawei.com>

checkpatch error: switch and case should be at the same indent.

Signed-off-by: Wang Weidong <wangweidong1@huawei.com>
---
 net/appletalk/ddp.c | 90 ++++++++++++++++++++++++++---------------------------
 1 file changed, 45 insertions(+), 45 deletions(-)

diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c
index 786255c..5fd5122 100644
--- a/net/appletalk/ddp.c
+++ b/net/appletalk/ddp.c
@@ -1789,53 +1789,53 @@ static int atalk_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 	void __user *argp = (void __user *)arg;
 
 	switch (cmd) {
-		/* Protocol layer */
-		case TIOCOUTQ: {
-			long amount = sk->sk_sndbuf - sk_wmem_alloc_get(sk);
+	/* Protocol layer */
+	case TIOCOUTQ: {
+		long amount = sk->sk_sndbuf - sk_wmem_alloc_get(sk);
 
-			if (amount < 0)
-				amount = 0;
-			rc = put_user(amount, (int __user *)argp);
-			break;
-		}
-		case TIOCINQ: {
-			/*
-			 * These two are safe on a single CPU system as only
-			 * user tasks fiddle here
-			 */
-			struct sk_buff *skb = skb_peek(&sk->sk_receive_queue);
-			long amount = 0;
+		if (amount < 0)
+			amount = 0;
+		rc = put_user(amount, (int __user *)argp);
+		break;
+	}
+	case TIOCINQ: {
+		/*
+		 * These two are safe on a single CPU system as only
+		 * user tasks fiddle here
+		 */
+		struct sk_buff *skb = skb_peek(&sk->sk_receive_queue);
+		long amount = 0;
 
-			if (skb)
-				amount = skb->len - sizeof(struct ddpehdr);
-			rc = put_user(amount, (int __user *)argp);
-			break;
-		}
-		case SIOCGSTAMP:
-			rc = sock_get_timestamp(sk, argp);
-			break;
-		case SIOCGSTAMPNS:
-			rc = sock_get_timestampns(sk, argp);
-			break;
-		/* Routing */
-		case SIOCADDRT:
-		case SIOCDELRT:
-			rc = -EPERM;
-			if (capable(CAP_NET_ADMIN))
-				rc = atrtr_ioctl(cmd, argp);
-			break;
-		/* Interface */
-		case SIOCGIFADDR:
-		case SIOCSIFADDR:
-		case SIOCGIFBRDADDR:
-		case SIOCATALKDIFADDR:
-		case SIOCDIFADDR:
-		case SIOCSARP:		/* proxy AARP */
-		case SIOCDARP:		/* proxy AARP */
-			rtnl_lock();
-			rc = atif_ioctl(cmd, argp);
-			rtnl_unlock();
-			break;
+		if (skb)
+		amount = skb->len - sizeof(struct ddpehdr);
+		rc = put_user(amount, (int __user *)argp);
+		break;
+	}
+	case SIOCGSTAMP:
+		rc = sock_get_timestamp(sk, argp);
+		break;
+	case SIOCGSTAMPNS:
+		rc = sock_get_timestampns(sk, argp);
+		break;
+	/* Routing */
+	case SIOCADDRT:
+	case SIOCDELRT:
+		rc = -EPERM;
+		if (capable(CAP_NET_ADMIN))
+			rc = atrtr_ioctl(cmd, argp);
+		break;
+	/* Interface */
+	case SIOCGIFADDR:
+	case SIOCSIFADDR:
+	case SIOCGIFBRDADDR:
+	case SIOCATALKDIFADDR:
+	case SIOCDIFADDR:
+	case SIOCSARP:		/* proxy AARP */
+	case SIOCDARP:		/* proxy AARP */
+		rtnl_lock();
+		rc = atif_ioctl(cmd, argp);
+		rtnl_unlock();
+		break;
 	}
 
 	return rc;
-- 
1.7.12

^ permalink raw reply related

* [PATCH net-next 0/4] appletalk: fix checkpatch errors or warning
From: Wang Weidong @ 2014-02-14  7:43 UTC (permalink / raw)
  To: acme, davem; +Cc: netdev

fix checkpatch errors or warning.

Wang Weidong (4):
  appletalk: fix checkpatch errors with space required or prohibited
  appletalk: fix checkpatch errors with (foo*)|foo * bar
  appletalk: convert printks to netdev_<level>
  appletalk: fix checkpatch error with indent

 net/appletalk/aarp.c |   6 +--
 net/appletalk/ddp.c  | 109 +++++++++++++++++++++++++--------------------------
 2 files changed, 57 insertions(+), 58 deletions(-)

-- 
1.7.12

^ permalink raw reply

* [PATCH net-next 3/4] appletalk: convert printks to pr_<level>
From: Wang Weidong @ 2014-02-14  7:43 UTC (permalink / raw)
  To: acme, davem; +Cc: netdev
In-Reply-To: <1392363826-8256-1-git-send-email-wangweidong1@huawei.com>

Prefer pr_<level> then printk(LEVEL).

Signed-off-by: Wang Weidong <wangweidong1@huawei.com>
---
 net/appletalk/aarp.c |  2 +-
 net/appletalk/ddp.c  | 13 ++++++-------
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/net/appletalk/aarp.c b/net/appletalk/aarp.c
index d1c55d8..9ec36ed 100644
--- a/net/appletalk/aarp.c
+++ b/net/appletalk/aarp.c
@@ -883,7 +883,7 @@ void __init aarp_proto_init(void)
 {
 	aarp_dl = register_snap_client(aarp_snap_id, aarp_rcv);
 	if (!aarp_dl)
-		printk(KERN_CRIT "Unable to register AARP with SNAP.\n");
+		pr_crit("Unable to register AARP with SNAP.\n");
 	setup_timer(&aarp_timer, aarp_expire_timeout, 0);
 	aarp_timer.expires  = jiffies + sysctl_aarp_expiry_time;
 	add_timer(&aarp_timer);
diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c
index 06e0d19..9189d3c 100644
--- a/net/appletalk/ddp.c
+++ b/net/appletalk/ddp.c
@@ -704,9 +704,9 @@ static int atif_ioctl(int cmd, void __user *arg)
 		if ((dev->flags & IFF_POINTOPOINT) &&
 		    atalk_find_interface(sa->sat_addr.s_net,
 					 sa->sat_addr.s_node)) {
-			printk(KERN_DEBUG "AppleTalk: point-to-point "
-			       "interface added with "
-			       "existing address\n");
+			pr_debug("AppleTalk: point-to-point "
+				 "interface added with "
+				 "existing address\n");
 			add_route = 0;
 		}
 
@@ -768,8 +768,7 @@ static int atif_ioctl(int cmd, void __user *arg)
 		} else {
 			limit = ntohs(nr->nr_lastnet);
 			if (limit - ntohs(nr->nr_firstnet) > 4096) {
-				printk(KERN_WARNING "Too many routes/"
-				       "iface.\n");
+				pr_warn("Too many routes/iface.\n");
 				return -EINVAL;
 			}
 			if (add_route)
@@ -1329,8 +1328,8 @@ static int atalk_route_packet(struct sk_buff *skb, struct net_device *dev,
 		 * needs to be broadcast onto the default network?
 		 */
 		if (dev->type == ARPHRD_PPP)
-			printk(KERN_DEBUG "AppleTalk: didn't forward broadcast "
-					  "packet received from PPP iface\n");
+			pr_debug("AppleTalk: didn't forward broadcast "
+				 "packet received from PPP iface\n");
 		goto free_it;
 	}
 
-- 
1.7.12

^ permalink raw reply related

* [PATCH net-next 1/4] appletalk: fix checkpatch errors with space required or prohibited
From: Wang Weidong @ 2014-02-14  7:43 UTC (permalink / raw)
  To: acme, davem; +Cc: netdev
In-Reply-To: <1392363826-8256-1-git-send-email-wangweidong1@huawei.com>

fix checkpatch errors while the space is required or prohibited

Signed-off-by: Wang Weidong <wangweidong1@huawei.com>
---
 net/appletalk/aarp.c | 4 ++--
 net/appletalk/ddp.c  | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/net/appletalk/aarp.c b/net/appletalk/aarp.c
index d27b86d..d1c55d8 100644
--- a/net/appletalk/aarp.c
+++ b/net/appletalk/aarp.c
@@ -926,7 +926,7 @@ static struct aarp_entry *iter_next(struct aarp_iter_state *iter, loff_t *pos)
 	struct aarp_entry *entry;
 
  rescan:
-	while(ct < AARP_HASH_SIZE) {
+	while (ct < AARP_HASH_SIZE) {
 		for (entry = table[ct]; entry; entry = entry->next) {
 			if (!pos || ++off == *pos) {
 				iter->table = table;
@@ -995,7 +995,7 @@ static const char *dt2str(unsigned long ticks)
 {
 	static char buf[32];
 
-	sprintf(buf, "%ld.%02ld", ticks / HZ, ((ticks % HZ) * 100 ) / HZ);
+	sprintf(buf, "%ld.%02ld", ticks / HZ, ((ticks % HZ) * 100) / HZ);
 
 	return buf;
 }
diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c
index 02806c6..a878df9 100644
--- a/net/appletalk/ddp.c
+++ b/net/appletalk/ddp.c
@@ -936,11 +936,11 @@ static unsigned long atalk_sum_skb(const struct sk_buff *skb, int offset,
 	int i, copy;
 
 	/* checksum stuff in header space */
-	if ( (copy = start - offset) > 0) {
+	if ((copy = start - offset) > 0) {
 		if (copy > len)
 			copy = len;
 		sum = atalk_sum_partial(skb->data + offset, copy, sum);
-		if ( (len -= copy) == 0)
+		if ((len -= copy) == 0)
 			return sum;
 
 		offset += copy;
@@ -1151,7 +1151,7 @@ static int atalk_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
 			goto out;
 
 		at->src_net  = addr->sat_addr.s_net = ap->s_net;
-		at->src_node = addr->sat_addr.s_node= ap->s_node;
+		at->src_node = addr->sat_addr.s_node = ap->s_node;
 	} else {
 		err = -EADDRNOTAVAIL;
 		if (!atalk_find_interface(addr->sat_addr.s_net,
-- 
1.7.12

^ permalink raw reply related

* [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


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