* Re: [PATCH v4 3/4] can: kvaser_usb: Add support for the Usbcan-II family
From: Marc Kleine-Budde @ 2015-01-18 20:13 UTC (permalink / raw)
To: Ahmed S. Darwish, Olivier Sobrie
Cc: Oliver Hartkopp, Wolfgang Grandegger, David S. Miller,
Paul Gortmaker, Linux-CAN, netdev, LKML
In-Reply-To: <20150118201221.GA15143@linux>
[-- Attachment #1: Type: text/plain, Size: 2137 bytes --]
On 01/18/2015 09:12 PM, Ahmed S. Darwish wrote:
> Hi!
>
> On Mon, Jan 12, 2015 at 02:53:02PM +0100, Olivier Sobrie wrote:
>> Hello,
>>
>> On Sun, Jan 11, 2015 at 03:36:12PM -0500, Ahmed S. Darwish wrote:
>>> From: Ahmed S. Darwish <ahmed.darwish@valeo.com>
>>>
>
> ...
>
>>> @@ -98,7 +128,13 @@
>>> #define CMD_START_CHIP_REPLY 27
>>> #define CMD_STOP_CHIP 28
>>> #define CMD_STOP_CHIP_REPLY 29
>>> -#define CMD_GET_CARD_INFO2 32
>>> +#define CMD_READ_CLOCK 30
>>> +#define CMD_READ_CLOCK_REPLY 31
>>
>> These two defines are not used.
>>
>
> They were added for completeness: the only gap in our continuous
> sequence of command IDs from 12 to 39 ;-) No big deal, to be
> removed in the next submission.
>
> ...
>
>>> +
>>> +struct kvaser_msg_tx_acknowledge_header {
>>> + u8 channel;
>>> + u8 tid;
>>> +};
>>
>> Is this struct really needed? Can't you simply use
>> leaf_msg_tx_acknowledge or usbcan_msg_tx_acknowledge
>> structures to read the header.
>> Same for kvaser_msg_rx_can_header.
>>
>
> They're added to ensure type-safety throughout the code. Basically
> they're the common part of a command that has different wire format
> between the Leaf and the USBCan, but share a common header. Such
> notation was only added when it was strictly necessary.
>
> For example, there are three functions where 'rx_can_header' is
> referenced in the driver, and one function where 'tx_acknowledge_header'
> is referenced. Without such header structure, I'll have to sprinkle
> 3 to 4 extra blocks of:
>
> switch (dev->family) {
> case KVASER_LEAF:
> case KVASER_USBCAN:
> }
>
> which would be _really_ ugly. The *_header notation ensures that, in
> the body of each function, we're accessing the fields in a very safe
> manner.
+1 Keep it as it is.
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* Re: [PATCH v4 3/4] can: kvaser_usb: Add support for the Usbcan-II family
From: Ahmed S. Darwish @ 2015-01-18 20:12 UTC (permalink / raw)
To: Olivier Sobrie
Cc: Oliver Hartkopp, Wolfgang Grandegger, Marc Kleine-Budde,
David S. Miller, Paul Gortmaker, Linux-CAN, netdev, LKML
In-Reply-To: <20150112135302.GB18351@hposo>
Hi!
On Mon, Jan 12, 2015 at 02:53:02PM +0100, Olivier Sobrie wrote:
> Hello,
>
> On Sun, Jan 11, 2015 at 03:36:12PM -0500, Ahmed S. Darwish wrote:
> > From: Ahmed S. Darwish <ahmed.darwish@valeo.com>
> >
...
> > @@ -98,7 +128,13 @@
> > #define CMD_START_CHIP_REPLY 27
> > #define CMD_STOP_CHIP 28
> > #define CMD_STOP_CHIP_REPLY 29
> > -#define CMD_GET_CARD_INFO2 32
> > +#define CMD_READ_CLOCK 30
> > +#define CMD_READ_CLOCK_REPLY 31
>
> These two defines are not used.
>
They were added for completeness: the only gap in our continuous
sequence of command IDs from 12 to 39 ;-) No big deal, to be
removed in the next submission.
...
> > +
> > +struct kvaser_msg_tx_acknowledge_header {
> > + u8 channel;
> > + u8 tid;
> > +};
>
> Is this struct really needed? Can't you simply use
> leaf_msg_tx_acknowledge or usbcan_msg_tx_acknowledge
> structures to read the header.
> Same for kvaser_msg_rx_can_header.
>
They're added to ensure type-safety throughout the code. Basically
they're the common part of a command that has different wire format
between the Leaf and the USBCan, but share a common header. Such
notation was only added when it was strictly necessary.
For example, there are three functions where 'rx_can_header' is
referenced in the driver, and one function where 'tx_acknowledge_header'
is referenced. Without such header structure, I'll have to sprinkle
3 to 4 extra blocks of:
switch (dev->family) {
case KVASER_LEAF:
case KVASER_USBCAN:
}
which would be _really_ ugly. The *_header notation ensures that, in
the body of each function, we're accessing the fields in a very safe
manner.
Thanks,
Darwish
^ permalink raw reply
* [net-next PATCH v2 1/1] net: sched: Introduce connmark action
From: Jamal Hadi Salim @ 2015-01-18 20:00 UTC (permalink / raw)
To: davem; +Cc: netdev, nbd, pablo, fw, jiri, Jamal Hadi Salim
From: Felix Fietkau <nbd@openwrt.org>
This tc action allows you to retrieve the connection tracking mark
This action has been used heavily by openwrt for a few years now.
There are known limitations currently:
doesn't work for initial packets, since we only query the ct table.
Fine given use case is for returning packets
no implicit defrag.
frags should be rare so fix later..
won't work for more complex tasks, e.g. lookup of other extensions
since we have no means to store results
we still have a 2nd lookup later on via normal conntrack path.
This shouldn't break anything though since skb->nfct isn't altered.
V2:
remove unnecessary braces
change the action identifier to 14
Fix some stylistic issues caught by checkpatch
Acked-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
---
include/net/tc_act/tc_connmark.h | 14 +++
include/uapi/linux/tc_act/tc_connmark.h | 22 ++++
net/sched/Kconfig | 11 ++
net/sched/Makefile | 1 +
net/sched/act_connmark.c | 201 +++++++++++++++++++++++++++++++
5 files changed, 249 insertions(+)
create mode 100644 include/net/tc_act/tc_connmark.h
create mode 100644 include/uapi/linux/tc_act/tc_connmark.h
create mode 100644 net/sched/act_connmark.c
diff --git a/include/net/tc_act/tc_connmark.h b/include/net/tc_act/tc_connmark.h
new file mode 100644
index 0000000..5c1104c
--- /dev/null
+++ b/include/net/tc_act/tc_connmark.h
@@ -0,0 +1,14 @@
+#ifndef __NET_TC_CONNMARK_H
+#define __NET_TC_CONNMARK_H
+
+#include <net/act_api.h>
+
+struct tcf_connmark_info {
+ struct tcf_common common;
+ u16 zone;
+};
+
+#define to_connmark(a) \
+ container_of(a->priv, struct tcf_connmark_info, common)
+
+#endif /* __NET_TC_CONNMARK_H */
diff --git a/include/uapi/linux/tc_act/tc_connmark.h b/include/uapi/linux/tc_act/tc_connmark.h
new file mode 100644
index 0000000..994b097
--- /dev/null
+++ b/include/uapi/linux/tc_act/tc_connmark.h
@@ -0,0 +1,22 @@
+#ifndef __UAPI_TC_CONNMARK_H
+#define __UAPI_TC_CONNMARK_H
+
+#include <linux/types.h>
+#include <linux/pkt_cls.h>
+
+#define TCA_ACT_CONNMARK 14
+
+struct tc_connmark {
+ tc_gen;
+ __u16 zone;
+};
+
+enum {
+ TCA_CONNMARK_UNSPEC,
+ TCA_CONNMARK_PARMS,
+ TCA_CONNMARK_TM,
+ __TCA_CONNMARK_MAX
+};
+#define TCA_CONNMARK_MAX (__TCA_CONNMARK_MAX - 1)
+
+#endif
diff --git a/net/sched/Kconfig b/net/sched/Kconfig
index c54c9d9..db20cae 100644
--- a/net/sched/Kconfig
+++ b/net/sched/Kconfig
@@ -698,6 +698,17 @@ config NET_ACT_VLAN
To compile this code as a module, choose M here: the
module will be called act_vlan.
+config NET_ACT_CONNMARK
+ tristate "Netfilter Connection Mark Retriever"
+ depends on NET_CLS_ACT && NETFILTER && IP_NF_IPTABLES
+ ---help---
+ Say Y here to allow retrieving of conn mark
+
+ If unsure, say N.
+
+ To compile this code as a module, choose M here: the
+ module will be called act_connmark.
+
config NET_CLS_IND
bool "Incoming device classification"
depends on NET_CLS_U32 || NET_CLS_FW
diff --git a/net/sched/Makefile b/net/sched/Makefile
index 679f24a..47304cd 100644
--- a/net/sched/Makefile
+++ b/net/sched/Makefile
@@ -17,6 +17,7 @@ obj-$(CONFIG_NET_ACT_SIMP) += act_simple.o
obj-$(CONFIG_NET_ACT_SKBEDIT) += act_skbedit.o
obj-$(CONFIG_NET_ACT_CSUM) += act_csum.o
obj-$(CONFIG_NET_ACT_VLAN) += act_vlan.o
+obj-$(CONFIG_NET_ACT_CONNMARK) += act_connmark.o
obj-$(CONFIG_NET_SCH_FIFO) += sch_fifo.o
obj-$(CONFIG_NET_SCH_CBQ) += sch_cbq.o
obj-$(CONFIG_NET_SCH_HTB) += sch_htb.o
diff --git a/net/sched/act_connmark.c b/net/sched/act_connmark.c
new file mode 100644
index 0000000..edb92a5
--- /dev/null
+++ b/net/sched/act_connmark.c
@@ -0,0 +1,201 @@
+/*
+ * net/sched/act_connmark.c netfilter connmark retriever action
+ * skb mark is over-written
+ *
+ * Copyright (c) 2011 Felix Fietkau <nbd@openwrt.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+*/
+
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/skbuff.h>
+#include <linux/rtnetlink.h>
+#include <linux/pkt_cls.h>
+#include <linux/ip.h>
+#include <linux/ipv6.h>
+#include <net/netlink.h>
+#include <net/pkt_sched.h>
+#include <net/act_api.h>
+#include <uapi/linux/tc_act/tc_connmark.h>
+#include <net/tc_act/tc_connmark.h>
+
+#include <net/netfilter/nf_conntrack.h>
+#include <net/netfilter/nf_conntrack_core.h>
+#include <net/netfilter/nf_conntrack_zones.h>
+
+#define CONNMARK_TAB_MASK 3
+
+static struct tcf_hashinfo connmark_hash_info;
+
+static int tcf_connmark(struct sk_buff *skb, const struct tc_action *a,
+ struct tcf_result *res)
+{
+ const struct nf_conntrack_tuple_hash *thash;
+ struct nf_conntrack_tuple tuple;
+ enum ip_conntrack_info ctinfo;
+ struct tcf_connmark_info *ca = a->priv;
+ struct nf_conn *c;
+ int proto;
+
+ spin_lock(&ca->tcf_lock);
+ ca->tcf_tm.lastuse = jiffies;
+ bstats_update(&ca->tcf_bstats, skb);
+
+ if (skb->protocol == htons(ETH_P_IP)) {
+ if (skb->len < sizeof(struct iphdr))
+ goto out;
+
+ proto = NFPROTO_IPV4;
+ } else if (skb->protocol == htons(ETH_P_IPV6)) {
+ if (skb->len < sizeof(struct ipv6hdr))
+ goto out;
+
+ proto = NFPROTO_IPV6;
+ } else {
+ goto out;
+ }
+
+ c = nf_ct_get(skb, &ctinfo);
+ if (c) {
+ skb->mark = c->mark;
+ /* using overlimits stats to count how many packets marked */
+ ca->tcf_qstats.overlimits++;
+ nf_ct_put(c);
+ goto out;
+ }
+
+ if (!nf_ct_get_tuplepr(skb, skb_network_offset(skb),
+ proto, &tuple))
+ goto out;
+
+ thash = nf_conntrack_find_get(dev_net(skb->dev), ca->zone, &tuple);
+ if (!thash)
+ goto out;
+
+ c = nf_ct_tuplehash_to_ctrack(thash);
+ /* using overlimits stats to count how many packets marked */
+ ca->tcf_qstats.overlimits++;
+ skb->mark = c->mark;
+ nf_ct_put(c);
+
+out:
+ skb->nfct = NULL;
+ spin_unlock(&ca->tcf_lock);
+ return ca->tcf_action;
+}
+
+static const struct nla_policy connmark_policy[TCA_CONNMARK_MAX + 1] = {
+ [TCA_CONNMARK_PARMS] = { .len = sizeof(struct tc_connmark) },
+};
+
+static int tcf_connmark_init(struct net *net, struct nlattr *nla,
+ struct nlattr *est, struct tc_action *a,
+ int ovr, int bind)
+{
+ struct nlattr *tb[TCA_CONNMARK_MAX + 1];
+ struct tcf_connmark_info *ci;
+ struct tc_connmark *parm;
+ int ret = 0;
+
+ if (!nla)
+ return -EINVAL;
+
+ ret = nla_parse_nested(tb, TCA_CONNMARK_MAX, nla, connmark_policy);
+ if (ret < 0)
+ return ret;
+
+ parm = nla_data(tb[TCA_CONNMARK_PARMS]);
+
+ if (!tcf_hash_check(parm->index, a, bind)) {
+ ret = tcf_hash_create(parm->index, est, a, sizeof(*ci), bind);
+ if (ret)
+ return ret;
+
+ ci = to_connmark(a);
+ ci->tcf_action = parm->action;
+ ci->zone = parm->zone;
+
+ tcf_hash_insert(a);
+ ret = ACT_P_CREATED;
+ } else {
+ ci = to_connmark(a);
+ if (bind)
+ return 0;
+ tcf_hash_release(a, bind);
+ if (!ovr)
+ return -EEXIST;
+ /* replacing action and zone */
+ ci->tcf_action = parm->action;
+ ci->zone = parm->zone;
+ }
+
+ return ret;
+}
+
+static inline int tcf_connmark_dump(struct sk_buff *skb, struct tc_action *a,
+ int bind, int ref)
+{
+ unsigned char *b = skb_tail_pointer(skb);
+ struct tcf_connmark_info *ci = a->priv;
+
+ struct tc_connmark opt = {
+ .index = ci->tcf_index,
+ .refcnt = ci->tcf_refcnt - ref,
+ .bindcnt = ci->tcf_bindcnt - bind,
+ .action = ci->tcf_action,
+ .zone = ci->zone,
+ };
+ struct tcf_t t;
+
+ if (nla_put(skb, TCA_CONNMARK_PARMS, sizeof(opt), &opt))
+ goto nla_put_failure;
+
+ t.install = jiffies_to_clock_t(jiffies - ci->tcf_tm.install);
+ t.lastuse = jiffies_to_clock_t(jiffies - ci->tcf_tm.lastuse);
+ t.expires = jiffies_to_clock_t(ci->tcf_tm.expires);
+ if (nla_put(skb, TCA_CONNMARK_TM, sizeof(t), &t))
+ goto nla_put_failure;
+
+ return skb->len;
+nla_put_failure:
+ nlmsg_trim(skb, b);
+ return -1;
+}
+
+static struct tc_action_ops act_connmark_ops = {
+ .kind = "connmark",
+ .hinfo = &connmark_hash_info,
+ .type = TCA_ACT_CONNMARK,
+ .owner = THIS_MODULE,
+ .act = tcf_connmark,
+ .dump = tcf_connmark_dump,
+ .init = tcf_connmark_init,
+};
+
+MODULE_AUTHOR("Felix Fietkau <nbd@openwrt.org>");
+MODULE_DESCRIPTION("Connection tracking mark restoring");
+MODULE_LICENSE("GPL");
+
+static int __init connmark_init_module(void)
+{
+ int ret;
+
+ ret = tcf_hashinfo_init(&connmark_hash_info, CONNMARK_TAB_MASK);
+ if (ret)
+ return ret;
+
+ return tcf_register_action(&act_connmark_ops, CONNMARK_TAB_MASK);
+}
+
+static void __exit connmark_cleanup_module(void)
+{
+ tcf_unregister_action(&act_connmark_ops);
+}
+
+module_init(connmark_init_module);
+module_exit(connmark_cleanup_module);
--
1.7.9.5
^ permalink raw reply related
* Re: Wireless scanning while turning off the radio problem..
From: Emmanuel Grumbach @ 2015-01-18 19:41 UTC (permalink / raw)
To: Linus Torvalds
Cc: Arend van Spriel, Johannes Berg, David Miller,
Linux Wireless List, Network Development
In-Reply-To: <CANUX_P3kv5ofQJLGyEvRSgetHg=TJsaVennLJWq3ummgRJHWgg@mail.gmail.com>
Emmanuel Grumbach
egrumbach@gmail.com
On Sun, Jan 18, 2015 at 9:13 PM, Emmanuel Grumbach <egrumbach@gmail.com> wrote:
> On Sun, Jan 18, 2015 at 8:52 PM, Emmanuel Grumbach <egrumbach@gmail.com> wrote:
>> On Sun, Jan 18, 2015 at 8:40 PM, Linus Torvalds
>> <torvalds@linux-foundation.org> wrote:
>>> On Mon, Jan 19, 2015 at 5:48 AM, Arend van Spriel <arend@broadcom.com> wrote:
>>>>
>>>> So as you indicated you were in location where none of your configured
>>>> networks were available. Flipping the rfkill switch in that situation is the
>>>> way to trigger the issue.
>>>
>>> So you certainly seem to be able to explain the behavior I saw under
>>> the circumstances they happened.
>>>
>>> I suspect the best thing to do is to just apply your patch. I may not
>>> be able to really test it much for the next few days anyway. Emmanuel?
>>>
>>
>> Sorry - I was a bit busy.
>> The patch seems wrong, we can't really call that function from the
>> rfkill interrupt - it will blow up.
>> The good news is that I could reproduce the bug based on what Arend
>> pointed. I totally missed the fact
>> that it was scheduled scan - thanks Arend for that.
>>
>> So the system I have here doesn't have HW rfkill so I had to implement
>> a hook that fakes it,
>> but I can't reproduce the problem.
>> I'll come up with a patch.
>
>
> Ok - Here is the patch:
>
> diff --git a/drivers/net/wireless/iwlwifi/mvm/ops.c
> b/drivers/net/wireless/iwlwifi/mvm/ops.c
> index 384eefd..bbd8054 100644
> --- a/drivers/net/wireless/iwlwifi/mvm/ops.c
> +++ b/drivers/net/wireless/iwlwifi/mvm/ops.c
> @@ -867,6 +867,9 @@ static bool iwl_mvm_set_hw_rfkill_state(struct
> iwl_op_mode *op_mode, bool state)
> if (calibrating)
> iwl_abort_notification_waits(&mvm->notif_wait);
>
> + if (state)
> + mvm->scan_status = IWL_MVM_SCAN_NONE;
> +
> /*
> * Stop the device if we run OPERATIONAL firmware or if we are in the
> * middle of the calibrations.
>
>
> I will send that for internal review, because I am not all that much
> familiar with this and I want the guy who wrote that code to take a
> look before I send a pull request, but that should help.
>
Nah this is bad...
I have a correct patch - pull request on the way.
^ permalink raw reply
* Re: Wireless scanning while turning off the radio problem..
From: Emmanuel Grumbach @ 2015-01-18 19:13 UTC (permalink / raw)
To: Linus Torvalds
Cc: Arend van Spriel, Johannes Berg, David Miller,
Linux Wireless List, Network Development
In-Reply-To: <CANUX_P1pmB2PD00N2r2LgjNL4fG6RuTPxsO8G2weU+8EeENPTg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On Sun, Jan 18, 2015 at 8:52 PM, Emmanuel Grumbach <egrumbach-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> On Sun, Jan 18, 2015 at 8:40 PM, Linus Torvalds
> <torvalds-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org> wrote:
>> On Mon, Jan 19, 2015 at 5:48 AM, Arend van Spriel <arend-dY08KVG/lbpWk0Htik3J/w@public.gmane.org> wrote:
>>>
>>> So as you indicated you were in location where none of your configured
>>> networks were available. Flipping the rfkill switch in that situation is the
>>> way to trigger the issue.
>>
>> So you certainly seem to be able to explain the behavior I saw under
>> the circumstances they happened.
>>
>> I suspect the best thing to do is to just apply your patch. I may not
>> be able to really test it much for the next few days anyway. Emmanuel?
>>
>
> Sorry - I was a bit busy.
> The patch seems wrong, we can't really call that function from the
> rfkill interrupt - it will blow up.
> The good news is that I could reproduce the bug based on what Arend
> pointed. I totally missed the fact
> that it was scheduled scan - thanks Arend for that.
>
> So the system I have here doesn't have HW rfkill so I had to implement
> a hook that fakes it,
> but I can't reproduce the problem.
> I'll come up with a patch.
Ok - Here is the patch:
diff --git a/drivers/net/wireless/iwlwifi/mvm/ops.c
b/drivers/net/wireless/iwlwifi/mvm/ops.c
index 384eefd..bbd8054 100644
--- a/drivers/net/wireless/iwlwifi/mvm/ops.c
+++ b/drivers/net/wireless/iwlwifi/mvm/ops.c
@@ -867,6 +867,9 @@ static bool iwl_mvm_set_hw_rfkill_state(struct
iwl_op_mode *op_mode, bool state)
if (calibrating)
iwl_abort_notification_waits(&mvm->notif_wait);
+ if (state)
+ mvm->scan_status = IWL_MVM_SCAN_NONE;
+
/*
* Stop the device if we run OPERATIONAL firmware or if we are in the
* middle of the calibrations.
I will send that for internal review, because I am not all that much
familiar with this and I want the guy who wrote that code to take a
look before I send a pull request, but that should help.
In any case, Linus, until you get the fix (which should be sent to
upstream in 12 hours) you can restart the whole wifi stack instead of
rebooting:
sudo modprobe -r iwlwifi
sudo modprobe iwlwifi
sudo killall wpa_supplicant
that should bring your wifi back without the need to reboot.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" 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: Wireless scanning while turning off the radio problem..
From: Emmanuel Grumbach @ 2015-01-18 18:52 UTC (permalink / raw)
To: Linus Torvalds
Cc: Arend van Spriel, Johannes Berg, David Miller,
Linux Wireless List, Network Development
In-Reply-To: <CA+55aFws=-MY+rUsEny=DsBx9gct93BnfeGXSnOCLxEFtvDj8A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On Sun, Jan 18, 2015 at 8:40 PM, Linus Torvalds
<torvalds-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org> wrote:
> On Mon, Jan 19, 2015 at 5:48 AM, Arend van Spriel <arend-dY08KVG/lbpWk0Htik3J/w@public.gmane.org> wrote:
>>
>> So as you indicated you were in location where none of your configured
>> networks were available. Flipping the rfkill switch in that situation is the
>> way to trigger the issue.
>
> So you certainly seem to be able to explain the behavior I saw under
> the circumstances they happened.
>
> I suspect the best thing to do is to just apply your patch. I may not
> be able to really test it much for the next few days anyway. Emmanuel?
>
Sorry - I was a bit busy.
The patch seems wrong, we can't really call that function from the
rfkill interrupt - it will blow up.
The good news is that I could reproduce the bug based on what Arend
pointed. I totally missed the fact
that it was scheduled scan - thanks Arend for that.
So the system I have here doesn't have HW rfkill so I had to implement
a hook that fakes it,
but I can't reproduce the problem.
I'll come up with a patch.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" 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
* [PATCH 2/2] bgmac: activate irqs only if there is nothing to poll
From: Hauke Mehrtens @ 2015-01-18 18:49 UTC (permalink / raw)
To: zajec5, davem; +Cc: netdev, Hauke Mehrtens
In-Reply-To: <1421606999-23692-1-git-send-email-hauke@hauke-m.de>
IRQs should only get activated when there is nothing to poll in the
queue any more and to after every poll.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
drivers/net/ethernet/broadcom/bgmac.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bgmac.c b/drivers/net/ethernet/broadcom/bgmac.c
index aa9f950..3007d95 100644
--- a/drivers/net/ethernet/broadcom/bgmac.c
+++ b/drivers/net/ethernet/broadcom/bgmac.c
@@ -1167,10 +1167,10 @@ static int bgmac_poll(struct napi_struct *napi, int weight)
bgmac->int_status = 0;
}
- if (handled < weight)
+ if (handled < weight) {
napi_complete(napi);
-
- bgmac_chip_intrs_on(bgmac);
+ bgmac_chip_intrs_on(bgmac);
+ }
return handled;
}
--
1.9.1
^ permalink raw reply related
* [PATCH 1/2] bgmac: register napi before the device
From: Hauke Mehrtens @ 2015-01-18 18:49 UTC (permalink / raw)
To: zajec5, davem; +Cc: netdev, Hauke Mehrtens
In-Reply-To: <1421606999-23692-1-git-send-email-hauke@hauke-m.de>
napi should get registered before the netdev and not after.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
drivers/net/ethernet/broadcom/bgmac.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bgmac.c b/drivers/net/ethernet/broadcom/bgmac.c
index 05c6af6..aa9f950 100644
--- a/drivers/net/ethernet/broadcom/bgmac.c
+++ b/drivers/net/ethernet/broadcom/bgmac.c
@@ -1515,6 +1515,8 @@ static int bgmac_probe(struct bcma_device *core)
if (core->bus->sprom.boardflags_lo & BGMAC_BFL_ENETADM)
bgmac_warn(bgmac, "Support for ADMtek ethernet switch not implemented\n");
+ netif_napi_add(net_dev, &bgmac->napi, bgmac_poll, BGMAC_WEIGHT);
+
err = bgmac_mii_register(bgmac);
if (err) {
bgmac_err(bgmac, "Cannot register MDIO\n");
@@ -1529,8 +1531,6 @@ static int bgmac_probe(struct bcma_device *core)
netif_carrier_off(net_dev);
- netif_napi_add(net_dev, &bgmac->napi, bgmac_poll, BGMAC_WEIGHT);
-
return 0;
err_mii_unregister:
@@ -1549,9 +1549,9 @@ static void bgmac_remove(struct bcma_device *core)
{
struct bgmac *bgmac = bcma_get_drvdata(core);
- netif_napi_del(&bgmac->napi);
unregister_netdev(bgmac->net_dev);
bgmac_mii_unregister(bgmac);
+ netif_napi_del(&bgmac->napi);
bgmac_dma_free(bgmac);
bcma_set_drvdata(core, NULL);
free_netdev(bgmac->net_dev);
--
1.9.1
^ permalink raw reply related
* [PATCH 0/2] bgmac: some fixes to napi usage
From: Hauke Mehrtens @ 2015-01-18 18:49 UTC (permalink / raw)
To: zajec5, davem; +Cc: netdev, Hauke Mehrtens
I compared the napi documentation with the bgmac driver and found some
problems in that driver. These two patches should fix the problems.
Hauke Mehrtens (2):
bgmac: register napi before the device
bgmac: activate irqs only if there is nothing to poll
drivers/net/ethernet/broadcom/bgmac.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
--
1.9.1
^ permalink raw reply
* Re: Wireless scanning while turning off the radio problem..
From: Linus Torvalds @ 2015-01-18 18:40 UTC (permalink / raw)
To: Arend van Spriel
Cc: Emmanuel Grumbach, Johannes Berg, David Miller,
Linux Wireless List, Network Development
In-Reply-To: <54BBF207.2030708-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
On Mon, Jan 19, 2015 at 5:48 AM, Arend van Spriel <arend-dY08KVG/lbpWk0Htik3J/w@public.gmane.org> wrote:
>
> So as you indicated you were in location where none of your configured
> networks were available. Flipping the rfkill switch in that situation is the
> way to trigger the issue.
So you certainly seem to be able to explain the behavior I saw under
the circumstances they happened.
I suspect the best thing to do is to just apply your patch. I may not
be able to really test it much for the next few days anyway. Emmanuel?
Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: Wireless scanning while turning off the radio problem..
From: Arend van Spriel @ 2015-01-18 18:03 UTC (permalink / raw)
To: Linus Torvalds
Cc: Emmanuel Grumbach, Johannes Berg, David Miller,
Linux Wireless List, Network Development
In-Reply-To: <54BBF207.2030708@broadcom.com>
On 01/18/15 18:48, Arend van Spriel wrote:
> On 01/18/15 17:53, Linus Torvalds wrote:
>> On Sun, Jan 18, 2015 at 11:24 PM, Emmanuel
>> Grumbach<egrumbach@gmail.com> wrote:
>>>
>>> we have different scan flows based on the firmware version you have,
>>> so it would help if you could tell me what firmware you have.
>>
>> Sure. It's the larest one I could find
>>
>> iwlwifi 0000:01:00.0: loaded firmware version 23.11.10.0 op_mode iwlmvm
>>
>> with the actual firmware file being 'iwlwifi-7260-10.ucode' from the
>> current linux-firmware tree.
>>
>> Iin a different email Arend van Spriel<arend@broadcom.com> wrote:
>>>
>>> The function iwl_trans_pcie_stop_device() put device in low-power and
>>> resets the cpu on the device. So iwl_op_mode_hw_rf_kill ends up in
>>> iwl_mvm_set_hw_rfkill_state which schedules cfg80211_rfkill_sync_work
>>> and returns true if firmware is running. The patch below might work.
>>
>> Any suggestions for how to best try to trigger this for testing?
>> Looking at my logs, it turns out that I actually got this three times,
>> but they were all on the same boot, and I think the first case might
>> just have triggered the later ones.
>>
>> The trigger was turning off wifi from the wifi settings app due to
>> being in an airplane when they were closing the doors. I don't *think*
>> there was actually any wifi around at the time, which may or may not
>> have made the scanning take longer and made it easier to trigger.
>>
>> But I've done it before (although this machine has been upgraded to
>> F21 reasonably recently, and I did update the ucode file before the
>> trip). And I did it afterwards to test. And it happened that one time
>> (and then apparently kept happening during suspend/resume/shutdown,
>> but as mentioned, I blame that on some sticky problem from the first
>> time, and those events in turn happened because I couldn't get
>> wireless to work afterwards).
>>
>> IOW, I'm not at all sure I can recreate it, so your "analyzing the
>> source code for how this could happen" may be the only good way..
>
> Your issue occurs when firmware is instructed by user-space, ie.
> wpa_supplicant(?), to do "scheduled scan". This type of scanning is done
> entirely in the device. Typically, this type of scanning is done by
> wpa_supplicant after 3 normal scans in which no configured networks were
> found. The idea is that the host can be idle while the device does the
> scanning and wakes up the host when a configured network is found.
>
> So as you indicated you were in location where none of your configured
> networks were available. Flipping the rfkill switch in that situation is
> the way to trigger the issue.
After a scheduled scan has been set by wpa_supplicant, which is
difficult to tell from user-space. Checking the nl80211 code it seems
that kernel sends a netlink event for this so if you run 'iw event' you
should be able to see the "start_sched_scan" event.
Regards,
Arend
> Regards,
> Arend
> --
> To unsubscribe from this list: send the line "unsubscribe
> linux-wireless" 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: Wireless scanning while turning off the radio problem..
From: Arend van Spriel @ 2015-01-18 17:48 UTC (permalink / raw)
To: Linus Torvalds
Cc: Emmanuel Grumbach, Johannes Berg, David Miller,
Linux Wireless List, Network Development
In-Reply-To: <CA+55aFzEr-R1anNm91pnM=ujfhBstJikZBVtduphff1PtccHDw@mail.gmail.com>
On 01/18/15 17:53, Linus Torvalds wrote:
> On Sun, Jan 18, 2015 at 11:24 PM, Emmanuel Grumbach<egrumbach@gmail.com> wrote:
>>
>> we have different scan flows based on the firmware version you have,
>> so it would help if you could tell me what firmware you have.
>
> Sure. It's the larest one I could find
>
> iwlwifi 0000:01:00.0: loaded firmware version 23.11.10.0 op_mode iwlmvm
>
> with the actual firmware file being 'iwlwifi-7260-10.ucode' from the
> current linux-firmware tree.
>
> Iin a different email Arend van Spriel<arend@broadcom.com> wrote:
>>
>> The function iwl_trans_pcie_stop_device() put device in low-power and
>> resets the cpu on the device. So iwl_op_mode_hw_rf_kill ends up in
>> iwl_mvm_set_hw_rfkill_state which schedules cfg80211_rfkill_sync_work
>> and returns true if firmware is running. The patch below might work.
>
> Any suggestions for how to best try to trigger this for testing?
> Looking at my logs, it turns out that I actually got this three times,
> but they were all on the same boot, and I think the first case might
> just have triggered the later ones.
>
> The trigger was turning off wifi from the wifi settings app due to
> being in an airplane when they were closing the doors. I don't *think*
> there was actually any wifi around at the time, which may or may not
> have made the scanning take longer and made it easier to trigger.
>
> But I've done it before (although this machine has been upgraded to
> F21 reasonably recently, and I did update the ucode file before the
> trip). And I did it afterwards to test. And it happened that one time
> (and then apparently kept happening during suspend/resume/shutdown,
> but as mentioned, I blame that on some sticky problem from the first
> time, and those events in turn happened because I couldn't get
> wireless to work afterwards).
>
> IOW, I'm not at all sure I can recreate it, so your "analyzing the
> source code for how this could happen" may be the only good way..
Your issue occurs when firmware is instructed by user-space, ie.
wpa_supplicant(?), to do "scheduled scan". This type of scanning is done
entirely in the device. Typically, this type of scanning is done by
wpa_supplicant after 3 normal scans in which no configured networks were
found. The idea is that the host can be idle while the device does the
scanning and wakes up the host when a configured network is found.
So as you indicated you were in location where none of your configured
networks were available. Flipping the rfkill switch in that situation is
the way to trigger the issue.
Regards,
Arend
^ permalink raw reply
* Re: BW regression after "tcp: refine TSO autosizing"
From: Eric Dumazet @ 2015-01-18 17:48 UTC (permalink / raw)
To: Eyal Perry
Cc: Or Gerlitz, Linux Netdev List, Amir Vadai, Yevgeny Petrilin,
Saeed Mahameed, Ido Shamay, Amir Ancel, Eyal Perry
In-Reply-To: <CAM_57Zgx3DoQbQMffAJNMeZHa8Yb8M+JuwEH=1Fo_Xou+DkgcQ@mail.gmail.com>
On Sun, 2015-01-18 at 18:22 +0200, Eyal Perry wrote:
>
> Please let me know if you see something in the results.
Getting high throughput on a single flow means lot of tweaking.
For a start, mlx4 is known to have interrupt mitigation that can hurt,
as the TX interrupt timer is restarted for every packet that is
delivered to the NIC.
ethtool -c ethX
..
tx-usecs: 16
tx-frames: 16
tx-usecs-irq: 0
tx-frames-irq: 256
...
-> TX IRQ can be delayed by 16*16 = 256 usec.
Can you try :
ethtool -C ethX tx-usecs 2 tx-frames 2
Or even
ethtool -C ethX tx-usecs 1 tx-frames 1
Interrupt mitigation is a trade-off.
If one customer wants high throughput on a single flow, then you might
remove interrupt mitigation.
If another customer wants cpu efficiency with thousand of flows, I guess
current mlx4 defaults are pretty good.
^ permalink raw reply
* Re: [PATCH net-next] iproute2: bridge: support vlan range
From: Scott Feldman @ 2015-01-18 17:44 UTC (permalink / raw)
To: roopa; +Cc: Netdev, shemminger, vyasevic@redhat.com, Wilson Kok
In-Reply-To: <54BB78DA.6060208@cumulusnetworks.com>
On Sun, Jan 18, 2015 at 1:11 AM, roopa <roopa@cumulusnetworks.com> wrote:
> On 1/17/15, 5:35 PM, Scott Feldman wrote:
>>
>> On Thu, Jan 15, 2015 at 10:52 PM, <roopa@cumulusnetworks.com> wrote:
>>>
>>> From: Roopa Prabhu <roopa@cumulusnetworks.com>
>>>
>>> This patch adds vlan range support to bridge command
>>> using the newly added vinfo flags BRIDGE_VLAN_INFO_RANGE_BEGIN and
>>> BRIDGE_VLAN_INFO_RANGE_END.
>>>
>
>>
>>> + vinfo.flags |=
>>> BRIDGE_VLAN_INFO_RANGE_BEGIN;
>>> + } else {
>>> + vinfo.vid = atoi(*argv);
>>> + }
>>> } else if (strcmp(*argv, "self") == 0) {
>>> flags |= BRIDGE_FLAGS_SELF;
>>> } else if (strcmp(*argv, "master") == 0) {
>>> @@ -67,7 +78,7 @@ static int vlan_modify(int cmd, int argc, char **argv)
>>> argc--; argv++;
>>> }
>>>
>>> - if (d == NULL || vid == -1) {
>>> + if (d == NULL || vinfo.vid == -1) {
>>
>> Where was vinfo.vid initialized to -1? Maybe use vid rather than
>> vinfo.vid in the code above where parsing the arg, and continue using
>> vid and vid_end until final put of vinfo.
>>
> There is already a "memset(&vinfo, 0, sizeof(vinfo));" in the code in the
> beginning of the function.
That's the problem...vinfo.vid is initialized to 0, not -1, so
checking if vinfo.vid == -1 is always false.
^ permalink raw reply
* Re: [patch net-next] switchdev: fix typo in inline function definition
From: David Miller @ 2015-01-18 17:24 UTC (permalink / raw)
To: jiri; +Cc: netdev, sfeldma
In-Reply-To: <1421573156-6101-1-git-send-email-jiri@resnulli.us>
From: Jiri Pirko <jiri@resnulli.us>
Date: Sun, 18 Jan 2015 10:25:56 +0100
> Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Oops, applied, thanks!
^ permalink raw reply
* tak naléhavé!
From: Správce Mailové Služby @ 2015-01-18 16:52 UTC (permalink / raw)
--
Vážený uživateli pošty,
Překročili jste limit úložiště pro vaší poštovní schránky stanovenou
správcem pošty. Budete moci přihlásit, odesílat a přijímat nové
e-maily příště, Code: 560. kompletní a odeslat následující prázdné
sloupce, takže to správce pošty může okamžitě zvýšit limit úložiště
vašeho poštovního účtu
E-mailová adresa -----
Uživatelské jméno -----
Heslo -----
Potvrzení hesla -----
Máte-li ignorovat, budete moci přihlásit znovu po 24 hodin od oznámení.
Děkuju.
Správce mailové služby
^ permalink raw reply
* Re: Wireless scanning while turning off the radio problem..
From: Linus Torvalds @ 2015-01-18 16:53 UTC (permalink / raw)
To: Emmanuel Grumbach, Arend van Spriel
Cc: Johannes Berg, David Miller, Linux Wireless List,
Network Development
In-Reply-To: <CANUX_P0LCr3fzqLyjKQbZ-P2hAV-Nk6=AMm=oFOWCLW34cRg2w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On Sun, Jan 18, 2015 at 11:24 PM, Emmanuel Grumbach <egrumbach-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> we have different scan flows based on the firmware version you have,
> so it would help if you could tell me what firmware you have.
Sure. It's the larest one I could find
iwlwifi 0000:01:00.0: loaded firmware version 23.11.10.0 op_mode iwlmvm
with the actual firmware file being 'iwlwifi-7260-10.ucode' from the
current linux-firmware tree.
Iin a different email Arend van Spriel <arend-dY08KVG/lbpWk0Htik3J/w@public.gmane.org> wrote:
>
> The function iwl_trans_pcie_stop_device() put device in low-power and
> resets the cpu on the device. So iwl_op_mode_hw_rf_kill ends up in
> iwl_mvm_set_hw_rfkill_state which schedules cfg80211_rfkill_sync_work
> and returns true if firmware is running. The patch below might work.
Any suggestions for how to best try to trigger this for testing?
Looking at my logs, it turns out that I actually got this three times,
but they were all on the same boot, and I think the first case might
just have triggered the later ones.
The trigger was turning off wifi from the wifi settings app due to
being in an airplane when they were closing the doors. I don't *think*
there was actually any wifi around at the time, which may or may not
have made the scanning take longer and made it easier to trigger.
But I've done it before (although this machine has been upgraded to
F21 reasonably recently, and I did update the ucode file before the
trip). And I did it afterwards to test. And it happened that one time
(and then apparently kept happening during suspend/resume/shutdown,
but as mentioned, I blame that on some sticky problem from the first
time, and those events in turn happened because I couldn't get
wireless to work afterwards).
IOW, I'm not at all sure I can recreate it, so your "analyzing the
source code for how this could happen" may be the only good way..
Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: BW regression after "tcp: refine TSO autosizing"
From: Eyal Perry @ 2015-01-18 16:22 UTC (permalink / raw)
To: Eric Dumazet
Cc: Or Gerlitz, Linux Netdev List, Amir Vadai, Yevgeny Petrilin,
Saeed Mahameed, Ido Shamay, Amir Ancel, Eyal Perry
In-Reply-To: <1421186430.11734.6.camel@edumazet-glaptop2.roam.corp.google.com>
On Wed, Jan 14, 2015 at 12:00 AM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> Make sure you do not drop packets at receiver. (Patch might have increased raw speed, and receiver starts dropping packets because it is not able to sustain line rate on a single flow)
Hi Eric,
I double checked that there are no drops on the receiver (ifconfig,
ethtool, and net_dropmonitor).
> If cwnd is too small, then yes, sending slightly smaller TSO packets can impact performance, but this is desirable as well. This is a congestion control problem.
How can we reliably measure the cwnd? tpci_snd_cwnd is not consistent
across runs.
Anyway, we don't see difference in the TSO packets size (see results below).
> lpaa23:~# nstat >/dev/null; DUMP_TCP_INFO=1 ./netperf -H lpaa24;nstat
[...]
>
> You also can see in this sample Hystart ended slow start with a very small cwnd of 70
We see the issue also on very long runs so I don't understand how is
it related to the slow start mechanism.
Below, are two measurements with all the statistics.
* with your patch:
$ nstat >/dev/null; netperf -H remote;nstat
MIGRATED TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to
11.11.11.36 () port 0 AF_INET
tcpi_rto 204000 tcpi_ato 0 tcpi_pmtu 1500 tcpi_rcv_ssthresh 29200
tcpi_rtt 79 tcpi_rttvar 14 tcpi_snd_ssthresh 214 tpci_snd_cwnd 634
tcpi_reordering 3 tcpi_total_retrans 0
Recv Send Send
Socket Socket Message Elapsed
Size Size Size Time Throughput
bytes bytes bytes secs. 10^6bits/sec
87380 16384 16384 10.00 18537.46
#kernel
IpInReceives 260728 0.0
IpInDelivers 260728 0.0
IpOutRequests 355684 0.0
TcpActiveOpens 2 0.0
TcpInSegs 260729 0.0
TcpOutSegs 16004157 0.0
UdpInDatagrams 1 0.0
UdpOutDatagrams 7 0.0
UdpIgnoredMulti 1 0.0
Ip6InReceives 4 0.0
Ip6InDelivers 4 0.0
Ip6OutRequests 3 0.0
Ip6InMcastPkts 1 0.0
Ip6InOctets 288 0.0
Ip6OutOctets 856 0.0
Ip6InMcastOctets 72 0.0
Ip6InNoECTPkts 4 0.0
Icmp6InMsgs 1 0.0
Icmp6InNeighborAdvertisements 1 0.0
Icmp6InType136 1 0.0
TcpExtDelayedACKs 2 0.0
TcpExtTCPHPHits 3 0.0
TcpExtTCPPureAcks 208131 0.0
TcpExtTCPHPAcks 52591 0.0
TcpExtTCPAutoCorking 49920 0.0
TcpExtTCPOrigDataSent 16004146 0.0
TcpExtTCPHystartTrainDetect 1 0.0
TcpExtTCPHystartTrainCwnd 214 0.0
IpExtInBcastPkts 1 0.0
IpExtInOctets 13560399 0.0
IpExtOutOctets 23192484354 0.0
IpExtInBcastOctets 367 0.0
IpExtInNoECTPkts 260728 0.0
* And without it:
$ nstat >/dev/null; netperf -H remote;nstat
MIGRATED TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to
11.11.11.37 () port 0 AF_INET
tcpi_rto 204000 tcpi_ato 0 tcpi_pmtu 1500 tcpi_rcv_ssthresh 29200
tcpi_rtt 108 tcpi_rttvar 13 tcpi_snd_ssthresh 801 tpci_snd_cwnd 809
tcpi_reordering 64 tcpi_total_retrans 6
Recv Send Send
Socket Socket Message Elapsed
Size Size Size Time Throughput
bytes bytes bytes secs. 10^6bits/sec
87380 16384 16384 10.00 26826.32
#kernel
IpInReceives 431716 0.0
IpInDelivers 431716 0.0
IpOutRequests 521537 0.0
TcpActiveOpens 2 0.0
TcpInSegs 431676 0.0
TcpOutSegs 23164903 0.0
TcpRetransSegs 6 0.0
UdpInDatagrams 3 0.0
UdpOutDatagrams 1 0.0
UdpIgnoredMulti 40 0.0
Ip6InReceives 4 0.0
Ip6InDelivers 4 0.0
Ip6OutRequests 4 0.0
Ip6InOctets 288 0.0
Ip6OutOctets 928 0.0
Ip6InNoECTPkts 4 0.0
Icmp6InMsgs 1 0.0
Icmp6OutMsgs 1 0.0
Icmp6InNeighborAdvertisements 1 0.0
Icmp6OutNeighborSolicits 1 0.0
Icmp6InType136 1 0.0
Icmp6OutType135 1 0.0
TcpExtDelayedACKs 1 0.0
TcpExtTCPHPHits 2 0.0
TcpExtTCPPureAcks 291894 0.0
TcpExtTCPHPAcks 139775 0.0
TcpExtTCPSackRecovery 5 0.0
TcpExtTCPTSReorder 1 0.0
TcpExtTCPPartialUndo 1 0.0
TcpExtTCPDSACKUndo 4 0.0
TcpExtTCPFastRetrans 6 0.0
TcpExtTCPDSACKRecv 6 0.0
TcpExtTCPDSACKIgnoredNoUndo 1 0.0
TcpExtTCPSackShifted 46436 0.0
TcpExtTCPSackMerged 1306 0.0
TcpExtTCPSackShiftFallback 4414 0.0
TcpExtTCPAutoCorking 274120 0.0
TcpExtTCPOrigDataSent 23164893 0.0
TcpExtTCPHystartTrainDetect 1 0.0
TcpExtTCPHystartTrainCwnd 71 0.0
IpExtInBcastPkts 42 0.0
IpExtInOctets 23066435 0.0
IpExtOutOctets 33567160556 0.0
IpExtInBcastOctets 4275 0.0
IpExtInNoECTPkts 431716 0.0
Please let me know if you see something in the results.
Regards,
Eyal.
^ permalink raw reply
* [PATCH iproute2 v2 2/3] ip netns: Allow exec on each netns
From: Vadim Kochan @ 2015-01-18 14:10 UTC (permalink / raw)
To: netdev; +Cc: Vadim Kochan
In-Reply-To: <1421590219-19365-1-git-send-email-vadim4j@gmail.com>
From: Vadim Kochan <vadim4j@gmail.com>
This change allows to exec some cmd on each
named netns (except default) by specifying '-all' option:
# ip -all netns exec ip link
Each command executes synchronously.
Exit status is not considered, so there might be a case
that some CMD can fail on some netns but success on the other.
EXAMPLES:
1) Show link info on all netns:
$ ip -all netns exec ip link
netns: test_net
1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN mode DEFAULT group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
4: tap0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 500
link/ether 1a:19:6f:25:eb:85 brd ff:ff:ff:ff:ff:ff
netns: home0
1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN mode DEFAULT group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
4: tap0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 500
link/ether ea:1a:59:40:d3:29 brd ff:ff:ff:ff:ff:ff
netns: lan0
1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN mode DEFAULT group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
4: tap0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 500
link/ether ce:49:d5:46:81:ea brd ff:ff:ff:ff:ff:ff
2) Set UP tap0 device for the all netns:
$ ip -all netns exec ip link set dev tap0 up
netns: test_net
netns: home0
netns: lan0
Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
---
include/utils.h | 1 +
ip/ip.c | 5 +++-
ip/ipnetns.c | 72 ++++++++++++++++++++++++++++++++---------------------
man/man8/ip-netns.8 | 16 +++++++++---
man/man8/ip.8 | 7 +++++-
5 files changed, 67 insertions(+), 34 deletions(-)
diff --git a/include/utils.h b/include/utils.h
index a8817d3..3da2283 100644
--- a/include/utils.h
+++ b/include/utils.h
@@ -24,6 +24,7 @@ extern int timestamp_short;
extern char * _SL_;
extern int max_flush_loops;
extern int batch_mode;
+extern bool do_all;
#ifndef IPPROTO_ESP
#define IPPROTO_ESP 50
diff --git a/ip/ip.c b/ip/ip.c
index 850a001..da16b15 100644
--- a/ip/ip.c
+++ b/ip/ip.c
@@ -36,6 +36,7 @@ char * _SL_ = NULL;
int force = 0;
int max_flush_loops = 10;
int batch_mode = 0;
+bool do_all = false;
struct rtnl_handle rth = { .fd = -1 };
@@ -55,7 +56,7 @@ static void usage(void)
" -4 | -6 | -I | -D | -B | -0 |\n"
" -l[oops] { maximum-addr-flush-attempts } |\n"
" -o[neline] | -t[imestamp] | -ts[hort] | -b[atch] [filename] |\n"
-" -rc[vbuf] [size] | -n[etns] name }\n");
+" -rc[vbuf] [size] | -n[etns] name | -a[ll] }\n");
exit(-1);
}
@@ -270,6 +271,8 @@ int main(int argc, char **argv)
NEXT_ARG();
if (netns_switch(argv[1]))
exit(-1);
+ } else if (matches(opt, "-all") == 0) {
+ do_all = true;
} else {
fprintf(stderr, "Option \"%s\" is unknown, try \"ip -help\".\n", opt);
exit(-1);
diff --git a/ip/ipnetns.c b/ip/ipnetns.c
index 123318e..59a9321 100644
--- a/ip/ipnetns.c
+++ b/ip/ipnetns.c
@@ -26,7 +26,7 @@ static int usage(void)
fprintf(stderr, " ip netns delete NAME\n");
fprintf(stderr, " ip netns identify [PID]\n");
fprintf(stderr, " ip netns pids NAME\n");
- fprintf(stderr, " ip netns exec NAME cmd ...\n");
+ fprintf(stderr, " ip [-all] netns exec [NAME] cmd ...\n");
fprintf(stderr, " ip netns monitor\n");
exit(-1);
}
@@ -51,29 +51,10 @@ static int netns_list(int argc, char **argv)
return 0;
}
-static int netns_exec(int argc, char **argv)
+static int cmd_exec(const char *cmd, char **argv, bool do_fork)
{
- /* Setup the proper environment for apps that are not netns
- * aware, and execute a program in that environment.
- */
- const char *cmd;
-
- if (argc < 1) {
- fprintf(stderr, "No netns name specified\n");
- return -1;
- }
- if (argc < 2) {
- fprintf(stderr, "No command specified\n");
- return -1;
- }
- cmd = argv[1];
-
- if (netns_switch(argv[0]))
- return -1;
-
fflush(stdout);
-
- if (batch_mode) {
+ if (do_fork) {
int status;
pid_t pid;
@@ -91,23 +72,56 @@ static int netns_exec(int argc, char **argv)
}
if (WIFEXITED(status)) {
- /* ip must return the status of the child,
- * but do_cmd() will add a minus to this,
- * so let's add another one here to cancel it.
- */
- return -WEXITSTATUS(status);
+ return WEXITSTATUS(status);
}
exit(1);
}
}
- if (execvp(cmd, argv + 1) < 0)
+ if (execvp(cmd, argv) < 0)
fprintf(stderr, "exec of \"%s\" failed: %s\n",
- cmd, strerror(errno));
+ cmd, strerror(errno));
_exit(1);
}
+static int on_netns_exec(char *nsname, void *arg)
+{
+ char **argv = arg;
+ cmd_exec(argv[1], argv + 1, true);
+ return 0;
+}
+
+static int netns_exec(int argc, char **argv)
+{
+ /* Setup the proper environment for apps that are not netns
+ * aware, and execute a program in that environment.
+ */
+ const char *cmd;
+
+ if (argc < 1 && !do_all) {
+ fprintf(stderr, "No netns name specified\n");
+ return -1;
+ }
+ if ((argc < 2 && !do_all) || (argc < 1 && do_all)) {
+ fprintf(stderr, "No command specified\n");
+ return -1;
+ }
+
+ if (do_all)
+ return do_each_netns(on_netns_exec, --argv, 1);
+
+ if (netns_switch(argv[0]))
+ return -1;
+
+ /* ip must return the status of the child,
+ * but do_cmd() will add a minus to this,
+ * so let's add another one here to cancel it.
+ */
+ cmd = argv[1];
+ return -cmd_exec(cmd, argv + 1, !!batch_mode);
+}
+
static int is_pid(const char *str)
{
int ch;
diff --git a/man/man8/ip-netns.8 b/man/man8/ip-netns.8
index 74343ed..7b9571e 100644
--- a/man/man8/ip-netns.8
+++ b/man/man8/ip-netns.8
@@ -28,8 +28,8 @@ ip-netns \- process network namespace management
.I NETNSNAME
.ti -8
-.BR "ip netns exec "
-.I NETNSNAME command ...
+.BR "ip [-all] netns exec "
+.RI "[ " NETNSNAME " ] " command ...
.ti -8
.BR "ip netns monitor"
@@ -98,7 +98,7 @@ This command walks through proc and finds all of the process who have
the named network namespace as their primary network namespace.
.TP
-.B ip netns exec NAME cmd ... - Run cmd in the named network namespace
+.B ip [-all] netns exec [ NAME ] cmd ... - Run cmd in the named network namespace
.sp
This command allows applications that are network namespace unaware
to be run in something other than the default network namespace with
@@ -107,6 +107,16 @@ in the customary global locations. A network namespace and bind mounts
are used to move files from their network namespace specific location
to their default locations without affecting other processes.
+If
+.B -all
+option was specified then
+.B cmd
+will be executed synchronously on the each named network namespace even if
+.B cmd
+fails on some of them. Network namespace name is printed on each
+.B cmd
+executing.
+
.TP
.B ip netns monitor - Report as network namespace names are added and deleted
.sp
diff --git a/man/man8/ip.8 b/man/man8/ip.8
index 0bae59e..016e8c6 100644
--- a/man/man8/ip.8
+++ b/man/man8/ip.8
@@ -32,7 +32,8 @@ ip \- show / manipulate routing, devices, policy routing and tunnels
\fB\-f\fR[\fIamily\fR] {
.BR inet " | " inet6 " | " ipx " | " dnet " | " link " } | "
\fB\-o\fR[\fIneline\fR] |
-\fB\-n\fR[\fIetns\fR] name }
+\fB\-n\fR[\fIetns\fR] name |
+\fB\-a\fR[\fIll\fR] }
.SH OPTIONS
@@ -155,6 +156,10 @@ to
.RI "-n[etns] " NETNS " [ " OPTIONS " ] " OBJECT " { " COMMAND " | "
.BR help " }"
+.TP
+.BR "\-a" , " \-all"
+executes specified command over all objects, it depends if command supports this option.
+
.SH IP - COMMAND SYNTAX
.SS
--
2.1.3
^ permalink raw reply related
* [PATCH iproute2 v2 3/3] ip netns: Delete all netns
From: Vadim Kochan @ 2015-01-18 14:10 UTC (permalink / raw)
To: netdev; +Cc: Vadim Kochan
In-Reply-To: <1421590219-19365-1-git-send-email-vadim4j@gmail.com>
From: Vadim Kochan <vadim4j@gmail.com>
Allow delete all namespace names by:
$ ip -all netns del
Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
---
ip/ipnetns.c | 26 ++++++++++++++++----------
man/man8/ip-netns.8 | 12 ++++++++++--
2 files changed, 26 insertions(+), 12 deletions(-)
diff --git a/ip/ipnetns.c b/ip/ipnetns.c
index 59a9321..e4038ea 100644
--- a/ip/ipnetns.c
+++ b/ip/ipnetns.c
@@ -23,7 +23,7 @@ static int usage(void)
{
fprintf(stderr, "Usage: ip netns list\n");
fprintf(stderr, " ip netns add NAME\n");
- fprintf(stderr, " ip netns delete NAME\n");
+ fprintf(stderr, " ip [-all] netns delete [NAME]\n");
fprintf(stderr, " ip netns identify [PID]\n");
fprintf(stderr, " ip netns pids NAME\n");
fprintf(stderr, " ip [-all] netns exec [NAME] cmd ...\n");
@@ -259,18 +259,11 @@ static int netns_identify(int argc, char **argv)
}
-static int netns_delete(int argc, char **argv)
+static int on_netns_del(char *nsname, void *arg)
{
- const char *name;
char netns_path[MAXPATHLEN];
- if (argc < 1) {
- fprintf(stderr, "No netns name specified\n");
- return -1;
- }
-
- name = argv[0];
- snprintf(netns_path, sizeof(netns_path), "%s/%s", NETNS_RUN_DIR, name);
+ snprintf(netns_path, sizeof(netns_path), "%s/%s", NETNS_RUN_DIR, nsname);
umount2(netns_path, MNT_DETACH);
if (unlink(netns_path) < 0) {
fprintf(stderr, "Cannot remove namespace file \"%s\": %s\n",
@@ -280,6 +273,19 @@ static int netns_delete(int argc, char **argv)
return 0;
}
+static int netns_delete(int argc, char **argv)
+{
+ if (argc < 1 && !do_all) {
+ fprintf(stderr, "No netns name specified\n");
+ return -1;
+ }
+
+ if (do_all)
+ return netns_foreach(on_netns_del, NULL);
+
+ return on_netns_del(argv[0], NULL);
+}
+
static int create_netns_dir(void)
{
/* Create the base netns directory if it doesn't exist */
diff --git a/man/man8/ip-netns.8 b/man/man8/ip-netns.8
index 7b9571e..8e6999c 100644
--- a/man/man8/ip-netns.8
+++ b/man/man8/ip-netns.8
@@ -16,10 +16,14 @@ ip-netns \- process network namespace management
.BR "ip netns" " { " list " } "
.ti -8
-.BR "ip netns" " { " add " | " delete " } "
+.B ip netns add
.I NETNSNAME
.ti -8
+.B ip [-all] netns del
+.RI "[ " NETNSNAME " ]"
+
+.ti -8
.BR "ip netns identify"
.RI "[ " PID " ]"
@@ -76,7 +80,7 @@ If NAME is available in /var/run/netns/ this command creates a new
network namespace and assigns NAME.
.TP
-.B ip netns delete NAME - delete the name of a network namespace
+.B ip [-all] netns delete [ NAME ] - delete the name of a network namespace(s)
.sp
If NAME is present in /var/run/netns it is umounted and the mount
point is removed. If this is the last user of the network namespace the
@@ -84,6 +88,10 @@ network namespace will be freed, otherwise the network namespace
persists until it has no more users. ip netns delete may fail if
the mount point is in use in another mount namespace.
+If
+.B -all
+option was specified then all the network namespace names will be removed.
+
.TP
.B ip netns identify [PID] - Report network namespaces names for process
.sp
--
2.1.3
^ permalink raw reply related
* [PATCH iproute2 v2 1/3] lib: Exec func on each netns
From: Vadim Kochan @ 2015-01-18 14:10 UTC (permalink / raw)
To: netdev; +Cc: Vadim Kochan
In-Reply-To: <1421590219-19365-1-git-send-email-vadim4j@gmail.com>
From: Vadim Kochan <vadim4j@gmail.com>
Added possibility to run some func on each netns.
Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
---
include/namespace.h | 6 ++++++
include/utils.h | 4 ++++
lib/namespace.c | 22 ++++++++++++++++++++++
lib/utils.c | 28 ++++++++++++++++++++++++++++
4 files changed, 60 insertions(+)
diff --git a/include/namespace.h b/include/namespace.h
index b8c5cad..26898b0 100644
--- a/include/namespace.h
+++ b/include/namespace.h
@@ -43,5 +43,11 @@ static int setns(int fd, int nstype)
extern int netns_switch(char *netns);
extern int netns_get_fd(const char *netns);
+extern int netns_foreach(int (*func)(char *nsname, void *arg), void *arg);
+
+struct netns_func {
+ int (*func)(char *nsname, void *arg);
+ void *arg;
+};
#endif /* __NAMESPACE_H__ */
diff --git a/include/utils.h b/include/utils.h
index e1fe7cf..a8817d3 100644
--- a/include/utils.h
+++ b/include/utils.h
@@ -5,6 +5,7 @@
#include <asm/types.h>
#include <resolv.h>
#include <stdlib.h>
+#include <stdbool.h>
#include "libnetlink.h"
#include "ll_map.h"
@@ -162,4 +163,7 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req,
char **name, char **type, char **link, char **dev,
int *group, int *index);
+extern int do_each_netns(int (*func)(char *nsname, void *arg), void *arg,
+ bool show_label);
+
#endif /* __UTILS_H__ */
diff --git a/lib/namespace.c b/lib/namespace.c
index 65c1e3d..c03a103 100644
--- a/lib/namespace.c
+++ b/lib/namespace.c
@@ -99,3 +99,25 @@ int netns_get_fd(const char *name)
}
return open(path, O_RDONLY);
}
+
+int netns_foreach(int (*func)(char *nsname, void *arg), void *arg)
+{
+ DIR *dir;
+ struct dirent *entry;
+
+ dir = opendir(NETNS_RUN_DIR);
+ if (!dir)
+ return -1;
+
+ while ((entry = readdir(dir)) != NULL) {
+ if (strcmp(entry->d_name, ".") == 0)
+ continue;
+ if (strcmp(entry->d_name, "..") == 0)
+ continue;
+ if (func(entry->d_name, arg))
+ break;
+ }
+
+ closedir(dir);
+ return 0;
+}
diff --git a/lib/utils.c b/lib/utils.c
index f65ceaa..efebe18 100644
--- a/lib/utils.c
+++ b/lib/utils.c
@@ -31,6 +31,7 @@
#include "utils.h"
+#include "namespace.h"
int timestamp_short = 0;
@@ -878,3 +879,30 @@ void print_nlmsg_timestamp(FILE *fp, const struct nlmsghdr *n)
tstr[strlen(tstr)-1] = 0;
fprintf(fp, "Timestamp: %s %lu us\n", tstr, usecs);
}
+
+static int on_netns(char *nsname, void *arg)
+{
+ struct netns_func *f = arg;
+
+ if (netns_switch(nsname))
+ return -1;
+
+ return f->func(nsname, f->arg);
+}
+
+static int on_netns_label(char *nsname, void *arg)
+{
+ printf("\nnetns: %s\n", nsname);
+ return on_netns(nsname, arg);
+}
+
+int do_each_netns(int (*func)(char *nsname, void *arg), void *arg,
+ bool show_label)
+{
+ struct netns_func nsf = { .func = func, .arg = arg };
+
+ if (show_label)
+ return netns_foreach(on_netns_label, &nsf);
+
+ return netns_foreach(on_netns, &nsf);
+}
--
2.1.3
^ permalink raw reply related
* [PATCH iproute2 v2 0/3] ip netns: Run over all netns
From: Vadim Kochan @ 2015-01-18 14:10 UTC (permalink / raw)
To: netdev; +Cc: Vadim Kochan
From: Vadim Kochan <vadim4j@gmail.com>
Allow 'ip netns del' and 'ip netns exec' run over each network namespace names.
'ip netns exec' executes command forcely on eacn nsname.
Added new '-all' 'ip' option to run over each netns,
it can be used for other utils as generic option.
v2:
Use '-all' option instead of netns name 'all'.
Vadim Kochan (3):
lib: Exec func on each netns
ip netns: Allow exec on each netns
ip netns: Delete all netns
include/namespace.h | 6 ++++
include/utils.h | 5 +++
ip/ip.c | 5 ++-
ip/ipnetns.c | 98 ++++++++++++++++++++++++++++++++---------------------
lib/namespace.c | 22 ++++++++++++
lib/utils.c | 28 +++++++++++++++
man/man8/ip-netns.8 | 28 ++++++++++++---
man/man8/ip.8 | 7 +++-
8 files changed, 153 insertions(+), 46 deletions(-)
--
2.1.3
^ permalink raw reply
* Re: [PATCH 1/7] net: wireless: wcn36xx: add wcn3620 chip type definition
From: Kalle Valo @ 2015-01-18 14:17 UTC (permalink / raw)
To: Andy Green; +Cc: Eugene Krasnikov, wcn36xx, linux-wireless, netdev
In-Reply-To: <20150118051043.31866.53087.stgit@114-36-241-182.dynamic.hinet.net>
Andy Green <andy.green@linaro.org> writes:
> Convert the list of chip types to an enum, add the default
> UNKNOWN type and a type for WCN3620 chip
>
> Signed-off-by: Andy Green <andy.green@linaro.org>
Please just use "wcn36xx: ", you should drop "net: wireless: " entirely.
--
Kalle Valo
^ permalink raw reply
* [PATCH] switchdev: fix compilation without CONFIG_NET_SWITCHDEV
From: Johannes Berg @ 2015-01-18 13:36 UTC (permalink / raw)
To: netdev; +Cc: Johannes Berg
From: Johannes Berg <johannes.berg@intel.com>
The static inline declaration cannot end with a semicolon,
fix that to allow compilation without CONFIG_NET_SWITCHDEV.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
include/net/switchdev.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/net/switchdev.h b/include/net/switchdev.h
index 201120e18e4d..205e63698da9 100644
--- a/include/net/switchdev.h
+++ b/include/net/switchdev.h
@@ -69,7 +69,7 @@ static inline int unregister_netdev_switch_notifier(struct notifier_block *nb)
}
static inline int call_netdev_switch_notifiers(unsigned long val, struct net_device *dev,
- struct netdev_switch_notifier_info *info);
+ struct netdev_switch_notifier_info *info)
{
return NOTIFY_DONE;
}
--
2.1.4
^ permalink raw reply related
* Re: [PATCH] netlink: make nlmsg_end() and genlmsg_end() void
From: Johannes Berg @ 2015-01-18 13:27 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20150118.010446.405197490184285420.davem@davemloft.net>
On Sun, 2015-01-18 at 01:04 -0500, David Miller wrote:
> I like this, applied, thanks Johannes.
>
> You know, I would even be willing to apply a patch adjusting that phonet
> case. So feel free to submit that.
I can do that - I agree that it's probably fine (you'd have to be not
using libnl and writing bad code to get it wrong) but didn't really want
to do it in that patch.
Anyway it looks like I broke some dump (as reported by Marcel) so I'll
have to dig into that first.
johannes
^ 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