Skip to content

Commit 1a9df9e

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: "Fixes here and there, a couple new device IDs, as usual: 1) Fix BQL race in dpaa2-eth driver, from Ioana Ciornei. 2) Fix 64-bit division in iwlwifi, from Arnd Bergmann. 3) Fix documentation for some eBPF helpers, from Quentin Monnet. 4) Some UAPI bpf header sync with tools, also from Quentin Monnet. 5) Set descriptor ownership bit at the right time for jumbo frames in stmmac driver, from Aaro Koskinen. 6) Set IFF_UP properly in tun driver, from Eric Dumazet. 7) Fix load/store doubleword instruction generation in powerpc eBPF JIT, from Naveen N. Rao. 8) nla_nest_start() return value checks all over, from Kangjie Lu. 9) Fix asoc_id handling in SCTP after the SCTP_*_ASSOC changes this merge window. From Marcelo Ricardo Leitner and Xin Long. 10) Fix memory corruption with large MTUs in stmmac, from Aaro Koskinen. 11) Do not use ipv4 header for ipv6 flows in TCP and DCCP, from Eric Dumazet. 12) Fix topology subscription cancellation in tipc, from Erik Hugne. 13) Memory leak in genetlink error path, from Yue Haibing. 14) Valid control actions properly in packet scheduler, from Davide Caratti. 15) Even if we get EEXIST, we still need to rehash if a shrink was delayed. From Herbert Xu. 16) Fix interrupt mask handling in interrupt handler of r8169, from Heiner Kallweit. 17) Fix leak in ehea driver, from Wen Yang" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (168 commits) dpaa2-eth: fix race condition with bql frame accounting chelsio: use BUG() instead of BUG_ON(1) net: devlink: skip info_get op call if it is not defined in dumpit net: phy: bcm54xx: Encode link speed and activity into LEDs tipc: change to check tipc_own_id to return in tipc_net_stop net: usb: aqc111: Extend HWID table by QNAP device net: sched: Kconfig: update reference link for PIE net: dsa: qca8k: extend slave-bus implementations net: dsa: qca8k: remove leftover phy accessors dt-bindings: net: dsa: qca8k: support internal mdio-bus dt-bindings: net: dsa: qca8k: fix example net: phy: don't clear BMCR in genphy_soft_reset bpf, libbpf: clarify bump in libbpf version info bpf, libbpf: fix version info and add it to shared object rxrpc: avoid clang -Wuninitialized warning tipc: tipc clang warning net: sched: fix cleanup NULL pointer exception in act_mirr r8169: fix cable re-plugging issue net: ethernet: ti: fix possible object reference leak net: ibm: fix possible object reference leak ...
2 parents 14c741d + 8c838f5 commit 1a9df9e

File tree

182 files changed

+3121
-1137
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

182 files changed

+3121
-1137
lines changed

Documentation/devicetree/bindings/net/dsa/qca8k.txt

Lines changed: 66 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,15 @@ Required properties:
1212
Subnodes:
1313

1414
The integrated switch subnode should be specified according to the binding
15-
described in dsa/dsa.txt. As the QCA8K switches do not have a N:N mapping of
16-
port and PHY id, each subnode describing a port needs to have a valid phandle
17-
referencing the internal PHY connected to it. The CPU port of this switch is
18-
always port 0.
15+
described in dsa/dsa.txt. If the QCA8K switch is connect to a SoC's external
16+
mdio-bus each subnode describing a port needs to have a valid phandle
17+
referencing the internal PHY it is connected to. This is because there's no
18+
N:N mapping of port and PHY id.
19+
20+
Don't use mixed external and internal mdio-bus configurations, as this is
21+
not supported by the hardware.
22+
23+
The CPU port of this switch is always port 0.
1924

2025
A CPU port node has the following optional node:
2126

@@ -31,8 +36,9 @@ For QCA8K the 'fixed-link' sub-node supports only the following properties:
3136
- 'full-duplex' (boolean, optional), to indicate that full duplex is
3237
used. When absent, half duplex is assumed.
3338

34-
Example:
39+
Examples:
3540

41+
for the external mdio-bus configuration:
3642

3743
&mdio0 {
3844
phy_port1: phy@0 {
@@ -55,12 +61,12 @@ Example:
5561
reg = <4>;
5662
};
5763

58-
switch0@0 {
64+
switch@10 {
5965
compatible = "qca,qca8337";
6066
#address-cells = <1>;
6167
#size-cells = <0>;
6268

63-
reg = <0>;
69+
reg = <0x10>;
6470

6571
ports {
6672
#address-cells = <1>;
@@ -108,3 +114,56 @@ Example:
108114
};
109115
};
110116
};
117+
118+
for the internal master mdio-bus configuration:
119+
120+
&mdio0 {
121+
switch@10 {
122+
compatible = "qca,qca8337";
123+
#address-cells = <1>;
124+
#size-cells = <0>;
125+
126+
reg = <0x10>;
127+
128+
ports {
129+
#address-cells = <1>;
130+
#size-cells = <0>;
131+
132+
port@0 {
133+
reg = <0>;
134+
label = "cpu";
135+
ethernet = <&gmac1>;
136+
phy-mode = "rgmii";
137+
fixed-link {
138+
speed = 1000;
139+
full-duplex;
140+
};
141+
};
142+
143+
port@1 {
144+
reg = <1>;
145+
label = "lan1";
146+
};
147+
148+
port@2 {
149+
reg = <2>;
150+
label = "lan2";
151+
};
152+
153+
port@3 {
154+
reg = <3>;
155+
label = "lan3";
156+
};
157+
158+
port@4 {
159+
reg = <4>;
160+
label = "lan4";
161+
};
162+
163+
port@5 {
164+
reg = <5>;
165+
label = "wan";
166+
};
167+
};
168+
};
169+
};

Documentation/networking/msg_zerocopy.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ the excellent reporting over at LWN.net or read the original code.
5050

5151
patchset
5252
[PATCH net-next v4 0/9] socket sendmsg MSG_ZEROCOPY
53-
http://lkml.kernel.org/r/20170803202945.70750-1-willemdebruijn.kernel@gmail.com
53+
https://lkml.kernel.org/netdev/20170803202945.70750-1-willemdebruijn.kernel@gmail.com
5454

5555

5656
Interface

Documentation/networking/netdev-FAQ.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,19 @@ it to the maintainer to figure out what is the most recent and current
131131
version that should be applied. If there is any doubt, the maintainer
132132
will reply and ask what should be done.
133133

134+
Q: I made changes to only a few patches in a patch series should I resend only those changed?
135+
--------------------------------------------------------------------------------------------
136+
A: No, please resend the entire patch series and make sure you do number your
137+
patches such that it is clear this is the latest and greatest set of patches
138+
that can be applied.
139+
140+
Q: I submitted multiple versions of a patch series and it looks like a version other than the last one has been accepted, what should I do?
141+
-------------------------------------------------------------------------------------------------------------------------------------------
142+
A: There is no revert possible, once it is pushed out, it stays like that.
143+
Please send incremental versions on top of what has been merged in order to fix
144+
the patches the way they would look like if your latest patch series was to be
145+
merged.
146+
134147
Q: How can I tell what patches are queued up for backporting to the various stable releases?
135148
--------------------------------------------------------------------------------------------
136149
A: Normally Greg Kroah-Hartman collects stable commits himself, but for

Documentation/networking/nf_flowtable.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ including the Netfilter hooks and the flowtable fastpath bypass.
4444
/ \ / \ |Routing | / \
4545
--> ingress ---> prerouting ---> |decision| | postrouting |--> neigh_xmit
4646
\_________/ \__________/ ---------- \____________/ ^
47-
| ^ | | ^ |
48-
flowtable | | ____\/___ | |
49-
| | | / \ | |
50-
__\/___ | --------->| forward |------------ |
47+
| ^ | ^ |
48+
flowtable | ____\/___ | |
49+
| | / \ | |
50+
__\/___ | | forward |------------ |
5151
|-----| | \_________/ |
5252
|-----| | 'flow offload' rule |
5353
|-----| | adds entry to |

Documentation/networking/snmp_counter.rst

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ algorithm.
413413
.. _F-RTO: https://tools.ietf.org/html/rfc5682
414414

415415
TCP Fast Path
416-
============
416+
=============
417417
When kernel receives a TCP packet, it has two paths to handler the
418418
packet, one is fast path, another is slow path. The comment in kernel
419419
code provides a good explanation of them, I pasted them below::
@@ -681,6 +681,7 @@ The TCP stack receives an out of order duplicate packet, so it sends a
681681
DSACK to the sender.
682682

683683
* TcpExtTCPDSACKRecv
684+
684685
The TCP stack receives a DSACK, which indicates an acknowledged
685686
duplicate packet is received.
686687

@@ -690,7 +691,7 @@ The TCP stack receives a DSACK, which indicate an out of order
690691
duplicate packet is received.
691692

692693
invalid SACK and DSACK
693-
====================
694+
======================
694695
When a SACK (or DSACK) block is invalid, a corresponding counter would
695696
be updated. The validation method is base on the start/end sequence
696697
number of the SACK block. For more details, please refer the comment
@@ -704,11 +705,13 @@ explaination:
704705
.. _Add counters for discarded SACK blocks: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=18f02545a9a16c9a89778b91a162ad16d510bb32
705706

706707
* TcpExtTCPSACKDiscard
708+
707709
This counter indicates how many SACK blocks are invalid. If the invalid
708710
SACK block is caused by ACK recording, the TCP stack will only ignore
709711
it and won't update this counter.
710712

711713
* TcpExtTCPDSACKIgnoredOld and TcpExtTCPDSACKIgnoredNoUndo
714+
712715
When a DSACK block is invalid, one of these two counters would be
713716
updated. Which counter will be updated depends on the undo_marker flag
714717
of the TCP socket. If the undo_marker is not set, the TCP stack isn't
@@ -719,7 +722,7 @@ will be updated. If the undo_marker is set, TcpExtTCPDSACKIgnoredOld
719722
will be updated. As implied in its name, it might be an old packet.
720723

721724
SACK shift
722-
=========
725+
==========
723726
The linux networking stack stores data in sk_buff struct (skb for
724727
short). If a SACK block acrosses multiple skb, the TCP stack will try
725728
to re-arrange data in these skb. E.g. if a SACK block acknowledges seq
@@ -730,12 +733,15 @@ seq 14 to 20. All data in skb2 will be moved to skb1, and skb2 will be
730733
discard, this operation is 'merge'.
731734

732735
* TcpExtTCPSackShifted
736+
733737
A skb is shifted
734738

735739
* TcpExtTCPSackMerged
740+
736741
A skb is merged
737742

738743
* TcpExtTCPSackShiftFallback
744+
739745
A skb should be shifted or merged, but the TCP stack doesn't do it for
740746
some reasons.
741747

arch/powerpc/include/asm/ppc-opcode.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,13 +302,15 @@
302302
/* Misc instructions for BPF compiler */
303303
#define PPC_INST_LBZ 0x88000000
304304
#define PPC_INST_LD 0xe8000000
305+
#define PPC_INST_LDX 0x7c00002a
305306
#define PPC_INST_LHZ 0xa0000000
306307
#define PPC_INST_LWZ 0x80000000
307308
#define PPC_INST_LHBRX 0x7c00062c
308309
#define PPC_INST_LDBRX 0x7c000428
309310
#define PPC_INST_STB 0x98000000
310311
#define PPC_INST_STH 0xb0000000
311312
#define PPC_INST_STD 0xf8000000
313+
#define PPC_INST_STDX 0x7c00012a
312314
#define PPC_INST_STDU 0xf8000001
313315
#define PPC_INST_STW 0x90000000
314316
#define PPC_INST_STWU 0x94000000

arch/powerpc/net/bpf_jit.h

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@
5151
#define PPC_LIS(r, i) PPC_ADDIS(r, 0, i)
5252
#define PPC_STD(r, base, i) EMIT(PPC_INST_STD | ___PPC_RS(r) | \
5353
___PPC_RA(base) | ((i) & 0xfffc))
54+
#define PPC_STDX(r, base, b) EMIT(PPC_INST_STDX | ___PPC_RS(r) | \
55+
___PPC_RA(base) | ___PPC_RB(b))
5456
#define PPC_STDU(r, base, i) EMIT(PPC_INST_STDU | ___PPC_RS(r) | \
5557
___PPC_RA(base) | ((i) & 0xfffc))
5658
#define PPC_STW(r, base, i) EMIT(PPC_INST_STW | ___PPC_RS(r) | \
@@ -65,7 +67,9 @@
6567
#define PPC_LBZ(r, base, i) EMIT(PPC_INST_LBZ | ___PPC_RT(r) | \
6668
___PPC_RA(base) | IMM_L(i))
6769
#define PPC_LD(r, base, i) EMIT(PPC_INST_LD | ___PPC_RT(r) | \
68-
___PPC_RA(base) | IMM_L(i))
70+
___PPC_RA(base) | ((i) & 0xfffc))
71+
#define PPC_LDX(r, base, b) EMIT(PPC_INST_LDX | ___PPC_RT(r) | \
72+
___PPC_RA(base) | ___PPC_RB(b))
6973
#define PPC_LWZ(r, base, i) EMIT(PPC_INST_LWZ | ___PPC_RT(r) | \
7074
___PPC_RA(base) | IMM_L(i))
7175
#define PPC_LHZ(r, base, i) EMIT(PPC_INST_LHZ | ___PPC_RT(r) | \
@@ -85,17 +89,6 @@
8589
___PPC_RA(a) | ___PPC_RB(b))
8690
#define PPC_BPF_STDCX(s, a, b) EMIT(PPC_INST_STDCX | ___PPC_RS(s) | \
8791
___PPC_RA(a) | ___PPC_RB(b))
88-
89-
#ifdef CONFIG_PPC64
90-
#define PPC_BPF_LL(r, base, i) do { PPC_LD(r, base, i); } while(0)
91-
#define PPC_BPF_STL(r, base, i) do { PPC_STD(r, base, i); } while(0)
92-
#define PPC_BPF_STLU(r, base, i) do { PPC_STDU(r, base, i); } while(0)
93-
#else
94-
#define PPC_BPF_LL(r, base, i) do { PPC_LWZ(r, base, i); } while(0)
95-
#define PPC_BPF_STL(r, base, i) do { PPC_STW(r, base, i); } while(0)
96-
#define PPC_BPF_STLU(r, base, i) do { PPC_STWU(r, base, i); } while(0)
97-
#endif
98-
9992
#define PPC_CMPWI(a, i) EMIT(PPC_INST_CMPWI | ___PPC_RA(a) | IMM_L(i))
10093
#define PPC_CMPDI(a, i) EMIT(PPC_INST_CMPDI | ___PPC_RA(a) | IMM_L(i))
10194
#define PPC_CMPW(a, b) EMIT(PPC_INST_CMPW | ___PPC_RA(a) | \

arch/powerpc/net/bpf_jit32.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,10 @@ DECLARE_LOAD_FUNC(sk_load_byte_msh);
122122
#define PPC_NTOHS_OFFS(r, base, i) PPC_LHZ_OFFS(r, base, i)
123123
#endif
124124

125+
#define PPC_BPF_LL(r, base, i) do { PPC_LWZ(r, base, i); } while(0)
126+
#define PPC_BPF_STL(r, base, i) do { PPC_STW(r, base, i); } while(0)
127+
#define PPC_BPF_STLU(r, base, i) do { PPC_STWU(r, base, i); } while(0)
128+
125129
#define SEEN_DATAREF 0x10000 /* might call external helpers */
126130
#define SEEN_XREG 0x20000 /* X reg is used */
127131
#define SEEN_MEM 0x40000 /* SEEN_MEM+(1<<n) = use mem[n] for temporary

arch/powerpc/net/bpf_jit64.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,26 @@ static const int b2p[] = {
6868
/* PPC NVR range -- update this if we ever use NVRs below r27 */
6969
#define BPF_PPC_NVR_MIN 27
7070

71+
/*
72+
* WARNING: These can use TMP_REG_2 if the offset is not at word boundary,
73+
* so ensure that it isn't in use already.
74+
*/
75+
#define PPC_BPF_LL(r, base, i) do { \
76+
if ((i) % 4) { \
77+
PPC_LI(b2p[TMP_REG_2], (i)); \
78+
PPC_LDX(r, base, b2p[TMP_REG_2]); \
79+
} else \
80+
PPC_LD(r, base, i); \
81+
} while(0)
82+
#define PPC_BPF_STL(r, base, i) do { \
83+
if ((i) % 4) { \
84+
PPC_LI(b2p[TMP_REG_2], (i)); \
85+
PPC_STDX(r, base, b2p[TMP_REG_2]); \
86+
} else \
87+
PPC_STD(r, base, i); \
88+
} while(0)
89+
#define PPC_BPF_STLU(r, base, i) do { PPC_STDU(r, base, i); } while(0)
90+
7191
#define SEEN_FUNC 0x1000 /* might call external helpers */
7292
#define SEEN_STACK 0x2000 /* uses BPF stack */
7393
#define SEEN_TAILCALL 0x4000 /* uses tail calls */

arch/powerpc/net/bpf_jit_comp64.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ static void bpf_jit_emit_tail_call(u32 *image, struct codegen_context *ctx, u32
252252
* if (tail_call_cnt > MAX_TAIL_CALL_CNT)
253253
* goto out;
254254
*/
255-
PPC_LD(b2p[TMP_REG_1], 1, bpf_jit_stack_tailcallcnt(ctx));
255+
PPC_BPF_LL(b2p[TMP_REG_1], 1, bpf_jit_stack_tailcallcnt(ctx));
256256
PPC_CMPLWI(b2p[TMP_REG_1], MAX_TAIL_CALL_CNT);
257257
PPC_BCC(COND_GT, out);
258258

@@ -265,7 +265,7 @@ static void bpf_jit_emit_tail_call(u32 *image, struct codegen_context *ctx, u32
265265
/* prog = array->ptrs[index]; */
266266
PPC_MULI(b2p[TMP_REG_1], b2p_index, 8);
267267
PPC_ADD(b2p[TMP_REG_1], b2p[TMP_REG_1], b2p_bpf_array);
268-
PPC_LD(b2p[TMP_REG_1], b2p[TMP_REG_1], offsetof(struct bpf_array, ptrs));
268+
PPC_BPF_LL(b2p[TMP_REG_1], b2p[TMP_REG_1], offsetof(struct bpf_array, ptrs));
269269

270270
/*
271271
* if (prog == NULL)
@@ -275,7 +275,7 @@ static void bpf_jit_emit_tail_call(u32 *image, struct codegen_context *ctx, u32
275275
PPC_BCC(COND_EQ, out);
276276

277277
/* goto *(prog->bpf_func + prologue_size); */
278-
PPC_LD(b2p[TMP_REG_1], b2p[TMP_REG_1], offsetof(struct bpf_prog, bpf_func));
278+
PPC_BPF_LL(b2p[TMP_REG_1], b2p[TMP_REG_1], offsetof(struct bpf_prog, bpf_func));
279279
#ifdef PPC64_ELF_ABI_v1
280280
/* skip past the function descriptor */
281281
PPC_ADDI(b2p[TMP_REG_1], b2p[TMP_REG_1],
@@ -606,7 +606,7 @@ static int bpf_jit_build_body(struct bpf_prog *fp, u32 *image,
606606
* the instructions generated will remain the
607607
* same across all passes
608608
*/
609-
PPC_STD(dst_reg, 1, bpf_jit_stack_local(ctx));
609+
PPC_BPF_STL(dst_reg, 1, bpf_jit_stack_local(ctx));
610610
PPC_ADDI(b2p[TMP_REG_1], 1, bpf_jit_stack_local(ctx));
611611
PPC_LDBRX(dst_reg, 0, b2p[TMP_REG_1]);
612612
break;
@@ -662,7 +662,7 @@ static int bpf_jit_build_body(struct bpf_prog *fp, u32 *image,
662662
PPC_LI32(b2p[TMP_REG_1], imm);
663663
src_reg = b2p[TMP_REG_1];
664664
}
665-
PPC_STD(src_reg, dst_reg, off);
665+
PPC_BPF_STL(src_reg, dst_reg, off);
666666
break;
667667

668668
/*
@@ -709,7 +709,7 @@ static int bpf_jit_build_body(struct bpf_prog *fp, u32 *image,
709709
break;
710710
/* dst = *(u64 *)(ul) (src + off) */
711711
case BPF_LDX | BPF_MEM | BPF_DW:
712-
PPC_LD(dst_reg, src_reg, off);
712+
PPC_BPF_LL(dst_reg, src_reg, off);
713713
break;
714714

715715
/*

0 commit comments

Comments
 (0)