* Re[3]: [PATCH V2 09/12] net/eipoib: Add main driver functionality
From: Naoto MATSUMOTO @ 2012-08-15 9:10 UTC (permalink / raw)
To: Eric W. Biederman, Ali Ayoub, David Miller, ogerlitz, roland,
netdev, sean.hefty, erezsh, dledford
Cc: Naoto MATSUMOTO
In-Reply-To: <20120807102129.5C95.C42C3789@sakura.ad.jp>
Hi All.
Our lab's additional infomation(result) for all.
Ethernet over L2TPv3 over IPoIB Pseudo-wire Multiplexing (RFC4719)
using "ip l2tp" command on linux. http://twitpic.com/ajn2nx
On Tue, 07 Aug 2012 10:21:33 +0900
Naoto MATSUMOTO <n-matsumoto@sakura.ad.jp> wrote:
> -----------------------------------------------------------------------
> Ethernet over EoIB using gretap with "Raid STP" performance result.
> http://twitpic.com/agd1pp
>
> How to use EoIB with gretap.
> http://twitpic.com/agd4io
regards,
--
SAKURA Internet Inc. / Senior Researcher
Naoto MATSUMOTO <n-matsumoto@sakura.ad.jp>
SAKURA Research Center <http://research.sakura.ad.jp/>
^ permalink raw reply
* [PATCH] act_mirred: do not drop packets when fails to mirror it
From: Jason Wang @ 2012-08-15 9:37 UTC (permalink / raw)
To: netdev, jhs, linux-kernel, davem
We drop packet unconditionally when we fail to mirror it. This is not intended
in some cases. Consdier for kvm guest, we may mirror the traffic of the bridge
to a tap device used by a VM. When kernel fails to mirror the packet in
conditions such as when qemu crashes or stop polling the tap, it's hard for the
management software to detect such condition and clean the the mirroring
before. This would lead all packets to the bridge to be dropped and break the
netowrk of other virtual machines.
To solve the issue, the patch does not drop packets when kernel fails to mirror
it, and only drop the redirected packets.
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
net/sched/act_mirred.c | 9 +++------
1 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c
index fe81cc1..3682951 100644
--- a/net/sched/act_mirred.c
+++ b/net/sched/act_mirred.c
@@ -198,15 +198,12 @@ static int tcf_mirred(struct sk_buff *skb, const struct tc_action *a,
err = dev_queue_xmit(skb2);
out:
- if (err) {
+ if (err)
m->tcf_qstats.overlimits++;
- /* should we be asking for packet to be dropped?
- * may make sense for redirect case only
- */
+ if (err && m->tcf_action == TC_ACT_STOLEN)
retval = TC_ACT_SHOT;
- } else {
+ else
retval = m->tcf_action;
- }
spin_unlock(&m->tcf_lock);
return retval;
^ permalink raw reply related
* [Patch net-next] sctp: fix a compile error in sctp.h
From: Cong Wang @ 2012-08-15 10:18 UTC (permalink / raw)
To: netdev; +Cc: David S. Miller, Eric W. Biederman, Cong Wang
I got the following compile error:
In file included from include/net/sctp/checksum.h:46:0,
from net/ipv4/netfilter/nf_nat_proto_sctp.c:14:
include/net/sctp/sctp.h: In function ‘sctp_dbg_objcnt_init’:
include/net/sctp/sctp.h:370:88: error: parameter name omitted
include/net/sctp/sctp.h: In function ‘sctp_dbg_objcnt_exit’:
include/net/sctp/sctp.h:371:88: error: parameter name omitted
which is caused by
commit 13d782f6b4fbbaf9d0380a9947deb45a9de46ae7
Author: Eric W. Biederman <ebiederm@xmission.com>
Date: Mon Aug 6 08:45:15 2012 +0000
sctp: Make the proc files per network namespace.
This patch could fix it.
Cc: David S. Miller <davem@davemloft.net>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Cong Wang <amwang@redhat.com>
---
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index aaa8292..9c6414f 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -367,8 +367,8 @@ void sctp_dbg_objcnt_exit(struct net *);
#define SCTP_DBG_OBJCNT_INC(name)
#define SCTP_DBG_OBJCNT_DEC(name)
-static inline void sctp_dbg_objcnt_init(struct net *) { return; }
-static inline void sctp_dbg_objcnt_exit(struct net *) { return; }
+static inline void sctp_dbg_objcnt_init(struct net *net) { return; }
+static inline void sctp_dbg_objcnt_exit(struct net *net) { return; }
#endif /* CONFIG_SCTP_DBG_OBJCOUNT */
^ permalink raw reply related
* Re: [Patch net-next] sctp: fix a compile error in sctp.h
From: David Miller @ 2012-08-15 10:45 UTC (permalink / raw)
To: amwang; +Cc: netdev, ebiederm
In-Reply-To: <1345025891-5021-1-git-send-email-amwang@redhat.com>
From: Cong Wang <amwang@redhat.com>
Date: Wed, 15 Aug 2012 18:18:11 +0800
> I got the following compile error:
>
> In file included from include/net/sctp/checksum.h:46:0,
> from net/ipv4/netfilter/nf_nat_proto_sctp.c:14:
> include/net/sctp/sctp.h: In function ‘sctp_dbg_objcnt_init’:
> include/net/sctp/sctp.h:370:88: error: parameter name omitted
> include/net/sctp/sctp.h: In function ‘sctp_dbg_objcnt_exit’:
> include/net/sctp/sctp.h:371:88: error: parameter name omitted
>
> which is caused by
>
> commit 13d782f6b4fbbaf9d0380a9947deb45a9de46ae7
> Author: Eric W. Biederman <ebiederm@xmission.com>
> Date: Mon Aug 6 08:45:15 2012 +0000
>
> sctp: Make the proc files per network namespace.
>
> This patch could fix it.
>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: "Eric W. Biederman" <ebiederm@xmission.com>
> Signed-off-by: Cong Wang <amwang@redhat.com>
Applied thanks.
I appended the SCTP debug objcnt procfs netns conversions by hand
since Eric didn't handle it in his commit.
Eric, please turn all relevant options both on and off when testing
the build of your patches. Thanks.
^ permalink raw reply
* Re: [net PATCH v3 1/3] net: netprio: fix files lock and remove useless d_path bits
From: Neil Horman @ 2012-08-15 10:52 UTC (permalink / raw)
To: John Fastabend; +Cc: viro, netdev, davem, linux-kernel, joe
In-Reply-To: <20120814223424.3551.21608.stgit@jf-dev1-dcblab>
On Tue, Aug 14, 2012 at 03:34:24PM -0700, John Fastabend wrote:
> Add lock to prevent a race with a file closing and also remove
> useless and ugly sscanf code. The extra code was never needed
> and the case it supposedly protected against is in fact handled
> correctly by sock_from_file as pointed out by Al Viro.
>
> CC: Neil Horman <nhorman@tuxdriver.com>
> Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
> Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
> ---
>
> net/core/netprio_cgroup.c | 22 ++++------------------
> 1 files changed, 4 insertions(+), 18 deletions(-)
>
> diff --git a/net/core/netprio_cgroup.c b/net/core/netprio_cgroup.c
> index ed0c043..f65dba3 100644
> --- a/net/core/netprio_cgroup.c
> +++ b/net/core/netprio_cgroup.c
> @@ -277,12 +277,6 @@ out_free_devname:
> void net_prio_attach(struct cgroup *cgrp, struct cgroup_taskset *tset)
> {
> struct task_struct *p;
> - char *tmp = kzalloc(sizeof(char) * PATH_MAX, GFP_KERNEL);
> -
> - if (!tmp) {
> - pr_warn("Unable to attach cgrp due to alloc failure!\n");
> - return;
> - }
>
> cgroup_taskset_for_each(p, cgrp, tset) {
> unsigned int fd;
> @@ -296,32 +290,24 @@ void net_prio_attach(struct cgroup *cgrp, struct cgroup_taskset *tset)
> continue;
> }
>
> - rcu_read_lock();
> + spin_lock(&files->file_lock);
> fdt = files_fdtable(files);
> for (fd = 0; fd < fdt->max_fds; fd++) {
> - char *path;
> struct file *file;
> struct socket *sock;
> - unsigned long s;
> - int rv, err = 0;
> + int err;
>
> file = fcheck_files(files, fd);
> if (!file)
> continue;
>
> - path = d_path(&file->f_path, tmp, PAGE_SIZE);
> - rv = sscanf(path, "socket:[%lu]", &s);
> - if (rv <= 0)
> - continue;
> -
> sock = sock_from_file(file, &err);
> - if (!err)
> + if (sock)
> sock_update_netprioidx(sock->sk, p);
> }
> - rcu_read_unlock();
> + spin_unlock(&files->file_lock);
> task_unlock(p);
> }
> - kfree(tmp);
> }
>
> static struct cftype ss_files[] = {
>
>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
It looks good to me. Al, could you please lend your review here too?
^ permalink raw reply
* Re: [net PATCH v3 2/3] net: netprio: fd passed in SCM_RIGHTS datagram not set correctly
From: Neil Horman @ 2012-08-15 10:53 UTC (permalink / raw)
To: John Fastabend; +Cc: viro, netdev, davem, linux-kernel, joe
In-Reply-To: <20120814223430.3551.88909.stgit@jf-dev1-dcblab>
On Tue, Aug 14, 2012 at 03:34:30PM -0700, John Fastabend wrote:
> A socket fd passed in a SCM_RIGHTS datagram was not getting
> updated with the new tasks cgrp prioidx. This leaves IO on
> the socket tagged with the old tasks priority.
>
> To fix this add a check in the scm recvmsg path to update the
> sock cgrp prioidx with the new tasks value.
>
> Thanks to Al Viro for catching this.
>
> CC: Neil Horman <nhorman@tuxdriver.com>
> Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
> Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
> ---
>
> net/core/scm.c | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/net/core/scm.c b/net/core/scm.c
> index 8f6ccfd..040cebe 100644
> --- a/net/core/scm.c
> +++ b/net/core/scm.c
> @@ -265,6 +265,7 @@ void scm_detach_fds(struct msghdr *msg, struct scm_cookie *scm)
> for (i=0, cmfptr=(__force int __user *)CMSG_DATA(cm); i<fdmax;
> i++, cmfptr++)
> {
> + struct socket *sock;
> int new_fd;
> err = security_file_receive(fp[i]);
> if (err)
> @@ -281,6 +282,9 @@ void scm_detach_fds(struct msghdr *msg, struct scm_cookie *scm)
> }
> /* Bump the usage count and install the file. */
> get_file(fp[i]);
> + sock = sock_from_file(fp[i], &err);
> + if (sock)
> + sock_update_netprioidx(sock->sk, current);
> fd_install(new_fd, fp[i]);
> }
>
>
>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
^ permalink raw reply
* Re: [net PATCH v3 3/3] net: netprio: fix cgrp create and write priomap race
From: Neil Horman @ 2012-08-15 10:56 UTC (permalink / raw)
To: John Fastabend; +Cc: viro, netdev, davem, linux-kernel, joe
In-Reply-To: <20120814223435.3551.62387.stgit@jf-dev1-dcblab>
On Tue, Aug 14, 2012 at 03:34:35PM -0700, John Fastabend wrote:
> A race exists where creating cgroups and also updating the priomap
> may result in losing a priomap update. This is because priomap
> writers are not protected by rtnl_lock.
>
> Move priority writer into rtnl_lock()/rtnl_unlock().
>
> CC: Neil Horman <nhorman@tuxdriver.com>
> Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
> Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
> ---
>
> net/core/netprio_cgroup.c | 8 +++-----
> 1 files changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/net/core/netprio_cgroup.c b/net/core/netprio_cgroup.c
> index f65dba3..c75e3f9 100644
> --- a/net/core/netprio_cgroup.c
> +++ b/net/core/netprio_cgroup.c
> @@ -101,12 +101,10 @@ static int write_update_netdev_table(struct net_device *dev)
> u32 max_len;
> struct netprio_map *map;
>
> - rtnl_lock();
> max_len = atomic_read(&max_prioidx) + 1;
> map = rtnl_dereference(dev->priomap);
> if (!map || map->priomap_len < max_len)
> ret = extend_netdev_table(dev, max_len);
> - rtnl_unlock();
>
> return ret;
> }
> @@ -256,17 +254,17 @@ static int write_priomap(struct cgroup *cgrp, struct cftype *cft,
> if (!dev)
> goto out_free_devname;
>
> + rtnl_lock();
> ret = write_update_netdev_table(dev);
> if (ret < 0)
> goto out_put_dev;
>
> - rcu_read_lock();
> - map = rcu_dereference(dev->priomap);
> + map = rtnl_dereference(dev->priomap);
> if (map)
> map->priomap[prioidx] = priority;
> - rcu_read_unlock();
>
> out_put_dev:
> + rtnl_unlock();
> dev_put(dev);
>
> out_free_devname:
>
>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
^ permalink raw reply
* [patch net-next] sctp: add function parameter names to fix compile error
From: Jiri Pirko @ 2012-08-15 11:00 UTC (permalink / raw)
To: netdev; +Cc: davem, Eric W. Biederman
Commit 13d782f6 introduced this problem.
Cc: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
---
include/net/sctp/sctp.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index aaa8292..9c6414f 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -367,8 +367,8 @@ void sctp_dbg_objcnt_exit(struct net *);
#define SCTP_DBG_OBJCNT_INC(name)
#define SCTP_DBG_OBJCNT_DEC(name)
-static inline void sctp_dbg_objcnt_init(struct net *) { return; }
-static inline void sctp_dbg_objcnt_exit(struct net *) { return; }
+static inline void sctp_dbg_objcnt_init(struct net *net) { return; }
+static inline void sctp_dbg_objcnt_exit(struct net *net) { return; }
#endif /* CONFIG_SCTP_DBG_OBJCOUNT */
--
1.7.10.4
^ permalink raw reply related
* Re: [PATCH 0/5] Call netif_carrier_off() after register_netdev()
From: Bjørn Mork @ 2012-08-15 11:40 UTC (permalink / raw)
To: Ben Hutchings
Cc: David Miller, shchepetkov, netdev, linux-kernel, ldv-project
In-Reply-To: <1344984477.2690.85.camel@bwh-desktop.uk.solarflarecom.com>
Ben Hutchings <bhutchings@solarflare.com> writes:
> But if you do it beforehand then it doesn't have the intended effect.
> (Supposed to be fixed by 22604c866889c4b2e12b73cbf1683bda1b72a313, which
> had to be reverted: c276e098d3ee33059b4a1c747354226cec58487c.)
>
> So you have to do it after, but without dropping the RTNL lock in
> between.
So you may want to add something like
int register_netdev_carrier_off(struct net_device *dev)
{
int err;
rtnl_lock();
err = register_netdevice(dev);
if (!err)
set_bit(__LINK_STATE_NOCARRIER, &dev->state)
rtnl_unlock();
return err;
}
for these drivers?
Bjørn
^ permalink raw reply
* Re: [PATCH] act_mirred: do not drop packets when fails to mirror it
From: Jamal Hadi Salim @ 2012-08-15 12:35 UTC (permalink / raw)
To: Jason Wang; +Cc: netdev, linux-kernel, davem
In-Reply-To: <20120815093756.22238.80872.stgit@amd-6168-8-1.englab.nay.redhat.com>
On Wed, 2012-08-15 at 17:37 +0800, Jason Wang wrote:
> We drop packet unconditionally when we fail to mirror it. This is not intended
> in some cases.
Hi Jason,
Did you actually notice the behavior you described or were you going by
the XXX comment I had in the code?
cheers,
jamal
^ permalink raw reply
* Re: [PATCH 02/16] user_ns: use new hashtable implementation
From: Sasha Levin @ 2012-08-15 13:40 UTC (permalink / raw)
To: Mathieu Desnoyers
Cc: snitzer-H+wXaHxf7aLQT0dZR+AlfA, neilb-l3A5Bk7waGM,
fweisbec-Re5JQEeQqe8AvxtiuMwx3w,
Trond.Myklebust-HgOvQuBEEgTQT0dZR+AlfA,
bfields-uC3wQj2KruNg9hUCZPvPmw,
paul.gortmaker-CWA4WttNNZF54TAoqtyWWQ,
dm-devel-H+wXaHxf7aLQT0dZR+AlfA, agk-H+wXaHxf7aLQT0dZR+AlfA,
aarcange-H+wXaHxf7aLQT0dZR+AlfA, rds-devel-N0ozoZBvEnrZJqsBc5GL+g,
eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w,
venkat.x.venkatsubra-QHcLZuEGTsvQT0dZR+AlfA,
ccaulfie-H+wXaHxf7aLQT0dZR+AlfA, mingo-X9Un+BFzKDI,
dev-yBygre7rU0TnMu66kgdUjQ, ericvh-Re5JQEeQqe8AvxtiuMwx3w,
josh-iaAMLnmF4UmaiuxdJuQwMA, rostedt-nx8X9YLhiw1AfugRpC6u6w,
lw-BthXqXjhjHXQFUHtdCDX3A, teigland-H+wXaHxf7aLQT0dZR+AlfA,
axboe-tSWWG44O7X1aa/9Udqfwiw, linux-nfs-u79uwXL29TY76Z2rM5mHXA,
edumazet-hpIqsD4AKlfQT0dZR+AlfA, linux-mm-Bw31MaZKKs3YtjvyW6yDsg,
netdev-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, ejt-H+wXaHxf7aLQT0dZR+AlfA,
Eric W. Biederman, tj-DgEjT+Ai2ygdnm+yROfE0A,
akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b,
torvalds-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b,
davem-fT/PcQaiUtIeIZ0/mPfg9Q
In-Reply-To: <20120815033155.GA32653@Krystal>
On 08/15/2012 05:31 AM, Mathieu Desnoyers wrote:
> * Eric W. Biederman (ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org) wrote:
>> Sasha Levin <levinsasha928-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>>
>>> On 08/15/2012 03:08 AM, Eric W. Biederman wrote:
>>>>> I can offer the following: I'll write a small module that will hash 1...10000
>>>>>> into a hashtable which uses 7 bits (just like user_ns) and post the distribution
>>>>>> we'll get.
>>>> That won't hurt. I think 1-100 then 1000-1100 may actually be more
>>>> representative. Not that I would mind seeing the larger range.
>>>> Especially since I am in the process of encouraging the use of more
>>>> uids.
>>>>
>>>
>>> Alrighty, the results are in (numbers are objects in bucket):
>>>
>>> For the 0...10000 range:
>>>
>>> Average: 78.125
>>> Std dev: 1.4197704151
>>> Min: 75
>>> Max: 80
>>>
>>>
>>> For the 1...100 range:
>>>
>>> Average: 0.78125
>>> Std dev: 0.5164613088
>>> Min: 0
>>> Max: 2
>>>
>>>
>>> For the 1000...1100 range:
>>>
>>> Average: 0.7890625
>>> Std dev: 0.4964812206
>>> Min: 0
>>> Max: 2
>>>
>>>
>>> Looks like hash_32 is pretty good with small numbers.
>>
>> Yes hash_32 seems reasonable for the uid hash. With those long hash
>> chains I wouldn't like to be on a machine with 10,000 processes with
>> each with a different uid, and a processes calling setuid in the fast
>> path.
>>
>> The uid hash that we are playing with is one that I sort of wish that
>> the hash table could grow in size, so that we could scale up better.
>
> Hi Eric,
>
> If you want to try out something that has more features than a basic
> hash table, already exists and is available for you to play with, you
> might want to have a look at the RCU lock-free resizable hash table.
> It's initially done in userspace, but shares the same RCU semantic as
> the kernel, and has chunk-based kernel-friendly index backends (thanks
> to Lai Jiangshan), very useful to integrate with the kernel page
> allocator.
I'm guessing that once this static hashtable is stable, a
DEFINE_DYNAMIC_HASHTABLE() will get introduced which will evolve into something
similar to what Mathieu has pointed out in the urcu.
^ permalink raw reply
* Re: [PATCH] act_mirred: do not drop packets when fails to mirror it
From: Jason Wang @ 2012-08-15 13:42 UTC (permalink / raw)
To: jhs; +Cc: netdev, linux-kernel, davem
In-Reply-To: <1345034141.20443.12.camel@mojatatu>
On 08/15/2012 08:35 PM, Jamal Hadi Salim wrote:
> On Wed, 2012-08-15 at 17:37 +0800, Jason Wang wrote:
>> We drop packet unconditionally when we fail to mirror it. This is not intended
>> in some cases.
> Hi Jason,
> Did you actually notice the behavior you described or were you going by
> the XXX comment I had in the code?
>
> cheers,
> jamal
Hi Jamal:
I met it actually through the following steps:
- start a kvm guest with tap and make it to be an interface of the bridge
- mirror the ingress traffic of the bridge to the tap
- terminate the qemu process, the tap device is then removed
- all packet goes to bridge would be dropped, so the network of guests
in the same bridge would be broken
It's hard for the management to forcast the termination of the porcess
and clean the mirroring before. The realistic way is to remove the
mirroring after the termination of the process. So, if we drop the
packets when the mirred device (tap) is removed, in the gap between the
qemu termitnaion and disabling mirroring, the bridge ( and other VMs
using the it) would not recevie any packet.
>
> --
> 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
^ permalink raw reply
* [PATCH net] net: qmi_wwan: new devices: UML290 and K5006-Z
From: Bjørn Mork @ 2012-08-15 13:42 UTC (permalink / raw)
To: netdev-u79uwXL29TY76Z2rM5mHXA
Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA, Bjørn Mork, Dan Williams,
Thomas Schäfer
Newer firmware versions for the Pantech UML290 use a different
subclass ID. The Windows driver match on both IDs, so we do
that as well.
The ZTE (Vodafone) K5006-Z is a new device.
Cc: Dan Williams <dcbw-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: Thomas Schäfer <tschaefer-zqRNUXuvxA0b1SvskN2V4Q@public.gmane.org>
Signed-off-by: Bjørn Mork <bjorn-yOkvZcmFvRU@public.gmane.org>
---
I'll prepare a backport for stable-3.4 and -3.5 once this
is in mainline, unless someone beats me to it. Feel free
to do so :-)
drivers/net/usb/qmi_wwan.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
index aaa061b..328397c 100644
--- a/drivers/net/usb/qmi_wwan.c
+++ b/drivers/net/usb/qmi_wwan.c
@@ -373,6 +373,10 @@ static const struct usb_device_id products[] = {
USB_DEVICE_AND_INTERFACE_INFO(0x106c, 0x3718, USB_CLASS_VENDOR_SPEC, 0xf0, 0xff),
.driver_info = (unsigned long)&qmi_wwan_shared,
},
+ { /* Pantech UML290 - newer firmware */
+ USB_DEVICE_AND_INTERFACE_INFO(0x106c, 0x3718, USB_CLASS_VENDOR_SPEC, 0xf1, 0xff),
+ .driver_info = (unsigned long)&qmi_wwan_shared,
+ },
/* 3. Combined interface devices matching on interface number */
{QMI_FIXED_INTF(0x19d2, 0x0055, 1)}, /* ZTE (Vodafone) K3520-Z */
@@ -382,6 +386,7 @@ static const struct usb_device_id products[] = {
{QMI_FIXED_INTF(0x19d2, 0x0326, 4)}, /* ZTE MF821D */
{QMI_FIXED_INTF(0x19d2, 0x1008, 4)}, /* ZTE (Vodafone) K3570-Z */
{QMI_FIXED_INTF(0x19d2, 0x1010, 4)}, /* ZTE (Vodafone) K3571-Z */
+ {QMI_FIXED_INTF(0x19d2, 0x1018, 3)}, /* ZTE (Vodafone) K5006-Z */
{QMI_FIXED_INTF(0x19d2, 0x1402, 2)}, /* ZTE MF60 */
{QMI_FIXED_INTF(0x19d2, 0x2002, 4)}, /* ZTE (Vodafone) K3765-Z */
{QMI_FIXED_INTF(0x0f3d, 0x68a2, 8)}, /* Sierra Wireless MC7700 */
--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" 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 related
* Re: [PATCH] net: add new QCA alx ethernet driver
From: Stephen Hemminger @ 2012-08-15 15:02 UTC (permalink / raw)
To: Ren, Cloud
Cc: David Miller, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, qca-linux-team, nic-devel,
Huang, Xiong, hao-ran.liu@canonical.com, joe@perches.com,
Rodriguez, Luis
In-Reply-To: <6349D7A510622448B1BA0967850A84380136A218@NASANEXD02D.na.qualcomm.com>
On Wed, 15 Aug 2012 05:39:11 +0000
"Ren, Cloud" <cjren@qca.qualcomm.com> wrote:
> From: David Miller [mailto:davem@davemloft.net]
> Sent: Wednesday, August 15, 2012 1:33 PM
>
> >From: "Ren, Cloud" <cjren@qca.qualcomm.com>
> >Date: Wed, 15 Aug 2012 03:29:26 +0000
> >
> >>>> + strncpy(netdev->name, pci_name(pdev), sizeof(netdev->name) - 1);
> >>>> ...
> >>>> + strcpy(netdev->name, "eth%d");
> >>>> + retval = register_netdev(netdev);
> >>>
> >>>The strcpy is unnecessary, alloc_etherdev already sets that.
> >>
> >> The strcpy is useful. netdev->name is set as pci_name in front. So the strcpy
> >restores it.
> >
> >Are you doing this just to influence the initial driver log messages?
>
> Yes.
>
> >
> >Don't do that, it's gross.
>
> Ok, I will remove it.
Before the driver is registered, use dev_info() type of logging.
^ permalink raw reply
* Re: [PATCH] act_mirred: do not drop packets when fails to mirror it
From: Jamal Hadi Salim @ 2012-08-15 15:10 UTC (permalink / raw)
To: Jason Wang; +Cc: netdev, linux-kernel, davem
In-Reply-To: <502BA72B.6070205@redhat.com>
On Wed, 2012-08-15 at 21:42 +0800, Jason Wang wrote:
>
> I met it actually through the following steps:
>
> - start a kvm guest with tap and make it to be an interface of the bridge
> - mirror the ingress traffic of the bridge to the tap
> - terminate the qemu process, the tap device is then removed
> - all packet goes to bridge would be dropped, so the network of guests
> in the same bridge would be broken
>
Makes sense.
Can you please leave the err check braces i.e
if (err) {
m->tcf_qstats.overlimits++;
if (m->tcfm_eaction != TCA_EGRESS_MIRROR)
retval = TC_ACT_SHOT;
else
retval = m->tcf_action;
} else {
retval = m->tcf_action;
}
Or at least dont use TC_ACT_STOLEN.
cheers,
jamal
^ permalink raw reply
* Re: blog post, other stuff
From: Ann Davis @ 2012-08-15 15:33 UTC (permalink / raw)
To: Luis R. Rodriguez, netdev
In-Reply-To: <CAB=NE6VXfs-=B+j_pFXPo+Ux99hHSFuYJB+_JKphtEYMyhAb7A@mail.gmail.com>
Luis,
>>> On 8/14/2012 at 04:44 PM, in message
<CAB=NE6VXfs-=B+j_pFXPo+Ux99hHSFuYJB+_JKphtEYMyhAb7A@mail.gmail.com>, "Luis R.
Rodriguez" <mcgrof@frijolero.org> wrote:
> On Tue, Aug 14, 2012 at 10:16 AM, Ann Davis <andavis@suse.com> wrote:
>> Luis,
>>
>>>>> On 8/13/2012 at 10:45 PM, in message
>> <CAB=NE6VFsJrXznJDU4w2Oq1gQkMjLTtJPtTk2hhL0V1FPLpaYQ@mail.gmail.com>, "Luis R.
>> Rodriguez" <mcgrof@frijolero.org> wrote:
>>> Here is:
>>>
>>> http://www.do-not-panic.com/2012/08/automatically-backporting-linux-kernel.h
>>> tml
>>>
>>> Does this work?
>>
>> Yes, I think this is great. Are you ok with me sending it on to Amanda and
> Jennifer along with a short "Here's some new stuff happening in the Driver
> Backport Workgroup" intro? I don't know if they will want to just pull in
> the text or have a link to your mcgrof site; do you have a preference? I
> think they should just pull in the text and reference your site if needed
> (less clicks means more likelihood of people reading).
>
> Whatever works, so I just updated the blog to reflect all the
> documentation updates I've made. The backports.wiki.kernel.org page
> now has all the documentation necessary and is very agnostic to any
> subsystem. I've also renamed compat-wireless.git tree to
> compat-drivers.git and also set information on the wiki about the
> first G+ hangout scheduled for Sept 4th.
Sounds great, I'll take care of getting the blog info to Amanda and Jennifer.
Yep, when I did a checkout yesterday I noticed that it's now compat-drivers. Builds fine on my SLE 11 SP2 box (3.0.26 kernel). :) On this topic, I've thought some more about what would be the best way to make sure the project continually builds for our openSUSE and SLE kernels. My latest idea is to pull the code into a compat-drivers project on our Open Build Service (OBS: http://build.opensuse.org ) . Have you heard of OBS? If I put the code in there then I could do continual git pulls and builds for all our openSUSE and SLE versions. (It can also build for other distros like RHEL, Ubuntu, etc. but my focus would be on our distros). Thoughts? I guess the basic question is whether it makes more sense to add lots of distro kernels into your builds or whether your builds should focu
s on kernel.org kernels and then different distro vendors take care of ensuring that the project builds for their own kernels. Maybe this discussion belongs on the list but I'm trying to get an initial feel for the overall design...
On another note, have you heard anything more from Konstantin re. whether kernel.org would accept hardware w/o a support contract? My HP contact here asked about the status.
Thanks much,
Ann
>
> Luis
^ permalink raw reply
* RFC - document network device carrier management
From: Stephen Hemminger @ 2012-08-15 15:58 UTC (permalink / raw)
To: David Miller; +Cc: netdev
Since carrier handling is often done incorrectly by new device drivers
be explicit about carrier handling API.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
---
This is a meant as starting point for discussion, it's probably wrong as is.
Since this isn't code, it could be applied for 3.6 and doesn't need for net-next.
--- a/Documentation/networking/netdevices.txt 2012-06-22 08:27:46.729168196 -0700
+++ b/Documentation/networking/netdevices.txt 2012-08-15 08:56:31.120429994 -0700
@@ -45,6 +45,36 @@ drop, truncate, or pass up oversize pack
packets is preferred.
+CARRIER
+=======
+Most network devices have an operational state that the device
+monitors. The Linux kernel uses the name "carrier" for this flag which
+is a historical reference to old modems. Carrier is reported to
+userspace via the IFF_RUNNING flag from SIOCGIFFLAGS ioctl.
+Carrier is controlled in the device driver
+by the functions netif_carrier_on and netif_carrier_off. These
+functions trigger the necessary netlink and userspace API changes;
+device drivers must not change netdevice->flags directly.
+
+The carrier defaults to ON when the device is created and registered.
+Simple devices (such as dummy) do not need to do anything.
+Ethernet style devices should:
+ * alloc_etherdev in probe routine
+ * call netif_carrier_off
+ * register network device
+ * start auto negotiation with phy in open routine
+ * call netif_carrier_on when link is up
+
+More complex RFC2863 style operational state is also possible
+but not required (see operstates.txt).
+
+The monitoring of link state is the responsibility of the network
+device driver. It can be done by polling, interrupt, or any other
+mechanism. netif_carrier_on/netif_carrier_off are atomic and can
+safely be called by an interrupt routine. Carrier events are
+managed by the linkwatch work queue and limited to one per second
+to avoid overwhelming management applications.
+
struct net_device synchronization rules
=======================================
ndo_open:
^ permalink raw reply
* Re: [PATCH net-next] igb: Change how we check for pre-existing and assigned VFs
From: Greg Rose @ 2012-08-15 16:03 UTC (permalink / raw)
To: Stefan Assmann; +Cc: netdev, e1000-devel, carolyn.wyborny
In-Reply-To: <1345009886-29153-1-git-send-email-sassmann@kpanic.de>
On Wed, 15 Aug 2012 07:51:26 +0200
Stefan Assmann <sassmann@kpanic.de> wrote:
> Adapt the pre-existing and assigned VFs code to the ixgbe way
> introduced in commit 9297127b9cdd8d30c829ef5fd28b7cc0323a7bcd.
>
> Instead of searching the enabled VFs we use pci_num_vf to determine
> enabled VFs. By comparing to which PF an assigned VF is owned it's
> possible to decide whether to leave it enabled or not.
>
> Signed-off-by: Stefan Assmann <sassmann@kpanic.de>
Acked-by: Greg Rose <gregory.v.rose@intel.com>
> ---
> drivers/net/ethernet/intel/igb/igb.h | 1 -
> drivers/net/ethernet/intel/igb/igb_main.c | 104
> ++++++----------------------- 2 files changed, 22 insertions(+), 83
> deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/igb/igb.h
> b/drivers/net/ethernet/intel/igb/igb.h index 9e572dd..d15576a 100644
> --- a/drivers/net/ethernet/intel/igb/igb.h
> +++ b/drivers/net/ethernet/intel/igb/igb.h
> @@ -99,7 +99,6 @@ struct vf_data_storage {
> u16 pf_vlan; /* When set, guest VLAN config not allowed. */
> u16 pf_qos;
> u16 tx_rate;
> - struct pci_dev *vfdev;
> };
>
> #define IGB_VF_FLAG_CTS 0x00000001 /* VF is clear to send
> data */ diff --git a/drivers/net/ethernet/intel/igb/igb_main.c
> b/drivers/net/ethernet/intel/igb/igb_main.c index b7c2d50..9e312da
> 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c
> +++ b/drivers/net/ethernet/intel/igb/igb_main.c
> @@ -172,8 +172,7 @@ static void igb_check_vf_rate_limit(struct
> igb_adapter *);
> #ifdef CONFIG_PCI_IOV
> static int igb_vf_configure(struct igb_adapter *adapter, int vf);
> -static int igb_find_enabled_vfs(struct igb_adapter *adapter);
> -static int igb_check_vf_assignment(struct igb_adapter *adapter);
> +static bool igb_vfs_are_assigned(struct igb_adapter *adapter);
> #endif
>
> #ifdef CONFIG_PM
> @@ -2295,11 +2294,11 @@ static void __devexit igb_remove(struct
> pci_dev *pdev) /* reclaim resources allocated to VFs */
> if (adapter->vf_data) {
> /* disable iov and allow time for transactions to
> clear */
> - if (!igb_check_vf_assignment(adapter)) {
> + if (igb_vfs_are_assigned(adapter)) {
> + dev_info(&pdev->dev, "Unloading driver while
> VFs are assigned - VFs will not be deallocated\n");
> + } else {
> pci_disable_sriov(pdev);
> msleep(500);
> - } else {
> - dev_info(&pdev->dev, "VF(s) assigned to
> guests!\n"); }
>
> kfree(adapter->vf_data);
> @@ -2339,7 +2338,7 @@ static void __devinit igb_probe_vfs(struct
> igb_adapter * adapter) #ifdef CONFIG_PCI_IOV
> struct pci_dev *pdev = adapter->pdev;
> struct e1000_hw *hw = &adapter->hw;
> - int old_vfs = igb_find_enabled_vfs(adapter);
> + int old_vfs = pci_num_vf(adapter->pdev);
> int i;
>
> /* Virtualization features not supported on i210 family. */
> @@ -5003,102 +5002,43 @@ static int igb_notify_dca(struct
> notifier_block *nb, unsigned long event, static int
> igb_vf_configure(struct igb_adapter *adapter, int vf) {
> unsigned char mac_addr[ETH_ALEN];
> - struct pci_dev *pdev = adapter->pdev;
> - struct e1000_hw *hw = &adapter->hw;
> - struct pci_dev *pvfdev;
> - unsigned int device_id;
> - u16 thisvf_devfn;
>
> eth_random_addr(mac_addr);
> igb_set_vf_mac(adapter, vf, mac_addr);
>
> - switch (adapter->hw.mac.type) {
> - case e1000_82576:
> - device_id = IGB_82576_VF_DEV_ID;
> - /* VF Stride for 82576 is 2 */
> - thisvf_devfn = (pdev->devfn + 0x80 + (vf << 1)) |
> - (pdev->devfn & 1);
> - break;
> - case e1000_i350:
> - device_id = IGB_I350_VF_DEV_ID;
> - /* VF Stride for I350 is 4 */
> - thisvf_devfn = (pdev->devfn + 0x80 + (vf << 2)) |
> - (pdev->devfn & 3);
> - break;
> - default:
> - device_id = 0;
> - thisvf_devfn = 0;
> - break;
> - }
> -
> - pvfdev = pci_get_device(hw->vendor_id, device_id, NULL);
> - while (pvfdev) {
> - if (pvfdev->devfn == thisvf_devfn)
> - break;
> - pvfdev = pci_get_device(hw->vendor_id,
> - device_id, pvfdev);
> - }
> -
> - if (pvfdev)
> - adapter->vf_data[vf].vfdev = pvfdev;
> - else
> - dev_err(&pdev->dev,
> - "Couldn't find pci dev ptr for VF %4.4x\n",
> - thisvf_devfn);
> - return pvfdev != NULL;
> + return 0;
> }
>
> -static int igb_find_enabled_vfs(struct igb_adapter *adapter)
> +static bool igb_vfs_are_assigned(struct igb_adapter *adapter)
> {
> - struct e1000_hw *hw = &adapter->hw;
> struct pci_dev *pdev = adapter->pdev;
> - struct pci_dev *pvfdev;
> - u16 vf_devfn = 0;
> - u16 vf_stride;
> - unsigned int device_id;
> - int vfs_found = 0;
> + struct pci_dev *vfdev;
> + int dev_id;
>
> switch (adapter->hw.mac.type) {
> case e1000_82576:
> - device_id = IGB_82576_VF_DEV_ID;
> - /* VF Stride for 82576 is 2 */
> - vf_stride = 2;
> + dev_id = IGB_82576_VF_DEV_ID;
> break;
> case e1000_i350:
> - device_id = IGB_I350_VF_DEV_ID;
> - /* VF Stride for I350 is 4 */
> - vf_stride = 4;
> + dev_id = IGB_I350_VF_DEV_ID;
> break;
> default:
> - device_id = 0;
> - vf_stride = 0;
> - break;
> - }
> -
> - vf_devfn = pdev->devfn + 0x80;
> - pvfdev = pci_get_device(hw->vendor_id, device_id, NULL);
> - while (pvfdev) {
> - if (pvfdev->devfn == vf_devfn &&
> - (pvfdev->bus->number >= pdev->bus->number))
> - vfs_found++;
> - vf_devfn += vf_stride;
> - pvfdev = pci_get_device(hw->vendor_id,
> - device_id, pvfdev);
> + return false;
> }
>
> - return vfs_found;
> -}
> -
> -static int igb_check_vf_assignment(struct igb_adapter *adapter)
> -{
> - int i;
> - for (i = 0; i < adapter->vfs_allocated_count; i++) {
> - if (adapter->vf_data[i].vfdev) {
> - if (adapter->vf_data[i].vfdev->dev_flags &
> - PCI_DEV_FLAGS_ASSIGNED)
> + /* loop through all the VFs to see if we own any that are
> assigned */
> + vfdev = pci_get_device(PCI_VENDOR_ID_INTEL, dev_id, NULL);
> + while (vfdev) {
> + /* if we don't own it we don't care */
> + if (vfdev->is_virtfn && vfdev->physfn == pdev) {
> + /* if it is assigned we cannot release it */
> + if (vfdev->dev_flags &
> PCI_DEV_FLAGS_ASSIGNED) return true;
> }
> +
> + vfdev = pci_get_device(PCI_VENDOR_ID_INTEL, dev_id,
> vfdev); }
> +
> return false;
> }
>
^ permalink raw reply
* Re: [PATCH net-next] igb: Change how we check for pre-existing and assigned VFs
From: Alexander Duyck @ 2012-08-15 16:12 UTC (permalink / raw)
To: Stefan Assmann; +Cc: e1000-devel, netdev
In-Reply-To: <1345009886-29153-1-git-send-email-sassmann@kpanic.de>
On 08/14/2012 10:51 PM, Stefan Assmann wrote:
> Adapt the pre-existing and assigned VFs code to the ixgbe way introduced
> in commit 9297127b9cdd8d30c829ef5fd28b7cc0323a7bcd.
>
> Instead of searching the enabled VFs we use pci_num_vf to determine enabled VFs.
> By comparing to which PF an assigned VF is owned it's possible to decide
> whether to leave it enabled or not.
>
> Signed-off-by: Stefan Assmann <sassmann@kpanic.de>
> ---
> drivers/net/ethernet/intel/igb/igb.h | 1 -
> drivers/net/ethernet/intel/igb/igb_main.c | 104 ++++++-----------------------
> 2 files changed, 22 insertions(+), 83 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/igb/igb.h b/drivers/net/ethernet/intel/igb/igb.h
> index 9e572dd..d15576a 100644
> --- a/drivers/net/ethernet/intel/igb/igb.h
> +++ b/drivers/net/ethernet/intel/igb/igb.h
> @@ -99,7 +99,6 @@ struct vf_data_storage {
> u16 pf_vlan; /* When set, guest VLAN config not allowed. */
> u16 pf_qos;
> u16 tx_rate;
> - struct pci_dev *vfdev;
> };
>
> #define IGB_VF_FLAG_CTS 0x00000001 /* VF is clear to send data */
> diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
> index b7c2d50..9e312da 100644
> --- a/drivers/net/ethernet/intel/igb/igb_main.c
> +++ b/drivers/net/ethernet/intel/igb/igb_main.c
> @@ -172,8 +172,7 @@ static void igb_check_vf_rate_limit(struct igb_adapter *);
>
> #ifdef CONFIG_PCI_IOV
> static int igb_vf_configure(struct igb_adapter *adapter, int vf);
> -static int igb_find_enabled_vfs(struct igb_adapter *adapter);
> -static int igb_check_vf_assignment(struct igb_adapter *adapter);
> +static bool igb_vfs_are_assigned(struct igb_adapter *adapter);
> #endif
>
> #ifdef CONFIG_PM
> @@ -2295,11 +2294,11 @@ static void __devexit igb_remove(struct pci_dev *pdev)
> /* reclaim resources allocated to VFs */
> if (adapter->vf_data) {
> /* disable iov and allow time for transactions to clear */
> - if (!igb_check_vf_assignment(adapter)) {
> + if (igb_vfs_are_assigned(adapter)) {
> + dev_info(&pdev->dev, "Unloading driver while VFs are assigned - VFs will not be deallocated\n");
> + } else {
> pci_disable_sriov(pdev);
> msleep(500);
> - } else {
> - dev_info(&pdev->dev, "VF(s) assigned to guests!\n");
> }
>
> kfree(adapter->vf_data);
> @@ -2339,7 +2338,7 @@ static void __devinit igb_probe_vfs(struct igb_adapter * adapter)
> #ifdef CONFIG_PCI_IOV
> struct pci_dev *pdev = adapter->pdev;
> struct e1000_hw *hw = &adapter->hw;
> - int old_vfs = igb_find_enabled_vfs(adapter);
> + int old_vfs = pci_num_vf(adapter->pdev);
> int i;
>
> /* Virtualization features not supported on i210 family. */
> @@ -5003,102 +5002,43 @@ static int igb_notify_dca(struct notifier_block *nb, unsigned long event,
> static int igb_vf_configure(struct igb_adapter *adapter, int vf)
> {
> unsigned char mac_addr[ETH_ALEN];
> - struct pci_dev *pdev = adapter->pdev;
> - struct e1000_hw *hw = &adapter->hw;
> - struct pci_dev *pvfdev;
> - unsigned int device_id;
> - u16 thisvf_devfn;
>
> eth_random_addr(mac_addr);
> igb_set_vf_mac(adapter, vf, mac_addr);
>
> - switch (adapter->hw.mac.type) {
> - case e1000_82576:
> - device_id = IGB_82576_VF_DEV_ID;
> - /* VF Stride for 82576 is 2 */
> - thisvf_devfn = (pdev->devfn + 0x80 + (vf << 1)) |
> - (pdev->devfn & 1);
> - break;
> - case e1000_i350:
> - device_id = IGB_I350_VF_DEV_ID;
> - /* VF Stride for I350 is 4 */
> - thisvf_devfn = (pdev->devfn + 0x80 + (vf << 2)) |
> - (pdev->devfn & 3);
> - break;
> - default:
> - device_id = 0;
> - thisvf_devfn = 0;
> - break;
> - }
> -
> - pvfdev = pci_get_device(hw->vendor_id, device_id, NULL);
> - while (pvfdev) {
> - if (pvfdev->devfn == thisvf_devfn)
> - break;
> - pvfdev = pci_get_device(hw->vendor_id,
> - device_id, pvfdev);
> - }
> -
> - if (pvfdev)
> - adapter->vf_data[vf].vfdev = pvfdev;
> - else
> - dev_err(&pdev->dev,
> - "Couldn't find pci dev ptr for VF %4.4x\n",
> - thisvf_devfn);
> - return pvfdev != NULL;
> + return 0;
> }
>
> -static int igb_find_enabled_vfs(struct igb_adapter *adapter)
> +static bool igb_vfs_are_assigned(struct igb_adapter *adapter)
> {
> - struct e1000_hw *hw = &adapter->hw;
> struct pci_dev *pdev = adapter->pdev;
> - struct pci_dev *pvfdev;
> - u16 vf_devfn = 0;
> - u16 vf_stride;
> - unsigned int device_id;
> - int vfs_found = 0;
> + struct pci_dev *vfdev;
> + int dev_id;
>
> switch (adapter->hw.mac.type) {
> case e1000_82576:
> - device_id = IGB_82576_VF_DEV_ID;
> - /* VF Stride for 82576 is 2 */
> - vf_stride = 2;
> + dev_id = IGB_82576_VF_DEV_ID;
> break;
> case e1000_i350:
> - device_id = IGB_I350_VF_DEV_ID;
> - /* VF Stride for I350 is 4 */
> - vf_stride = 4;
> + dev_id = IGB_I350_VF_DEV_ID;
> break;
> default:
> - device_id = 0;
> - vf_stride = 0;
> - break;
> - }
> -
> - vf_devfn = pdev->devfn + 0x80;
> - pvfdev = pci_get_device(hw->vendor_id, device_id, NULL);
> - while (pvfdev) {
> - if (pvfdev->devfn == vf_devfn &&
> - (pvfdev->bus->number >= pdev->bus->number))
> - vfs_found++;
> - vf_devfn += vf_stride;
> - pvfdev = pci_get_device(hw->vendor_id,
> - device_id, pvfdev);
> + return false;
> }
>
> - return vfs_found;
> -}
> -
> -static int igb_check_vf_assignment(struct igb_adapter *adapter)
> -{
> - int i;
> - for (i = 0; i < adapter->vfs_allocated_count; i++) {
> - if (adapter->vf_data[i].vfdev) {
> - if (adapter->vf_data[i].vfdev->dev_flags &
> - PCI_DEV_FLAGS_ASSIGNED)
> + /* loop through all the VFs to see if we own any that are assigned */
> + vfdev = pci_get_device(PCI_VENDOR_ID_INTEL, dev_id, NULL);
> + while (vfdev) {
> + /* if we don't own it we don't care */
> + if (vfdev->is_virtfn && vfdev->physfn == pdev) {
> + /* if it is assigned we cannot release it */
> + if (vfdev->dev_flags & PCI_DEV_FLAGS_ASSIGNED)
> return true;
> }
> +
> + vfdev = pci_get_device(PCI_VENDOR_ID_INTEL, dev_id, vfdev);
> }
> +
> return false;
> }
>
As the author of commit 9297127b9cdd8d30c829ef5fd28b7cc0323a7bcd it
would have been nice to include me on the CC since I am probably one of
the best people to review this patch. That being said, the patch itself
looks good.
A follow-on patch that probably needs to be written would be to create a
generic version of "vfs_are_assigned" as a part of the SR-IOV API. That
way we can avoid duplicating the function in each of the drivers. All
that would need to be changed is to pull the vendor ID from the pdev,
and to pull the VF device ID from the SR-IOV configuration space of the
physical function. I'll try to get to that sometime in the next few
weeks if nobody gets to it before I do.
Acked-by: Alexander Duyck <alexander.h.duyck@intel.com>
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply
* Re: [PATCH v2] net-tcp: TCP/IP stack bypass for loopback connections
From: Bill Fink @ 2012-08-15 16:17 UTC (permalink / raw)
To: David Miller; +Cc: brutus, edumazet, netdev
In-Reply-To: <20120814.223907.1954070712467723629.davem@davemloft.net>
On Tue, 14 Aug 2012, David Miller wrote:
> From: Bill Fink <billfink@mindspring.com>
> Date: Wed, 15 Aug 2012 01:24:28 -0400
>
> > I see no reason to make it obtuse rather than something more
> > descriptive of its function (as opposed to how it's implemented).
>
> I want to live in a world where things are allowed to have some
> character, and some slightly amusing names. And that's why we'll
> call it TCP friends, thank you very much.
That's too bad. You seem to disdain user input in favor
of personal amusement. A very poor argument in my opinion.
> > I do have some concern that since the loopback path through the
> > TCP stack won't be heavily exercised anymore, it may be more likely
> > for bugs or performance degradations to creep into that code.
>
> Are you kidding me? Most people do not use loopback TCP, they use
> TCP to a real external entity. TCP friends only kicks in for
> loopback connections.
>
> So, like all of your other concerns, this one is meritless.
You like kicking dead horses I guess. I already agreed that
having the option enabled by default was fine after Bruce's
helpful info in response to my concerns.
And using the real TCP loopback can be very useful in analyzing
the functionality and performance of systems and applications
as an initial baseline before testing across real networks.
It can help identify system bottlenecks and scope out the outer
boundaries of what's possible to achieve.
Just because most people don't use loopback TCP doesn't mean
it doesn't have valid and useful purposes for some. And it's
interesting that your argument here that "most people do not
use loopback TCP" is in opposition to your previous argument
for enabling the option by default that "it benefits basically
everyone".
But this is further kicking of a dead horse. I've agreed
that having the option enabled by default is fine and I
will continue to disagree about the option name, but that
is your call of course.
-Bill
^ permalink raw reply
* [RFC PATCH 0/5] net: socket bind to file descriptor introduced
From: Stanislav Kinsbursky @ 2012-08-15 16:21 UTC (permalink / raw)
To: tglx, mingo, davem, hpa
Cc: thierry.reding, bfields, eric.dumazet, xemul, neilb, netdev, x86,
linux-kernel, paul.gortmaker, viro, gorcunov, akpm, tim.c.chen,
devel, ebiederm
This patch set introduces new socket operation and new system call:
sys_fbind(), which allows to bind socket to opened file.
File to bind to can be created by sys_mknod(S_IFSOCK) and opened by
open(O_PATH).
This system call is especially required for UNIX sockets, which has name
lenght limitation.
The following series implements...
---
Stanislav Kinsbursky (5):
net: cleanup unix_bind() a little
net: split unix_bind()
net: new protocol operation fbind() introduced
net: fbind() for unix sockets protocol operations introduced
syscall: sys_fbind() introduced
arch/x86/syscalls/syscall_32.tbl | 1
arch/x86/syscalls/syscall_64.tbl | 1
include/linux/net.h | 2 +
include/linux/syscalls.h | 1
kernel/sys_ni.c | 3 +
net/socket.c | 25 +++++++
net/unix/af_unix.c | 136 ++++++++++++++++++++++++++++++--------
7 files changed, 140 insertions(+), 29 deletions(-)
^ permalink raw reply
* [RFC PATCH 1/5] net: cleanup unix_bind() a little
From: Stanislav Kinsbursky @ 2012-08-15 16:22 UTC (permalink / raw)
To: tglx, mingo, davem, hpa
Cc: thierry.reding, bfields, eric.dumazet, xemul, neilb, netdev, x86,
linux-kernel, paul.gortmaker, viro, gorcunov, akpm, tim.c.chen,
devel, ebiederm
In-Reply-To: <20120815161141.7598.16682.stgit@localhost.localdomain>
This will simplify further changes for unix_fbind().
---
net/unix/af_unix.c | 12 +++++-------
1 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 641f2e4..bc90ddb 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -880,10 +880,8 @@ static int unix_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
if (err)
goto out_mknod_dput;
err = security_path_mknod(&path, dentry, mode, 0);
- if (err)
- goto out_mknod_drop_write;
- err = vfs_mknod(path.dentry->d_inode, dentry, mode, 0);
-out_mknod_drop_write:
+ if (!err)
+ err = vfs_mknod(path.dentry->d_inode, dentry, mode, 0);
mnt_drop_write(path.mnt);
if (err)
goto out_mknod_dput;
@@ -896,9 +894,9 @@ out_mknod_drop_write:
spin_lock(&unix_table_lock);
+ err = -EADDRINUSE;
if (!sun_path[0]) {
- err = -EADDRINUSE;
- if (__unix_find_socket_byname(net, sunaddr, addr_len,
+ if (__unix_find_socket_byname(net, sunaddr, addr->len,
sk->sk_type, hash)) {
unix_release_addr(addr);
goto out_unlock;
@@ -906,7 +904,7 @@ out_mknod_drop_write:
list = &unix_socket_table[addr->hash];
} else {
- list = &unix_socket_table[dentry->d_inode->i_ino & (UNIX_HASH_SIZE-1)];
+ list = &unix_socket_table[path.dentry->d_inode->i_ino & (UNIX_HASH_SIZE-1)];
u->path = path;
}
^ permalink raw reply related
* [RFC PATCH 2/5] net: split unix_bind()
From: Stanislav Kinsbursky @ 2012-08-15 16:22 UTC (permalink / raw)
To: tglx, mingo, davem, hpa
Cc: thierry.reding, bfields, eric.dumazet, xemul, neilb, netdev, x86,
linux-kernel, paul.gortmaker, viro, gorcunov, akpm, tim.c.chen,
devel, ebiederm
In-Reply-To: <20120815161141.7598.16682.stgit@localhost.localdomain>
This patch moves UNIX socket insert into separated function, because this code
will be used for unix_fbind() too.
Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
---
net/unix/af_unix.c | 52 +++++++++++++++++++++++++++++-----------------------
1 files changed, 29 insertions(+), 23 deletions(-)
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index bc90ddb..b26200d 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -814,11 +814,38 @@ fail:
return NULL;
}
+static int __unix_add_sock(struct path *path, struct sock *sk,
+ struct unix_address *addr, int hash)
+{
+ struct net *net = sock_net(sk);
+ struct unix_sock *u = unix_sk(sk);
+ struct sockaddr_un *sunaddr = addr->name;
+ char *sun_path = sunaddr->sun_path;
+ struct hlist_head *list;
+
+ if (!sun_path[0]) {
+ if (__unix_find_socket_byname(net, sunaddr, addr->len,
+ sk->sk_type, hash)) {
+ unix_release_addr(addr);
+ return -EADDRINUSE;
+ }
+
+ list = &unix_socket_table[addr->hash];
+ } else {
+ list = &unix_socket_table[path->dentry->d_inode->i_ino & (UNIX_HASH_SIZE-1)];
+ u->path = *path;
+ }
+
+ __unix_remove_socket(sk);
+ u->addr = addr;
+ __unix_insert_socket(list, sk);
+ return 0;
+
+}
static int unix_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
{
struct sock *sk = sock->sk;
- struct net *net = sock_net(sk);
struct unix_sock *u = unix_sk(sk);
struct sockaddr_un *sunaddr = (struct sockaddr_un *)uaddr;
char *sun_path = sunaddr->sun_path;
@@ -827,7 +854,6 @@ static int unix_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
int err;
unsigned int hash;
struct unix_address *addr;
- struct hlist_head *list;
err = -EINVAL;
if (sunaddr->sun_family != AF_UNIX)
@@ -893,27 +919,7 @@ static int unix_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
}
spin_lock(&unix_table_lock);
-
- err = -EADDRINUSE;
- if (!sun_path[0]) {
- if (__unix_find_socket_byname(net, sunaddr, addr->len,
- sk->sk_type, hash)) {
- unix_release_addr(addr);
- goto out_unlock;
- }
-
- list = &unix_socket_table[addr->hash];
- } else {
- list = &unix_socket_table[path.dentry->d_inode->i_ino & (UNIX_HASH_SIZE-1)];
- u->path = path;
- }
-
- err = 0;
- __unix_remove_socket(sk);
- u->addr = addr;
- __unix_insert_socket(list, sk);
-
-out_unlock:
+ err = __unix_add_sock(&path, sk, addr, hash);
spin_unlock(&unix_table_lock);
out_up:
mutex_unlock(&u->readlock);
^ permalink raw reply related
* [RFC PATCH 3/5] net: new protocol operation fbind() introduced
From: Stanislav Kinsbursky @ 2012-08-15 16:22 UTC (permalink / raw)
To: tglx, mingo, davem, hpa
Cc: thierry.reding, bfields, eric.dumazet, xemul, neilb, netdev, x86,
linux-kernel, paul.gortmaker, viro, gorcunov, akpm, tim.c.chen,
devel, ebiederm
In-Reply-To: <20120815161141.7598.16682.stgit@localhost.localdomain>
This operation is used to bind socket to specified file.
Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
---
include/linux/net.h | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/include/linux/net.h b/include/linux/net.h
index e9ac2df..843cb75 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -157,6 +157,7 @@ struct kiocb;
struct sockaddr;
struct msghdr;
struct module;
+struct path;
struct proto_ops {
int family;
@@ -165,6 +166,7 @@ struct proto_ops {
int (*bind) (struct socket *sock,
struct sockaddr *myaddr,
int sockaddr_len);
+ int (*fbind) (struct file *file, struct socket *sock);
int (*connect) (struct socket *sock,
struct sockaddr *vaddr,
int sockaddr_len, int flags);
^ permalink raw reply related
* [RFC PATCH 4/5] net: fbind() for unix sockets protocol operations introduced
From: Stanislav Kinsbursky @ 2012-08-15 16:22 UTC (permalink / raw)
To: tglx, mingo, davem, hpa
Cc: thierry.reding, bfields, eric.dumazet, xemul, neilb, netdev, x86,
linux-kernel, paul.gortmaker, viro, gorcunov, akpm, tim.c.chen,
devel, ebiederm
In-Reply-To: <20120815161141.7598.16682.stgit@localhost.localdomain>
Path for unix_address is taken from passed file.
File inode have to be socket.
Since no sunaddr is present, addr->name is constructed at the place. It
obviously means, then path name can be truncated is it's longer then
UNIX_MAX_PATH.
Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
---
net/unix/af_unix.c | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 76 insertions(+), 2 deletions(-)
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index b26200d..2f34c9d 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -286,12 +286,11 @@ static inline struct sock *unix_find_socket_byname(struct net *net,
return s;
}
-static struct sock *unix_find_socket_byinode(struct inode *i)
+static struct sock *__unix_find_socket_byinode(struct inode *i)
{
struct sock *s;
struct hlist_node *node;
- spin_lock(&unix_table_lock);
sk_for_each(s, node,
&unix_socket_table[i->i_ino & (UNIX_HASH_SIZE - 1)]) {
struct dentry *dentry = unix_sk(s)->path.dentry;
@@ -303,6 +302,15 @@ static struct sock *unix_find_socket_byinode(struct inode *i)
}
s = NULL;
found:
+ return s;
+}
+
+static struct sock *unix_find_socket_byinode(struct inode *i)
+{
+ struct sock *s;
+
+ spin_lock(&unix_table_lock);
+ s = __unix_find_socket_byinode(i);
spin_unlock(&unix_table_lock);
return s;
}
@@ -502,6 +510,7 @@ out:
static int unix_release(struct socket *);
static int unix_bind(struct socket *, struct sockaddr *, int);
+static int unix_fbind(struct file *file, struct socket *sock);
static int unix_stream_connect(struct socket *, struct sockaddr *,
int addr_len, int flags);
static int unix_socketpair(struct socket *, struct socket *);
@@ -542,6 +551,7 @@ static const struct proto_ops unix_stream_ops = {
.owner = THIS_MODULE,
.release = unix_release,
.bind = unix_bind,
+ .fbind = unix_fbind,
.connect = unix_stream_connect,
.socketpair = unix_socketpair,
.accept = unix_accept,
@@ -564,6 +574,7 @@ static const struct proto_ops unix_dgram_ops = {
.owner = THIS_MODULE,
.release = unix_release,
.bind = unix_bind,
+ .fbind = unix_fbind,
.connect = unix_dgram_connect,
.socketpair = unix_socketpair,
.accept = sock_no_accept,
@@ -586,6 +597,7 @@ static const struct proto_ops unix_seqpacket_ops = {
.owner = THIS_MODULE,
.release = unix_release,
.bind = unix_bind,
+ .fbind = unix_fbind,
.connect = unix_stream_connect,
.socketpair = unix_socketpair,
.accept = unix_accept,
@@ -843,6 +855,68 @@ static int __unix_add_sock(struct path *path, struct sock *sk,
}
+static int unix_fbind(struct file *f, struct socket *sock)
+{
+ struct sock *sk = sock->sk, *tmp;
+ struct unix_sock *u = unix_sk(sk);
+ struct unix_address *addr;
+ struct path *path = &f->f_path;
+ struct inode *inode = path->dentry->d_inode;
+ char *buf, *name;
+ int err;
+
+ err = -ENOTSOCK;
+ if (!S_ISSOCK(inode->i_mode))
+ goto out;
+
+ mutex_lock(&u->readlock);
+
+ err = -EINVAL;
+ if (u->addr)
+ goto out_up;
+
+ err = -ENOMEM;
+ buf = (char*)__get_free_page(GFP_KERNEL);
+ if (!buf)
+ goto out_up;
+
+ err = -EFAULT;
+ name = d_path(path, buf, PAGE_SIZE);
+ if (IS_ERR(name))
+ goto out_up_page;
+
+ addr = kmalloc(sizeof(*addr) + sizeof(struct sockaddr_un), GFP_KERNEL);
+ if (!addr)
+ goto out_up_page;
+
+ addr->name->sun_family = AF_UNIX;
+ addr->len = min(strlen(name), (size_t)UNIX_PATH_MAX);
+ memcpy(addr->name->sun_path, name, addr->len);
+ atomic_set(&addr->refcnt, 1);
+
+ spin_lock(&unix_table_lock);
+
+ err = -EADDRINUSE;
+ tmp = __unix_find_socket_byinode(inode);
+ if (tmp) {
+ sock_put(tmp);
+ unix_release_addr(addr);
+ goto out_unlock;
+ }
+
+ err = __unix_add_sock(path, sk, addr, 0);
+ path_get(path);
+
+out_unlock:
+ spin_unlock(&unix_table_lock);
+out_up_page:
+ free_page((unsigned long)buf);
+out_up:
+ mutex_unlock(&u->readlock);
+out:
+ return err;
+}
+
static int unix_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
{
struct sock *sk = sock->sk;
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox