* [PATCH 1/2] bpf samples: fix compiler errors with sockex2 and sockex3
From: Naveen N. Rao @ 2016-09-23 20:40 UTC (permalink / raw)
To: linux-kernel, linuxppc-dev, netdev, David S. Miller
Cc: Michael Ellerman, Alexei Starovoitov, Daniel Borkmann,
Ananth N Mavinakayanahalli
These samples fail to compile as 'struct flow_keys' conflicts with
definition in net/flow_dissector.h. Fix the same by renaming the
structure used in the sample.
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
---
samples/bpf/sockex2_kern.c | 10 +++++-----
samples/bpf/sockex3_kern.c | 8 ++++----
samples/bpf/sockex3_user.c | 4 ++--
3 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/samples/bpf/sockex2_kern.c b/samples/bpf/sockex2_kern.c
index ba0e177..44e5846 100644
--- a/samples/bpf/sockex2_kern.c
+++ b/samples/bpf/sockex2_kern.c
@@ -14,7 +14,7 @@ struct vlan_hdr {
__be16 h_vlan_encapsulated_proto;
};
-struct flow_keys {
+struct bpf_flow_keys {
__be32 src;
__be32 dst;
union {
@@ -59,7 +59,7 @@ static inline __u32 ipv6_addr_hash(struct __sk_buff *ctx, __u64 off)
}
static inline __u64 parse_ip(struct __sk_buff *skb, __u64 nhoff, __u64 *ip_proto,
- struct flow_keys *flow)
+ struct bpf_flow_keys *flow)
{
__u64 verlen;
@@ -83,7 +83,7 @@ static inline __u64 parse_ip(struct __sk_buff *skb, __u64 nhoff, __u64 *ip_proto
}
static inline __u64 parse_ipv6(struct __sk_buff *skb, __u64 nhoff, __u64 *ip_proto,
- struct flow_keys *flow)
+ struct bpf_flow_keys *flow)
{
*ip_proto = load_byte(skb,
nhoff + offsetof(struct ipv6hdr, nexthdr));
@@ -96,7 +96,7 @@ static inline __u64 parse_ipv6(struct __sk_buff *skb, __u64 nhoff, __u64 *ip_pro
return nhoff;
}
-static inline bool flow_dissector(struct __sk_buff *skb, struct flow_keys *flow)
+static inline bool flow_dissector(struct __sk_buff *skb, struct bpf_flow_keys *flow)
{
__u64 nhoff = ETH_HLEN;
__u64 ip_proto;
@@ -198,7 +198,7 @@ struct bpf_map_def SEC("maps") hash_map = {
SEC("socket2")
int bpf_prog2(struct __sk_buff *skb)
{
- struct flow_keys flow;
+ struct bpf_flow_keys flow;
struct pair *value;
u32 key;
diff --git a/samples/bpf/sockex3_kern.c b/samples/bpf/sockex3_kern.c
index 41ae2fd..95907f8 100644
--- a/samples/bpf/sockex3_kern.c
+++ b/samples/bpf/sockex3_kern.c
@@ -61,7 +61,7 @@ struct vlan_hdr {
__be16 h_vlan_encapsulated_proto;
};
-struct flow_keys {
+struct bpf_flow_keys {
__be32 src;
__be32 dst;
union {
@@ -88,7 +88,7 @@ static inline __u32 ipv6_addr_hash(struct __sk_buff *ctx, __u64 off)
}
struct globals {
- struct flow_keys flow;
+ struct bpf_flow_keys flow;
};
struct bpf_map_def SEC("maps") percpu_map = {
@@ -114,14 +114,14 @@ struct pair {
struct bpf_map_def SEC("maps") hash_map = {
.type = BPF_MAP_TYPE_HASH,
- .key_size = sizeof(struct flow_keys),
+ .key_size = sizeof(struct bpf_flow_keys),
.value_size = sizeof(struct pair),
.max_entries = 1024,
};
static void update_stats(struct __sk_buff *skb, struct globals *g)
{
- struct flow_keys key = g->flow;
+ struct bpf_flow_keys key = g->flow;
struct pair *value;
value = bpf_map_lookup_elem(&hash_map, &key);
diff --git a/samples/bpf/sockex3_user.c b/samples/bpf/sockex3_user.c
index d4184ab..3fcfd8c4 100644
--- a/samples/bpf/sockex3_user.c
+++ b/samples/bpf/sockex3_user.c
@@ -7,7 +7,7 @@
#include <arpa/inet.h>
#include <sys/resource.h>
-struct flow_keys {
+struct bpf_flow_keys {
__be32 src;
__be32 dst;
union {
@@ -49,7 +49,7 @@ int main(int argc, char **argv)
(void) f;
for (i = 0; i < 5; i++) {
- struct flow_keys key = {}, next_key;
+ struct bpf_flow_keys key = {}, next_key;
struct pair value;
sleep(1);
--
2.9.3
^ permalink raw reply related
* Re: [PATCH net v2] ip6_gre: fix flowi6_proto value in ip6gre_xmit_other()
From: Lance Richardson @ 2016-09-23 20:37 UTC (permalink / raw)
To: Sergei Shtylyov; +Cc: netdev, shmulik ladkani, jbenc
In-Reply-To: <53fca902-c7e6-c216-6366-ba3f483854a0@cogentembedded.com>
> From: "Sergei Shtylyov" <sergei.shtylyov@cogentembedded.com>
> To: "Lance Richardson" <lrichard@redhat.com>, netdev@vger.kernel.org
> Cc: "shmulik ladkani" <shmulik.ladkani@gmail.com>, jbenc@redhat.com
> Sent: Friday, September 23, 2016 4:01:15 PM
> Subject: Re: [PATCH net v2] ip6_gre: fix flowi6_proto value in ip6gre_xmit_other()
>
> Hello.
>
> On 09/23/2016 10:50 PM, Lance Richardson wrote:
>
> > Similar to commit 3be07244b733 ("ip6_gre: fix flowi6_proto value in
> > xmit path"), set flowi6_proto to IPPROTO_GRE for output route lookup.
> >
> > Up until now, ip6gre_xmit_other() has set flowi6_proto to a bogus value.
> > This affected output route lookup for packets sent on an ip6gretap device
> > in cases where routing was dependent on the value of flowi6_proto.
> >
> > Since the correct proto is already set in the tunnel flowi6 template via
> > commit 252f3f5a1189 ("ip6_gre: Set flowi6_proto as IPPROTO_GRE in xmit
> > path."), simply delete the line setting the incorrect flowi6_proto value.
> >
> > Suggested-by: Jiri Benc <jbenc@redhat.com>
> > Fixes: commit c12b395a4664 ("gre: Support GRE over IPv6")
>
> That "commit" isn't needed here, this tag has a standardized format.
> Hopefully, can be fixed while applying...
Thanks for pointing that out, I mistakenly added that "commit" after
checkpatch.pl complained about not having "commit" before the hashes
in the log. Hoping it can be fixed when applying as well.
>
> > Reviewed-by: Shmulik Ladkani <shmulik.ladkani@gmail.com>
> > Signed-off-by: Lance Richardson <lrichard@redhat.com>
> [...]
>
> MBR, Sergei
>
>
^ permalink raw reply
* [PATCH 3/3] bpf powerpc: add support for bpf constant blinding
From: Naveen N. Rao @ 2016-09-23 20:35 UTC (permalink / raw)
To: linux-kernel, linuxppc-dev, netdev, Michael Ellerman
Cc: Alexei Starovoitov, Daniel Borkmann, David S. Miller,
Ananth N Mavinakayanahalli
In-Reply-To: <40b65ab2bb3a48837ab047a70887de3ccd70c56b.1474661927.git.naveen.n.rao@linux.vnet.ibm.com>
In line with similar support for other architectures by Daniel Borkmann.
'MOD Default X' from test_bpf without constant blinding:
84 bytes emitted from JIT compiler (pass:3, flen:7)
d0000000058a4688 + <x>:
0: nop
4: nop
8: std r27,-40(r1)
c: std r28,-32(r1)
10: xor r8,r8,r8
14: xor r28,r28,r28
18: mr r27,r3
1c: li r8,66
20: cmpwi r28,0
24: bne 0x0000000000000030
28: li r8,0
2c: b 0x0000000000000044
30: divwu r9,r8,r28
34: mullw r9,r28,r9
38: subf r8,r9,r8
3c: rotlwi r8,r8,0
40: li r8,66
44: ld r27,-40(r1)
48: ld r28,-32(r1)
4c: mr r3,r8
50: blr
... and with constant blinding:
140 bytes emitted from JIT compiler (pass:3, flen:11)
d00000000bd6ab24 + <x>:
0: nop
4: nop
8: std r27,-40(r1)
c: std r28,-32(r1)
10: xor r8,r8,r8
14: xor r28,r28,r28
18: mr r27,r3
1c: lis r2,-22834
20: ori r2,r2,36083
24: rotlwi r2,r2,0
28: xori r2,r2,36017
2c: xoris r2,r2,42702
30: rotlwi r2,r2,0
34: mr r8,r2
38: rotlwi r8,r8,0
3c: cmpwi r28,0
40: bne 0x000000000000004c
44: li r8,0
48: b 0x000000000000007c
4c: divwu r9,r8,r28
50: mullw r9,r28,r9
54: subf r8,r9,r8
58: rotlwi r8,r8,0
5c: lis r2,-17137
60: ori r2,r2,39065
64: rotlwi r2,r2,0
68: xori r2,r2,39131
6c: xoris r2,r2,48399
70: rotlwi r2,r2,0
74: mr r8,r2
78: rotlwi r8,r8,0
7c: ld r27,-40(r1)
80: ld r28,-32(r1)
84: mr r3,r8
88: blr
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
---
arch/powerpc/net/bpf_jit64.h | 9 +++++----
arch/powerpc/net/bpf_jit_comp64.c | 36 +++++++++++++++++++++++++++++-------
2 files changed, 34 insertions(+), 11 deletions(-)
diff --git a/arch/powerpc/net/bpf_jit64.h b/arch/powerpc/net/bpf_jit64.h
index 038e00b..62fa758 100644
--- a/arch/powerpc/net/bpf_jit64.h
+++ b/arch/powerpc/net/bpf_jit64.h
@@ -39,10 +39,10 @@
#ifndef __ASSEMBLY__
/* BPF register usage */
-#define SKB_HLEN_REG (MAX_BPF_REG + 0)
-#define SKB_DATA_REG (MAX_BPF_REG + 1)
-#define TMP_REG_1 (MAX_BPF_REG + 2)
-#define TMP_REG_2 (MAX_BPF_REG + 3)
+#define SKB_HLEN_REG (MAX_BPF_JIT_REG + 0)
+#define SKB_DATA_REG (MAX_BPF_JIT_REG + 1)
+#define TMP_REG_1 (MAX_BPF_JIT_REG + 2)
+#define TMP_REG_2 (MAX_BPF_JIT_REG + 3)
/* BPF to ppc register mappings */
static const int b2p[] = {
@@ -62,6 +62,7 @@ static const int b2p[] = {
/* frame pointer aka BPF_REG_10 */
[BPF_REG_FP] = 31,
/* eBPF jit internal registers */
+ [BPF_REG_AX] = 2,
[SKB_HLEN_REG] = 25,
[SKB_DATA_REG] = 26,
[TMP_REG_1] = 9,
diff --git a/arch/powerpc/net/bpf_jit_comp64.c b/arch/powerpc/net/bpf_jit_comp64.c
index 3ec29d6..0fe98a5 100644
--- a/arch/powerpc/net/bpf_jit_comp64.c
+++ b/arch/powerpc/net/bpf_jit_comp64.c
@@ -974,21 +974,37 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *fp)
int pass;
int flen;
struct bpf_binary_header *bpf_hdr;
+ struct bpf_prog *org_fp = fp;
+ struct bpf_prog *tmp_fp;
+ bool bpf_blinded = false;
if (!bpf_jit_enable)
- return fp;
+ return org_fp;
+
+ tmp_fp = bpf_jit_blind_constants(org_fp);
+ if (IS_ERR(tmp_fp))
+ return org_fp;
+
+ if (tmp_fp != org_fp) {
+ bpf_blinded = true;
+ fp = tmp_fp;
+ }
flen = fp->len;
addrs = kzalloc((flen+1) * sizeof(*addrs), GFP_KERNEL);
- if (addrs == NULL)
- return fp;
+ if (addrs == NULL) {
+ fp = org_fp;
+ goto out;
+ }
+
+ memset(&cgctx, 0, sizeof(struct codegen_context));
- cgctx.idx = 0;
- cgctx.seen = 0;
/* Scouting faux-generate pass 0 */
- if (bpf_jit_build_body(fp, 0, &cgctx, addrs))
+ if (bpf_jit_build_body(fp, 0, &cgctx, addrs)) {
/* We hit something illegal or unsupported. */
+ fp = org_fp;
goto out;
+ }
/*
* Pretend to build prologue, given the features we've seen. This will
@@ -1003,8 +1019,10 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *fp)
bpf_hdr = bpf_jit_binary_alloc(alloclen, &image, 4,
bpf_jit_fill_ill_insns);
- if (!bpf_hdr)
+ if (!bpf_hdr) {
+ fp = org_fp;
goto out;
+ }
code_base = (u32 *)(image + FUNCTION_DESCR_SIZE);
@@ -1041,6 +1059,10 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *fp)
out:
kfree(addrs);
+
+ if (bpf_blinded)
+ bpf_jit_prog_release_other(fp, fp == org_fp ? tmp_fp : org_fp);
+
return fp;
}
--
2.9.3
^ permalink raw reply related
* [PATCH 2/3] bpf powerpc: implement support for tail calls
From: Naveen N. Rao @ 2016-09-23 20:35 UTC (permalink / raw)
To: linux-kernel, linuxppc-dev, netdev, Michael Ellerman
Cc: Alexei Starovoitov, Daniel Borkmann, David S. Miller,
Ananth N Mavinakayanahalli
In-Reply-To: <40b65ab2bb3a48837ab047a70887de3ccd70c56b.1474661927.git.naveen.n.rao@linux.vnet.ibm.com>
Tail calls allow JIT'ed eBPF programs to call into other JIT'ed eBPF
programs. This can be achieved either by:
(1) retaining the stack setup by the first eBPF program and having all
subsequent eBPF programs re-using it, or,
(2) by unwinding/tearing down the stack and having each eBPF program
deal with its own stack as it sees fit.
To ensure that this does not create loops, there is a limit to how many
tail calls can be done (currently 32). This requires the JIT'ed code to
maintain a count of the number of tail calls done so far.
Approach (1) is simple, but requires every eBPF program to have (almost)
the same prologue/epilogue, regardless of whether they need it. This is
inefficient for small eBPF programs which may not sometimes need a
prologue at all. As such, to minimize impact of tail call
implementation, we use approach (2) here which needs each eBPF program
in the chain to use its own prologue/epilogue. This is not ideal when
many tail calls are involved and when all the eBPF programs in the chain
have similar prologue/epilogue. However, the impact is restricted to
programs that do tail calls. Individual eBPF programs are not affected.
We maintain the tail call count in a fixed location on the stack and
updated tail call count values are passed in through this. The very
first eBPF program in a chain sets this up to 0 (the first 2
instructions). Subsequent tail calls skip the first two eBPF JIT
instructions to maintain the count. For programs that don't do tail
calls themselves, the first two instructions are NOPs.
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
---
arch/powerpc/include/asm/ppc-opcode.h | 2 +
arch/powerpc/net/bpf_jit.h | 2 +
arch/powerpc/net/bpf_jit64.h | 1 +
arch/powerpc/net/bpf_jit_comp64.c | 149 +++++++++++++++++++++++++++-------
4 files changed, 126 insertions(+), 28 deletions(-)
diff --git a/arch/powerpc/include/asm/ppc-opcode.h b/arch/powerpc/include/asm/ppc-opcode.h
index 127ebf5..54ff8ce 100644
--- a/arch/powerpc/include/asm/ppc-opcode.h
+++ b/arch/powerpc/include/asm/ppc-opcode.h
@@ -236,6 +236,7 @@
#define PPC_INST_STWU 0x94000000
#define PPC_INST_MFLR 0x7c0802a6
#define PPC_INST_MTLR 0x7c0803a6
+#define PPC_INST_MTCTR 0x7c0903a6
#define PPC_INST_CMPWI 0x2c000000
#define PPC_INST_CMPDI 0x2c200000
#define PPC_INST_CMPW 0x7c000000
@@ -250,6 +251,7 @@
#define PPC_INST_SUB 0x7c000050
#define PPC_INST_BLR 0x4e800020
#define PPC_INST_BLRL 0x4e800021
+#define PPC_INST_BCTR 0x4e800420
#define PPC_INST_MULLD 0x7c0001d2
#define PPC_INST_MULLW 0x7c0001d6
#define PPC_INST_MULHWU 0x7c000016
diff --git a/arch/powerpc/net/bpf_jit.h b/arch/powerpc/net/bpf_jit.h
index d5301b6..89f7007 100644
--- a/arch/powerpc/net/bpf_jit.h
+++ b/arch/powerpc/net/bpf_jit.h
@@ -40,6 +40,8 @@
#define PPC_BLR() EMIT(PPC_INST_BLR)
#define PPC_BLRL() EMIT(PPC_INST_BLRL)
#define PPC_MTLR(r) EMIT(PPC_INST_MTLR | ___PPC_RT(r))
+#define PPC_BCTR() EMIT(PPC_INST_BCTR)
+#define PPC_MTCTR(r) EMIT(PPC_INST_MTCTR | ___PPC_RT(r))
#define PPC_ADDI(d, a, i) EMIT(PPC_INST_ADDI | ___PPC_RT(d) | \
___PPC_RA(a) | IMM_L(i))
#define PPC_MR(d, a) PPC_OR(d, a, a)
diff --git a/arch/powerpc/net/bpf_jit64.h b/arch/powerpc/net/bpf_jit64.h
index a1645d7..038e00b 100644
--- a/arch/powerpc/net/bpf_jit64.h
+++ b/arch/powerpc/net/bpf_jit64.h
@@ -88,6 +88,7 @@ DECLARE_LOAD_FUNC(sk_load_byte);
#define SEEN_FUNC 0x1000 /* might call external helpers */
#define SEEN_STACK 0x2000 /* uses BPF stack */
#define SEEN_SKB 0x4000 /* uses sk_buff */
+#define SEEN_TAILCALL 0x8000 /* uses tail calls */
struct codegen_context {
/*
diff --git a/arch/powerpc/net/bpf_jit_comp64.c b/arch/powerpc/net/bpf_jit_comp64.c
index 5f8c91f..3ec29d6 100644
--- a/arch/powerpc/net/bpf_jit_comp64.c
+++ b/arch/powerpc/net/bpf_jit_comp64.c
@@ -17,6 +17,7 @@
#include <linux/filter.h>
#include <linux/if_vlan.h>
#include <asm/kprobes.h>
+#include <linux/bpf.h>
#include "bpf_jit64.h"
@@ -77,6 +78,11 @@ static int bpf_jit_stack_local(struct codegen_context *ctx)
return -(BPF_PPC_STACK_SAVE + 16);
}
+static int bpf_jit_stack_tailcallcnt(struct codegen_context *ctx)
+{
+ return bpf_jit_stack_local(ctx) + 8;
+}
+
static int bpf_jit_stack_offsetof(struct codegen_context *ctx, int reg)
{
if (reg >= BPF_PPC_NVR_MIN && reg < 32)
@@ -102,33 +108,25 @@ static void bpf_jit_emit_skb_loads(u32 *image, struct codegen_context *ctx)
PPC_BPF_LL(b2p[SKB_DATA_REG], 3, offsetof(struct sk_buff, data));
}
-static void bpf_jit_emit_func_call(u32 *image, struct codegen_context *ctx, u64 func)
+static void bpf_jit_build_prologue(u32 *image, struct codegen_context *ctx)
{
-#ifdef PPC64_ELF_ABI_v1
- /* func points to the function descriptor */
- PPC_LI64(b2p[TMP_REG_2], func);
- /* Load actual entry point from function descriptor */
- PPC_BPF_LL(b2p[TMP_REG_1], b2p[TMP_REG_2], 0);
- /* ... and move it to LR */
- PPC_MTLR(b2p[TMP_REG_1]);
+ int i;
+
/*
- * Load TOC from function descriptor at offset 8.
- * We can clobber r2 since we get called through a
- * function pointer (so caller will save/restore r2)
- * and since we don't use a TOC ourself.
+ * Initialize tail_call_cnt if we do tail calls.
+ * Otherwise, put in NOPs so that it can be skipped when we are
+ * invoked through a tail call.
*/
- PPC_BPF_LL(2, b2p[TMP_REG_2], 8);
-#else
- /* We can clobber r12 */
- PPC_FUNC_ADDR(12, func);
- PPC_MTLR(12);
-#endif
- PPC_BLRL();
-}
+ if (ctx->seen & SEEN_TAILCALL) {
+ PPC_LI(b2p[TMP_REG_1], 0);
+ /* this goes in the redzone */
+ PPC_BPF_STL(b2p[TMP_REG_1], 1, -(BPF_PPC_STACK_SAVE + 8));
+ } else {
+ PPC_NOP();
+ PPC_NOP();
+ }
-static void bpf_jit_build_prologue(u32 *image, struct codegen_context *ctx)
-{
- int i;
+#define BPF_TAILCALL_PROLOGUE_SIZE 8
if (bpf_has_stack_frame(ctx)) {
/*
@@ -170,13 +168,10 @@ static void bpf_jit_build_prologue(u32 *image, struct codegen_context *ctx)
STACK_FRAME_MIN_SIZE + MAX_BPF_STACK);
}
-static void bpf_jit_build_epilogue(u32 *image, struct codegen_context *ctx)
+static void bpf_jit_emit_common_epilogue(u32 *image, struct codegen_context *ctx)
{
int i;
- /* Move result to r3 */
- PPC_MR(3, b2p[BPF_REG_0]);
-
/* Restore NVRs */
for (i = BPF_REG_6; i <= BPF_REG_10; i++)
if (bpf_is_seen_register(ctx, i))
@@ -198,10 +193,105 @@ static void bpf_jit_build_epilogue(u32 *image, struct codegen_context *ctx)
PPC_MTLR(0);
}
}
+}
+
+static void bpf_jit_build_epilogue(u32 *image, struct codegen_context *ctx)
+{
+ bpf_jit_emit_common_epilogue(image, ctx);
+
+ /* Move result to r3 */
+ PPC_MR(3, b2p[BPF_REG_0]);
PPC_BLR();
}
+static void bpf_jit_emit_func_call(u32 *image, struct codegen_context *ctx, u64 func)
+{
+#ifdef PPC64_ELF_ABI_v1
+ /* func points to the function descriptor */
+ PPC_LI64(b2p[TMP_REG_2], func);
+ /* Load actual entry point from function descriptor */
+ PPC_BPF_LL(b2p[TMP_REG_1], b2p[TMP_REG_2], 0);
+ /* ... and move it to LR */
+ PPC_MTLR(b2p[TMP_REG_1]);
+ /*
+ * Load TOC from function descriptor at offset 8.
+ * We can clobber r2 since we get called through a
+ * function pointer (so caller will save/restore r2)
+ * and since we don't use a TOC ourself.
+ */
+ PPC_BPF_LL(2, b2p[TMP_REG_2], 8);
+#else
+ /* We can clobber r12 */
+ PPC_FUNC_ADDR(12, func);
+ PPC_MTLR(12);
+#endif
+ PPC_BLRL();
+}
+
+static void bpf_jit_emit_tail_call(u32 *image, struct codegen_context *ctx, u32 out)
+{
+ /*
+ * By now, the eBPF program has already setup parameters in r3, r4 and r5
+ * r3/BPF_REG_1 - pointer to ctx -- passed as is to the next bpf program
+ * r4/BPF_REG_2 - pointer to bpf_array
+ * r5/BPF_REG_3 - index in bpf_array
+ */
+ int b2p_bpf_array = b2p[BPF_REG_2];
+ int b2p_index = b2p[BPF_REG_3];
+
+ /*
+ * if (index >= array->map.max_entries)
+ * goto out;
+ */
+ PPC_LWZ(b2p[TMP_REG_1], b2p_bpf_array, offsetof(struct bpf_array, map.max_entries));
+ PPC_CMPLW(b2p_index, b2p[TMP_REG_1]);
+ PPC_BCC(COND_GE, out);
+
+ /*
+ * if (tail_call_cnt > MAX_TAIL_CALL_CNT)
+ * goto out;
+ */
+ PPC_LD(b2p[TMP_REG_1], 1, bpf_jit_stack_tailcallcnt(ctx));
+ PPC_CMPLWI(b2p[TMP_REG_1], MAX_TAIL_CALL_CNT);
+ PPC_BCC(COND_GT, out);
+
+ /*
+ * tail_call_cnt++;
+ */
+ PPC_ADDI(b2p[TMP_REG_1], b2p[TMP_REG_1], 1);
+ PPC_BPF_STL(b2p[TMP_REG_1], 1, bpf_jit_stack_tailcallcnt(ctx));
+
+ /* prog = array->ptrs[index]; */
+ PPC_MULI(b2p[TMP_REG_1], b2p_index, 8);
+ PPC_ADD(b2p[TMP_REG_1], b2p[TMP_REG_1], b2p_bpf_array);
+ PPC_LD(b2p[TMP_REG_1], b2p[TMP_REG_1], offsetof(struct bpf_array, ptrs));
+
+ /*
+ * if (prog == NULL)
+ * goto out;
+ */
+ PPC_CMPLDI(b2p[TMP_REG_1], 0);
+ PPC_BCC(COND_EQ, out);
+
+ /* goto *(prog->bpf_func + prologue_size); */
+ PPC_LD(b2p[TMP_REG_1], b2p[TMP_REG_1], offsetof(struct bpf_prog, bpf_func));
+#ifdef PPC64_ELF_ABI_v1
+ /* skip past the function descriptor */
+ PPC_ADDI(b2p[TMP_REG_1], b2p[TMP_REG_1],
+ FUNCTION_DESCR_SIZE + BPF_TAILCALL_PROLOGUE_SIZE);
+#else
+ PPC_ADDI(b2p[TMP_REG_1], b2p[TMP_REG_1], BPF_TAILCALL_PROLOGUE_SIZE);
+#endif
+ PPC_MTCTR(b2p[TMP_REG_1]);
+
+ /* tear down stack, restore NVRs, ... */
+ bpf_jit_emit_common_epilogue(image, ctx);
+
+ PPC_BCTR();
+ /* out: */
+}
+
/* Assemble the body code between the prologue & epilogue */
static int bpf_jit_build_body(struct bpf_prog *fp, u32 *image,
struct codegen_context *ctx,
@@ -846,9 +936,12 @@ common_load:
break;
/*
- * TODO: Tail call
+ * Tail call
*/
case BPF_JMP | BPF_CALL | BPF_X:
+ ctx->seen |= SEEN_TAILCALL;
+ bpf_jit_emit_tail_call(image, ctx, addrs[i + 1]);
+ break;
default:
/*
--
2.9.3
^ permalink raw reply related
* [PATCH 1/3] bpf powerpc: introduce accessors for using the tmp local stack space
From: Naveen N. Rao @ 2016-09-23 20:35 UTC (permalink / raw)
To: linux-kernel, linuxppc-dev, netdev, Michael Ellerman
Cc: Alexei Starovoitov, Daniel Borkmann, David S. Miller,
Ananth N Mavinakayanahalli
While at it, ensure that the location of the local save area is
consistent whether or not we setup our own stackframe. This property is
utilised in the next patch that adds support for tail calls.
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
---
arch/powerpc/net/bpf_jit64.h | 16 +++++---
arch/powerpc/net/bpf_jit_comp64.c | 79 ++++++++++++++++++++++-----------------
2 files changed, 55 insertions(+), 40 deletions(-)
diff --git a/arch/powerpc/net/bpf_jit64.h b/arch/powerpc/net/bpf_jit64.h
index 5046d6f..a1645d7 100644
--- a/arch/powerpc/net/bpf_jit64.h
+++ b/arch/powerpc/net/bpf_jit64.h
@@ -16,22 +16,25 @@
/*
* Stack layout:
+ * Ensure the top half (upto local_tmp_var) stays consistent
+ * with our redzone usage.
*
* [ prev sp ] <-------------
* [ nv gpr save area ] 8*8 |
+ * [ tail_call_cnt ] 8 |
+ * [ local_tmp_var ] 8 |
* fp (r31) --> [ ebpf stack space ] 512 |
- * [ local/tmp var space ] 16 |
* [ frame header ] 32/112 |
* sp (r1) ---> [ stack pointer ] --------------
*/
-/* for bpf JIT code internal usage */
-#define BPF_PPC_STACK_LOCALS 16
/* for gpr non volatile registers BPG_REG_6 to 10, plus skb cache registers */
#define BPF_PPC_STACK_SAVE (8*8)
+/* for bpf JIT code internal usage */
+#define BPF_PPC_STACK_LOCALS 16
/* Ensure this is quadword aligned */
-#define BPF_PPC_STACKFRAME (STACK_FRAME_MIN_SIZE + BPF_PPC_STACK_LOCALS + \
- MAX_BPF_STACK + BPF_PPC_STACK_SAVE)
+#define BPF_PPC_STACKFRAME (STACK_FRAME_MIN_SIZE + MAX_BPF_STACK + \
+ BPF_PPC_STACK_LOCALS + BPF_PPC_STACK_SAVE)
#ifndef __ASSEMBLY__
@@ -65,6 +68,9 @@ static const int b2p[] = {
[TMP_REG_2] = 10
};
+/* PPC NVR range -- update this if we ever use NVRs below r24 */
+#define BPF_PPC_NVR_MIN 24
+
/* Assembly helpers */
#define DECLARE_LOAD_FUNC(func) u64 func(u64 r3, u64 r4); \
u64 func##_negative_offset(u64 r3, u64 r4); \
diff --git a/arch/powerpc/net/bpf_jit_comp64.c b/arch/powerpc/net/bpf_jit_comp64.c
index 6073b78..5f8c91f 100644
--- a/arch/powerpc/net/bpf_jit_comp64.c
+++ b/arch/powerpc/net/bpf_jit_comp64.c
@@ -58,6 +58,35 @@ static inline bool bpf_has_stack_frame(struct codegen_context *ctx)
return ctx->seen & SEEN_FUNC || bpf_is_seen_register(ctx, BPF_REG_FP);
}
+/*
+ * When not setting up our own stackframe, the redzone usage is:
+ *
+ * [ prev sp ] <-------------
+ * [ ... ] |
+ * sp (r1) ---> [ stack pointer ] --------------
+ * [ nv gpr save area ] 8*8
+ * [ tail_call_cnt ] 8
+ * [ local_tmp_var ] 8
+ * [ unused red zone ] 208 bytes protected
+ */
+static int bpf_jit_stack_local(struct codegen_context *ctx)
+{
+ if (bpf_has_stack_frame(ctx))
+ return STACK_FRAME_MIN_SIZE + MAX_BPF_STACK;
+ else
+ return -(BPF_PPC_STACK_SAVE + 16);
+}
+
+static int bpf_jit_stack_offsetof(struct codegen_context *ctx, int reg)
+{
+ if (reg >= BPF_PPC_NVR_MIN && reg < 32)
+ return (bpf_has_stack_frame(ctx) ? BPF_PPC_STACKFRAME : 0)
+ - (8 * (32 - reg));
+
+ pr_err("BPF JIT is asking about unknown registers");
+ BUG();
+}
+
static void bpf_jit_emit_skb_loads(u32 *image, struct codegen_context *ctx)
{
/*
@@ -100,9 +129,8 @@ static void bpf_jit_emit_func_call(u32 *image, struct codegen_context *ctx, u64
static void bpf_jit_build_prologue(u32 *image, struct codegen_context *ctx)
{
int i;
- bool new_stack_frame = bpf_has_stack_frame(ctx);
- if (new_stack_frame) {
+ if (bpf_has_stack_frame(ctx)) {
/*
* We need a stack frame, but we don't necessarily need to
* save/restore LR unless we call other functions
@@ -122,9 +150,7 @@ static void bpf_jit_build_prologue(u32 *image, struct codegen_context *ctx)
*/
for (i = BPF_REG_6; i <= BPF_REG_10; i++)
if (bpf_is_seen_register(ctx, i))
- PPC_BPF_STL(b2p[i], 1,
- (new_stack_frame ? BPF_PPC_STACKFRAME : 0) -
- (8 * (32 - b2p[i])));
+ PPC_BPF_STL(b2p[i], 1, bpf_jit_stack_offsetof(ctx, b2p[i]));
/*
* Save additional non-volatile regs if we cache skb
@@ -132,22 +158,21 @@ static void bpf_jit_build_prologue(u32 *image, struct codegen_context *ctx)
*/
if (ctx->seen & SEEN_SKB) {
PPC_BPF_STL(b2p[SKB_HLEN_REG], 1,
- BPF_PPC_STACKFRAME - (8 * (32 - b2p[SKB_HLEN_REG])));
+ bpf_jit_stack_offsetof(ctx, b2p[SKB_HLEN_REG]));
PPC_BPF_STL(b2p[SKB_DATA_REG], 1,
- BPF_PPC_STACKFRAME - (8 * (32 - b2p[SKB_DATA_REG])));
+ bpf_jit_stack_offsetof(ctx, b2p[SKB_DATA_REG]));
bpf_jit_emit_skb_loads(image, ctx);
}
/* Setup frame pointer to point to the bpf stack area */
if (bpf_is_seen_register(ctx, BPF_REG_FP))
PPC_ADDI(b2p[BPF_REG_FP], 1,
- BPF_PPC_STACKFRAME - BPF_PPC_STACK_SAVE);
+ STACK_FRAME_MIN_SIZE + MAX_BPF_STACK);
}
static void bpf_jit_build_epilogue(u32 *image, struct codegen_context *ctx)
{
int i;
- bool new_stack_frame = bpf_has_stack_frame(ctx);
/* Move result to r3 */
PPC_MR(3, b2p[BPF_REG_0]);
@@ -155,20 +180,18 @@ static void bpf_jit_build_epilogue(u32 *image, struct codegen_context *ctx)
/* Restore NVRs */
for (i = BPF_REG_6; i <= BPF_REG_10; i++)
if (bpf_is_seen_register(ctx, i))
- PPC_BPF_LL(b2p[i], 1,
- (new_stack_frame ? BPF_PPC_STACKFRAME : 0) -
- (8 * (32 - b2p[i])));
+ PPC_BPF_LL(b2p[i], 1, bpf_jit_stack_offsetof(ctx, b2p[i]));
/* Restore non-volatile registers used for skb cache */
if (ctx->seen & SEEN_SKB) {
PPC_BPF_LL(b2p[SKB_HLEN_REG], 1,
- BPF_PPC_STACKFRAME - (8 * (32 - b2p[SKB_HLEN_REG])));
+ bpf_jit_stack_offsetof(ctx, b2p[SKB_HLEN_REG]));
PPC_BPF_LL(b2p[SKB_DATA_REG], 1,
- BPF_PPC_STACKFRAME - (8 * (32 - b2p[SKB_DATA_REG])));
+ bpf_jit_stack_offsetof(ctx, b2p[SKB_DATA_REG]));
}
/* Tear down our stack frame */
- if (new_stack_frame) {
+ if (bpf_has_stack_frame(ctx)) {
PPC_ADDI(1, 1, BPF_PPC_STACKFRAME);
if (ctx->seen & SEEN_FUNC) {
PPC_BPF_LL(0, 1, PPC_LR_STKOFF);
@@ -200,7 +223,6 @@ static int bpf_jit_build_body(struct bpf_prog *fp, u32 *image,
u64 imm64;
u8 *func;
u32 true_cond;
- int stack_local_off;
/*
* addrs[] maps a BPF bytecode address into a real offset from
@@ -219,9 +241,9 @@ static int bpf_jit_build_body(struct bpf_prog *fp, u32 *image,
* optimization but everything else should work without
* any issues.
*/
- if (dst_reg >= 24 && dst_reg <= 31)
+ if (dst_reg >= BPF_PPC_NVR_MIN && dst_reg < 32)
bpf_set_seen_register(ctx, insn[i].dst_reg);
- if (src_reg >= 24 && src_reg <= 31)
+ if (src_reg >= BPF_PPC_NVR_MIN && src_reg < 32)
bpf_set_seen_register(ctx, insn[i].src_reg);
switch (code) {
@@ -490,25 +512,12 @@ bpf_alu32_trunc:
* Way easier and faster(?) to store the value
* into stack and then use ldbrx
*
- * First, determine where in stack we can store
- * this:
- * - if we have allotted a stack frame, then we
- * will utilize the area set aside by
- * BPF_PPC_STACK_LOCALS
- * - else, we use the area beneath the NV GPR
- * save area
- *
* ctx->seen will be reliable in pass2, but
* the instructions generated will remain the
* same across all passes
*/
- if (bpf_has_stack_frame(ctx))
- stack_local_off = STACK_FRAME_MIN_SIZE;
- else
- stack_local_off = -(BPF_PPC_STACK_SAVE + 8);
-
- PPC_STD(dst_reg, 1, stack_local_off);
- PPC_ADDI(b2p[TMP_REG_1], 1, stack_local_off);
+ PPC_STD(dst_reg, 1, bpf_jit_stack_local(ctx));
+ PPC_ADDI(b2p[TMP_REG_1], 1, bpf_jit_stack_local(ctx));
PPC_LDBRX(dst_reg, 0, b2p[TMP_REG_1]);
break;
}
@@ -668,7 +677,7 @@ emit_clear:
/* Save skb pointer if we need to re-cache skb data */
if (bpf_helper_changes_skb_data(func))
- PPC_BPF_STL(3, 1, STACK_FRAME_MIN_SIZE);
+ PPC_BPF_STL(3, 1, bpf_jit_stack_local(ctx));
bpf_jit_emit_func_call(image, ctx, (u64)func);
@@ -678,7 +687,7 @@ emit_clear:
/* refresh skb cache */
if (bpf_helper_changes_skb_data(func)) {
/* reload skb pointer to r3 */
- PPC_BPF_LL(3, 1, STACK_FRAME_MIN_SIZE);
+ PPC_BPF_LL(3, 1, bpf_jit_stack_local(ctx));
bpf_jit_emit_skb_loads(image, ctx);
}
break;
--
2.9.3
^ permalink raw reply related
* Re: [RFC] net: store port/representative id in metadata_dst
From: John Fastabend @ 2016-09-23 20:25 UTC (permalink / raw)
To: Jakub Kicinski, Samudrala, Sridhar
Cc: Jiri Benc, Jiri Pirko, netdev, Thomas Graf, Roopa Prabhu,
ogerlitz, ast, daniel, simon.horman, Paolo Abeni, Pravin B Shelar,
hannes, kubakici
In-Reply-To: <20160923211728.4c2f05ab@jkicinski-Precision-T1700>
On 16-09-23 01:17 PM, Jakub Kicinski wrote:
> On Fri, 23 Sep 2016 10:22:59 -0700, Samudrala, Sridhar wrote:
>> On 9/23/2016 8:29 AM, Jakub Kicinski wrote:
>>> On Fri, 23 Sep 2016 07:23:26 -0700, John Fastabend wrote:
>>>> Yep, I like the idea in general. I had a slightly different approach in
>>>> mind though. If you look at __dev_queue_xmit() there is a void
>>>> accel_priv pointer (gather you found this based on your commit note).
>>>> My take was we could extend this a bit so it can be used by the VFR
>>>> devices and they could do a dev_queue_xmit_accel(). In this way there is
>>>> no need to touch /net/core/{filter, dst, ip_tunnel}.c etc. Maybe the
>>>> accel logic needs to be extended to push the priv pointer all the way
>>>> through the xmit routine of the target netdev though. This should look
>>>> a lot like the macvlan accelerated xmit device path without the
>>>> switching logic.
>>>>
>>>> Of course maybe the name would be extended to dev_queue_xmit_extended()
>>>> or something.
>>>>
>>>> So the flow on ingress would be,
>>>>
>>>> 1. pkt_received_by_PF_netdev
>>>> 2. PF_netdev reads some tag off packet/descriptor and sets correct
>>>> skb->dev field. This is needed so stack "sees" packets from
>>>> correct VF ports.
>>>> 3. packet passed up to stack.
>>>>
>>>> I guess it is a bit "zombie" like on the receive path because the packet
>>>> is never actually handled by VF netdev code per se and on egress can
>>>> traverse both the VFR and PF netdevs qdiscs. But on the other hand the
>>>> VFR netdevs and PF netdevs are all in the same driver. Plus using a
>>>> queue per VFR is a bit of a waste as its not needed and also hardware
>>>> may not have any mechanism to push VF traffic onto a rx queue.
>>>>
>>>> On egress,
>>>>
>>>> 1. VFR xmit is called
>>>> 2. VFR xmit calls dev_queue_xmit_accel() with some meta-data if needed
>>>> for the lower netdev
>>>> 3. lower netdev sends out the packet.
>>>>
>>>> Again we don't need to waste any queues for each VFR and the VFR can be
>>>> a LLTX device. In this scheme I think you avoid much of the changes in
>>>> your patch and keep it all contained in the driver. Any thoughts?
>>
>> The 'accel' parameter in dev_queue_xmit_accel() is currently only passed
>> to ndo_select_queue() via netdev_pick_tx() and is used to select the tx
>> queue.
>> Also, it is not passed all the way to the driver specific xmit routine.
>> Doesn't it require
>> changing all the driver xmit routines if we want to pass this parameter?
>>
>>> Goes without saying that you have a much better understanding of packet
>>> scheduling so please bear with me :) My target model is that I have
>>> n_cpus x "n_tc/prio" queues on the PF and I want to transmit the
>>> fallback traffic over those same queues. So no new HW queues are used
>>> for VFRs at all. This is a reverse of macvlan offload which AFAICT has
>>> "bastard hw queues" which actually TX for a separate software device.
>>>
>>> My understanding was that I can rework this model to have software
>>> queues for VFRs (#sw queues == #PF queues + #VFRs) but no extra HW
>>> queues (#hw queues == #PF queues) but then when the driver sees a
>>> packet on sw-only VFR queue it has to pick one of the PF queues (which
>>> one?), lock PF software queue to own it, and only then can it
>>> transmit. With the dst_metadata there is no need for extra locking or
>>> queue selection.
>>
>> Yes. The VFPR netdevs don't have any HW queues associated with them and
>> we would like
>> to use the PF queues for the xmit.
>> I was also looking into some way of passing the port id via skb
>> parameter to the
>> dev_queue_xmit() call so that the PF xmit routine can do a directed
>> transmit to a specifc VF.
>> Is skb->cb an option to pass this info?
>> dst_metadata approach would work too if it is acceptable.
>
> I don't think we can trust skb->cb to be set to anything meaningful
> when the skb is received by the lower device.
>
Agreed. I wouldn't recommend using skb->cb. How about passing it through
dev_queue_xmit_accel() through to the driver?
If you pass the metadata through the dev_queue_xmit_accel() handle tx
queue selection would work using normal mechanisms (xps, select_queue,
cls hook, etc.). If you wanted to pick some specific queue based on
policy the policy could be loaded into one of those hooks.
.John
^ permalink raw reply
* [PATCH] nfp: bpf: improve handling for disabled BPF syscall
From: Arnd Bergmann @ 2016-09-23 20:23 UTC (permalink / raw)
To: Jakub Kicinski, David S. Miller
Cc: Arnd Bergmann, oss-drivers, netdev, linux-kernel
I stumbled over a new warning during randconfig testing,
with CONFIG_BPF_SYSCALL disabled:
drivers/net/ethernet/netronome/nfp/nfp_net_offload.c: In function 'nfp_net_bpf_offload':
drivers/net/ethernet/netronome/nfp/nfp_net_offload.c:263:3: error: '*((void *)&res+4)' may be used uninitialized in this function [-Werror=maybe-uninitialized]
drivers/net/ethernet/netronome/nfp/nfp_net_offload.c:263:3: error: 'res.n_instr' may be used uninitialized in this function [-Werror=maybe-uninitialized]
As far as I can tell, this is a false positive caused by the compiler
getting confused about a function that is partially inlined, but it's
easy to avoid while improving the code:
The nfp_bpf_jit() stub helper for that configuration is unusual as it
is defined in a header file but not marked 'static inline'. By moving
the compile-time check into the caller using the IS_ENABLED() macro,
we can remove that stub and simplify the nfp_net_bpf_offload_prepare()
function enough to unconfuse the compiler.
Fixes: 7533fdc0f77f ("nfp: bpf: add hardware bpf offload")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/net/ethernet/netronome/nfp/nfp_bpf.h | 10 ----------
drivers/net/ethernet/netronome/nfp/nfp_net_offload.c | 3 +++
2 files changed, 3 insertions(+), 10 deletions(-)
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_bpf.h b/drivers/net/ethernet/netronome/nfp/nfp_bpf.h
index fc220cd04115..87aa8a3e9112 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_bpf.h
+++ b/drivers/net/ethernet/netronome/nfp/nfp_bpf.h
@@ -192,20 +192,10 @@ struct nfp_bpf_result {
bool dense_mode;
};
-#ifdef CONFIG_BPF_SYSCALL
int
nfp_bpf_jit(struct bpf_prog *filter, void *prog, enum nfp_bpf_action_type act,
unsigned int prog_start, unsigned int prog_done,
unsigned int prog_sz, struct nfp_bpf_result *res);
-#else
-int
-nfp_bpf_jit(struct bpf_prog *filter, void *prog, enum nfp_bpf_action_type act,
- unsigned int prog_start, unsigned int prog_done,
- unsigned int prog_sz, struct nfp_bpf_result *res)
-{
- return -ENOTSUPP;
-}
-#endif
int nfp_prog_verify(struct nfp_prog *nfp_prog, struct bpf_prog *prog);
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_offload.c b/drivers/net/ethernet/netronome/nfp/nfp_net_offload.c
index 43f42f842eda..8acfb631a0ea 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_net_offload.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_net_offload.c
@@ -148,6 +148,9 @@ nfp_net_bpf_offload_prepare(struct nfp_net *nn,
unsigned int max_mtu;
int ret;
+ if (!IS_ENABLED(CONFIG_BPF_SYSCALL))
+ return -ENOTSUPP;
+
ret = nfp_net_bpf_get_act(nn, cls_bpf);
if (ret < 0)
return ret;
--
2.9.0
^ permalink raw reply related
* Re: Alignment issues with freescale FEC driver
From: Uwe Kleine-König @ 2016-09-23 20:22 UTC (permalink / raw)
To: Russell King - ARM Linux
Cc: Eric Nelson, Fugang Duan, Otavio Salvador, netdev@vger.kernel.org,
Troy Kisky, Eric Dumazet, Simone,
linux-arm-kernel@lists.infradead.org, kernel
In-Reply-To: <20160923183725.GC1041@n2100.armlinux.org.uk>
Hello Russell,
On Fri, Sep 23, 2016 at 07:37:25PM +0100, Russell King - ARM Linux wrote:
> On Fri, Sep 23, 2016 at 11:26:18AM -0700, Eric Nelson wrote:
> > So the question is: should we just live with this and acknowledge a
> > performance penalty of bad alignment or do something about it?
>
> Well, I've no interest in trying to do anything with the FEC driver
> anymore, as I'll just generate another big patch stack which won't
> make it into the kernel in a timely fashion - my last attempt at
> improving the FEC driver was dogged with conflicting changes and I
> gave up with it in the end. I ended up spending a full cycle
> rebasing, re-testing, and re-evaluating their performance only to find
> that I'd missed the merge window again, and other conflicting changes
> got merged which meant that I had to start from the beginning again.
I'm not included in the set of people who are responsible to review and
merge fec patches, but I'd be surprised if you couldn't get an exclusive
lock for that driver. Something like: After 4.X-rc1 the fec isn't
touched any more until you got your series ready for the 4.X+1 merge
window. Of course some fixes might have to go in, but these hopefully
won't disturb much.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply
* Re: [RFC] net: store port/representative id in metadata_dst
From: Jakub Kicinski @ 2016-09-23 20:17 UTC (permalink / raw)
To: Samudrala, Sridhar
Cc: John Fastabend, Jiri Benc, Jiri Pirko, netdev, Thomas Graf,
Roopa Prabhu, ogerlitz, ast, daniel, simon.horman, Paolo Abeni,
Pravin B Shelar, hannes, kubakici
In-Reply-To: <57E564F3.5010107@intel.com>
On Fri, 23 Sep 2016 10:22:59 -0700, Samudrala, Sridhar wrote:
> On 9/23/2016 8:29 AM, Jakub Kicinski wrote:
> > On Fri, 23 Sep 2016 07:23:26 -0700, John Fastabend wrote:
> >> Yep, I like the idea in general. I had a slightly different approach in
> >> mind though. If you look at __dev_queue_xmit() there is a void
> >> accel_priv pointer (gather you found this based on your commit note).
> >> My take was we could extend this a bit so it can be used by the VFR
> >> devices and they could do a dev_queue_xmit_accel(). In this way there is
> >> no need to touch /net/core/{filter, dst, ip_tunnel}.c etc. Maybe the
> >> accel logic needs to be extended to push the priv pointer all the way
> >> through the xmit routine of the target netdev though. This should look
> >> a lot like the macvlan accelerated xmit device path without the
> >> switching logic.
> >>
> >> Of course maybe the name would be extended to dev_queue_xmit_extended()
> >> or something.
> >>
> >> So the flow on ingress would be,
> >>
> >> 1. pkt_received_by_PF_netdev
> >> 2. PF_netdev reads some tag off packet/descriptor and sets correct
> >> skb->dev field. This is needed so stack "sees" packets from
> >> correct VF ports.
> >> 3. packet passed up to stack.
> >>
> >> I guess it is a bit "zombie" like on the receive path because the packet
> >> is never actually handled by VF netdev code per se and on egress can
> >> traverse both the VFR and PF netdevs qdiscs. But on the other hand the
> >> VFR netdevs and PF netdevs are all in the same driver. Plus using a
> >> queue per VFR is a bit of a waste as its not needed and also hardware
> >> may not have any mechanism to push VF traffic onto a rx queue.
> >>
> >> On egress,
> >>
> >> 1. VFR xmit is called
> >> 2. VFR xmit calls dev_queue_xmit_accel() with some meta-data if needed
> >> for the lower netdev
> >> 3. lower netdev sends out the packet.
> >>
> >> Again we don't need to waste any queues for each VFR and the VFR can be
> >> a LLTX device. In this scheme I think you avoid much of the changes in
> >> your patch and keep it all contained in the driver. Any thoughts?
>
> The 'accel' parameter in dev_queue_xmit_accel() is currently only passed
> to ndo_select_queue() via netdev_pick_tx() and is used to select the tx
> queue.
> Also, it is not passed all the way to the driver specific xmit routine.
> Doesn't it require
> changing all the driver xmit routines if we want to pass this parameter?
>
> > Goes without saying that you have a much better understanding of packet
> > scheduling so please bear with me :) My target model is that I have
> > n_cpus x "n_tc/prio" queues on the PF and I want to transmit the
> > fallback traffic over those same queues. So no new HW queues are used
> > for VFRs at all. This is a reverse of macvlan offload which AFAICT has
> > "bastard hw queues" which actually TX for a separate software device.
> >
> > My understanding was that I can rework this model to have software
> > queues for VFRs (#sw queues == #PF queues + #VFRs) but no extra HW
> > queues (#hw queues == #PF queues) but then when the driver sees a
> > packet on sw-only VFR queue it has to pick one of the PF queues (which
> > one?), lock PF software queue to own it, and only then can it
> > transmit. With the dst_metadata there is no need for extra locking or
> > queue selection.
>
> Yes. The VFPR netdevs don't have any HW queues associated with them and
> we would like
> to use the PF queues for the xmit.
> I was also looking into some way of passing the port id via skb
> parameter to the
> dev_queue_xmit() call so that the PF xmit routine can do a directed
> transmit to a specifc VF.
> Is skb->cb an option to pass this info?
> dst_metadata approach would work too if it is acceptable.
I don't think we can trust skb->cb to be set to anything meaningful
when the skb is received by the lower device.
^ permalink raw reply
* [PATCH] mlx5: Add ndo_poll_controller() implementation
From: Calvin Owens @ 2016-09-23 20:13 UTC (permalink / raw)
To: Saeed Mahameed, Matan Barak, Leon Romanovsky
Cc: netdev, linux-kernel, kernel-team, Calvin Owens
This implements ndo_poll_controller in net_device_ops for mlx5, which is
necessary to use netconsole with this driver.
Signed-off-by: Calvin Owens <calvinowens@fb.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index 2459c7f..439476f 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -2786,6 +2786,20 @@ static void mlx5e_tx_timeout(struct net_device *dev)
schedule_work(&priv->tx_timeout_work);
}
+#ifdef CONFIG_NET_POLL_CONTROLLER
+/* Fake "interrupt" called by netpoll (eg netconsole) to send skbs without
+ * reenabling interrupts.
+ */
+static void mlx5e_netpoll(struct net_device *dev)
+{
+ struct mlx5e_priv *priv = netdev_priv(dev);
+ int i, nr_sq = priv->params.num_channels * priv->params.num_tc;
+
+ for (i = 0; i < nr_sq; i++)
+ napi_schedule(priv->txq_to_sq_map[i]->cq.napi);
+}
+#endif
+
static const struct net_device_ops mlx5e_netdev_ops_basic = {
.ndo_open = mlx5e_open,
.ndo_stop = mlx5e_close,
@@ -2805,6 +2819,9 @@ static const struct net_device_ops mlx5e_netdev_ops_basic = {
.ndo_rx_flow_steer = mlx5e_rx_flow_steer,
#endif
.ndo_tx_timeout = mlx5e_tx_timeout,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+ .ndo_poll_controller = mlx5e_netpoll,
+#endif
};
static const struct net_device_ops mlx5e_netdev_ops_sriov = {
@@ -2836,6 +2853,9 @@ static const struct net_device_ops mlx5e_netdev_ops_sriov = {
.ndo_set_vf_link_state = mlx5e_set_vf_link_state,
.ndo_get_vf_stats = mlx5e_get_vf_stats,
.ndo_tx_timeout = mlx5e_tx_timeout,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+ .ndo_poll_controller = mlx5e_netpoll,
+#endif
};
static int mlx5e_check_required_hca_cap(struct mlx5_core_dev *mdev)
--
2.9.3
^ permalink raw reply related
* Re: [PATCH net v2] ip6_gre: fix flowi6_proto value in ip6gre_xmit_other()
From: Sergei Shtylyov @ 2016-09-23 20:01 UTC (permalink / raw)
To: Lance Richardson, netdev; +Cc: shmulik.ladkani, jbenc
In-Reply-To: <1474660229-5665-1-git-send-email-lrichard@redhat.com>
Hello.
On 09/23/2016 10:50 PM, Lance Richardson wrote:
> Similar to commit 3be07244b733 ("ip6_gre: fix flowi6_proto value in
> xmit path"), set flowi6_proto to IPPROTO_GRE for output route lookup.
>
> Up until now, ip6gre_xmit_other() has set flowi6_proto to a bogus value.
> This affected output route lookup for packets sent on an ip6gretap device
> in cases where routing was dependent on the value of flowi6_proto.
>
> Since the correct proto is already set in the tunnel flowi6 template via
> commit 252f3f5a1189 ("ip6_gre: Set flowi6_proto as IPPROTO_GRE in xmit
> path."), simply delete the line setting the incorrect flowi6_proto value.
>
> Suggested-by: Jiri Benc <jbenc@redhat.com>
> Fixes: commit c12b395a4664 ("gre: Support GRE over IPv6")
That "commit" isn't needed here, this tag has a standardized format.
Hopefully, can be fixed while applying...
> Reviewed-by: Shmulik Ladkani <shmulik.ladkani@gmail.com>
> Signed-off-by: Lance Richardson <lrichard@redhat.com>
[...]
MBR, Sergei
^ permalink raw reply
* [PATCH 3/3] mac80211: Set lower memory limit for non-VHT devices
From: Toke Høiland-Jørgensen @ 2016-09-23 19:59 UTC (permalink / raw)
To: make-wifi-fast-JXvr2/1DY2fm6VMwtOF2vx4hnT+Y9+D1,
linux-wireless-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA
Cc: Toke Høiland-Jørgensen
In-Reply-To: <20160923195911.4572-1-toke-LJ9M9ZcSy1A@public.gmane.org>
Small devices can run out of memory from queueing too many packets. If
VHT is not supported by the PHY, having more than 4 MBytes of total
queue in the TXQ intermediate queues is not needed, and so we can safely
limit the memory usage in these cases and avoid OOM.
Signed-off-by: Toke Høiland-Jørgensen <toke-LJ9M9ZcSy1A@public.gmane.org>
---
net/mac80211/tx.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 1ff08be..82f41fc 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1434,6 +1434,8 @@ int ieee80211_txq_setup_flows(struct ieee80211_local *local)
struct fq *fq = &local->fq;
int ret;
int i;
+ bool supp_vht = false;
+ enum nl80211_band band;
if (!local->ops->wake_tx_queue)
return 0;
@@ -1442,6 +1444,22 @@ int ieee80211_txq_setup_flows(struct ieee80211_local *local)
if (ret)
return ret;
+ /*
+ * If the hardware doesn't support VHT, it is safe to limit the maximum
+ * queue size. 4 Mbytes is 64 max-size aggregates in 802.11n.
+ */
+ for (band = 0; band < NUM_NL80211_BANDS; band++) {
+ struct ieee80211_supported_band *sband;
+
+ sband = local->hw.wiphy->bands[band];
+ if (!sband)
+ continue;
+
+ supp_vht = supp_vht || sband->vht_cap.vht_supported;
+ }
+ if (!supp_vht)
+ fq->memory_limit = 4 << 20; /* 4 Mbytes */
+
codel_params_init(&local->cparams);
local->cparams.interval = MS2TIME(100);
local->cparams.target = MS2TIME(20);
--
2.9.3
^ permalink raw reply related
* [PATCH 2/3] mac80211: Export fq memory limit information in debugfs
From: Toke Høiland-Jørgensen @ 2016-09-23 19:59 UTC (permalink / raw)
To: make-wifi-fast-JXvr2/1DY2fm6VMwtOF2vx4hnT+Y9+D1,
linux-wireless-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA
Cc: Toke Høiland-Jørgensen
In-Reply-To: <20160923195911.4572-1-toke-LJ9M9ZcSy1A@public.gmane.org>
Add memory limit, usage and overlimit counter to per-PHY 'aqm' debugfs
file.
Signed-off-by: Toke Høiland-Jørgensen <toke-LJ9M9ZcSy1A@public.gmane.org>
---
net/mac80211/debugfs.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/net/mac80211/debugfs.c b/net/mac80211/debugfs.c
index 8ca62b6..f56e2f4 100644
--- a/net/mac80211/debugfs.c
+++ b/net/mac80211/debugfs.c
@@ -89,13 +89,19 @@ static ssize_t aqm_read(struct file *file,
"R fq_flows_cnt %u\n"
"R fq_backlog %u\n"
"R fq_overlimit %u\n"
+ "R fq_overmemory %u\n"
"R fq_collisions %u\n"
+ "R fq_memory_usage %u\n"
+ "RW fq_memory_limit %u\n"
"RW fq_limit %u\n"
"RW fq_quantum %u\n",
fq->flows_cnt,
fq->backlog,
+ fq->overmemory,
fq->overlimit,
fq->collisions,
+ fq->memory_usage,
+ fq->memory_limit,
fq->limit,
fq->quantum);
@@ -128,6 +134,8 @@ static ssize_t aqm_write(struct file *file,
if (sscanf(buf, "fq_limit %u", &local->fq.limit) == 1)
return count;
+ else if (sscanf(buf, "fq_memory_limit %u", &local->fq.memory_limit) == 1)
+ return count;
else if (sscanf(buf, "fq_quantum %u", &local->fq.quantum) == 1)
return count;
--
2.9.3
^ permalink raw reply related
* [PATCH 1/3] fq.h: Port memory limit mechanism from fq_codel
From: Toke Høiland-Jørgensen @ 2016-09-23 19:59 UTC (permalink / raw)
To: make-wifi-fast-JXvr2/1DY2fm6VMwtOF2vx4hnT+Y9+D1,
linux-wireless-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA
Cc: Toke Høiland-Jørgensen
In-Reply-To: <20160923195911.4572-1-toke-LJ9M9ZcSy1A@public.gmane.org>
The reusable fairness queueing implementation (fq.h) lacks the memory
usage limit that the fq_codel qdisc has. This means that small
devices (e.g. WiFi routers) can run out of memory when flooded with a
large number of packets. This ports the memory limit feature from
fq_codel to fq.h.
Signed-off-by: Toke Høiland-Jørgensen <toke-LJ9M9ZcSy1A@public.gmane.org>
---
include/net/fq.h | 3 +++
include/net/fq_impl.h | 7 ++++++-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/include/net/fq.h b/include/net/fq.h
index 268b490..6d8521a 100644
--- a/include/net/fq.h
+++ b/include/net/fq.h
@@ -72,9 +72,12 @@ struct fq {
u32 flows_cnt;
u32 perturbation;
u32 limit;
+ u32 memory_limit;
+ u32 memory_usage;
u32 quantum;
u32 backlog;
u32 overlimit;
+ u32 overmemory;
u32 collisions;
};
diff --git a/include/net/fq_impl.h b/include/net/fq_impl.h
index 163f3ed..4e6131c 100644
--- a/include/net/fq_impl.h
+++ b/include/net/fq_impl.h
@@ -29,6 +29,7 @@ static struct sk_buff *fq_flow_dequeue(struct fq *fq,
tin->backlog_packets--;
flow->backlog -= skb->len;
fq->backlog--;
+ fq->memory_usage -= skb->truesize;
if (flow->backlog == 0) {
list_del_init(&flow->backlogchain);
@@ -154,6 +155,7 @@ static void fq_tin_enqueue(struct fq *fq,
flow->backlog += skb->len;
tin->backlog_bytes += skb->len;
tin->backlog_packets++;
+ fq->memory_usage += skb->truesize;
fq->backlog++;
fq_recalc_backlog(fq, tin, flow);
@@ -166,7 +168,7 @@ static void fq_tin_enqueue(struct fq *fq,
__skb_queue_tail(&flow->queue, skb);
- if (fq->backlog > fq->limit) {
+ if (fq->backlog > fq->limit || fq->memory_usage > fq->memory_limit) {
flow = list_first_entry_or_null(&fq->backlogs,
struct fq_flow,
backlogchain);
@@ -181,6 +183,8 @@ static void fq_tin_enqueue(struct fq *fq,
flow->tin->overlimit++;
fq->overlimit++;
+ if (fq->memory_usage > fq->memory_limit)
+ fq->overmemory++;
}
}
@@ -251,6 +255,7 @@ static int fq_init(struct fq *fq, int flows_cnt)
fq->perturbation = prandom_u32();
fq->quantum = 300;
fq->limit = 8192;
+ fq->memory_limit = 16 << 20; /* 16 MBytes */
fq->flows = kcalloc(fq->flows_cnt, sizeof(fq->flows[0]), GFP_KERNEL);
if (!fq->flows)
--
2.9.3
^ permalink raw reply related
* [PATCH 0/3] Add memory limits to fq.h and mac80211 TXQ
From: Toke Høiland-Jørgensen @ 2016-09-23 19:59 UTC (permalink / raw)
To: make-wifi-fast-JXvr2/1DY2fm6VMwtOF2vx4hnT+Y9+D1,
linux-wireless-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA
Cc: Toke Høiland-Jørgensen
This is a series of small patches to avoid OOM conditions on small
wireless devices with the mac80211 intermediate TXQ structure. The
current default limit in fq.h translates to up to 16 Mbytes of memory
usage, which can be fatal to a device with 32 MBytes of total RAM.
Rather than just change the fq_limit, this ports the memory limit
mechanism from the fq_codel qdisc. The second patch in the series just
adds the new fields to the mac80211 'aqm' debugfs file.
The third patch changes mac80211 to set a lower memory limit for non-VHT
devices. The assumption is that (a) for 802.11n and lower 4 Mbytes of
total queue (2048 packets, 64 max-size aggregates) is plenty, and so it
is safe to simply limit the queue size. And (b) that VHT-capable devices
are usually installed in systems equipped with more system memory.
Toke Høiland-Jørgensen (3):
fq.h: Port memory limit mechanism from fq_codel
mac80211: Export fq memory limit information in debugfs
mac80211: Set lower memory limit for non-VHT devices
include/net/fq.h | 3 +++
include/net/fq_impl.h | 7 ++++++-
net/mac80211/debugfs.c | 8 ++++++++
net/mac80211/tx.c | 18 ++++++++++++++++++
4 files changed, 35 insertions(+), 1 deletion(-)
--
2.9.3
base-commit: fb2a3d5c7c85cb6e8bc88192be919b4ef8d6e630
^ permalink raw reply
* Re: [PATCH net] ip6_gre: fix flowi6_proto value in ip6gre_xmit_other()
From: Shmulik Ladkani @ 2016-09-23 19:57 UTC (permalink / raw)
To: Lance Richardson; +Cc: netdev
In-Reply-To: <745948754.3473250.1474660344493.JavaMail.zimbra@redhat.com>
On Fri, 23 Sep 2016 15:52:24 -0400 (EDT) Lance Richardson <lrichard@redhat.com> wrote:
> > From: "Shmulik Ladkani" <shmulik.ladkani@gmail.com>
> > Suggesting to add:
> >
> > Up until now, 'ip6gre_xmit_other' has set flowi6_proto to a bogus value.
> > This affects output route lookup upon xmit of non ipv4/ipv6 packets on a
> > ip6gretap device, in cases where routing depends on flowi6_proto.
> >
>
> Added in v2, taking some editorial license (please let me know if I mangled it
> too badly).
Thanks Lance, looks good.
^ permalink raw reply
* Re: [PATCH net] ip6_gre: fix flowi6_proto value in ip6gre_xmit_other()
From: Lance Richardson @ 2016-09-23 19:52 UTC (permalink / raw)
To: Shmulik Ladkani; +Cc: netdev
In-Reply-To: <20160923220036.55d469b0@halley>
> From: "Shmulik Ladkani" <shmulik.ladkani@gmail.com>
> To: "Lance Richardson" <lrichard@redhat.com>
> Cc: netdev@vger.kernel.org
> Sent: Friday, September 23, 2016 3:00:36 PM
> Subject: Re: [PATCH net] ip6_gre: fix flowi6_proto value in ip6gre_xmit_other()
>
> On Fri, 23 Sep 2016 12:54:59 -0400 Lance Richardson <lrichard@redhat.com>
> wrote:
> > Similar to commit 3be07244b733 ("ip6_gre: fix flowi6_proto value in
> > xmit path"), set flowi6_proto to IPPROTO_GRE for output route lookup.
>
> Suggesting to add:
>
> Up until now, 'ip6gre_xmit_other' has set flowi6_proto to a bogus value.
> This affects output route lookup upon xmit of non ipv4/ipv6 packets on a
> ip6gretap device, in cases where routing depends on flowi6_proto.
>
Added in v2, taking some editorial license (please let me know if I mangled it
too badly).
Thanks,
Lance
> > Since the correct proto is already set in the tunnel flowi6 template via
> > commit 252f3f5a1189 ("ip6_gre: Set flowi6_proto as IPPROTO_GRE in xmit
> > path."), simply delete the line setting the incorrect flowi6_proto value.
> >
> > Suggested-by: Jiri Benc <jbenc@redhat.com>
> > Fixes: commit c12b395a4664 ("gre: Support GRE over IPv6")
> > Signed-off-by: Lance Richardson <lrichard@redhat.com>
>
> Reviewed-by: Shmulik Ladkani <shmulik.ladkani@gmail.com>
>
^ permalink raw reply
* [PATCH net v2] ip6_gre: fix flowi6_proto value in ip6gre_xmit_other()
From: Lance Richardson @ 2016-09-23 19:50 UTC (permalink / raw)
To: netdev; +Cc: shmulik.ladkani, jbenc
Similar to commit 3be07244b733 ("ip6_gre: fix flowi6_proto value in
xmit path"), set flowi6_proto to IPPROTO_GRE for output route lookup.
Up until now, ip6gre_xmit_other() has set flowi6_proto to a bogus value.
This affected output route lookup for packets sent on an ip6gretap device
in cases where routing was dependent on the value of flowi6_proto.
Since the correct proto is already set in the tunnel flowi6 template via
commit 252f3f5a1189 ("ip6_gre: Set flowi6_proto as IPPROTO_GRE in xmit
path."), simply delete the line setting the incorrect flowi6_proto value.
Suggested-by: Jiri Benc <jbenc@redhat.com>
Fixes: commit c12b395a4664 ("gre: Support GRE over IPv6")
Reviewed-by: Shmulik Ladkani <shmulik.ladkani@gmail.com>
Signed-off-by: Lance Richardson <lrichard@redhat.com>
---
v2: expanded commit description as suggested by Shmulik Ladkani.
net/ipv6/ip6_gre.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
index 704274c..edc3daa 100644
--- a/net/ipv6/ip6_gre.c
+++ b/net/ipv6/ip6_gre.c
@@ -648,7 +648,6 @@ static int ip6gre_xmit_other(struct sk_buff *skb, struct net_device *dev)
encap_limit = t->parms.encap_limit;
memcpy(&fl6, &t->fl.u.ip6, sizeof(fl6));
- fl6.flowi6_proto = skb->protocol;
err = gre_handle_offloads(skb, !!(t->parms.o_flags & TUNNEL_CSUM));
if (err)
--
2.5.5
^ permalink raw reply related
* Re: [PATCH] realtek: Add switch variable to 'switch case not processed' messages
From: Larry Finger @ 2016-09-23 19:07 UTC (permalink / raw)
To: Joe Perches, Jean Delvare, Chaoming Li
Cc: Kalle Valo, linux-wireless-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <d091f73a6adf3bdaa09ab0399c22a9fdfe9b188c.1474654979.git.joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
On 09/23/2016 01:27 PM, Joe Perches wrote:
> Help along debugging by showing what switch/case variable is not
> being processed in these messages.
>
> Signed-off-by: Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
Acked-by: Larry Finger <Larry.Finger-tQ5ms3gMjBLk1uMJSBkQmQ@public.gmane.org>
Thanks,
Larry
^ permalink raw reply
* Re: [PATCH] realtek: Add switch variable to 'switch case not processed' messages
From: Joe Perches @ 2016-09-23 19:02 UTC (permalink / raw)
To: Larry Finger, Jean Delvare, Chaoming Li
Cc: Kalle Valo, linux-wireless, netdev, linux-kernel
In-Reply-To: <f98d2cf1-802a-93c1-b219-ec45aa417940@lwfinger.net>
On Fri, 2016-09-23 at 13:59 -0500, Larry Finger wrote:
> I'm not familiar with the %#x format. What does it do?
Outputs SPECIAL prefix, it's the same as "0x%x"
lib/vsprintf.c:
#define SPECIAL 64 /* prefix hex with "0x", octal with "0" */
^ permalink raw reply
* Re: [PATCH net] ip6_gre: fix flowi6_proto value in ip6gre_xmit_other()
From: Shmulik Ladkani @ 2016-09-23 19:00 UTC (permalink / raw)
To: Lance Richardson; +Cc: netdev
In-Reply-To: <1474649699-31069-1-git-send-email-lrichard@redhat.com>
On Fri, 23 Sep 2016 12:54:59 -0400 Lance Richardson <lrichard@redhat.com> wrote:
> Similar to commit 3be07244b733 ("ip6_gre: fix flowi6_proto value in
> xmit path"), set flowi6_proto to IPPROTO_GRE for output route lookup.
Suggesting to add:
Up until now, 'ip6gre_xmit_other' has set flowi6_proto to a bogus value.
This affects output route lookup upon xmit of non ipv4/ipv6 packets on a
ip6gretap device, in cases where routing depends on flowi6_proto.
> Since the correct proto is already set in the tunnel flowi6 template via
> commit 252f3f5a1189 ("ip6_gre: Set flowi6_proto as IPPROTO_GRE in xmit
> path."), simply delete the line setting the incorrect flowi6_proto value.
>
> Suggested-by: Jiri Benc <jbenc@redhat.com>
> Fixes: commit c12b395a4664 ("gre: Support GRE over IPv6")
> Signed-off-by: Lance Richardson <lrichard@redhat.com>
Reviewed-by: Shmulik Ladkani <shmulik.ladkani@gmail.com>
^ permalink raw reply
* Re: [PATCH] Net Driver: Add Cypress GX3 VID=04b4 PID=3610.
From: Greg KH @ 2016-09-23 19:00 UTC (permalink / raw)
To: chris.roth-/KKvz3x1pcI
Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <a6cbbf76a41946efa9f87dc15d4bba53-7W3tOxt+DW0TrS4zaltX1A@public.gmane.org>
On Fri, Sep 23, 2016 at 12:24:50PM -0600, chris.roth-/KKvz3x1pcI@public.gmane.org wrote:
> From: Chris Roth <chris.roth-/KKvz3x1pcI@public.gmane.org>
>
> Add support for Cypress GX3 SuperSpeed to Gigabit Ethernet
> Bridge Controller (Vendor=04b4 ProdID=3610).
>
> Patch verified on x64 linux kernel 4.7.4 system with the
> Kensington SD4600P USB-C Universal Dock with Power, which uses the
> Cypress GX3 SuperSpeed to Gigabit Ethernet Bridge Controller.
>
> A similar patch was signed-off and tested-by Allan Chou
> <allan-knRN6Y/kmf1NUHwG+Fw1Kw@public.gmane.org> on 2015-12-01.
Then you should put a "From: " line at the top of this patch that looks
like:
From: Allan Chou <allan-knRN6Y/kmf1NUHwG+Fw1Kw@public.gmane.org>
at the top of the patch and then a blank line, and put the signed-off-by
back in the patch as well, with yours below it. The file
Documentation/SubmittingPatches should show you how to do this.
Can you try again?
thanks,
greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH] realtek: Add switch variable to 'switch case not processed' messages
From: Larry Finger @ 2016-09-23 18:59 UTC (permalink / raw)
To: Joe Perches, Jean Delvare, Chaoming Li
Cc: Kalle Valo, linux-wireless, netdev, linux-kernel
In-Reply-To: <d091f73a6adf3bdaa09ab0399c22a9fdfe9b188c.1474654979.git.joe@perches.com>
On 09/23/2016 01:27 PM, Joe Perches wrote:
> Help along debugging by showing what switch/case variable is not
> being processed in these messages.
>
> Signed-off-by: Joe Perches <joe@perches.com>
Joe,
You beat me to the patch. No problem as this one looks OK; however, I'm not
familiar with the %#x format. What does it do?
Larry
> ---
> drivers/net/wireless/realtek/rtlwifi/core.c | 3 ++-
> drivers/net/wireless/realtek/rtlwifi/pci.c | 3 ++-
> drivers/net/wireless/realtek/rtlwifi/ps.c | 2 +-
> drivers/net/wireless/realtek/rtlwifi/rtl8188ee/fw.c | 4 ++--
> drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c | 9 +++++----
> drivers/net/wireless/realtek/rtlwifi/rtl8188ee/led.c | 4 ++--
> drivers/net/wireless/realtek/rtlwifi/rtl8188ee/phy.c | 10 ++++++----
> .../wireless/realtek/rtlwifi/rtl8192c/fw_common.c | 4 ++--
> .../wireless/realtek/rtlwifi/rtl8192c/phy_common.c | 8 +++++---
> drivers/net/wireless/realtek/rtlwifi/rtl8192ce/hw.c | 7 ++++---
> drivers/net/wireless/realtek/rtlwifi/rtl8192ce/led.c | 4 ++--
> drivers/net/wireless/realtek/rtlwifi/rtl8192ce/phy.c | 7 ++-----
> drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c | 4 ++--
> drivers/net/wireless/realtek/rtlwifi/rtl8192cu/led.c | 4 ++--
> drivers/net/wireless/realtek/rtlwifi/rtl8192cu/phy.c | 7 ++-----
> drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c | 4 ++--
> drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c | 9 +++++----
> drivers/net/wireless/realtek/rtlwifi/rtl8192de/led.c | 4 ++--
> drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c | 15 +++++++--------
> drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c | 4 ++--
> drivers/net/wireless/realtek/rtlwifi/rtl8192ee/hw.c | 9 +++++----
> drivers/net/wireless/realtek/rtlwifi/rtl8192ee/led.c | 4 ++--
> drivers/net/wireless/realtek/rtlwifi/rtl8192ee/phy.c | 10 ++++++----
> drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c | 9 +++++----
> drivers/net/wireless/realtek/rtlwifi/rtl8192se/led.c | 4 ++--
> drivers/net/wireless/realtek/rtlwifi/rtl8192se/phy.c | 5 +++--
> drivers/net/wireless/realtek/rtlwifi/rtl8723ae/fw.c | 4 ++--
> drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c | 9 +++++----
> drivers/net/wireless/realtek/rtlwifi/rtl8723ae/led.c | 4 ++--
> drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c | 10 ++++++----
> drivers/net/wireless/realtek/rtlwifi/rtl8723be/fw.c | 4 ++--
> drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c | 10 +++++-----
> drivers/net/wireless/realtek/rtlwifi/rtl8723be/led.c | 4 ++--
> drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c | 12 +++++++-----
> drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c | 4 ++--
> drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c | 9 +++++----
> drivers/net/wireless/realtek/rtlwifi/rtl8821ae/led.c | 4 ++--
> drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c | 20 ++++++--------------
> 38 files changed, 128 insertions(+), 123 deletions(-)
>
> diff --git a/drivers/net/wireless/realtek/rtlwifi/core.c b/drivers/net/wireless/realtek/rtlwifi/core.c
> index 7aee5ebb1..f95760c 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/core.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/core.c
> @@ -765,7 +765,8 @@ static int rtl_op_config(struct ieee80211_hw *hw, u32 changed)
> mac->bw_40 = false;
> mac->bw_80 = false;
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not processed\n");
> + "switch case %#x not processed\n",
> + channel_type);
> break;
> }
> }
> diff --git a/drivers/net/wireless/realtek/rtlwifi/pci.c b/drivers/net/wireless/realtek/rtlwifi/pci.c
> index d12586d..0dfa9ea 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/pci.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/pci.c
> @@ -179,7 +179,8 @@ static void _rtl_pci_update_default_setting(struct ieee80211_hw *hw)
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not processed\n");
> + "switch case %#x not processed\n",
> + rtlpci->const_support_pciaspm);
> break;
> }
>
> diff --git a/drivers/net/wireless/realtek/rtlwifi/ps.c b/drivers/net/wireless/realtek/rtlwifi/ps.c
> index 9a64f9b..18d979a 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/ps.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/ps.c
> @@ -151,7 +151,7 @@ static bool rtl_ps_set_rf_state(struct ieee80211_hw *hw,
>
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not processed\n");
> + "switch case %#x not processed\n", state_toset);
> break;
> }
>
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/fw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/fw.c
> index 6291256..5360d53 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/fw.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/fw.c
> @@ -334,7 +334,7 @@ static void _rtl88e_fill_h2c_command(struct ieee80211_hw *hw,
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
> - "switch case not process\n");
> + "switch case %#x not processed\n", boxnum);
> break;
> }
> isfw_read = _rtl88e_check_fw_read_last_h2c(hw, boxnum);
> @@ -405,7 +405,7 @@ static void _rtl88e_fill_h2c_command(struct ieee80211_hw *hw,
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
> - "switch case not process\n");
> + "switch case %#x not processed\n", cmd_len);
> break;
> }
>
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c
> index 4ab6201..3285117 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c
> @@ -357,7 +357,7 @@ void rtl88ee_get_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
> break; }
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not process %x\n", variable);
> + "switch case %#x not processed\n", variable);
> break;
> }
> }
> @@ -571,7 +571,8 @@ void rtl88ee_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not process\n");
> + "switch case %#x not processed\n",
> + e_aci);
> break;
> }
> }
> @@ -735,7 +736,7 @@ void rtl88ee_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
> break; }
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not process %x\n", variable);
> + "switch case %#x not processed\n", variable);
> break;
> }
> }
> @@ -2352,7 +2353,7 @@ void rtl88ee_set_key(struct ieee80211_hw *hw, u32 key_index,
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not process\n");
> + "switch case %#x not processed\n", enc_algo);
> enc_algo = CAM_TKIP;
> break;
> }
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/led.c b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/led.c
> index b504bd0..f05c2c6 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/led.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/led.c
> @@ -62,7 +62,7 @@ void rtl88ee_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled)
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
> - "switch case not process\n");
> + "switch case %#x not processed\n", pled->ledpin);
> break;
> }
> pled->ledon = true;
> @@ -100,7 +100,7 @@ void rtl88ee_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled)
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
> - "switch case not process\n");
> + "switch case %#x not processed\n", pled->ledpin);
> break;
> }
> pled->ledon = false;
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/phy.c
> index 7498a12..fffaa92 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/phy.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/phy.c
> @@ -1346,7 +1346,8 @@ static bool _rtl88e_phy_sw_chnl_step_by_step(struct ieee80211_hw *hw,
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
> - "switch case not process\n");
> + "switch case %#x not processed\n",
> + currentcmd->cmdid);
> break;
> }
>
> @@ -2128,7 +2129,7 @@ bool rtl88e_phy_set_io_cmd(struct ieee80211_hw *hw, enum io_type iotype)
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
> - "switch case not process\n");
> + "switch case %#x not processed\n", iotype);
> break;
> }
> } while (false);
> @@ -2166,7 +2167,8 @@ static void rtl88e_phy_set_io(struct ieee80211_hw *hw)
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
> - "switch case not process\n");
> + "switch case %#x not processed\n",
> + rtlphy->current_io_type);
> break;
> }
> rtlphy->set_io_inprogress = false;
> @@ -2319,7 +2321,7 @@ static bool _rtl88ee_phy_set_rf_power_state(struct ieee80211_hw *hw,
> }
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
> - "switch case not process\n");
> + "switch case %#x not processed\n", rfpwr_state);
> bresult = false;
> break;
> }
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c
> index 43fcb25..7d15246 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c
> @@ -352,7 +352,7 @@ static void _rtl92c_fill_h2c_command(struct ieee80211_hw *hw,
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
> - "switch case not process\n");
> + "switch case %#x not processed\n", boxnum);
> break;
> }
>
> @@ -456,7 +456,7 @@ static void _rtl92c_fill_h2c_command(struct ieee80211_hw *hw,
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
> - "switch case not process\n");
> + "switch case %#x not processed\n", cmd_len);
> break;
> }
>
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192c/phy_common.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192c/phy_common.c
> index 60ab2ec..27e3d5f 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192c/phy_common.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192c/phy_common.c
> @@ -910,7 +910,8 @@ bool _rtl92c_phy_sw_chnl_step_by_step(struct ieee80211_hw *hw,
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
> - "switch case not process\n");
> + "switch case %#x not processed\n",
> + currentcmd->cmdid);
> break;
> }
>
> @@ -1567,7 +1568,7 @@ bool rtl92c_phy_set_io_cmd(struct ieee80211_hw *hw, enum io_type iotype)
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
> - "switch case not process\n");
> + "switch case %#x not processed\n", iotype);
> break;
> }
> } while (false);
> @@ -1605,7 +1606,8 @@ void rtl92c_phy_set_io(struct ieee80211_hw *hw)
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
> - "switch case not process\n");
> + "switch case %#x not processed\n",
> + rtlphy->current_io_type);
> break;
> }
> rtlphy->set_io_inprogress = false;
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/hw.c
> index 2446079..6d308f9 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/hw.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/hw.c
> @@ -143,7 +143,7 @@ void rtl92ce_get_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
> }
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not processed\n");
> + "switch case %#x not processed\n", variable);
> break;
> }
> }
> @@ -367,7 +367,8 @@ void rtl92ce_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not processed\n");
> + "switch case %#x not processed\n",
> + e_aci);
> break;
> }
> }
> @@ -2154,7 +2155,7 @@ void rtl92ce_set_key(struct ieee80211_hw *hw, u32 key_index,
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not processed\n");
> + "switch case %#x not processed\n", enc_algo);
> enc_algo = CAM_TKIP;
> break;
> }
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/led.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/led.c
> index 8283e9b..24e483b 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/led.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/led.c
> @@ -62,7 +62,7 @@ void rtl92ce_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled)
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not processed\n");
> + "switch case %#x not processed\n", pled->ledpin);
> break;
> }
> pled->ledon = true;
> @@ -97,7 +97,7 @@ void rtl92ce_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled)
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not processed\n");
> + "switch case %#x not processed\n", pled->ledpin);
> break;
> }
> pled->ledon = false;
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/phy.c
> index 1ee5a6a..46d0d94 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/phy.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/phy.c
> @@ -300,12 +300,9 @@ bool rtl92c_phy_config_rf_with_headerfile(struct ieee80211_hw *hw,
> }
> break;
> case RF90_PATH_C:
> - RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not processed\n");
> - break;
> case RF90_PATH_D:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not processed\n");
> + "switch case %#x not processed\n", rfpath);
> break;
> default:
> break;
> @@ -554,7 +551,7 @@ static bool _rtl92ce_phy_set_rf_power_state(struct ieee80211_hw *hw,
> }
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not processed\n");
> + "switch case %#x not processed\n", rfpwr_state);
> bresult = false;
> break;
> }
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c
> index 8789752..ae8f055 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c
> @@ -1560,7 +1560,7 @@ void rtl92cu_get_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not processed\n");
> + "switch case %#x not processed\n", variable);
> break;
> }
> }
> @@ -1931,7 +1931,7 @@ void rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
> }
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not processed\n");
> + "switch case %#x not processed\n", variable);
> break;
> }
> }
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/led.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/led.c
> index 75a2deb..8514ab65 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/led.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/led.c
> @@ -62,7 +62,7 @@ void rtl92cu_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled)
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not processed\n");
> + "switch case %#x not processed\n", pled->ledpin);
> break;
> }
> pled->ledon = true;
> @@ -95,7 +95,7 @@ void rtl92cu_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled)
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not processed\n");
> + "switch case %#x not processed\n", pled->ledpin);
> break;
> }
> pled->ledon = false;
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/phy.c
> index c972fa5..4b29764 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/phy.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/phy.c
> @@ -277,12 +277,9 @@ bool rtl92cu_phy_config_rf_with_headerfile(struct ieee80211_hw *hw,
> }
> break;
> case RF90_PATH_C:
> - RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not processed\n");
> - break;
> case RF90_PATH_D:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not processed\n");
> + "switch case %#x not processed\n", rfpath);
> break;
> default:
> break;
> @@ -517,7 +514,7 @@ static bool _rtl92cu_phy_set_rf_power_state(struct ieee80211_hw *hw,
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not processed\n");
> + "switch case %#x not processed\n", rfpwr_state);
> bresult = false;
> break;
> }
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c
> index 62ef820..8de29cc 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c
> @@ -435,7 +435,7 @@ static void _rtl92d_fill_h2c_command(struct ieee80211_hw *hw,
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not processed\n");
> + "switch case %#x not processed\n", boxnum);
> break;
> }
> isfw_read = _rtl92d_check_fw_read_last_h2c(hw, boxnum);
> @@ -512,7 +512,7 @@ static void _rtl92d_fill_h2c_command(struct ieee80211_hw *hw,
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not processed\n");
> + "switch case %#x not processed\n", cmd_len);
> break;
> }
> bwrite_success = true;
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c
> index 5720551..5369011 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c
> @@ -166,7 +166,7 @@ void rtl92de_get_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not processed\n");
> + "switch case %#x not processed\n", variable);
> break;
> }
> }
> @@ -361,7 +361,8 @@ void rtl92de_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not processed\n");
> + "switch case %#x not processed\n",
> + e_aci);
> break;
> }
> }
> @@ -502,7 +503,7 @@ void rtl92de_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
> }
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not processed\n");
> + "switch case %#x not processed\n", variable);
> break;
> }
> }
> @@ -2171,7 +2172,7 @@ void rtl92de_set_key(struct ieee80211_hw *hw, u32 key_index,
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not processed\n");
> + "switch case %#x not processed\n", enc_algo);
> enc_algo = CAM_TKIP;
> break;
> }
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/led.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/led.c
> index 76a57ae..811ba57 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/led.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/led.c
> @@ -71,7 +71,7 @@ void rtl92de_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled)
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not processed\n");
> + "switch case %#x not processed\n", pled->ledpin);
> break;
> }
> pled->ledon = true;
> @@ -106,7 +106,7 @@ void rtl92de_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled)
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not processed\n");
> + "switch case %#x not processed\n", pled->ledpin);
> break;
> }
> pled->ledon = false;
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c
> index 2a4810d..2a1edfd 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c
> @@ -836,12 +836,9 @@ bool rtl92d_phy_config_rf_with_headerfile(struct ieee80211_hw *hw,
> }
> break;
> case RF90_PATH_C:
> - RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not processed\n");
> - break;
> case RF90_PATH_D:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not processed\n");
> + "switch case %#x not processed\n", rfpath);
> break;
> }
> return true;
> @@ -2850,7 +2847,8 @@ static bool _rtl92d_phy_sw_chnl_step_by_step(struct ieee80211_hw *hw,
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not processed\n");
> + "switch case %#x not processed\n",
> + currentcmd->cmdid);
> break;
> }
> break;
> @@ -2963,7 +2961,8 @@ static void rtl92d_phy_set_io(struct ieee80211_hw *hw)
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not processed\n");
> + "switch case %#x not processed\n",
> + rtlphy->current_io_type);
> break;
> }
> rtlphy->set_io_inprogress = false;
> @@ -2994,7 +2993,7 @@ bool rtl92d_phy_set_io_cmd(struct ieee80211_hw *hw, enum io_type iotype)
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not processed\n");
> + "switch case %#x not processed\n", iotype);
> break;
> }
> } while (false);
> @@ -3182,7 +3181,7 @@ bool rtl92d_phy_set_rf_power_state(struct ieee80211_hw *hw,
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not processed\n");
> + "switch case %#x not processed\n", rfpwr_state);
> bresult = false;
> break;
> }
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c
> index 0708eed..b3f6a9e 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c
> @@ -344,7 +344,7 @@ static void _rtl92ee_fill_h2c_command(struct ieee80211_hw *hw, u8 element_id,
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
> - "switch case not process\n");
> + "switch case %#x not processed\n", boxnum);
> break;
> }
>
> @@ -433,7 +433,7 @@ static void _rtl92ee_fill_h2c_command(struct ieee80211_hw *hw, u8 element_id,
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
> - "switch case not process\n");
> + "switch case %#x not processed\n", cmd_len);
> break;
> }
>
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/hw.c
> index b07af8d..47bb6d8 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/hw.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/hw.c
> @@ -340,7 +340,7 @@ void rtl92ee_get_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_DMESG,
> - "switch case not process %x\n", variable);
> + "switch case %#x not processed\n", variable);
> break;
> }
> }
> @@ -566,7 +566,8 @@ void rtl92ee_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_DMESG,
> - "switch case not process\n");
> + "switch case %#x not processed\n",
> + e_aci);
> break;
> }
> }
> @@ -685,7 +686,7 @@ void rtl92ee_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_DMESG,
> - "switch case not process %x\n", variable);
> + "switch case %#x not processed\n", variable);
> break;
> }
> }
> @@ -2463,7 +2464,7 @@ void rtl92ee_set_key(struct ieee80211_hw *hw, u32 key_index,
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_DMESG,
> - "switch case not process\n");
> + "switch case %#x not processed\n", enc_algo);
> enc_algo = CAM_TKIP;
> break;
> }
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/led.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/led.c
> index 8388e37..47da05d 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/led.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/led.c
> @@ -61,7 +61,7 @@ void rtl92ee_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled)
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
> - "switch case not process\n");
> + "switch case %#x not processed\n", pled->ledpin);
> break;
> }
> pled->ledon = true;
> @@ -91,7 +91,7 @@ void rtl92ee_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled)
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
> - "switch case not process\n");
> + "switch case %#x not processed\n", pled->ledpin);
> break;
> }
> pled->ledon = false;
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/phy.c
> index beafc9a..5ad7e75 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/phy.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/phy.c
> @@ -1927,7 +1927,8 @@ static bool _rtl92ee_phy_sw_chnl_step_by_step(struct ieee80211_hw *hw,
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
> - "switch case not process\n");
> + "switch case %#x not processed\n",
> + currentcmd->cmdid);
> break;
> }
>
> @@ -3001,7 +3002,7 @@ bool rtl92ee_phy_set_io_cmd(struct ieee80211_hw *hw, enum io_type iotype)
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
> - "switch case not process\n");
> + "switch case %#x not processed\n", iotype);
> break;
> }
> } while (false);
> @@ -3041,7 +3042,8 @@ static void rtl92ee_phy_set_io(struct ieee80211_hw *hw)
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
> - "switch case not process\n");
> + "switch case %#x not processed\n",
> + rtlphy->current_io_type);
> break;
> }
> rtlphy->set_io_inprogress = false;
> @@ -3187,7 +3189,7 @@ static bool _rtl92ee_phy_set_rf_power_state(struct ieee80211_hw *hw,
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
> - "switch case not process\n");
> + "switch case %#x not processed\n", rfpwr_state);
> bresult = false;
> break;
> }
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c
> index ddfa0ae..5bad9c9 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c
> @@ -79,7 +79,7 @@ void rtl92se_get_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
> }
> default: {
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not processed\n");
> + "switch case %#x not processed\n", variable);
> break;
> }
> }
> @@ -297,7 +297,8 @@ void rtl92se_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not processed\n");
> + "switch case %#x not processed\n",
> + e_aci);
> break;
> }
> }
> @@ -433,7 +434,7 @@ void rtl92se_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
> break; }
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not processed\n");
> + "switch case %#x not processed\n", variable);
> break;
> }
>
> @@ -2465,7 +2466,7 @@ void rtl92se_set_key(struct ieee80211_hw *hw, u32 key_index, u8 *p_macaddr,
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not processed\n");
> + "switch case %#x not processed\n", enc_algo);
> enc_algo = CAM_TKIP;
> break;
> }
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/led.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/led.c
> index 44949b5..9849cb9 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/led.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/led.c
> @@ -68,7 +68,7 @@ void rtl92se_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled)
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not processed\n");
> + "switch case %#x not processed\n", pled->ledpin);
> break;
> }
> pled->ledon = true;
> @@ -104,7 +104,7 @@ void rtl92se_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled)
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not processed\n");
> + "switch case %#x not processed\n", pled->ledpin);
> break;
> }
> pled->ledon = false;
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/phy.c
> index 881821f..4bb7558 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/phy.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/phy.c
> @@ -442,7 +442,8 @@ static bool _rtl92s_phy_sw_chnl_step_by_step(struct ieee80211_hw *hw,
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not processed\n");
> + "switch case %#x not processed\n",
> + currentcmd->cmdid);
> break;
> }
>
> @@ -648,7 +649,7 @@ bool rtl92s_phy_set_rf_power_state(struct ieee80211_hw *hw,
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not processed\n");
> + "switch case %#x not processed\n", rfpwr_state);
> bresult = false;
> break;
> }
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/fw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/fw.c
> index b7c0d38..1186755 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/fw.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/fw.c
> @@ -124,7 +124,7 @@ static void _rtl8723e_fill_h2c_command(struct ieee80211_hw *hw, u8 element_id,
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not process\n");
> + "switch case %#x not processed\n", boxnum);
> break;
> }
>
> @@ -230,7 +230,7 @@ static void _rtl8723e_fill_h2c_command(struct ieee80211_hw *hw, u8 element_id,
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not process\n");
> + "switch case %#x not processed\n", cmd_len);
> break;
> }
>
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c
> index ba30efc..2bf603b 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c
> @@ -143,7 +143,7 @@ void rtl8723e_get_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
> }
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
> - "switch case not process\n");
> + "switch case %#x not processed\n", variable);
> break;
> }
> }
> @@ -366,7 +366,8 @@ void rtl8723e_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
> - "switch case not process\n");
> + "switch case %#x not processed\n",
> + e_aci);
> break;
> }
> }
> @@ -546,7 +547,7 @@ void rtl8723e_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
> }
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
> - "switch case not process\n");
> + "switch case %#x not processed\n", variable);
> break;
> }
> }
> @@ -2225,7 +2226,7 @@ void rtl8723e_set_key(struct ieee80211_hw *hw, u32 key_index,
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
> - "switch case not process\n");
> + "switch case %#x not processed\n", enc_algo);
> enc_algo = CAM_TKIP;
> break;
> }
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/led.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/led.c
> index 1317335..c7be934 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/led.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/led.c
> @@ -63,7 +63,7 @@ void rtl8723e_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled)
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not process\n");
> + "switch case %#x not processed\n", pled->ledpin);
> break;
> }
> pled->ledon = true;
> @@ -105,7 +105,7 @@ void rtl8723e_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled)
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not process\n");
> + "switch case %#x not processed\n", pled->ledpin);
> break;
> }
> pled->ledon = false;
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c
> index 601b78e..17b58cb 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c
> @@ -1023,7 +1023,8 @@ static bool _rtl8723e_phy_sw_chnl_step_by_step(struct ieee80211_hw *hw,
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
> - "switch case not process\n");
> + "switch case %#x not processed\n",
> + currentcmd->cmdid);
> break;
> }
>
> @@ -1499,7 +1500,7 @@ bool rtl8723e_phy_set_io_cmd(struct ieee80211_hw *hw, enum io_type iotype)
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
> - "switch case not process\n");
> + "switch case %#x not processed\n", iotype);
> break;
> }
> } while (false);
> @@ -1536,7 +1537,8 @@ static void rtl8723e_phy_set_io(struct ieee80211_hw *hw)
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
> - "switch case not process\n");
> + "switch case %#x not processed\n",
> + rtlphy->current_io_type);
> break;
> }
> rtlphy->set_io_inprogress = false;
> @@ -1682,7 +1684,7 @@ static bool _rtl8723e_phy_set_rf_power_state(struct ieee80211_hw *hw,
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
> - "switch case not process\n");
> + "switch case %#x not processed\n", rfpwr_state);
> bresult = false;
> break;
> }
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/fw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/fw.c
> index d5da0f3..8c5c27c 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/fw.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/fw.c
> @@ -122,7 +122,7 @@ static void _rtl8723be_fill_h2c_command(struct ieee80211_hw *hw, u8 element_id,
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not process\n");
> + "switch case %#x not processed\n", boxnum);
> break;
> }
>
> @@ -195,7 +195,7 @@ static void _rtl8723be_fill_h2c_command(struct ieee80211_hw *hw, u8 element_id,
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not process\n");
> + "switch case %#x not processed\n", cmd_len);
> break;
> }
>
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c
> index 82e4476..999c1ac 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c
> @@ -350,7 +350,7 @@ void rtl8723be_get_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
> - "switch case not process %x\n", variable);
> + "switch case %#x not processed\n", variable);
> break;
> }
> }
> @@ -607,7 +607,8 @@ void rtl8723be_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
> - "switch case not process\n");
> + "switch case %#x not processed\n",
> + e_aci);
> break;
> }
> }
> @@ -723,8 +724,7 @@ void rtl8723be_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
> - "switch case not process %x\n",
> - variable);
> + "switch case %#x not processed\n", variable);
> break;
> }
> }
> @@ -2565,7 +2565,7 @@ void rtl8723be_set_key(struct ieee80211_hw *hw, u32 key_index,
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
> - "switch case not process\n");
> + "switch case %#x not processed\n", enc_algo);
> enc_algo = CAM_TKIP;
> break;
> }
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/led.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/led.c
> index 4196efb..497913e 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/led.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/led.c
> @@ -58,7 +58,7 @@ void rtl8723be_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled)
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not process\n");
> + "switch case %#x not processed\n", pled->ledpin);
> break;
> }
> pled->ledon = true;
> @@ -100,7 +100,7 @@ void rtl8723be_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled)
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not process\n");
> + "switch case %#x not processed\n", pled->ledpin);
> break;
> }
> pled->ledon = false;
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c
> index 285818d..3cc2232 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c
> @@ -837,7 +837,7 @@ bool rtl8723be_phy_config_rf_with_headerfile(struct ieee80211_hw *hw,
> break;
> case RF90_PATH_D:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
> - "switch case not process\n");
> + "switch case %#x not processed\n", rfpath);
> break;
> }
> return true;
> @@ -1507,7 +1507,8 @@ static bool _rtl8723be_phy_sw_chnl_step_by_step(struct ieee80211_hw *hw,
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
> - "switch case not process\n");
> + "switch case %#x not processed\n",
> + currentcmd->cmdid);
> break;
> }
>
> @@ -2515,7 +2516,7 @@ bool rtl8723be_phy_set_io_cmd(struct ieee80211_hw *hw, enum io_type iotype)
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
> - "switch case not process\n");
> + "switch case %#x not processed\n", iotype);
> break;
> }
> } while (false);
> @@ -2553,7 +2554,8 @@ static void rtl8723be_phy_set_io(struct ieee80211_hw *hw)
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
> - "switch case not process\n");
> + "switch case %#x not processed\n",
> + rtlphy->current_io_type);
> break;
> }
> rtlphy->set_io_inprogress = false;
> @@ -2705,7 +2707,7 @@ static bool _rtl8723be_phy_set_rf_power_state(struct ieee80211_hw *hw,
>
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
> - "switch case not process\n");
> + "switch case %#x not processed\n", rfpwr_state);
> bresult = false;
> break;
> }
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c
> index a4fc70e..b665446 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c
> @@ -392,7 +392,7 @@ static void _rtl8821ae_fill_h2c_command(struct ieee80211_hw *hw,
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
> - "switch case not process\n");
> + "switch case %#x not processed\n", boxnum);
> break;
> }
>
> @@ -481,7 +481,7 @@ static void _rtl8821ae_fill_h2c_command(struct ieee80211_hw *hw,
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
> - "switch case not process\n");
> + "switch case %#x not processed\n", cmd_len);
> break;
> }
>
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c
> index 0cddf1a..1281ebe 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c
> @@ -480,7 +480,7 @@ void rtl8821ae_get_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
> - "switch case not process %x\n", variable);
> + "switch case %#x not processed\n", variable);
> break;
> }
> }
> @@ -671,7 +671,8 @@ void rtl8821ae_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
> - "switch case not process\n");
> + "switch case %#x not processed\n",
> + e_aci);
> break;
> }
> }
> @@ -800,7 +801,7 @@ void rtl8821ae_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
> break; }
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
> - "switch case not process %x\n", variable);
> + "switch case %#x not processed\n", variable);
> break;
> }
> }
> @@ -3934,7 +3935,7 @@ void rtl8821ae_set_key(struct ieee80211_hw *hw, u32 key_index,
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
> - "switch case not process\n");
> + "switch case %#x not processed\n", enc_algo);
> enc_algo = CAM_TKIP;
> break;
> }
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/led.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/led.c
> index ba1946a..fcb3b28 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/led.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/led.c
> @@ -60,7 +60,7 @@ void rtl8821ae_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled)
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
> - "switch case not process\n");
> + "switch case %#x not processed\n", pled->ledpin);
> break;
> }
> pled->ledon = true;
> @@ -133,7 +133,7 @@ void rtl8821ae_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled)
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
> - "switch case not process\n");
> + "switch case %#x not processed\n", pled->ledpin);
> break;
> }
> pled->ledon = false;
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c
> index a71bfe3..5dad402 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c
> @@ -2063,12 +2063,9 @@ bool rtl8812ae_phy_config_rf_with_headerfile(struct ieee80211_hw *hw,
> }
> break;
> case RF90_PATH_C:
> - RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not process\n");
> - break;
> case RF90_PATH_D:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not process\n");
> + "switch case %#x not processed\n", rfpath);
> break;
> }
> return true;
> @@ -2133,16 +2130,10 @@ bool rtl8821ae_phy_config_rf_with_headerfile(struct ieee80211_hw *hw,
> break;
>
> case RF90_PATH_B:
> - RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not process\n");
> - break;
> case RF90_PATH_C:
> - RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not process\n");
> - break;
> case RF90_PATH_D:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not process\n");
> + "switch case %#x not processed\n", rfpath);
> break;
> }
> return true;
> @@ -4670,7 +4661,7 @@ bool rtl8821ae_phy_set_io_cmd(struct ieee80211_hw *hw, enum io_type iotype)
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not process\n");
> + "switch case %#x not processed\n", iotype);
> break;
> }
> } while (false);
> @@ -4714,7 +4705,8 @@ static void rtl8821ae_phy_set_io(struct ieee80211_hw *hw)
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not process\n");
> + "switch case %#x not processed\n",
> + rtlphy->current_io_type);
> break;
> }
> rtlphy->set_io_inprogress = false;
> @@ -4820,7 +4812,7 @@ static bool _rtl8821ae_phy_set_rf_power_state(struct ieee80211_hw *hw,
> break;
> default:
> RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "switch case not process\n");
> + "switch case %#x not processed\n", rfpwr_state);
> bresult = false;
> break;
> }
>
^ permalink raw reply
* Re: Alignment issues with freescale FEC driver
From: Eric Nelson @ 2016-09-23 18:49 UTC (permalink / raw)
To: Russell King - ARM Linux
Cc: Eric Dumazet, linux-arm-kernel@lists.infradead.org,
netdev@vger.kernel.org, Fugang Duan, Troy Kisky, Otavio Salvador,
Simone
In-Reply-To: <20160923183725.GC1041@n2100.armlinux.org.uk>
Thanks Russell,
On 09/23/2016 11:37 AM, Russell King - ARM Linux wrote:
> On Fri, Sep 23, 2016 at 11:26:18AM -0700, Eric Nelson wrote:
>> So the question is: should we just live with this and acknowledge a
>> performance penalty of bad alignment or do something about it?
>
> Well, I've no interest in trying to do anything with the FEC driver
> anymore, as I'll just generate another big patch stack which won't
> make it into the kernel in a timely fashion - my last attempt at
> improving the FEC driver was dogged with conflicting changes and I
> gave up with it in the end. I ended up spending a full cycle
> rebasing, re-testing, and re-evaluating their performance only to find
> that I'd missed the merge window again, and other conflicting changes
> got merged which meant that I had to start from the beginning again.
>
That's sad. I recall reading your notes on that patch series and it was
a model for how to structure and document a patch set.
I hadn't noticed that you abandoned it and it's frustrating that the
merge process prevented your efforts from being used.
I'm also disheartened to hear your frustration about getting things
pushed up-stream and the entire Linux community should take note.
>> I'm not sure the cost (or the details) of Eric's proposed fix of allocating
>> and copying the header to another skb.
>
> I had a quick look at this, and although Eric's idea may be a good
> idea, it doesn't contain enough details for me to be able to
> implement it - eg, I've no idea how to attach the 128-byte skb to the
> beginning of a previously allocated skb containing the rest of the
> packet. I've just looked through linux/skbuff.h and I can't see
> anything that takes two sk_buff's that would do the job.
>
> However, I don't think that's necessary in this case, because the
> iMX6 FEC supports the 16-bit alignment of the packet, if only it was
> enabled in hardware and the driver caters for it.
>
Right. If the hardware supports placing things at a suitable address,
that's the right approach.
I'll try to review your earlier patch set and at least find a way to address
the alignment issues.
I'm a bit booked until LinuxCon but will try to get something out soon.
Regards,
Eric
^ permalink raw reply
* Re: [PATCH] netns: move {inc,dec}_net_namespaces into #ifdef
From: Eric W. Biederman @ 2016-09-23 18:42 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: David S. Miller, WANG Cong, netdev, linux-kernel
In-Reply-To: <20160923160650.3631870-1-arnd@arndb.de>
Arnd Bergmann <arnd@arndb.de> writes:
> With the newly enforced limit on the number of namespaces,
> we get a build warning if CONFIG_NETNS is disabled:
>
> net/core/net_namespace.c:273:13: error: 'dec_net_namespaces' defined but not used [-Werror=unused-function]
> net/core/net_namespace.c:268:24: error: 'inc_net_namespaces' defined but not used [-Werror=unused-function]
>
> This moves the two added functions inside the #ifdef that guards
> their callers.
>
> Fixes: 703286608a22 ("netns: Add a limit on the number of net namespaces")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Applied to my namespace tree thanks.
This was a hold over from calling those functions in a different location.
Eric
> ---
> net/core/net_namespace.c | 20 ++++++++++----------
> 1 file changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
> index d0eb13d3226b..989434f36f96 100644
> --- a/net/core/net_namespace.c
> +++ b/net/core/net_namespace.c
> @@ -265,16 +265,6 @@ struct net *get_net_ns_by_id(struct net *net, int id)
> return peer;
> }
>
> -static struct ucounts *inc_net_namespaces(struct user_namespace *ns)
> -{
> - return inc_ucount(ns, current_euid(), UCOUNT_NET_NAMESPACES);
> -}
> -
> -static void dec_net_namespaces(struct ucounts *ucounts)
> -{
> - dec_ucount(ucounts, UCOUNT_NET_NAMESPACES);
> -}
> -
> /*
> * setup_net runs the initializers for the network namespace object.
> */
> @@ -319,6 +309,16 @@ static __net_init int setup_net(struct net *net, struct user_namespace *user_ns)
>
>
> #ifdef CONFIG_NET_NS
> +static struct ucounts *inc_net_namespaces(struct user_namespace *ns)
> +{
> + return inc_ucount(ns, current_euid(), UCOUNT_NET_NAMESPACES);
> +}
> +
> +static void dec_net_namespaces(struct ucounts *ucounts)
> +{
> + dec_ucount(ucounts, UCOUNT_NET_NAMESPACES);
> +}
> +
> static struct kmem_cache *net_cachep;
> static struct workqueue_struct *netns_wq;
^ 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