* [PATCH v2 2/2 -net-next] ravb: Add missing free_irq() calls to ravb_close()
From: Geert Uytterhoeven @ 2016-05-07 11:17 UTC (permalink / raw)
To: David S. Miller, Sergei Shtylyov
Cc: Yoshihiro Kaneko, Simon Horman, netdev, linux-renesas-soc,
Geert Uytterhoeven
In-Reply-To: <1462619832-5177-1-git-send-email-geert+renesas@glider.be>
When reopening the network device on ra7795/salvator-x, e.g. after a
DHCP timeout:
IP-Config: Reopening network devices...
genirq: Flags mismatch irq 139. 00000000 (eth0:ch24:emac) vs. 00000000 (
ravb e6800000.ethernet eth0: cannot request IRQ eth0:ch24:emac
IP-Config: Failed to open eth0
IP-Config: No network devices available
The "mismatch" is due to requesting an IRQ that is already in use,
while IRQF_PROBE_SHARED wasn't set.
However, the real cause is that ravb_close() doesn't release any of the
R-Car Gen3-specific secondary IRQs.
Add the missing free_irq() calls to fix this.
Fixes: 22d4df8ff3a3cc72 ("ravb: Add support for r8a7795 SoC")
Fixes: f51bdc236b6c5835 ("ravb: Add dma queue interrupt support")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
This version is against net-next.git.
v2:
- Clearly state which version this patch is against,
- Add Fixes tags.
---
drivers/net/ethernet/renesas/ravb_main.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
index 34066e0649f5c673..867caf6e7a5a65ad 100644
--- a/drivers/net/ethernet/renesas/ravb_main.c
+++ b/drivers/net/ethernet/renesas/ravb_main.c
@@ -1667,6 +1667,13 @@ static int ravb_close(struct net_device *ndev)
priv->phydev = NULL;
}
+ if (priv->chip_id != RCAR_GEN2) {
+ free_irq(priv->tx_irqs[RAVB_NC], ndev);
+ free_irq(priv->rx_irqs[RAVB_NC], ndev);
+ free_irq(priv->tx_irqs[RAVB_BE], ndev);
+ free_irq(priv->rx_irqs[RAVB_BE], ndev);
+ free_irq(priv->emac_irq, ndev);
+ }
free_irq(ndev->irq, ndev);
napi_disable(&priv->napi[RAVB_NC]);
--
1.9.1
^ permalink raw reply related
* Re: [PATCH 1/2] net: phy: add ethtool_phy_{get|set}_link_ksettings
From: Ben Hutchings @ 2016-05-07 11:59 UTC (permalink / raw)
To: Philippe Reynes, f.fainelli, fugang.duan, davem; +Cc: netdev, linux-kernel
In-Reply-To: <1462576729-5932-1-git-send-email-tremyfr@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 867 bytes --]
On Sat, 2016-05-07 at 01:18 +0200, Philippe Reynes wrote:
> The callback {get|set}_link_ksettings are often defined
> in a very close way. There are mainly two differences in
> those callback:
> - the name of the netdev private structure
> - the name of the struct phydev in the private structure
>
> We add two defines ethtool_phy_{get|set}_link_ksettings
> to avoid writing severals times almost the same function.
[...]
I don't think there's no need to access a private structure, as there's
a phydev pointer in struct net_device. If some drivers don't maintain
that pointer, they should be changed to do so. Then they can
use generic implementations of {get,set}_link_ksettings provided by
phylib.
Ben.
--
Ben Hutchings
Editing code like this is akin to sticking plasters on the bleeding stump
of a severed limb. - me, 29 June 1999
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* Re: [PATCH net-next 5/7] Driver: Vmxnet3: Add support for get_coalesce, set_coalesce ethtool operations
From: Ben Hutchings @ 2016-05-07 12:04 UTC (permalink / raw)
To: Shrikrishna Khare, netdev, linux-kernel, pv-drivers
Cc: Keyong Sun, Manoj Tammali
In-Reply-To: <1462576336-83513-6-git-send-email-skhare@vmware.com>
[-- Attachment #1: Type: text/plain, Size: 1080 bytes --]
On Fri, 2016-05-06 at 16:12 -0700, Shrikrishna Khare wrote:
[...]
> +static int
> +vmxnet3_set_coalesce(struct net_device *netdev, struct ethtool_coalesce *ec)
> +{
[...]
> + switch (ec->rx_coalesce_usecs) {
> + case VMXNET3_COALESCE_DEFAULT:
> + case VMXNET3_COALESCE_DISABLED:
> + case VMXNET3_COALESCE_ADAPT:
> + if (ec->tx_max_coalesced_frames ||
> + ec->tx_max_coalesced_frames_irq ||
> + ec->rx_max_coalesced_frames_irq) {
> + return -EINVAL;
> + }
> + memset(adapter->coal_conf, 0, sizeof(*adapter->coal_conf));
> + adapter->coal_conf->coalMode = ec->rx_coalesce_usecs;
> + break;
> + case VMXNET3_COALESCE_STATIC:
[...]
I don't want to see drivers introducing magic values for fields that
are denominated in microseconds (especially not for 0, which is the
correct way to specify 'no coalescing'). If the current
ethtool_coalesce structure is inadequate, propose an extension.
Ben.
--
Ben Hutchings
Editing code like this is akin to sticking plasters on the bleeding stump
of a severed limb. - me, 29 June 1999
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* Re: [PATCH net-next] net: make sch_handle_ingress() drop monitor ready
From: Jamal Hadi Salim @ 2016-05-07 13:09 UTC (permalink / raw)
To: Eric Dumazet, David Miller; +Cc: netdev
In-Reply-To: <1462575350.13075.60.camel@edumazet-glaptop3.roam.corp.google.com>
On 16-05-06 06:55 PM, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@google.com>
>
> TC_ACT_STOLEN is used when ingress traffic is mirred/redirected
> to say ifb.
>
> Packet is not dropped, but consumed.
>
> Only TC_ACT_SHOT is a clear indication something went wrong.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
cheers,
jamal
^ permalink raw reply
* Re: [iproute2 PATCH v3 1/1] tc: introduce IFE action
From: Jamal Hadi Salim @ 2016-05-07 13:11 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev, phil
In-Reply-To: <571E0D68.1050106@mojatatu.com>
On 16-04-25 08:28 AM, Jamal Hadi Salim wrote:
> On 16-04-22 01:00 PM, Stephen Hemminger wrote:
>> On Thu, 21 Apr 2016 17:40:14 -0400
>
>>
>> All header files for iproute2 (in include/linux) should come from
>> santized kernel
>> headers. I do not see the file tc_ife.h in include/uapi/linux in
>> current net-next
>> kernel source tree.
>>
>
> I am assuming based on your other email this is taken care of?
your patch didnt make it. I have time - will take care of this.
cheers,
jamal
^ permalink raw reply
* [net-next PATCH 1/1] export tc ife uapi header
From: Jamal Hadi Salim @ 2016-05-07 13:19 UTC (permalink / raw)
To: davem; +Cc: netdev, stephen, Jamal Hadi Salim
From: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
---
include/uapi/linux/tc_act/Kbuild | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/uapi/linux/tc_act/Kbuild b/include/uapi/linux/tc_act/Kbuild
index 242cf0c..e3969bd 100644
--- a/include/uapi/linux/tc_act/Kbuild
+++ b/include/uapi/linux/tc_act/Kbuild
@@ -10,3 +10,4 @@ header-y += tc_skbedit.h
header-y += tc_vlan.h
header-y += tc_bpf.h
header-y += tc_connmark.h
+header-y += tc_ife.h
--
1.9.1
^ permalink raw reply related
* [iproute2 PATCH v4 1/1] tc: introduce IFE action
From: Jamal Hadi Salim @ 2016-05-07 13:35 UTC (permalink / raw)
To: stephen; +Cc: netdev, Jamal Hadi Salim
From: Jamal Hadi Salim <jhs@mojatatu.com>
This action allows for a sending side to encapsulate arbitrary metadata
which is decapsulated by the receiving end.
The sender runs in encoding mode and the receiver in decode mode.
Both sender and receiver must specify the same ethertype.
At some point we hope to have a registered ethertype and we'll
then provide a default so the user doesnt have to specify it.
For now we enforce the user specify it.
Described in netdev01 paper:
"Distributing Linux Traffic Control Classifier-Action Subsystem"
Authors: Jamal Hadi Salim and Damascene M. Joachimpillai
Also refer to IETF draft-ietf-forces-interfelfb-04.txt
Lets show example usage where we encode icmp from a sender towards
a receiver with an skbmark of 17; both sender and receiver use
ethertype of 0xdead to interop.
YYYY: Lets start with Receiver-side policy config:
xxx: add an ingress qdisc
sudo tc qdisc add dev $ETH ingress
xxx: any packets with ethertype 0xdead will be subjected to ife decoding
xxx: we then restart the classification so we can match on icmp at prio 3
sudo $TC filter add dev $ETH parent ffff: prio 2 protocol 0xdead \
u32 match u32 0 0 flowid 1:1 \
action ife decode reclassify
xxx: on restarting the classification from above if it was an icmp
xxx: packet, then match it here and continue to the next rule at prio 4
xxx: which will match based on skb mark of 17
sudo tc filter add dev $ETH parent ffff: prio 3 protocol ip \
u32 match ip protocol 1 0xff flowid 1:1 \
action continue
xxx: match on skbmark of 0x11 (decimal 17) and accept
sudo tc filter add dev $ETH parent ffff: prio 4 protocol ip \
handle 0x11 fw flowid 1:1 \
action ok
xxx: Lets show the decoding policy
sudo tc -s filter ls dev $ETH parent ffff: protocol 0xdead
xxx:
filter pref 2 u32
filter pref 2 u32 fh 800: ht divisor 1
filter pref 2 u32 fh 800::800 order 2048 key ht 800 bkt 0 flowid 1:1 (rule hit 0 success 0)
match 00000000/00000000 at 0 (success 0 )
action order 1: ife decode action reclassify type 0x0
allow mark allow prio
index 11 ref 1 bind 1 installed 45 sec used 45 sec
Action statistics:
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
xxx:
Observe that above lists all metadatum it can decode. Typically these
submodules will already be compiled into a monolithic kernel or
loaded as modules
YYYY: Lets show the sender side now ..
xxx: Add an egress qdisc on the sender netdev
sudo tc qdisc add dev $ETH root handle 1: prio
xxx:
xxx: Match all icmp packets to 192.168.122.237/24, then
xxx: tag the packet with skb mark of decimal 17, then
xxx: Encode it with:
xxx: ethertype 0xdead
xxx: add skb->mark to whitelist of metadatum to send
xxx: rewrite target dst MAC address to 02:15:15:15:15:15
xxx:
sudo $TC filter add dev $ETH parent 1: protocol ip prio 10 u32 \
match ip dst 192.168.122.237/24 \
match ip protocol 1 0xff \
flowid 1:2 \
action skbedit mark 17 \
action ife encode \
type 0xDEAD \
allow mark \
dst 02:15:15:15:15:15
xxx: Lets show the encoding policy
filter pref 10 u32
filter pref 10 u32 fh 800: ht divisor 1
filter pref 10 u32 fh 800::800 order 2048 key ht 800 bkt 0 flowid 1:2 (rule hit 118 success 0)
match c0a87a00/ffffff00 at 16 (success 0 )
match 00010000/00ff0000 at 8 (success 0 )
action order 1: skbedit mark 17
index 11 ref 1 bind 1 installed 3 sec used 3 sec
Action statistics:
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
action order 2: ife encode action pipe type 0xDEAD
allow mark dst 02:15:15:15:15:15
index 12 ref 1 bind 1 installed 3 sec used 3 sec
Action statistics:
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
xxx:
Now test by sending ping from sender to destination
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
---
tc/Makefile | 1 +
tc/m_ife.c | 341 ++++++++++++++++++++++++++++++++++++++++++
4 files changed, 418 insertions(+)
create mode 100644 include/linux/tc_act/tc_ife.h
create mode 100644 include/linux/tc_ife.h
create mode 100644 tc/m_ife.c
diff --git a/tc/Makefile b/tc/Makefile
index f5bea87..20f5110 100644
--- a/tc/Makefile
+++ b/tc/Makefile
@@ -43,6 +43,7 @@ TCMODULES += m_gact.o
TCMODULES += m_mirred.o
TCMODULES += m_nat.o
TCMODULES += m_pedit.o
+TCMODULES += m_ife.o
TCMODULES += m_skbedit.o
TCMODULES += m_csum.o
TCMODULES += m_simple.o
diff --git a/tc/m_ife.c b/tc/m_ife.c
new file mode 100644
index 0000000..839e370
--- /dev/null
+++ b/tc/m_ife.c
@@ -0,0 +1,341 @@
+/*
+ * m_ife.c IFE actions module
+ *
+ * This program is free software; you can distribute 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.
+ *
+ * Authors: J Hadi Salim (jhs@mojatatu.com)
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <syslog.h>
+#include <fcntl.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <string.h>
+#include <linux/netdevice.h>
+
+#include "rt_names.h"
+#include "utils.h"
+#include "tc_util.h"
+#include <linux/tc_act/tc_ife.h>
+
+static void ife_explain(void)
+{
+ fprintf(stderr,
+ "Usage:... ife {decode|encode} {ALLOW|USE} [dst DMAC] [src SMAC] [type TYPE] [CONTROL] [index INDEX]\n");
+ fprintf(stderr,
+ "\tALLOW := Encode direction. Allows encoding specified metadata\n"
+ "\t\t e.g \"allow mark\"\n"
+ "\tUSE := Encode direction. Enforce Static encoding of specified metadata\n"
+ "\t\t e.g \"use mark 0x12\"\n"
+ "\tDMAC := 6 byte Destination MAC address to encode\n"
+ "\tSMAC := optional 6 byte Source MAC address to encode\n"
+ "\tTYPE := optional 16 bit ethertype to encode\n"
+ "\tCONTROL := reclassify|pipe|drop|continue|ok\n"
+ "\tINDEX := optional IFE table index value used\n");
+ fprintf(stderr, "encode is used for sending IFE packets\n");
+ fprintf(stderr, "decode is used for receiving IFE packets\n");
+}
+
+static void ife_usage(void)
+{
+ ife_explain();
+ exit(-1);
+}
+
+static int parse_ife(struct action_util *a, int *argc_p, char ***argv_p,
+ int tca_id, struct nlmsghdr *n)
+{
+ int argc = *argc_p;
+ char **argv = *argv_p;
+ int ok = 0;
+ struct tc_ife p;
+ struct rtattr *tail;
+ struct rtattr *tail2;
+ char dbuf[ETH_ALEN];
+ char sbuf[ETH_ALEN];
+ __u16 ife_type = 0;
+ __u32 ife_prio = 0;
+ __u32 ife_prio_v = 0;
+ __u32 ife_mark = 0;
+ __u32 ife_mark_v = 0;
+ char *daddr = NULL;
+ char *saddr = NULL;
+
+ memset(&p, 0, sizeof(p));
+ p.action = TC_ACT_PIPE; /* good default */
+
+ if (argc <= 0)
+ return -1;
+
+ while (argc > 0) {
+ if (matches(*argv, "ife") == 0) {
+ NEXT_ARG();
+ continue;
+ } else if (matches(*argv, "decode") == 0) {
+ p.flags = IFE_DECODE; /* readability aid */
+ ok++;
+ } else if (matches(*argv, "encode") == 0) {
+ p.flags = IFE_ENCODE;
+ ok++;
+ } else if (matches(*argv, "allow") == 0) {
+ NEXT_ARG();
+ if (matches(*argv, "mark") == 0) {
+ ife_mark = IFE_META_SKBMARK;
+ } else if (matches(*argv, "prio") == 0) {
+ ife_prio = IFE_META_PRIO;
+ } else {
+ fprintf(stderr, "Illegal meta define <%s>\n",
+ *argv);
+ return -1;
+ }
+ } else if (matches(*argv, "use") == 0) {
+ NEXT_ARG();
+ if (matches(*argv, "mark") == 0) {
+ NEXT_ARG();
+ if (get_u32(&ife_mark_v, *argv, 0))
+ invarg("ife mark val is invalid",
+ *argv);
+ } else if (matches(*argv, "prio") == 0) {
+ NEXT_ARG();
+ if (get_u32(&ife_prio_v, *argv, 0))
+ invarg("ife prio val is invalid",
+ *argv);
+ } else {
+ fprintf(stderr, "Illegal meta use type <%s>\n",
+ *argv);
+ return -1;
+ }
+ } else if (matches(*argv, "type") == 0) {
+ NEXT_ARG();
+ if (get_u16(&ife_type, *argv, 0))
+ invarg("ife type is invalid", *argv);
+ fprintf(stderr, "IFE type 0x%x\n", ife_type);
+ } else if (matches(*argv, "dst") == 0) {
+ NEXT_ARG();
+ daddr = *argv;
+ if (sscanf(daddr, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx",
+ dbuf, dbuf + 1, dbuf + 2,
+ dbuf + 3, dbuf + 4, dbuf + 5) != 6) {
+ fprintf(stderr, "Invalid mac address %s\n",
+ daddr);
+ }
+ fprintf(stderr, "dst MAC address <%s>\n", daddr);
+
+ } else if (matches(*argv, "src") == 0) {
+ NEXT_ARG();
+ saddr = *argv;
+ if (sscanf(saddr, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx",
+ sbuf, sbuf + 1, sbuf + 2,
+ sbuf + 3, sbuf + 4, sbuf + 5) != 6) {
+ fprintf(stderr, "Invalid mac address %s\n",
+ saddr);
+ }
+ fprintf(stderr, "src MAC address <%s>\n", saddr);
+ } else if (matches(*argv, "help") == 0) {
+ ife_usage();
+ } else {
+ break;
+ }
+
+ argc--;
+ argv++;
+ }
+
+ if (argc) {
+ if (matches(*argv, "reclassify") == 0) {
+ p.action = TC_ACT_RECLASSIFY;
+ argc--;
+ argv++;
+ } else if (matches(*argv, "pipe") == 0) {
+ p.action = TC_ACT_PIPE;
+ argc--;
+ argv++;
+ } else if (matches(*argv, "drop") == 0 ||
+ matches(*argv, "shot") == 0) {
+ p.action = TC_ACT_SHOT;
+ argc--;
+ argv++;
+ } else if (matches(*argv, "continue") == 0) {
+ p.action = TC_ACT_UNSPEC;
+ argc--;
+ argv++;
+ } else if (matches(*argv, "pass") == 0) {
+ p.action = TC_ACT_OK;
+ argc--;
+ argv++;
+ }
+ }
+
+ if (argc) {
+ if (matches(*argv, "index") == 0) {
+ NEXT_ARG();
+ if (get_u32(&p.index, *argv, 10)) {
+ fprintf(stderr, "ife: Illegal \"index\"\n");
+ return -1;
+ }
+ argc--;
+ argv++;
+ }
+ }
+
+ if (!ok) {
+ fprintf(stderr, "IFE requires decode/encode specified\n");
+ ife_usage();
+ }
+
+ tail = NLMSG_TAIL(n);
+ addattr_l(n, MAX_MSG, tca_id, NULL, 0);
+ addattr_l(n, MAX_MSG, TCA_IFE_PARMS, &p, sizeof(p));
+
+ if (!(p.flags & IFE_ENCODE))
+ goto skip_encode;
+
+ if (daddr)
+ addattr_l(n, MAX_MSG, TCA_IFE_DMAC, dbuf, ETH_ALEN);
+ if (ife_type)
+ addattr_l(n, MAX_MSG, TCA_IFE_TYPE, &ife_type, 2);
+ if (saddr)
+ addattr_l(n, MAX_MSG, TCA_IFE_SMAC, sbuf, ETH_ALEN);
+
+ tail2 = NLMSG_TAIL(n);
+ addattr_l(n, MAX_MSG, TCA_IFE_METALST, NULL, 0);
+ if (ife_mark || ife_mark_v) {
+ if (ife_mark_v)
+ addattr_l(n, MAX_MSG, IFE_META_SKBMARK, &ife_mark_v, 4);
+ else
+ addattr_l(n, MAX_MSG, IFE_META_SKBMARK, NULL, 0);
+ }
+ if (ife_prio || ife_prio_v) {
+ if (ife_prio_v)
+ addattr_l(n, MAX_MSG, IFE_META_PRIO, &ife_prio_v, 4);
+ else
+ addattr_l(n, MAX_MSG, IFE_META_PRIO, NULL, 0);
+ }
+
+ tail2->rta_len = (void *)NLMSG_TAIL(n) - (void *)tail2;
+
+skip_encode:
+ tail->rta_len = (void *)NLMSG_TAIL(n) - (void *)tail;
+
+ *argc_p = argc;
+ *argv_p = argv;
+ return 0;
+}
+
+static int print_ife(struct action_util *au, FILE *f, struct rtattr *arg)
+{
+ struct tc_ife *p = NULL;
+ struct rtattr *tb[TCA_IFE_MAX + 1];
+ __u16 ife_type = 0;
+ __u32 mmark = 0;
+ __u32 mhash = 0;
+ __u32 mprio = 0;
+ int has_optional = 0;
+ SPRINT_BUF(b1);
+ SPRINT_BUF(b2);
+
+ if (arg == NULL)
+ return -1;
+
+ parse_rtattr_nested(tb, TCA_IFE_MAX, arg);
+
+ if (tb[TCA_IFE_PARMS] == NULL) {
+ fprintf(f, "[NULL ife parameters]");
+ return -1;
+ }
+ p = RTA_DATA(tb[TCA_IFE_PARMS]);
+
+ fprintf(f, "ife %s action %s ",
+ (p->flags & IFE_ENCODE) ? "encode" : "decode",
+ action_n2a(p->action, b1, sizeof(b1)));
+
+ if (tb[TCA_IFE_TYPE]) {
+ ife_type = rta_getattr_u16(tb[TCA_IFE_TYPE]);
+ has_optional = 1;
+ fprintf(f, "type 0x%X ", ife_type);
+ }
+
+ if (has_optional)
+ fprintf(f, "\n\t ");
+
+ if (tb[TCA_IFE_METALST]) {
+ struct rtattr *metalist[IFE_META_MAX + 1];
+ int len = 0;
+
+ parse_rtattr_nested(metalist, IFE_META_MAX,
+ tb[TCA_IFE_METALST]);
+
+ if (metalist[IFE_META_SKBMARK]) {
+ len = RTA_PAYLOAD(metalist[IFE_META_SKBMARK]);
+ if (len) {
+ mmark = rta_getattr_u32(metalist[IFE_META_SKBMARK]);
+ fprintf(f, "use mark %d ", mmark);
+ } else
+ fprintf(f, "allow mark ");
+ }
+
+ if (metalist[IFE_META_HASHID]) {
+ len = RTA_PAYLOAD(metalist[IFE_META_HASHID]);
+ if (len) {
+ mhash = rta_getattr_u32(metalist[IFE_META_HASHID]);
+ fprintf(f, "use hash %d ", mhash);
+ } else
+ fprintf(f, "allow hash ");
+ }
+
+ if (metalist[IFE_META_PRIO]) {
+ len = RTA_PAYLOAD(metalist[IFE_META_PRIO]);
+ if (len) {
+ mprio = rta_getattr_u32(metalist[IFE_META_PRIO]);
+ fprintf(f, "use prio %d ", mprio);
+ } else
+ fprintf(f, "allow prio ");
+ }
+
+ }
+
+ if (tb[TCA_IFE_DMAC]) {
+ has_optional = 1;
+ fprintf(f, "dst %s ",
+ ll_addr_n2a(RTA_DATA(tb[TCA_IFE_DMAC]),
+ RTA_PAYLOAD(tb[TCA_IFE_DMAC]), 0, b2,
+ sizeof(b2)));
+
+ }
+
+ if (tb[TCA_IFE_SMAC]) {
+ has_optional = 1;
+ fprintf(f, "src %s ",
+ ll_addr_n2a(RTA_DATA(tb[TCA_IFE_SMAC]),
+ RTA_PAYLOAD(tb[TCA_IFE_SMAC]), 0, b2,
+ sizeof(b2)));
+ }
+
+ fprintf(f, "\n\t index %d ref %d bind %d", p->index, p->refcnt,
+ p->bindcnt);
+ if (show_stats) {
+ if (tb[TCA_IFE_TM]) {
+ struct tcf_t *tm = RTA_DATA(tb[TCA_IFE_TM]);
+
+ print_tm(f, tm);
+ }
+ }
+
+ fprintf(f, "\n");
+
+ return 0;
+}
+
+struct action_util ife_action_util = {
+ .id = "ife",
+ .parse_aopt = parse_ife,
+ .print_aopt = print_ife,
+};
--
1.9.1
^ permalink raw reply related
* [iproute2 PATCH 1/1] tc: don't ignore ok as an action branch
From: Jamal Hadi Salim @ 2016-05-07 13:39 UTC (permalink / raw)
To: stephen; +Cc: phil, netdev, Jamal Hadi Salim
From: Jamal Hadi Salim <jhs@mojatatu.com>
This is what used to happen before:
tc filter add dev tap1 parent ffff: protocol 0xfefe prio 10 \
u32 match u32 0 0 flowid 1:16 \
action ife decode allow mark ok
tc -s filter ls dev tap1 parent ffff:
filter protocol [65278] pref 10 u32
filter protocol [65278] pref 10 u32 fh 800: ht divisor 1
filter protocol [65278] pref 10 u32 fh 800::800 order 2048 key ht 800
bkt 0 flowid 1:16
match 00000000/00000000 at 0
action order 1: ife decode action pipe
index 2 ref 1 bind 1 installed 4 sec used 4 sec
type: 0x0
Metadata: allow mark
Action statistics:
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
action order 2: gact action pass
random type none pass val 0
index 1 ref 1 bind 1 installed 4 sec used 4 sec
Action statistics:
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
Note the extra action added at the end..
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
---
tc/m_connmark.c | 3 ++-
tc/m_csum.c | 3 ++-
tc/m_ife.c | 3 ++-
tc/m_mirred.c | 3 ++-
tc/m_nat.c | 3 ++-
tc/m_pedit.c | 3 ++-
tc/m_skbedit.c | 3 ++-
tc/m_vlan.c | 3 ++-
8 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/tc/m_connmark.c b/tc/m_connmark.c
index b1c7d3a..143d75d 100644
--- a/tc/m_connmark.c
+++ b/tc/m_connmark.c
@@ -99,7 +99,8 @@ parse_connmark(struct action_util *a, int *argc_p, char ***argv_p, int tca_id,
sel.action = TC_ACT_UNSPEC;
argc--;
argv++;
- } else if (matches(*argv, "pass") == 0) {
+ } else if (matches(*argv, "pass") == 0 ||
+ matches(*argv, "ok") == 0) {
sel.action = TC_ACT_OK;
argc--;
argv++;
diff --git a/tc/m_csum.c b/tc/m_csum.c
index 36181fa..fb1183a 100644
--- a/tc/m_csum.c
+++ b/tc/m_csum.c
@@ -140,7 +140,8 @@ parse_csum(struct action_util *a, int *argc_p,
sel.action = TC_ACT_UNSPEC;
argc--;
argv++;
- } else if (matches(*argv, "pass") == 0) {
+ } else if (matches(*argv, "pass") == 0 ||
+ matches(*argv, "ok") == 0) {
sel.action = TC_ACT_OK;
argc--;
argv++;
diff --git a/tc/m_ife.c b/tc/m_ife.c
index 839e370..ed01ff7 100644
--- a/tc/m_ife.c
+++ b/tc/m_ife.c
@@ -167,7 +167,8 @@ static int parse_ife(struct action_util *a, int *argc_p, char ***argv_p,
p.action = TC_ACT_UNSPEC;
argc--;
argv++;
- } else if (matches(*argv, "pass") == 0) {
+ } else if (matches(*argv, "pass") == 0 ||
+ matches(*argv, "ok") == 0) {
p.action = TC_ACT_OK;
argc--;
argv++;
diff --git a/tc/m_mirred.c b/tc/m_mirred.c
index e7e69df..64aad4d 100644
--- a/tc/m_mirred.c
+++ b/tc/m_mirred.c
@@ -172,7 +172,8 @@ parse_egress(struct action_util *a, int *argc_p, char ***argv_p,
} else if (matches(*argv, "continue") == 0) {
p.action = TC_POLICE_UNSPEC;
NEXT_ARG();
- } else if (matches(*argv, "pass") == 0) {
+ } else if (matches(*argv, "pass") == 0 ||
+ matches(*argv, "ok") == 0) {
p.action = TC_POLICE_OK;
NEXT_ARG();
}
diff --git a/tc/m_nat.c b/tc/m_nat.c
index 4b90121..4d1b1ed 100644
--- a/tc/m_nat.c
+++ b/tc/m_nat.c
@@ -135,7 +135,8 @@ parse_nat(struct action_util *a, int *argc_p, char ***argv_p, int tca_id, struct
sel.action = TC_ACT_UNSPEC;
argc--;
argv++;
- } else if (matches(*argv, "pass") == 0) {
+ } else if (matches(*argv, "pass") == 0 ||
+ matches(*argv, "ok") == 0) {
sel.action = TC_ACT_OK;
argc--;
argv++;
diff --git a/tc/m_pedit.c b/tc/m_pedit.c
index 2a94dfb..a539b68 100644
--- a/tc/m_pedit.c
+++ b/tc/m_pedit.c
@@ -495,7 +495,8 @@ parse_pedit(struct action_util *a, int *argc_p, char ***argv_p, int tca_id, stru
} else if (matches(*argv, "continue") == 0) {
sel.sel.action = TC_ACT_UNSPEC;
NEXT_ARG();
- } else if (matches(*argv, "pass") == 0) {
+ } else if (matches(*argv, "pass") == 0 ||
+ matches(*argv, "ok") == 0) {
sel.sel.action = TC_ACT_OK;
NEXT_ARG();
}
diff --git a/tc/m_skbedit.c b/tc/m_skbedit.c
index 180b9cb..9ba288c 100644
--- a/tc/m_skbedit.c
+++ b/tc/m_skbedit.c
@@ -114,7 +114,8 @@ parse_skbedit(struct action_util *a, int *argc_p, char ***argv_p, int tca_id,
} else if (matches(*argv, "continue") == 0) {
sel.action = TC_ACT_UNSPEC;
NEXT_ARG();
- } else if (matches(*argv, "pass") == 0) {
+ } else if (matches(*argv, "pass") == 0 ||
+ matches(*argv, "ok") == 0) {
sel.action = TC_ACT_OK;
NEXT_ARG();
}
diff --git a/tc/m_vlan.c b/tc/m_vlan.c
index 3233d20..c268446 100644
--- a/tc/m_vlan.c
+++ b/tc/m_vlan.c
@@ -119,7 +119,8 @@ static int parse_vlan(struct action_util *a, int *argc_p, char ***argv_p,
parm.action = TC_ACT_UNSPEC;
argc--;
argv++;
- } else if (matches(*argv, "pass") == 0) {
+ } else if (matches(*argv, "pass") == 0 ||
+ matches(*argv, "ok") == 0) {
parm.action = TC_ACT_OK;
argc--;
argv++;
--
1.9.1
^ permalink raw reply related
* Re: [PATCH net-next v2 1/2] net: l3mdev: Add hook in ip and ipv6
From: David Ahern @ 2016-05-07 14:50 UTC (permalink / raw)
To: Shmulik Ladkani; +Cc: netdev
In-Reply-To: <20160507113025.67c3ab43@halley>
On 5/7/16 2:30 AM, Shmulik Ladkani wrote:
> Hi David,
>
> On Fri, 6 May 2016 18:49:40 -0700 David Ahern <dsa@cumulusnetworks.com> wrote:
>> +static bool ipv6_ndisc_frame(const struct sk_buff *skb)
>> +{
>> + const struct ipv6hdr *ipv6h = (struct ipv6hdr *)skb->data;
>> + size_t hlen = sizeof(*ipv6h);
>> + bool rc = false;
>> +
>> + if (ipv6h->nexthdr == NEXTHDR_ICMP) {
>> + const struct icmp6hdr *icmph;
>> +
>> + if (skb->len < hlen + sizeof(*icmph))
>> + goto out;
>> +
>> + icmph = (struct icmp6hdr *)(skb->data + sizeof(*ipv6h));
>> + switch (icmph->icmp6_type) {
>
> Don't we need an additional pskb_may_pull here?
>
> If I get it right, 'ipv6_rcv' only assures sizeof(ipv6hdr) to be in the
> linear header (unless it's a NEXTHDR_HOP, which is not the case here).
yes, I inadvertently dropped this:
commit 65c38aa653c14df49e19faad74bd375f36e61c57
Author: David Ahern <dsa@cumulusnetworks.com>
Date: Tue Feb 23 10:10:26 2016 -0800
net: vrf: Remove direct access to skb->data
when I forward ported this patch. Will fix and re-send.
>
>> +static inline
>> +struct sk_buff *l3mdev_l3_rcv(struct sk_buff *skb, u16 proto)
>> +{
>> + struct net_device *master = NULL;
>> +
>> + if (netif_is_l3_slave(skb->dev))
>> + master = netdev_master_upper_dev_get_rcu(skb->dev);
>> +
>> + else if (netif_is_l3_master(skb->dev))
>> + master = skb->dev;
>> +
>> + if (master && master->l3mdev_ops->l3mdev_l3_rcv)
>> + skb = master->l3mdev_ops->l3mdev_l3_rcv(master, skb, proto);
>
> In the case where netif_is_l3_master(skb->dev) is true, can you explain
> why we need to pass it through the l3mdev_l3_rcv callback again?
what do you mean again? This is only time the l3mdev_l3_rcv method is
called on a packet.
^ permalink raw reply
* Re: [PATCH net-next 2/2] net: original ingress device index in PKTINFO
From: David Ahern @ 2016-05-07 14:53 UTC (permalink / raw)
To: Shmulik Ladkani; +Cc: netdev
In-Reply-To: <20160507114148.347716e4@halley>
On 5/7/16 2:41 AM, Shmulik Ladkani wrote:
> Hi David,
>
> On Fri, 6 May 2016 18:49:41 -0700 David Ahern <dsa@cumulusnetworks.com> wrote:
>> Applications such as OSPF and BFD need the original ingress device not
>> the VRF device;
>
> Would you consider this true for any IP_PKTINFO users in VRF setups?
yes. I was just giving specific examples, but certainly every app I am
aware of wants the enslaved index. If an app pops up that wants the vrf
index it can be derived from the enslaved index.
>
>> @@ -1193,7 +1193,12 @@ void ipv4_pktinfo_prepare(const struct sock *sk, struct sk_buff *skb)
>> ipv6_sk_rxinfo(sk);
>>
>> if (prepare && skb_rtable(skb)) {
>> - pktinfo->ipi_ifindex = inet_iif(skb);
>> + /* skb->cb is overloaded: prior to this point it is IP{6}CB
>> + * which has interface index (iif) as the first member of the
>> + * underlying inet{6}_skb_parm struct. This code then overlays
>> + * PKTINFO_SKB_CB and in_pktinfo also has iif as the first
>> + * element so the iif is picked up from the prior IPCB
>> + */
>
> Better if there was a guarantee in the code that inet_skb_parm layout stays
> that way. Or instead just explicitly assign the iif.
At this point inet_iif points to the vrf device so can't use it.
^ permalink raw reply
* Re: [PATCH v9 net-next 1/2] hv_sock: introduce Hyper-V Sockets
From: David Miller @ 2016-05-07 17:40 UTC (permalink / raw)
To: decui
Cc: gregkh, netdev, linux-kernel, devel, olaf, apw, jasowang, cavery,
kys, haiyangz, joe, vkuznets
In-Reply-To: <BLUPR03MB1410F30AED34632F8F1268DEBF7E0@BLUPR03MB1410.namprd03.prod.outlook.com>
From: Dexuan Cui <decui@microsoft.com>
Date: Sat, 7 May 2016 10:49:25 +0000
> I should be able to make 'send', 'recv' here to pointers and use vmalloc()
> to allocate the memory for them. I will do this.
That's still unswappable kernel memory.
People can open N sockets, where N is something on the order of the FD
limit the process has, per process. This allows someone to quickly
eat up a lot of memory and hold onto it nearly indefinitely.
^ permalink raw reply
* Re: [PATCH net-next 5/7] Driver: Vmxnet3: Add support for get_coalesce, set_coalesce ethtool operations
From: David Miller @ 2016-05-07 17:41 UTC (permalink / raw)
To: ben; +Cc: skhare, netdev, linux-kernel, pv-drivers, sunk, tammalim
In-Reply-To: <1462622686.19332.33.camel@decadent.org.uk>
From: Ben Hutchings <ben@decadent.org.uk>
Date: Sat, 07 May 2016 13:04:46 +0100
> On Fri, 2016-05-06 at 16:12 -0700, Shrikrishna Khare wrote:
> [...]
>> +static int
>> +vmxnet3_set_coalesce(struct net_device *netdev, struct ethtool_coalesce *ec)
>> +{
> [...]
>> + switch (ec->rx_coalesce_usecs) {
>> + case VMXNET3_COALESCE_DEFAULT:
>> + case VMXNET3_COALESCE_DISABLED:
>> + case VMXNET3_COALESCE_ADAPT:
>> + if (ec->tx_max_coalesced_frames ||
>> + ec->tx_max_coalesced_frames_irq ||
>> + ec->rx_max_coalesced_frames_irq) {
>> + return -EINVAL;
>> + }
>> + memset(adapter->coal_conf, 0, sizeof(*adapter->coal_conf));
>> + adapter->coal_conf->coalMode = ec->rx_coalesce_usecs;
>> + break;
>> + case VMXNET3_COALESCE_STATIC:
> [...]
>
> I don't want to see drivers introducing magic values for fields that
> are denominated in microseconds (especially not for 0, which is the
> correct way to specify 'no coalescing'). If the current
> ethtool_coalesce structure is inadequate, propose an extension.
Agreed.
^ permalink raw reply
* [PATCH net] macsec: key identifier is 128 bits, not 64
From: Sabrina Dubroca @ 2016-05-07 18:19 UTC (permalink / raw)
To: netdev; +Cc: Hannes Frederic Sowa, Sabrina Dubroca
The MACsec standard mentions a key identifier for each key, but
doesn't specify anything about it, so I arbitrarily chose 64 bits.
IEEE 802.1X-2010 specifies MKA (MACsec Key Agreement), and defines the
key identifier to be 128 bits (96 bits "member identifier" + 32 bits
"key number").
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
Let's make uapi consistent now, before macsec lands in an official
kernel release.
drivers/net/macsec.c | 19 +++++++++++++------
include/uapi/linux/if_macsec.h | 4 +++-
2 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/drivers/net/macsec.c b/drivers/net/macsec.c
index c6385617bfb2..92eaab95ae2b 100644
--- a/drivers/net/macsec.c
+++ b/drivers/net/macsec.c
@@ -85,7 +85,7 @@ struct gcm_iv {
* @tfm: crypto struct, key storage
*/
struct macsec_key {
- u64 id;
+ u8 id[MACSEC_KEYID_LEN];
struct crypto_aead *tfm;
};
@@ -1529,7 +1529,8 @@ static const struct nla_policy macsec_genl_sa_policy[NUM_MACSEC_SA_ATTR] = {
[MACSEC_SA_ATTR_AN] = { .type = NLA_U8 },
[MACSEC_SA_ATTR_ACTIVE] = { .type = NLA_U8 },
[MACSEC_SA_ATTR_PN] = { .type = NLA_U32 },
- [MACSEC_SA_ATTR_KEYID] = { .type = NLA_U64 },
+ [MACSEC_SA_ATTR_KEYID] = { .type = NLA_BINARY,
+ .len = MACSEC_KEYID_LEN, },
[MACSEC_SA_ATTR_KEY] = { .type = NLA_BINARY,
.len = MACSEC_MAX_KEY_LEN, },
};
@@ -1576,6 +1577,9 @@ static bool validate_add_rxsa(struct nlattr **attrs)
return false;
}
+ if (nla_len(attrs[MACSEC_SA_ATTR_KEYID]) != MACSEC_KEYID_LEN)
+ return false;
+
return true;
}
@@ -1641,7 +1645,7 @@ static int macsec_add_rxsa(struct sk_buff *skb, struct genl_info *info)
if (tb_sa[MACSEC_SA_ATTR_ACTIVE])
rx_sa->active = !!nla_get_u8(tb_sa[MACSEC_SA_ATTR_ACTIVE]);
- rx_sa->key.id = nla_get_u64(tb_sa[MACSEC_SA_ATTR_KEYID]);
+ nla_memcpy(rx_sa->key.id, tb_sa[MACSEC_SA_ATTR_KEY], MACSEC_KEYID_LEN);
rx_sa->sc = rx_sc;
rcu_assign_pointer(rx_sc->sa[assoc_num], rx_sa);
@@ -1722,6 +1726,9 @@ static bool validate_add_txsa(struct nlattr **attrs)
return false;
}
+ if (nla_len(attrs[MACSEC_SA_ATTR_KEYID]) != MACSEC_KEYID_LEN)
+ return false;
+
return true;
}
@@ -1777,7 +1784,7 @@ static int macsec_add_txsa(struct sk_buff *skb, struct genl_info *info)
return -ENOMEM;
}
- tx_sa->key.id = nla_get_u64(tb_sa[MACSEC_SA_ATTR_KEYID]);
+ nla_memcpy(tx_sa->key.id, tb_sa[MACSEC_SA_ATTR_KEY], MACSEC_KEYID_LEN);
spin_lock_bh(&tx_sa->lock);
tx_sa->next_pn = nla_get_u32(tb_sa[MACSEC_SA_ATTR_PN]);
@@ -2318,7 +2325,7 @@ static int dump_secy(struct macsec_secy *secy, struct net_device *dev,
if (nla_put_u8(skb, MACSEC_SA_ATTR_AN, i) ||
nla_put_u32(skb, MACSEC_SA_ATTR_PN, tx_sa->next_pn) ||
- nla_put_u64(skb, MACSEC_SA_ATTR_KEYID, tx_sa->key.id) ||
+ nla_put(skb, MACSEC_SA_ATTR_KEYID, MACSEC_KEYID_LEN, tx_sa->key.id) ||
nla_put_u8(skb, MACSEC_SA_ATTR_ACTIVE, tx_sa->active)) {
nla_nest_cancel(skb, txsa_nest);
nla_nest_cancel(skb, txsa_list);
@@ -2419,7 +2426,7 @@ static int dump_secy(struct macsec_secy *secy, struct net_device *dev,
if (nla_put_u8(skb, MACSEC_SA_ATTR_AN, i) ||
nla_put_u32(skb, MACSEC_SA_ATTR_PN, rx_sa->next_pn) ||
- nla_put_u64(skb, MACSEC_SA_ATTR_KEYID, rx_sa->key.id) ||
+ nla_put(skb, MACSEC_SA_ATTR_KEYID, MACSEC_KEYID_LEN, rx_sa->key.id) ||
nla_put_u8(skb, MACSEC_SA_ATTR_ACTIVE, rx_sa->active)) {
nla_nest_cancel(skb, rxsa_nest);
nla_nest_cancel(skb, rxsc_nest);
diff --git a/include/uapi/linux/if_macsec.h b/include/uapi/linux/if_macsec.h
index 4c58d9917aa4..3411ed06b9c0 100644
--- a/include/uapi/linux/if_macsec.h
+++ b/include/uapi/linux/if_macsec.h
@@ -19,6 +19,8 @@
#define MACSEC_MAX_KEY_LEN 128
+#define MACSEC_KEYID_LEN 16
+
#define MACSEC_DEFAULT_CIPHER_ID 0x0080020001000001ULL
#define MACSEC_DEFAULT_CIPHER_ALT 0x0080C20001000001ULL
@@ -77,7 +79,7 @@ enum macsec_sa_attrs {
MACSEC_SA_ATTR_ACTIVE, /* config/dump, u8 0..1 */
MACSEC_SA_ATTR_PN, /* config/dump, u32 */
MACSEC_SA_ATTR_KEY, /* config, data */
- MACSEC_SA_ATTR_KEYID, /* config/dump, u64 */
+ MACSEC_SA_ATTR_KEYID, /* config/dump, 128-bit */
MACSEC_SA_ATTR_STATS, /* dump, nested, macsec_sa_stats_attr */
__MACSEC_SA_ATTR_END,
NUM_MACSEC_SA_ATTR = __MACSEC_SA_ATTR_END,
--
2.8.2
^ permalink raw reply related
* Re: [PATCH net-next v2 1/2] net: l3mdev: Add hook in ip and ipv6
From: Shmulik Ladkani @ 2016-05-07 18:32 UTC (permalink / raw)
To: David Ahern; +Cc: netdev
In-Reply-To: <572E00C9.4050109@cumulusnetworks.com>
Hi David,
On Sat, 7 May 2016 08:50:49 -0600 David Ahern <dsa@cumulusnetworks.com> wrote:
> >> +static inline
> >> +struct sk_buff *l3mdev_l3_rcv(struct sk_buff *skb, u16 proto)
> >> +{
> >> + struct net_device *master = NULL;
> >> +
> >> + if (netif_is_l3_slave(skb->dev))
> >> + master = netdev_master_upper_dev_get_rcu(skb->dev);
> >> +
> >> + else if (netif_is_l3_master(skb->dev))
> >> + master = skb->dev;
> >> +
> >> + if (master && master->l3mdev_ops->l3mdev_l3_rcv)
> >> + skb = master->l3mdev_ops->l3mdev_l3_rcv(master, skb, proto);
> >
> > In the case where netif_is_l3_master(skb->dev) is true, can you explain
> > why we need to pass it through the l3mdev_l3_rcv callback again?
>
> what do you mean again? This is only time the l3mdev_l3_rcv method is
> called on a packet.
You have the following:
if (netif_is_l3_slave(skb->dev))
master = netdev_master_upper_dev_get_rcu(skb->dev);
else if (netif_is_l3_master(skb->dev))
master = skb->dev;
if (master && master->l3mdev_ops->l3mdev_l3_rcv)
skb = master->l3mdev_ops->l3mdev_l3_rcv(master, skb, proto);
So in both conditions (skb->dev being the slave or the master) the skb
is passed to master's l3mdev_l3_rcv callback.
Appreciate if you can elaborate:
- Why callback needs to be invoked when skb->dev is the L3 master?
- On which circumstances we end up entering
l3mdev_ip_rcv/l3mdev_ip6_rcv where skb->dev is the master?
If I got it right, we enter 'ip_rcv_finish' on a slave device,
the callback is invoked and eventually sets skb->dev and skb->skb_iif
to the VRF device; then ip_rcv_finish continues processing the
altered skb (with the changed skb->dev).
So on which cicumstances do we enter 'ip_rcv_finish' where the
skb->dev is ALREADY a master device?
Thanks,
Shmulik
^ permalink raw reply
* Re: [PATCH v2 1/2 -net] ravb: Add missing free_irq() call to ravb_close()
From: Sergei Shtylyov @ 2016-05-07 18:39 UTC (permalink / raw)
To: Geert Uytterhoeven, David S. Miller
Cc: Yoshihiro Kaneko, Simon Horman, netdev, linux-renesas-soc
In-Reply-To: <1462619832-5177-2-git-send-email-geert+renesas@glider.be>
Hello.
On 05/07/2016 02:17 PM, Geert Uytterhoeven wrote:
> When reopening the network device on ra7795/salvator-x, e.g. after a
> DHCP timeout:
>
> IP-Config: Reopening network devices...
> genirq: Flags mismatch irq 139. 00000000 (eth0:ch24:emac) vs. 00000000 (eth0:ch24:emac)
> ravb e6800000.ethernet eth0: cannot request IRQ eth0:ch24:emac
Er, this can't be a message from the kernel built from net.git. That
driver used 'ndev->name'
to request both IRQs...
> IP-Config: Failed to open eth0
> IP-Config: No network devices available
>
> The "mismatch" is due to requesting an IRQ that is already in use,
> while IRQF_PROBE_SHARED wasn't set.
>
> However, the real cause is that ravb_close() doesn't release the R-Car
> Gen3-specific secondary IRQ.
>
> Add the missing free_irq() call to fix this.
>
> Fixes: 22d4df8ff3a3cc72 ("ravb: Add support for r8a7795 SoC")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
MBR, Sergei
^ permalink raw reply
* Re: [PATCH v2 2/2 -net-next] ravb: Add missing free_irq() calls to ravb_close()
From: Sergei Shtylyov @ 2016-05-07 18:45 UTC (permalink / raw)
To: Geert Uytterhoeven, David S. Miller
Cc: Yoshihiro Kaneko, Simon Horman, netdev, linux-renesas-soc
In-Reply-To: <1462619832-5177-3-git-send-email-geert+renesas@glider.be>
Hello.
On 05/07/2016 02:17 PM, Geert Uytterhoeven wrote:
> When reopening the network device on ra7795/salvator-x, e.g. after a
> DHCP timeout:
>
> IP-Config: Reopening network devices...
> genirq: Flags mismatch irq 139. 00000000 (eth0:ch24:emac) vs. 00000000 (
Unwrapped line this time? :-)
> ravb e6800000.ethernet eth0: cannot request IRQ eth0:ch24:emac
> IP-Config: Failed to open eth0
> IP-Config: No network devices available
>
> The "mismatch" is due to requesting an IRQ that is already in use,
> while IRQF_PROBE_SHARED wasn't set.
>
> However, the real cause is that ravb_close() doesn't release any of the
> R-Car Gen3-specific secondary IRQs.
>
> Add the missing free_irq() calls to fix this.
>
> Fixes: 22d4df8ff3a3cc72 ("ravb: Add support for r8a7795 SoC")
> Fixes: f51bdc236b6c5835 ("ravb: Add dma queue interrupt support")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
MBR, Sergei
^ permalink raw reply
* pull request: bluetooth-next 2016-05-07
From: Johan Hedberg @ 2016-05-07 18:56 UTC (permalink / raw)
To: davem-fT/PcQaiUtIeIZ0/mPfg9Q
Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
linux-bluetooth-u79uwXL29TY76Z2rM5mHXA
[-- Attachment #1: Type: text/plain, Size: 1917 bytes --]
Hi Dave,
Here are a few more Bluetooth patches for the 4.7 kernel:
- NULL pointer fix in hci_intel driver
- New Intel Bluetooth controller id in btusb driver
- Added device tree binding documentation for Marvel's bt-sd8xxx
- Platform specific wakeup interrupt support for btmrvl driver
Please let me know if there are any issues pulling. Thanks.
Johan
---
The following changes since commit 582a1db98892ef4c1f34c7338b272331994d44ab:
Merge branch 'qed-selftests' (2016-05-02 00:16:45 -0400)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git for-upstream
for you to fetch changes up to a0af53b511423cca93900066512379e21586d7dd:
Bluetooth: Add support for Intel Bluetooth device 8265 [8087:0a2b] (2016-05-06 21:52:35 +0200)
----------------------------------------------------------------
Loic Poulain (1):
Bluetooth: hci_intel: Fix null gpio desc pointer dereference
Tedd Ho-Jeong An (1):
Bluetooth: Add support for Intel Bluetooth device 8265 [8087:0a2b]
Xinming Hu (2):
dt: bindings: add MARVELL's bt-sd8xxx wireless device
btmrvl: add platform specific wakeup interrupt support
Documentation/devicetree/bindings/btmrvl.txt | 29 --------
.../devicetree/bindings/net/marvell-bt-sd8xxx.txt | 56 +++++++++++++++
drivers/bluetooth/btmrvl_drv.h | 11 +++
drivers/bluetooth/btmrvl_main.c | 35 +++++----
drivers/bluetooth/btmrvl_sdio.c | 79 +++++++++++++++++++++
drivers/bluetooth/btmrvl_sdio.h | 6 ++
drivers/bluetooth/btusb.c | 11 +--
drivers/bluetooth/hci_intel.c | 6 +-
8 files changed, 180 insertions(+), 53 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/btmrvl.txt
create mode 100644 Documentation/devicetree/bindings/net/marvell-bt-sd8xxx.txt
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* Re: [PATCH net 1/1] net: fec: update dirty_tx even if no skb
From: Troy Kisky @ 2016-05-07 18:56 UTC (permalink / raw)
To: Fugang Duan, netdev@vger.kernel.org, davem@davemloft.net,
lznuaa@gmail.com
Cc: Fabio Estevam, l.stach@pengutronix.de, andrew@lunn.ch,
tremyfr@gmail.com, gerg@uclinux.org,
linux-arm-kernel@lists.infradead.org, johannes@sipsolutions.net,
stillcompiling@gmail.com, sergei.shtylyov@cogentembedded.com,
arnd@arndb.de, holgerschurig@gmail.com
In-Reply-To: <VI1PR0401MB18558325A80D252D2EC64A7BFF6F0@VI1PR0401MB1855.eurprd04.prod.outlook.com>
On 4/21/2016 10:59 PM, Fugang Duan wrote:
> From: Troy Kisky <troy.kisky@boundarydevices.com> Sent: Friday, April 22, 2016 10:01 AM
>> To: netdev@vger.kernel.org; davem@davemloft.net; Fugang Duan
>> <fugang.duan@nxp.com>; lznuaa@gmail.com
>> Cc: Fabio Estevam <fabio.estevam@nxp.com>; l.stach@pengutronix.de;
>> andrew@lunn.ch; tremyfr@gmail.com; gerg@uclinux.org; linux-arm-
>> kernel@lists.infradead.org; johannes@sipsolutions.net;
>> stillcompiling@gmail.com; sergei.shtylyov@cogentembedded.com;
>> arnd@arndb.de; holgerschurig@gmail.com; Troy Kisky
>> <troy.kisky@boundarydevices.com>
>> Subject: [PATCH net 1/1] net: fec: update dirty_tx even if no skb
>>
>> If dirty_tx isn't updated, then dma_unmap_single will be called twice.
>>
>> This fixes a
>> [ 58.420980] ------------[ cut here ]------------
>> [ 58.425667] WARNING: CPU: 0 PID: 377 at /home/schurig/d/mkarm/linux-
>> 4.5/lib/dma-debug.c:1096 check_unmap+0x9d0/0xab8()
>> [ 58.436405] fec 2188000.ethernet: DMA-API: device driver tries to free DMA
>> memory it has not allocated [device address=0x0000000000000000] [size=66
>> bytes]
>>
>> encountered by Holger
>>
>> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
>> Tested-by: <holgerschurig@gmail.com>
>> ---
>> drivers/net/ethernet/freescale/fec_main.c | 8 +++-----
>> 1 file changed, 3 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/freescale/fec_main.c
>> b/drivers/net/ethernet/freescale/fec_main.c
>> index 08243c2..b71654c 100644
>> --- a/drivers/net/ethernet/freescale/fec_main.c
>> +++ b/drivers/net/ethernet/freescale/fec_main.c
>> @@ -1197,10 +1197,8 @@ fec_enet_tx_queue(struct net_device *ndev, u16
>> queue_id)
>> fec16_to_cpu(bdp->cbd_datlen),
>> DMA_TO_DEVICE);
>> bdp->cbd_bufaddr = cpu_to_fec32(0);
>> - if (!skb) {
>> - bdp = fec_enet_get_nextdesc(bdp, &txq->bd);
>> - continue;
>> - }
>> + if (!skb)
>> + goto skb_done;
>>
>> /* Check for errors. */
>> if (status & (BD_ENET_TX_HB | BD_ENET_TX_LC | @@ -1239,7
>> +1237,7 @@ fec_enet_tx_queue(struct net_device *ndev, u16 queue_id)
>>
>> /* Free the sk buffer associated with this last transmit */
>> dev_kfree_skb_any(skb);
>> -
>> +skb_done:
>> /* Make sure the update to bdp and tx_skbuff are performed
>> * before dirty_tx
>> */
>> --
>> 2.5.0
>
> The patch is fine for me.
> Can you review below patch that also fix the issue. It can take much effort due to less rmb() and READ_ONCE() operation that is very sensitive for duplex Gbps test for i.MX6SX/i.MX7d SOC. (i.MX6SX can reach at 1.4Gbps, i.MX7D can reach at 1.8Gbps.)
>
Am I supposed to do anything else to get this patch into net ?
^ permalink raw reply
* Re: [PATCH net-next 1/2] net: l3mdev: Move get_saddr and rt6_dst
From: David Miller @ 2016-05-07 19:01 UTC (permalink / raw)
To: dsa; +Cc: netdev
In-Reply-To: <1462424050-16084-2-git-send-email-dsa@cumulusnetworks.com>
From: David Ahern <dsa@cumulusnetworks.com>
Date: Wed, 4 May 2016 21:54:09 -0700
> + if (dev && netif_is_l3_master(dev) &&
> + dev->l3mdev_ops->l3mdev_get_saddr) {
> + rc = dev->l3mdev_ops->l3mdev_get_saddr(dev, fl4);
> + }
Please do not use braces for single statement basic blocks.
The same issue exists in patch #2 so please fix it there as well.
Thanks.
^ permalink raw reply
* Re: [PATCH net-next 2/2] net: original ingress device index in PKTINFO
From: Shmulik Ladkani @ 2016-05-07 19:08 UTC (permalink / raw)
To: David Ahern; +Cc: netdev
In-Reply-To: <572E0178.4010601@cumulusnetworks.com>
Hi,
On Sat, 7 May 2016 08:53:44 -0600 David Ahern <dsa@cumulusnetworks.com> wrote:
> >> @@ -1193,7 +1193,12 @@ void ipv4_pktinfo_prepare(const struct sock *sk, struct sk_buff *skb)
> >> ipv6_sk_rxinfo(sk);
> >>
> >> if (prepare && skb_rtable(skb)) {
> >> - pktinfo->ipi_ifindex = inet_iif(skb);
> >> + /* skb->cb is overloaded: prior to this point it is IP{6}CB
> >> + * which has interface index (iif) as the first member of the
> >> + * underlying inet{6}_skb_parm struct. This code then overlays
> >> + * PKTINFO_SKB_CB and in_pktinfo also has iif as the first
> >> + * element so the iif is picked up from the prior IPCB
> >> + */
> >
> > Better if there was a guarantee in the code that inet_skb_parm layout stays
> > that way. Or instead just explicitly assign the iif.
>
> At this point inet_iif points to the vrf device so can't use it.
Initially I was thinking about explicitly getting the iif out of the
IPCB first, then assign to ipi_ifindex. Seems more readable, and less
fragile. However this depends on the IPCB/IP6CB layout relationship as
well (iif being first on both).
I assume documenting the IP{6}CB/PKTINFO_SKB_CB layout relationship at the
struct definitions would be beneficial.
Regards,
Shmulik
^ permalink raw reply
* Re: [PATCH net-next 2/4] xen-netback: add control protocol implementation
From: David Miller @ 2016-05-07 19:09 UTC (permalink / raw)
To: paul.durrant; +Cc: xen-devel, netdev, wei.liu2
In-Reply-To: <1462447170-1815-3-git-send-email-paul.durrant@citrix.com>
From: Paul Durrant <paul.durrant@citrix.com>
Date: Thu, 5 May 2016 12:19:28 +0100
> +struct xenvif_hash_cache {
> + rwlock_t lock;
You really don't want to lock on every SKB hash computation like
this, turn this into a spin lock for locking the write side and
use RCU locking for lookup and usage.
THanks.
^ permalink raw reply
* Re: [PATCH net-next] cxgb4: Reset dcb state machine and tx queue prio only if dcb is enabled
From: David Miller @ 2016-05-07 19:16 UTC (permalink / raw)
To: hariprasad; +Cc: netdev, leedom, nirranjan
In-Reply-To: <1462426539-5729-1-git-send-email-hariprasad@chelsio.com>
From: Hariprasad Shenai <hariprasad@chelsio.com>
Date: Thu, 5 May 2016 11:05:39 +0530
> When cxgb4 is enabled with CONFIG_CHELSIO_T4_DCB set, VI enable command
> gets called with DCB enabled. But when we have a back to back setup with
> DCB enabled on one side and non-DCB on the Peer side. Firmware doesn't
> send any DCB_L2_CFG, and DCB priority is never set for Tx queue.
> But driver resets the queue priority and state machine whenever there
> is a link down, this patch fixes it by adding a check to reset only if
> cxgb4_dcb_enabled() returns true.
>
> Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Applied.
^ permalink raw reply
* Re: [patch 1/2] netxen: fix error handling in netxen_get_flash_block()
From: David Miller @ 2016-05-07 19:16 UTC (permalink / raw)
To: dan.carpenter
Cc: manish.chopra, sony.chacko, rajesh.borundia, netdev, linux-kernel,
kernel-janitors
In-Reply-To: <20160505131846.GB3038@mwanda>
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Thu, 5 May 2016 16:18:46 +0300
> My static checker complained that "v" can be used unintialized if
> netxen_rom_fast_read() returns -EIO. That function never actually
> returns -1.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Applied.
^ permalink raw reply
* Re: [patch 2/2] netxen: reversed condition in netxen_nic_set_link_parameters()
From: David Miller @ 2016-05-07 19:16 UTC (permalink / raw)
To: dan.carpenter
Cc: manish.chopra, sony.chacko, rajesh.borundia, netdev, linux-kernel,
kernel-janitors
In-Reply-To: <20160505131944.GC3038@mwanda>
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Thu, 5 May 2016 16:19:44 +0300
> My static checker complains that we are using "autoneg" without
> initializing it. The problem is the ->phy_read() condition is reversed
> so we only set this on error instead of success.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Applied.
^ permalink raw reply
* Re: [patch] netxen: netxen_rom_fast_read() doesn't return -1
From: David Miller @ 2016-05-07 19:16 UTC (permalink / raw)
To: dan.carpenter
Cc: manish.chopra, sony.chacko, rajesh.borundia, netdev, linux-kernel,
kernel-janitors
In-Reply-To: <20160505132019.GD3038@mwanda>
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Thu, 5 May 2016 16:20:20 +0300
> The error handling is broken here. netxen_rom_fast_read() returns zero
> on success and -EIO on error. It never returns -1.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Applied.
^ 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