* Re: [PATCH net] pkt_sched: fq: avoid hang when quantum 0
From: Eric Dumazet @ 2015-02-03 17:46 UTC (permalink / raw)
To: Kenneth Klette Jonassen; +Cc: netdev
In-Reply-To: <1422982158-12530-1-git-send-email-kennetkl@ifi.uio.no>
On Tue, 2015-02-03 at 17:49 +0100, Kenneth Klette Jonassen wrote:
> Configuring fq with quantum 0 hangs the system, presumably because of a
> non-interruptible infinite loop. Either way quantum 0 does not make sense.
>
> Reproduce with:
> sudo tc qdisc add dev lo root fq quantum 0 initial_quantum 0
> ping 127.0.0.1
>
> Signed-off-by: Kenneth Klette Jonassen <kennetkl@ifi.uio.no>
> ---
Acked-by: Eric Dumazet <edumazet@google.com>
^ permalink raw reply
* Re: [PATCH net 1/1] cls_api.c: Fix dumping of non-existing actions' stats.
From: Cong Wang @ 2015-02-03 17:39 UTC (permalink / raw)
To: Ignacy Gawędzki, netdev
In-Reply-To: <20150203173251.GB6246@zenon.in.qult.net>
On Tue, Feb 3, 2015 at 9:32 AM, Ignacy Gawędzki
<ignacy.gawedzki@green-communications.fr> wrote:
> In tcf_exts_dump_stats(), ensure that exts->actions is not empty before
> accessing the first element of that list and calling tcf_action_copy_stats()
> on it. This fixes some random segvs when adding filters of type "basic" with
> no particular action.
>
> This also fixes the dumping of those "no-action" filters, which more often
> than not made calls to tcf_action_copy_stats() fail and consequently netlink
> attributes added by the caller to be removed by a call to nla_nest_cancel().
>
> Signed-off-by: Ignacy Gawędzki <ignacy.gawedzki@green-communications.fr>
> ---
> net/sched/cls_api.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
> index aad6a67..30e6967 100644
> --- a/net/sched/cls_api.c
> +++ b/net/sched/cls_api.c
> @@ -602,9 +602,12 @@ EXPORT_SYMBOL(tcf_exts_dump);
> int tcf_exts_dump_stats(struct sk_buff *skb, struct tcf_exts *exts)
> {
> #ifdef CONFIG_NET_CLS_ACT
> - struct tc_action *a = tcf_exts_first_act(exts);
> - if (tcf_action_copy_stats(skb, a, 1) < 0)
> - return -1;
> + struct tc_action *a;
> + if (!list_empty(&exts->actions)) {
> + a = tcf_exts_first_act(exts);
> + if (tcf_action_copy_stats(skb, a, 1) < 0)
> + return -1;
> + }
Hmm, or just fix tcf_exts_first_act()? Let it call list_first_entry_or_null().
Also, please add Fixes: tag.
Fixes: commit 33be627159913b094bb578e83e9a7fdc66c10208
^ permalink raw reply
* [PATCH net 1/1] cls_api.c: Fix dumping of non-existing actions' stats.
From: Ignacy Gawędzki @ 2015-02-03 17:32 UTC (permalink / raw)
To: netdev
In-Reply-To: <20150203141059.GA25454@zenon.in.qult.net>
In tcf_exts_dump_stats(), ensure that exts->actions is not empty before
accessing the first element of that list and calling tcf_action_copy_stats()
on it. This fixes some random segvs when adding filters of type "basic" with
no particular action.
This also fixes the dumping of those "no-action" filters, which more often
than not made calls to tcf_action_copy_stats() fail and consequently netlink
attributes added by the caller to be removed by a call to nla_nest_cancel().
Signed-off-by: Ignacy Gawędzki <ignacy.gawedzki@green-communications.fr>
---
net/sched/cls_api.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index aad6a67..30e6967 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -602,9 +602,12 @@ EXPORT_SYMBOL(tcf_exts_dump);
int tcf_exts_dump_stats(struct sk_buff *skb, struct tcf_exts *exts)
{
#ifdef CONFIG_NET_CLS_ACT
- struct tc_action *a = tcf_exts_first_act(exts);
- if (tcf_action_copy_stats(skb, a, 1) < 0)
- return -1;
+ struct tc_action *a;
+ if (!list_empty(&exts->actions)) {
+ a = tcf_exts_first_act(exts);
+ if (tcf_action_copy_stats(skb, a, 1) < 0)
+ return -1;
+ }
#endif
return 0;
}
--
2.1.0
^ permalink raw reply related
* [PATCH net 0/1] Re: RFC: Fix "tc filter show" for basic filters
From: Ignacy Gawędzki @ 2015-02-03 17:32 UTC (permalink / raw)
To: netdev
In-Reply-To: <20150203141059.GA25454@zenon.in.qult.net>
Hi again,
After some playing around, I found that my quick-and-dirty fix didn't actually
do the job. I eventually traced the problem to come from the fact that
tcf_exts_dump_stats() just assumed that the list of actions in exts->actions
contains at least one element and accessed it using tcf_exts_first_act().
This is clearly not true in the case of filters with no associated action in
particular, as in the case of my "basic" filter.
Simply ensuring that the list is not empty beforehand is enough to fix the
problem, just as is also done above in tcf_exts_dump().
Ignacy Gawędzki (1):
cls_api.c: Fix dumping of non-existing actions' stats.
net/sched/cls_api.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
--
2.1.0
^ permalink raw reply
* [PATCH v2 net-next] pkt_sched: fq: better control of DDOS traffic
From: Eric Dumazet @ 2015-02-03 17:32 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <1422626772.21689.90.camel@edumazet-glaptop2.roam.corp.google.com>
From: Eric Dumazet <edumazet@google.com>
FQ has a fast path for skb attached to a socket, as it does not
have to compute a flow hash. But for other packets, FQ being non
stochastic means that hosts exposed to random Internet traffic
can allocate million of flows structure (104 bytes each) pretty
easily. Not only host can OOM, but lookup in RB trees can take
too much cpu and memory resources.
This patch adds a new attribute, orphan_mask, that is adding
possibility of having a stochastic hash for orphaned skb.
Its default value is 1024 slots, to mimic SFQ behavior.
Note: This does not apply to locally generated TCP traffic,
and no locally generated traffic will share a flow structure
with another perfect or stochastic flow.
This patch also handles the specific case of SYNACK messages:
They are attached to the listener socket, and therefore all map
to a single hash bucket. If listener have set SO_MAX_PACING_RATE,
hoping to have new accepted socket inherit this rate, SYNACK
might be paced and even dropped.
This is very similar to an internal patch Google have used more
than one year.
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
v2: make the left shift in fq_classify.
net/sched/sch_fq.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/net/sched/sch_fq.c b/net/sched/sch_fq.c
index 2a50f5c62070a81ae37d871aac2626555128fd38..c7dee59763454777e8bb2c028d932340b2ced5da 100644
--- a/net/sched/sch_fq.c
+++ b/net/sched/sch_fq.c
@@ -92,6 +92,7 @@ struct fq_sched_data {
u32 flow_refill_delay;
u32 flow_max_rate; /* optional max rate per flow */
u32 flow_plimit; /* max packets per flow */
+ u32 orphan_mask; /* mask for orphaned skb */
struct rb_root *fq_root;
u8 rate_enable;
u8 fq_trees_log;
@@ -222,11 +223,20 @@ static struct fq_flow *fq_classify(struct sk_buff *skb, struct fq_sched_data *q)
if (unlikely((skb->priority & TC_PRIO_MAX) == TC_PRIO_CONTROL))
return &q->internal;
- if (unlikely(!sk)) {
+ /* SYNACK messages are attached to a listener socket.
+ * 1) They are not part of a 'flow' yet
+ * 2) We do not want to rate limit them (eg SYNFLOOD attack),
+ * especially if the listener set SO_MAX_PACING_RATE
+ * 3) We pretend they are orphaned
+ */
+ if (!sk || sk->sk_state == TCP_LISTEN) {
+ unsigned long hash = skb_get_hash(skb) & q->orphan_mask;
+
/* By forcing low order bit to 1, we make sure to not
* collide with a local flow (socket pointers are word aligned)
*/
- sk = (struct sock *)(skb_get_hash(skb) | 1L);
+ sk = (struct sock *)((hash << 1) | 1UL);
+ skb_orphan(skb);
}
root = &q->fq_root[hash_32((u32)(long)sk, q->fq_trees_log)];
@@ -698,6 +708,9 @@ static int fq_change(struct Qdisc *sch, struct nlattr *opt)
q->flow_refill_delay = usecs_to_jiffies(usecs_delay);
}
+ if (tb[TCA_FQ_ORPHAN_MASK])
+ q->orphan_mask = nla_get_u32(tb[TCA_FQ_ORPHAN_MASK]);
+
if (!err) {
sch_tree_unlock(sch);
err = fq_resize(sch, fq_log);
@@ -743,6 +756,7 @@ static int fq_init(struct Qdisc *sch, struct nlattr *opt)
q->delayed = RB_ROOT;
q->fq_root = NULL;
q->fq_trees_log = ilog2(1024);
+ q->orphan_mask = 1024 - 1;
qdisc_watchdog_init(&q->watchdog, sch);
if (opt)
@@ -772,6 +786,7 @@ static int fq_dump(struct Qdisc *sch, struct sk_buff *skb)
nla_put_u32(skb, TCA_FQ_FLOW_MAX_RATE, q->flow_max_rate) ||
nla_put_u32(skb, TCA_FQ_FLOW_REFILL_DELAY,
jiffies_to_usecs(q->flow_refill_delay)) ||
+ nla_put_u32(skb, TCA_FQ_ORPHAN_MASK, q->orphan_mask) ||
nla_put_u32(skb, TCA_FQ_BUCKETS_LOG, q->fq_trees_log))
goto nla_put_failure;
^ permalink raw reply related
* Re: [PATCH] net: ipv6: Make address flushing on ifdown optional - v2
From: Stephen Hemminger @ 2015-02-03 17:27 UTC (permalink / raw)
To: David Ahern; +Cc: netdev, Hannes Frederic Sowa
In-Reply-To: <54D0124C.70202@gmail.com>
On Mon, 02 Feb 2015 17:11:56 -0700
David Ahern <dsahern@gmail.com> wrote:
> On 2/2/15 4:10 PM, Stephen Hemminger wrote:
> > Checkpatch complains about space before tab, which could be your
> > mailer mangling the patch.
>
> Yes, found that a couple of days ago. I use 'git send-email' to send the
> patches, and I have a pre-commit hook to run checkpatch.pl. Perhaps I
> goofed something in the recent latptop transitions.
>
> >
> > This should probably go into the netconf netlink message as well.
> >
>
> Not sure I understand this point. Can you point me to a code reference
> to look up?
>
> Though that did remind me that I should add a blurb in
> Documentation/networking/ip-sysctl.txt.
>
> David
Never mind, actually NETCONFA stuff is mostly for case where
listener needs to know how to handle offload, and this doesn't
impact that.
^ permalink raw reply
* Re: [PATCH 0/6 net-next] rhashtable fixes
From: Thomas Graf @ 2015-02-03 17:21 UTC (permalink / raw)
To: Ying Xue; +Cc: davem, netdev
In-Reply-To: <54CB5563.9080000@windriver.com>
On 01/30/15 at 05:56pm, Ying Xue wrote:
> On 01/30/2015 05:29 PM, Thomas Graf wrote:
> > Right, I see the same soft lockup. Interestingly I cannot trigger it
> > with the rht test code. I can only trigger it with your Netlink socket
> > creation stress test. It is definitely related to the deferred worker,
> > when I disable growing, then the bug disappears.
>
> Yes, when I disable expansion, the soft lockup also disappears too.
I have found the last remaining race and can now run your test
program successfully in an endless loop.
I will resubmit a v2 of this series.
^ permalink raw reply
* Re: [PATCH net-next 03/10] net/bonding: Notify state change on slaves
From: Moni Shoua @ 2015-02-03 17:17 UTC (permalink / raw)
To: Nikolay Aleksandrov
Cc: Or Gerlitz, David S. Miller, netdev, Roland Dreier, Amir Vadai,
Tal Alon
In-Reply-To: <54D0F2B7.4000005@redhat.com>
> Hi Or,
> A few questions below,
>
Hi Nik
You are probably right about the problem of de-referencing slave
inside a work. I didn't think of the scenario of release the dev and
re-enslaving it to another bond while the work is still pending in the
queue.
I'll fix this and the memory leak you noticed in the next set
thanks
Moni
^ permalink raw reply
* [PATCH net] pkt_sched: fq: avoid hang when quantum 0
From: Kenneth Klette Jonassen @ 2015-02-03 16:49 UTC (permalink / raw)
To: netdev; +Cc: Kenneth Klette Jonassen
Configuring fq with quantum 0 hangs the system, presumably because of a
non-interruptible infinite loop. Either way quantum 0 does not make sense.
Reproduce with:
sudo tc qdisc add dev lo root fq quantum 0 initial_quantum 0
ping 127.0.0.1
Signed-off-by: Kenneth Klette Jonassen <kennetkl@ifi.uio.no>
---
net/sched/sch_fq.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/net/sched/sch_fq.c b/net/sched/sch_fq.c
index 2a50f5c..313794b 100644
--- a/net/sched/sch_fq.c
+++ b/net/sched/sch_fq.c
@@ -670,8 +670,14 @@ static int fq_change(struct Qdisc *sch, struct nlattr *opt)
if (tb[TCA_FQ_FLOW_PLIMIT])
q->flow_plimit = nla_get_u32(tb[TCA_FQ_FLOW_PLIMIT]);
- if (tb[TCA_FQ_QUANTUM])
- q->quantum = nla_get_u32(tb[TCA_FQ_QUANTUM]);
+ if (tb[TCA_FQ_QUANTUM]) {
+ u32 quantum = nla_get_u32(tb[TCA_FQ_QUANTUM]);
+
+ if (quantum > 0)
+ q->quantum = quantum;
+ else
+ err = -EINVAL;
+ }
if (tb[TCA_FQ_INITIAL_QUANTUM])
q->initial_quantum = nla_get_u32(tb[TCA_FQ_INITIAL_QUANTUM]);
--
1.9.1
^ permalink raw reply related
* Re: [PATCH net-next] cxgb4: Add low latency socket busy_poll support
From: Rick Jones @ 2015-02-03 16:45 UTC (permalink / raw)
To: Hariprasad Shenai, netdev
Cc: davem, leedom, anish, nirranjan, praveenm, kumaras
In-Reply-To: <1422940816-27402-1-git-send-email-hariprasad@chelsio.com>
On 02/02/2015 09:20 PM, Hariprasad Shenai wrote:
> cxgb_busy_poll, corresponding to ndo_busy_poll, gets called by the socket
> waiting for data.
>
> With busy_poll enabled, improvement is seen in latency numbers as observed by
> collecting netperf TCP_RR numbers.
Which, not surprisingly, leads to the question - how much improvement?
:) Extra credit for including the change in netperf-reported service
demands.
happy benchmarking,
rick jones
^ permalink raw reply
* Re: low vxlan throughput with tso enabled
From: Rick Jones @ 2015-02-03 16:36 UTC (permalink / raw)
To: Reiner Herrmann, netdev; +Cc: svens, Vittorio Curcio
In-Reply-To: <bde634e5-3c57-4e80-9309-670cbd51c1b9@DE-WIE-EXCH3A.green.sophos>
On 02/03/2015 07:50 AM, Reiner Herrmann wrote:
> I have a vxlan tunnel established between two network interfaces, which
> both have a MTU of 1500. The vxlan interfaces have the same MTU.
> With TSO enabled, I observe low throughput with TCP connections (<100
> kB/s).
> Disabling TSO works around this issue and throughput is as expected.
> Can someone please explain how TSO is influencing the tunnel to cause
> such a difference?
I've been under the impression that one generally wants the MTU of a
tunnel interface to be no more than the MTU of the physical interface
over which it runs, less the size of the encapsulation headers used by
the tunnel. What happens when you make the MTU of the tunnel interface
1400 bytes instead of 1500?
rick jones
^ permalink raw reply
* Re: low vxlan throughput with tso enabled
From: Tom Herbert @ 2015-02-03 16:26 UTC (permalink / raw)
To: Reiner Herrmann; +Cc: Linux Netdev List, svens, Vittorio Curcio
In-Reply-To: <bde634e5-3c57-4e80-9309-670cbd51c1b9@DE-WIE-EXCH3A.green.sophos>
On Tue, Feb 3, 2015 at 7:50 AM, Reiner Herrmann
<reiner.herrmann@sophos.com> wrote:
> Hi!
>
> I have a vxlan tunnel established between two network interfaces, which
> both have a MTU of 1500. The vxlan interfaces have the same MTU.
> With TSO enabled, I observe low throughput with TCP connections (<100 kB/s).
> Disabling TSO works around this issue and throughput is as expected.
> Can someone please explain how TSO is influencing the tunnel to cause
> such a difference?
>
Please provide more information. What NIC? What is the link rate? What
are you running to test. Also report 'ethtool -k' of both tunnel and
Ethernet interfaces, and tcpdump on the interfaces (to see GSO
packets).
Thanks
> Kind regards,
> Reiner
>
> --
> 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
* Re: [PATCH net-next] veth: set iflink to the peer veth
From: Nicolas Dichtel @ 2015-02-03 16:21 UTC (permalink / raw)
To: Eric Dumazet; +Cc: netdev, davem
In-Reply-To: <1422979929.907.19.camel@edumazet-glaptop2.roam.corp.google.com>
Le 03/02/2015 17:12, Eric Dumazet a écrit :
> If I move one veth to another namespace, is iflink still relevant ?
>
>
You're right. ifindex may change.
^ permalink raw reply
* Re: [PATCH net-next] veth: set iflink to the peer veth
From: Eric Dumazet @ 2015-02-03 16:12 UTC (permalink / raw)
To: Nicolas Dichtel; +Cc: netdev, davem
In-Reply-To: <1422978106-4744-1-git-send-email-nicolas.dichtel@6wind.com>
On Tue, 2015-02-03 at 16:41 +0100, Nicolas Dichtel wrote:
> Now that the peer netns is advertised in rtnl messages, we can set this property
> so that IFLA_LINK will advertise the peer ifindex. It allows the userland to get
> the full veth configuration.
>
> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
> ---
> drivers/net/veth.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/net/veth.c b/drivers/net/veth.c
> index 4cca36ebc4fb..02d1f798a371 100644
> --- a/drivers/net/veth.c
> +++ b/drivers/net/veth.c
> @@ -427,9 +427,11 @@ static int veth_newlink(struct net *src_net, struct net_device *dev,
>
> priv = netdev_priv(dev);
> rcu_assign_pointer(priv->peer, peer);
> + dev->iflink = peer->ifindex;
>
> priv = netdev_priv(peer);
> rcu_assign_pointer(priv->peer, dev);
> + peer->iflink = dev->ifindex;
> return 0;
>
> err_register_dev:
Is is network namespace ready ?
If I move one veth to another namespace, is iflink still relevant ?
^ permalink raw reply
* Re: [PATCH net-next 03/10] net/bonding: Notify state change on slaves
From: Nikolay Aleksandrov @ 2015-02-03 16:09 UTC (permalink / raw)
To: Or Gerlitz, David S. Miller
Cc: netdev, Roland Dreier, Amir Vadai, Tal Alon, Moni Shoua
In-Reply-To: <1422974919-28084-4-git-send-email-ogerlitz@mellanox.com>
On 03/02/15 15:48, Or Gerlitz wrote:
> From: Moni Shoua <monis@mellanox.com>
>
> Use notifier chain to dispatch an event upon a change in slave state.
> Event is dispatched with slave specific info.
>
> Signed-off-by: Moni Shoua <monis@mellanox.com>
> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
> ---
> drivers/net/bonding/bond_main.c | 42 +++++++++++++++++++++++++++++++++++++++
> include/net/bonding.h | 12 +++++++++++
> 2 files changed, 54 insertions(+), 0 deletions(-)
>
Hi Or,
A few questions below,
> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
> index 0665608..c9771f3 100644
> --- a/drivers/net/bonding/bond_main.c
> +++ b/drivers/net/bonding/bond_main.c
> @@ -1191,6 +1191,47 @@ static void bond_fill_ifslave(struct slave *slave, struct ifslave *info)
> info->link_failure_count = slave->link_failure_count;
> }
>
> +static void bond_netdev_notify(struct slave *slave, struct net_device *dev)
> +{
> + struct bonding *bond = slave->bond;
^^^^^^^^^^^
What if the struct slave where "slave" points to gets freed before this execution ?
> + struct netdev_bonding_info bonding_info;
> +
> + rtnl_lock();
> + /* make sure that slave is still valid */
> + if (dev->priv_flags & IFF_BONDING) {
^^^^^^^
What if the slave is released, enslaved to a different bond and the old bond is
destroyed between the dereference up there and the rtnl_lock() ?
Or the bonding gets unloaded altogether ?
> + bond_fill_ifslave(slave, &bonding_info.slave);
> + bond_fill_ifbond(bond, &bonding_info.master);
> + netdev_bonding_info_change(slave->dev, &bonding_info);
> + }
> + rtnl_unlock();
> +}
> +
> +static void bond_netdev_notify_work(struct work_struct *_work)
> +{
> + struct netdev_notify_work *w =
> + container_of(_work, struct netdev_notify_work, work.work);
> +
> + bond_netdev_notify(w->slave, w->dev);
> + dev_put(w->dev);
> +}
> +
> +void bond_queue_slave_event(struct slave *slave)
> +{
> + struct netdev_notify_work *nnw = kzalloc(sizeof(*nnw), GFP_ATOMIC);
^^^^^^^^
Where's this freed after the work's done ?
> +
> + if (!nnw)
> + return;
> +
> + INIT_DELAYED_WORK(&nnw->work, bond_netdev_notify_work);
> + nnw->slave = slave;
> + nnw->dev = slave->dev;
> +
> + if (queue_delayed_work(slave->bond->wq, &nnw->work, 0))
> + dev_hold(slave->dev);
> + else
> + kfree(nnw);
> +}
> +
<snip>
Cheers,
Nik
^ permalink raw reply
* Re: [PATCH] net: rocker: Change netdev names to include slot number
From: David Ahern @ 2015-02-03 16:06 UTC (permalink / raw)
To: Scott Feldman; +Cc: Florian Fainelli, Netdev
In-Reply-To: <CAE4R7bArt7+C-kHJ7UXFo4w9feG0C_uZqQ7n8KC0brSXhqX3gg@mail.gmail.com>
On 2/2/15 10:46 PM, Scott Feldman wrote:
>> [root@f21 ~]# cat /sys/devices/virtual/net/sw5p0/phys_port_id
>> cat: /sys/devices/virtual/net/sw5p0/phys_port_id: Operation not supported
>
> We should implement .ndo_get_phys_port_id in rocker to return a unique
> name for the port, which can then be used in udev script to name
> interface. When rocker device is instantiated, a unique switch name
> is given on qemu cmd line, for example "sw1". Rocker device could
> return that string to the driver, or even combine that string with the
Right. That's what I went looking for at first and noticed that info is
not pushed to the driver. And then I know at least one vendor puts the
slot id in interface names which is the reason I went for the PCI slot id.
> port index to have "sw1p1". The second instantiated rocker device
> would give up "sw2px" port names.
And yes, adding the port index to the above name -- though ideally
starting at 1 and not 0.
>
> A real switch with a physical port than can be split, or when multiple
> ports are ganged to form one mega port, letting the device pick a
> unique name is probably best. For example, splitting a single
> physical 40Gb port into 4 10Gb ports would present 4 kernel
> interfaces, but we probably want to use the base port in the naming,
> so we'd have something like "sw1p1s1" to mean switch 1, front panel
> port 1, split port 1. Letting the device name the ports on current
> port configuration of the port will keep driver/kernel simple, and let
> udev be the final name chooser.
Exactly. When you add in break out ports to the mix having sane, logical
default names (without udev) makes life easier. That was my ultimate
intent here - logical default names that udev or a user could then
modify if so desired.
But anyways, since the request is to have udev do the naming I need to
come back to it. A quick search on the systemd web site did not stumble
onto examples I could use, so I need to put this on the back burner
until I have time to dig through systemd docs.
David
^ permalink raw reply
* Re: [V2,for,3.19,3/7] rtlwifi: rtl8192ee: Fix adhoc fail
From: Larry Finger @ 2015-02-03 16:00 UTC (permalink / raw)
To: Kalle Valo; +Cc: linux-wireless, Troy Tan, netdev, Stable
In-Reply-To: <87r3u7w2l5.fsf@kamboji.qca.qualcomm.com>
On 02/03/2015 07:23 AM, Kalle Valo wrote:
> Kalle Valo <kvalo@codeaurora.org> writes:
>
>>> From: Troy Tan <troy_tan@realsil.com.cn>
>>>
>>> When the buffer descriptor index exceeds 2, then a TX HANG condition
>>> will result.
>>>
>>> Signed-off-by: Troy Tan <troy_tan@realsil.com.cn>
>>> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
>>> Cc: Stable <stable@vger.kernel.org> [V3.18]
>>
>> Thanks, 4 patches applied to wireless-drivers-next.git:
>>
>> b661a5da5776 rtlwifi: rtl8192ee: Fix adhoc fail
>> 6e5f44361628 rtlwifi: rtl8192ee: Fix TX hang due to failure to update TX write point
>> 92ff754240b8 rtlwifi: rtl8192ee: Fix parsing of received packet
>> 21b39ddb5bb2 rtlwifi: rtl8192ee: Fix DMA stalls
>>
>> 3 patches skipped:
>
> I had to skip these three patches because of my mistake. So what I did
> was that I had merged ("fast forwarded") the net tree into my
> wireless-drivers tree and not realising I should not do that. So now I
> can't merge wireless-drivers into wireless-drivers-next anymore, as it
> will pull unnecessary net changes.
>
>> [V2,for,3.19,1/7] rtlwifi: Remove logging statement that is no longer
>> needed
>
> I'll apply this after 3.20-rc1 is released, it should apply then without
> problems (or the conflicts are easy for me to fix). Luckily this is just
> a cosmetic error and can wait for 3.20-rc2, right?
That is correct. 3.20-rc2 will be OK. I'll probably get a bunch of "your ****
driver is spamming my logs, but I can ignore them".
>
>> [V2,for,3.19,2/7] rtlwifi: rtl8192ee: Fix handling of new style descriptors
>> [V2,for,3.19,6/7] rtlwifi: rtl8192ee: Fix problems with calculating free space in FIFO
>
> Not sure what to do with these one. Should you rebase and send them now?
These two fix real bugs and need to be in the kernel ASAP. Unfortunately, I saw
you pass them off to DaveM and I deleted them from my "Submitted Patch" list. I
can recreate them from my working copy of wireless-drivers, and I will resubmit.
When I do, please process them as quickly as possible.
Thanks,
Larry
^ permalink raw reply
* [PATCH net-next 7/7] net/mlx4_en: Notify TX Vlan offload change
From: Amir Vadai @ 2015-02-03 15:57 UTC (permalink / raw)
To: David S. Miller
Cc: netdev, Amir Vadai, Or Gerlitz, Yevgeny Petrilin, Ido Shamay
In-Reply-To: <1422979041-25208-1-git-send-email-amirv@mellanox.com>
From: Ido Shamay <idos@mellanox.com>
Notify users when TX vlan offload feature changed with ethtool.
Relevant command - ethtool -K <eth> txvlan on/off.
Signed-off-by: Ido Shamay <idos@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
index e075ff1..0897274 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
@@ -2201,6 +2201,10 @@ static int mlx4_en_set_features(struct net_device *netdev,
return ret;
}
+ if (DEV_FEATURE_CHANGED(netdev, features, NETIF_F_HW_VLAN_CTAG_TX))
+ en_info(priv, "Turn %s TX vlan strip offload\n",
+ (features & NETIF_F_HW_VLAN_CTAG_TX) ? "ON" : "OFF");
+
if (features & NETIF_F_LOOPBACK)
priv->ctrl_flags |= cpu_to_be32(MLX4_WQE_CTRL_FORCE_LOOPBACK);
else
--
1.9.3
^ permalink raw reply related
* [PATCH net-next 6/7] net/mlx4_en: Adjust RX frag strides to frag sizes
From: Amir Vadai @ 2015-02-03 15:57 UTC (permalink / raw)
To: David S. Miller
Cc: netdev, Amir Vadai, Or Gerlitz, Yevgeny Petrilin, Ido Shamay
In-Reply-To: <1422979041-25208-1-git-send-email-amirv@mellanox.com>
From: Ido Shamay <idos@mellanox.com>
This patch improves memory utilization and therefore the packets rate
for special MTU's. Instead of setting the frag_stride to the maximal
hard coded frag_size, use the actual frag_size that is set according to
the MTU, when setting the stride of the last frag.
So, for example, for MTU 1600, where the frag_size of the 2nd frag is
86, the frag_size is set to 128 instead of 4096. See below:
Before:
frag:0 - size:1536 prefix:0 stride:1536
frag:1 - size:86 prefix:1536 stride:4096
frag 0 allocator: - size:32768 frags:21
frag 1 allocator: - size:32768 frags:8
After:
frag:0 - size:1536 prefix:0 stride:1536
frag:1 - size:86 prefix:1536 stride:128
frag 0 allocator: - size:32768 frags:21
frag 1 allocator: - size:32768 frags:256
Signed-off-by: Ido Shamay <idos@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx4/en_rx.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
index 30a2203..698d60d 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
@@ -1063,8 +1063,9 @@ void mlx4_en_calc_rx_buf(struct net_device *dev)
(eff_mtu > buf_size + frag_sizes[i]) ?
frag_sizes[i] : eff_mtu - buf_size;
priv->frag_info[i].frag_prefix_size = buf_size;
- priv->frag_info[i].frag_stride = ALIGN(frag_sizes[i],
- SMP_CACHE_BYTES);
+ priv->frag_info[i].frag_stride =
+ ALIGN(priv->frag_info[i].frag_size,
+ SMP_CACHE_BYTES);
buf_size += priv->frag_info[i].frag_size;
i++;
}
--
1.9.3
^ permalink raw reply related
* [PATCH net-next 2/7] net/mlx4: mlx4_config_dev_retrieval() - Initialize struct config_dev before using
From: Amir Vadai @ 2015-02-03 15:57 UTC (permalink / raw)
To: David S. Miller
Cc: netdev, Amir Vadai, Or Gerlitz, Yevgeny Petrilin, Maor Gottlieb
In-Reply-To: <1422979041-25208-1-git-send-email-amirv@mellanox.com>
From: Maor Gottlieb <maorg@mellanox.com>
Add Initialization to struct config_dev before filling and using it.
Fix to warning:
warning: config_dev.rx_checksum_val may be used uninitialized in this function
Signed-off-by: Maor Gottlieb <maorg@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx4/fw.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.c b/drivers/net/ethernet/mellanox/mlx4/fw.c
index dbabfae..241838f 100644
--- a/drivers/net/ethernet/mellanox/mlx4/fw.c
+++ b/drivers/net/ethernet/mellanox/mlx4/fw.c
@@ -2162,7 +2162,7 @@ static const u8 config_dev_csum_flags[] = {
int mlx4_config_dev_retrieval(struct mlx4_dev *dev,
struct mlx4_config_dev_params *params)
{
- struct mlx4_config_dev config_dev;
+ struct mlx4_config_dev config_dev = {0};
int err;
u8 csum_mask;
--
1.9.3
^ permalink raw reply related
* [PATCH net-next 5/7] net/mlx4_en: Print page allocator information
From: Amir Vadai @ 2015-02-03 15:57 UTC (permalink / raw)
To: David S. Miller
Cc: netdev, Amir Vadai, Or Gerlitz, Yevgeny Petrilin, Ido Shamay
In-Reply-To: <1422979041-25208-1-git-send-email-amirv@mellanox.com>
From: Ido Shamay <idos@mellanox.com>
After Initialization of page_alloc, print actual allocated page
size and number of frags it contains. prints is done only when drv
message level is set on the interface.
Signed-off-by: Ido Shamay <idos@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx4/en_rx.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
index 2ba5d36..30a2203 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
@@ -162,6 +162,10 @@ static int mlx4_en_init_allocator(struct mlx4_en_priv *priv,
if (mlx4_alloc_pages(priv, &ring->page_alloc[i],
frag_info, GFP_KERNEL | __GFP_COLD))
goto out;
+
+ en_dbg(DRV, priv, " frag %d allocator: - size:%d frags:%d\n",
+ i, ring->page_alloc[i].page_size,
+ atomic_read(&ring->page_alloc[i].page->_count));
}
return 0;
--
1.9.3
^ permalink raw reply related
* [PATCH net-next 4/7] net/mlx5_core: Move to use hex PCI device IDs
From: Amir Vadai @ 2015-02-03 15:57 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Amir Vadai, Or Gerlitz, Yevgeny Petrilin
In-Reply-To: <1422979041-25208-1-git-send-email-amirv@mellanox.com>
From: Or Gerlitz <ogerlitz@mellanox.com>
Align the IDs in the code with the modinfo, lspci -n, etc tools outputs.
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx5/core/main.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c
index 3f45256..d665193 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c
@@ -903,12 +903,12 @@ static void remove_one(struct pci_dev *pdev)
}
static const struct pci_device_id mlx5_core_pci_table[] = {
- { PCI_VDEVICE(MELLANOX, 4113) }, /* Connect-IB */
- { PCI_VDEVICE(MELLANOX, 4114) }, /* Connect-IB VF */
- { PCI_VDEVICE(MELLANOX, 4115) }, /* ConnectX-4 */
- { PCI_VDEVICE(MELLANOX, 4116) }, /* ConnectX-4 VF */
- { PCI_VDEVICE(MELLANOX, 4117) }, /* ConnectX-4LX */
- { PCI_VDEVICE(MELLANOX, 4118) }, /* ConnectX-4LX VF */
+ { PCI_VDEVICE(MELLANOX, 0x1011) }, /* Connect-IB */
+ { PCI_VDEVICE(MELLANOX, 0x1012) }, /* Connect-IB VF */
+ { PCI_VDEVICE(MELLANOX, 0x1013) }, /* ConnectX-4 */
+ { PCI_VDEVICE(MELLANOX, 0x1014) }, /* ConnectX-4 VF */
+ { PCI_VDEVICE(MELLANOX, 0x1015) }, /* ConnectX-4LX */
+ { PCI_VDEVICE(MELLANOX, 0x1016) }, /* ConnectX-4LX VF */
{ 0, }
};
--
1.9.3
^ permalink raw reply related
* [PATCH net-next 3/7] net/mlx4_core: Fix misleading debug print on CQE stride support
From: Amir Vadai @ 2015-02-03 15:57 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Amir Vadai, Or Gerlitz, Yevgeny Petrilin
In-Reply-To: <1422979041-25208-1-git-send-email-amirv@mellanox.com>
From: Or Gerlitz <ogerlitz@mellanox.com>
We do support cache line sizes of 32 and 64 bytes without activating the
CQE stride feature. Fix a misleading print saying that these cache line
sizes aren't supported.
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx4/main.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
index cc9f484..e045562 100644
--- a/drivers/net/ethernet/mellanox/mlx4/main.c
+++ b/drivers/net/ethernet/mellanox/mlx4/main.c
@@ -251,7 +251,8 @@ static void mlx4_enable_cqe_eqe_stride(struct mlx4_dev *dev)
if (mlx4_is_master(dev))
dev_cap->function_caps |= MLX4_FUNC_CAP_EQE_CQE_STRIDE;
} else {
- mlx4_dbg(dev, "Disabling CQE stride cacheLine unsupported\n");
+ if (cache_line_size() != 32 && cache_line_size() != 64)
+ mlx4_dbg(dev, "Disabling CQE stride, cacheLine size unsupported\n");
dev_cap->flags2 &= ~MLX4_DEV_CAP_FLAG2_CQE_STRIDE;
dev_cap->flags2 &= ~MLX4_DEV_CAP_FLAG2_EQE_STRIDE;
}
--
1.9.3
^ permalink raw reply related
* [PATCH net-next 1/7] net/mlx4_core: Fix mpt_entry initialization in mlx4_mr_rereg_mem_write()
From: Amir Vadai @ 2015-02-03 15:57 UTC (permalink / raw)
To: David S. Miller
Cc: netdev, Amir Vadai, Or Gerlitz, Yevgeny Petrilin, Maor Gottlieb
In-Reply-To: <1422979041-25208-1-git-send-email-amirv@mellanox.com>
From: Maor Gottlieb <maorg@mellanox.com>
a) Previously, mlx4_mr_rereg_write filled the MPT's start
and length with the old MPT's values.
Fixing the initialization to take the new start and length.
b) In addition access flags in mpt_status were initialized instead of
status due to bad boolean operation. Fixing the operation.
c) Initialization of pd_slave caused a protection error.
Fix - removing this initialization.
d) In resource_tracker.c: Fixing vf encoding to be one-based.
Fixes: e630664c ('mlx4_core: Add helper functions to support MR re-registration')
Signed-off-by: Maor Gottlieb <maorg@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx4/mr.c | 13 +++++--------
drivers/net/ethernet/mellanox/mlx4/resource_tracker.c | 2 +-
2 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx4/mr.c b/drivers/net/ethernet/mellanox/mlx4/mr.c
index d21e884..78f51e1 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mr.c
+++ b/drivers/net/ethernet/mellanox/mlx4/mr.c
@@ -598,14 +598,11 @@ int mlx4_mr_rereg_mem_write(struct mlx4_dev *dev, struct mlx4_mr *mr,
if (err)
return err;
- mpt_entry->start = cpu_to_be64(mr->iova);
- mpt_entry->length = cpu_to_be64(mr->size);
- mpt_entry->entity_size = cpu_to_be32(mr->mtt.page_shift);
-
- mpt_entry->pd_flags &= cpu_to_be32(MLX4_MPT_PD_MASK |
- MLX4_MPT_PD_FLAG_EN_INV);
- mpt_entry->flags &= cpu_to_be32(MLX4_MPT_FLAG_FREE |
- MLX4_MPT_FLAG_SW_OWNS);
+ mpt_entry->start = cpu_to_be64(iova);
+ mpt_entry->length = cpu_to_be64(size);
+ mpt_entry->entity_size = cpu_to_be32(page_shift);
+ mpt_entry->flags &= ~(cpu_to_be32(MLX4_MPT_FLAG_FREE |
+ MLX4_MPT_FLAG_SW_OWNS));
if (mr->mtt.order < 0) {
mpt_entry->flags |= cpu_to_be32(MLX4_MPT_FLAG_PHYSICAL);
mpt_entry->mtt_addr = 0;
diff --git a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
index 79feeb6..628c2e8 100644
--- a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
+++ b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
@@ -2541,7 +2541,7 @@ int mlx4_SW2HW_MPT_wrapper(struct mlx4_dev *dev, int slave,
/* Make sure that the PD bits related to the slave id are zeros. */
pd = mr_get_pd(inbox->buf);
pd_slave = (pd >> 17) & 0x7f;
- if (pd_slave != 0 && pd_slave != slave) {
+ if (pd_slave != 0 && --pd_slave != slave) {
err = -EPERM;
goto ex_abort;
}
--
1.9.3
^ permalink raw reply related
* [PATCH net-next 0/7] Mellanox drivers updates Feb-03-2015
From: Amir Vadai @ 2015-02-03 15:57 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Amir Vadai, Or Gerlitz, Yevgeny Petrilin
Hi,
This patchset introduces some small bug fixes and code cleanups in mlx4_core,
mlx4_en and mlx5_core.
I am sending it in parallel to the patchset sent by Or Gerlitz today [1] because
this is the end of the time frame for 3.20. I also checked that there are no
conflicts between those two patchsets (Or's patchset is focused on the bonding
area while this on Mellanox drivers).
The patchset was applied on top of commit 7d37d0c ('net: sctp: Deletion of an
unnecessary check before the function call "kfree"')
[1] - [PATCH 00/10] Add HA and LAG support to mlx4 RoCE and SRIOV services
http://marc.info/?l=linux-netdev&m=142297582610254&w=2
Thanks,
Amir
Ido Shamay (3):
net/mlx4_en: Print page allocator information
net/mlx4_en: Adjust RX frag strides to frag sizes
net/mlx4_en: Notify TX Vlan offload change
Maor Gottlieb (2):
net/mlx4_core: Fix mpt_entry initialization in
mlx4_mr_rereg_mem_write()
net/mlx4: mlx4_config_dev_retrieval() - Initialize struct config_dev
before using
Or Gerlitz (2):
net/mlx4_core: Fix misleading debug print on CQE stride support
net/mlx5_core: Move to use hex PCI device IDs
drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 4 ++++
drivers/net/ethernet/mellanox/mlx4/en_rx.c | 9 +++++++--
drivers/net/ethernet/mellanox/mlx4/fw.c | 2 +-
drivers/net/ethernet/mellanox/mlx4/main.c | 3 ++-
drivers/net/ethernet/mellanox/mlx4/mr.c | 13 +++++--------
drivers/net/ethernet/mellanox/mlx4/resource_tracker.c | 2 +-
drivers/net/ethernet/mellanox/mlx5/core/main.c | 12 ++++++------
7 files changed, 26 insertions(+), 19 deletions(-)
--
1.9.3
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox