Skip to content

Commit 5470461

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Use an appropriate TSQ pacing shift in mac80211, from Toke Høiland-Jørgensen. 2) Just like ipv4's ip_route_me_harder(), we have to use skb_to_full_sk in ip6_route_me_harder, from Eric Dumazet. 3) Fix several shutdown races and similar other problems in l2tp, from James Chapman. 4) Handle missing XDP flush properly in tuntap, for real this time. From Jason Wang. 5) Out-of-bounds access in powerpc ebpf tailcalls, from Daniel Borkmann. 6) Fix phy_resume() locking, from Andrew Lunn. 7) IFLA_MTU values are ignored on newlink for some tunnel types, fix from Xin Long. 8) Revert F-RTO middle box workarounds, they only handle one dimension of the problem. From Yuchung Cheng. 9) Fix socket refcounting in RDS, from Ka-Cheong Poon. 10) Don't allow ppp unit registration to an unregistered channel, from Guillaume Nault. 11) Various hv_netvsc fixes from Stephen Hemminger. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (98 commits) hv_netvsc: propagate rx filters to VF hv_netvsc: filter multicast/broadcast hv_netvsc: defer queue selection to VF hv_netvsc: use napi_schedule_irqoff hv_netvsc: fix race in napi poll when rescheduling hv_netvsc: cancel subchannel setup before halting device hv_netvsc: fix error unwind handling if vmbus_open fails hv_netvsc: only wake transmit queue if link is up hv_netvsc: avoid retry on send during shutdown virtio-net: re enable XDP_REDIRECT for mergeable buffer ppp: prevent unregistered channels from connecting to PPP units tc-testing: skbmod: fix match value of ethertype mlxsw: spectrum_switchdev: Check success of FDB add operation net: make skb_gso_*_seglen functions private net: xfrm: use skb_gso_validate_network_len() to check gso sizes net: sched: tbf: handle GSO_BY_FRAGS case in enqueue net: rename skb_gso_validate_mtu -> skb_gso_validate_network_len rds: Incorrect reference counting in TCP socket creation net: ethtool: don't ignore return from driver get_fecparam method vrf: check forwarding on the original netdevice when generating ICMP dest unreachable ...
2 parents 661e50b + a7f0fb1 commit 5470461

File tree

95 files changed

+1033
-658
lines changed

Some content is hidden

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

95 files changed

+1033
-658
lines changed

Documentation/devicetree/bindings/net/renesas,ravb.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Required properties:
1818
- "renesas,etheravb-r8a7795" for the R8A7795 SoC.
1919
- "renesas,etheravb-r8a7796" for the R8A7796 SoC.
2020
- "renesas,etheravb-r8a77970" for the R8A77970 SoC.
21+
- "renesas,etheravb-r8a77980" for the R8A77980 SoC.
2122
- "renesas,etheravb-r8a77995" for the R8A77995 SoC.
2223
- "renesas,etheravb-rcar-gen3" as a fallback for the above
2324
R-Car Gen3 devices.

arch/arm/mach-orion5x/Kconfig

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,13 @@ config MACH_KUROBOX_PRO
5858

5959
config MACH_DNS323
6060
bool "D-Link DNS-323"
61-
select GENERIC_NET_UTILS
6261
select I2C_BOARDINFO if I2C
6362
help
6463
Say 'Y' here if you want your kernel to support the
6564
D-Link DNS-323 platform.
6665

6766
config MACH_TS209
6867
bool "QNAP TS-109/TS-209"
69-
select GENERIC_NET_UTILS
7068
help
7169
Say 'Y' here if you want your kernel to support the
7270
QNAP TS-109/TS-209 platform.
@@ -101,7 +99,6 @@ config MACH_LINKSTATION_LS_HGL
10199

102100
config MACH_TS409
103101
bool "QNAP TS-409"
104-
select GENERIC_NET_UTILS
105102
help
106103
Say 'Y' here if you want your kernel to support the
107104
QNAP TS-409 platform.

arch/arm/mach-orion5x/dns323-setup.c

Lines changed: 50 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,42 @@ static struct mv643xx_eth_platform_data dns323_eth_data = {
173173
.phy_addr = MV643XX_ETH_PHY_ADDR(8),
174174
};
175175

176+
/* dns323_parse_hex_*() taken from tsx09-common.c; should a common copy of these
177+
* functions be kept somewhere?
178+
*/
179+
static int __init dns323_parse_hex_nibble(char n)
180+
{
181+
if (n >= '0' && n <= '9')
182+
return n - '0';
183+
184+
if (n >= 'A' && n <= 'F')
185+
return n - 'A' + 10;
186+
187+
if (n >= 'a' && n <= 'f')
188+
return n - 'a' + 10;
189+
190+
return -1;
191+
}
192+
193+
static int __init dns323_parse_hex_byte(const char *b)
194+
{
195+
int hi;
196+
int lo;
197+
198+
hi = dns323_parse_hex_nibble(b[0]);
199+
lo = dns323_parse_hex_nibble(b[1]);
200+
201+
if (hi < 0 || lo < 0)
202+
return -1;
203+
204+
return (hi << 4) | lo;
205+
}
206+
176207
static int __init dns323_read_mac_addr(void)
177208
{
178209
u_int8_t addr[6];
179-
void __iomem *mac_page;
210+
int i;
211+
char *mac_page;
180212

181213
/* MAC address is stored as a regular ol' string in /dev/mtdblock4
182214
* (0x007d0000-0x00800000) starting at offset 196480 (0x2ff80).
@@ -185,8 +217,23 @@ static int __init dns323_read_mac_addr(void)
185217
if (!mac_page)
186218
return -ENOMEM;
187219

188-
if (!mac_pton((__force const char *) mac_page, addr))
189-
goto error_fail;
220+
/* Sanity check the string we're looking at */
221+
for (i = 0; i < 5; i++) {
222+
if (*(mac_page + (i * 3) + 2) != ':') {
223+
goto error_fail;
224+
}
225+
}
226+
227+
for (i = 0; i < 6; i++) {
228+
int byte;
229+
230+
byte = dns323_parse_hex_byte(mac_page + (i * 3));
231+
if (byte < 0) {
232+
goto error_fail;
233+
}
234+
235+
addr[i] = byte;
236+
}
190237

191238
iounmap(mac_page);
192239
printk("DNS-323: Found ethernet MAC address: %pM\n", addr);

arch/arm/mach-orion5x/tsx09-common.c

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,53 @@ struct mv643xx_eth_platform_data qnap_tsx09_eth_data = {
5353
.phy_addr = MV643XX_ETH_PHY_ADDR(8),
5454
};
5555

56+
static int __init qnap_tsx09_parse_hex_nibble(char n)
57+
{
58+
if (n >= '0' && n <= '9')
59+
return n - '0';
60+
61+
if (n >= 'A' && n <= 'F')
62+
return n - 'A' + 10;
63+
64+
if (n >= 'a' && n <= 'f')
65+
return n - 'a' + 10;
66+
67+
return -1;
68+
}
69+
70+
static int __init qnap_tsx09_parse_hex_byte(const char *b)
71+
{
72+
int hi;
73+
int lo;
74+
75+
hi = qnap_tsx09_parse_hex_nibble(b[0]);
76+
lo = qnap_tsx09_parse_hex_nibble(b[1]);
77+
78+
if (hi < 0 || lo < 0)
79+
return -1;
80+
81+
return (hi << 4) | lo;
82+
}
83+
5684
static int __init qnap_tsx09_check_mac_addr(const char *addr_str)
5785
{
5886
u_int8_t addr[6];
87+
int i;
5988

60-
if (!mac_pton(addr_str, addr))
61-
return -1;
89+
for (i = 0; i < 6; i++) {
90+
int byte;
91+
92+
/*
93+
* Enforce "xx:xx:xx:xx:xx:xx\n" format.
94+
*/
95+
if (addr_str[(i * 3) + 2] != ((i < 5) ? ':' : '\n'))
96+
return -1;
97+
98+
byte = qnap_tsx09_parse_hex_byte(addr_str + (i * 3));
99+
if (byte < 0)
100+
return -1;
101+
addr[i] = byte;
102+
}
62103

63104
printk(KERN_INFO "tsx09: found ethernet mac address %pM\n", addr);
64105

@@ -77,12 +118,12 @@ void __init qnap_tsx09_find_mac_addr(u32 mem_base, u32 size)
77118
unsigned long addr;
78119

79120
for (addr = mem_base; addr < (mem_base + size); addr += 1024) {
80-
void __iomem *nor_page;
121+
char *nor_page;
81122
int ret = 0;
82123

83124
nor_page = ioremap(addr, 1024);
84125
if (nor_page != NULL) {
85-
ret = qnap_tsx09_check_mac_addr((__force const char *)nor_page);
126+
ret = qnap_tsx09_check_mac_addr(nor_page);
86127
iounmap(nor_page);
87128
}
88129

arch/powerpc/net/bpf_jit_comp64.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ static void bpf_jit_emit_tail_call(u32 *image, struct codegen_context *ctx, u32
240240
* goto out;
241241
*/
242242
PPC_LWZ(b2p[TMP_REG_1], b2p_bpf_array, offsetof(struct bpf_array, map.max_entries));
243+
PPC_RLWINM(b2p_index, b2p_index, 0, 0, 31);
243244
PPC_CMPLW(b2p_index, b2p[TMP_REG_1]);
244245
PPC_BCC(COND_GE, out);
245246

drivers/bluetooth/btusb.c

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
*
2222
*/
2323

24+
#include <linux/dmi.h>
2425
#include <linux/module.h>
2526
#include <linux/usb.h>
2627
#include <linux/usb/quirks.h>
@@ -379,6 +380,21 @@ static const struct usb_device_id blacklist_table[] = {
379380
{ } /* Terminating entry */
380381
};
381382

383+
/* The Bluetooth USB module build into some devices needs to be reset on resume,
384+
* this is a problem with the platform (likely shutting off all power) not with
385+
* the module itself. So we use a DMI list to match known broken platforms.
386+
*/
387+
static const struct dmi_system_id btusb_needs_reset_resume_table[] = {
388+
{
389+
/* Lenovo Yoga 920 (QCA Rome device 0cf3:e300) */
390+
.matches = {
391+
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
392+
DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo YOGA 920"),
393+
},
394+
},
395+
{}
396+
};
397+
382398
#define BTUSB_MAX_ISOC_FRAMES 10
383399

384400
#define BTUSB_INTR_RUNNING 0
@@ -2945,6 +2961,9 @@ static int btusb_probe(struct usb_interface *intf,
29452961
hdev->send = btusb_send_frame;
29462962
hdev->notify = btusb_notify;
29472963

2964+
if (dmi_check_system(btusb_needs_reset_resume_table))
2965+
interface_to_usbdev(intf)->quirks |= USB_QUIRK_RESET_RESUME;
2966+
29482967
#ifdef CONFIG_PM
29492968
err = btusb_config_oob_wake(hdev);
29502969
if (err)
@@ -3031,12 +3050,6 @@ static int btusb_probe(struct usb_interface *intf,
30313050
if (id->driver_info & BTUSB_QCA_ROME) {
30323051
data->setup_on_usb = btusb_setup_qca;
30333052
hdev->set_bdaddr = btusb_set_bdaddr_ath3012;
3034-
3035-
/* QCA Rome devices lose their updated firmware over suspend,
3036-
* but the USB hub doesn't notice any status change.
3037-
* explicitly request a device reset on resume.
3038-
*/
3039-
interface_to_usbdev(intf)->quirks |= USB_QUIRK_RESET_RESUME;
30403053
}
30413054

30423055
#ifdef CONFIG_BT_HCIBTUSB_RTL

drivers/bluetooth/hci_bcm.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -922,12 +922,13 @@ static int bcm_get_resources(struct bcm_device *dev)
922922

923923
dev->clk = devm_clk_get(dev->dev, NULL);
924924

925-
dev->device_wakeup = devm_gpiod_get(dev->dev, "device-wakeup",
926-
GPIOD_OUT_LOW);
925+
dev->device_wakeup = devm_gpiod_get_optional(dev->dev, "device-wakeup",
926+
GPIOD_OUT_LOW);
927927
if (IS_ERR(dev->device_wakeup))
928928
return PTR_ERR(dev->device_wakeup);
929929

930-
dev->shutdown = devm_gpiod_get(dev->dev, "shutdown", GPIOD_OUT_LOW);
930+
dev->shutdown = devm_gpiod_get_optional(dev->dev, "shutdown",
931+
GPIOD_OUT_LOW);
931932
if (IS_ERR(dev->shutdown))
932933
return PTR_ERR(dev->shutdown);
933934

drivers/net/ethernet/freescale/gianfar.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3063,9 +3063,6 @@ static void gfar_process_frame(struct net_device *ndev, struct sk_buff *skb)
30633063
if (ndev->features & NETIF_F_RXCSUM)
30643064
gfar_rx_checksum(skb, fcb);
30653065

3066-
/* Tell the skb what kind of packet this is */
3067-
skb->protocol = eth_type_trans(skb, ndev);
3068-
30693066
/* There's need to check for NETIF_F_HW_VLAN_CTAG_RX here.
30703067
* Even if vlan rx accel is disabled, on some chips
30713068
* RXFCB_VLN is pseudo randomly set.
@@ -3136,13 +3133,15 @@ int gfar_clean_rx_ring(struct gfar_priv_rx_q *rx_queue, int rx_work_limit)
31363133
continue;
31373134
}
31383135

3136+
gfar_process_frame(ndev, skb);
3137+
31393138
/* Increment the number of packets */
31403139
total_pkts++;
31413140
total_bytes += skb->len;
31423141

31433142
skb_record_rx_queue(skb, rx_queue->qindex);
31443143

3145-
gfar_process_frame(ndev, skb);
3144+
skb->protocol = eth_type_trans(skb, ndev);
31463145

31473146
/* Send the packet up the stack */
31483147
napi_gro_receive(&rx_queue->grp->napi_rx, skb);

drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1888,6 +1888,14 @@ static void ixgbe_dma_sync_frag(struct ixgbe_ring *rx_ring,
18881888
ixgbe_rx_pg_size(rx_ring),
18891889
DMA_FROM_DEVICE,
18901890
IXGBE_RX_DMA_ATTR);
1891+
} else if (ring_uses_build_skb(rx_ring)) {
1892+
unsigned long offset = (unsigned long)(skb->data) & ~PAGE_MASK;
1893+
1894+
dma_sync_single_range_for_cpu(rx_ring->dev,
1895+
IXGBE_CB(skb)->dma,
1896+
offset,
1897+
skb_headlen(skb),
1898+
DMA_FROM_DEVICE);
18911899
} else {
18921900
struct skb_frag_struct *frag = &skb_shinfo(skb)->frags[0];
18931901

drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_keys.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -107,20 +107,20 @@ static const struct mlxsw_afk_element_info mlxsw_afk_element_infos[] = {
107107
MLXSW_AFK_ELEMENT_INFO_U32(VID, 0x10, 8, 12),
108108
MLXSW_AFK_ELEMENT_INFO_U32(PCP, 0x10, 20, 3),
109109
MLXSW_AFK_ELEMENT_INFO_U32(TCP_FLAGS, 0x10, 23, 9),
110-
MLXSW_AFK_ELEMENT_INFO_U32(IP_TTL_, 0x14, 0, 8),
111-
MLXSW_AFK_ELEMENT_INFO_U32(IP_ECN, 0x14, 9, 2),
112-
MLXSW_AFK_ELEMENT_INFO_U32(IP_DSCP, 0x14, 11, 6),
113-
MLXSW_AFK_ELEMENT_INFO_U32(SRC_IP4, 0x18, 0, 32),
114-
MLXSW_AFK_ELEMENT_INFO_U32(DST_IP4, 0x1C, 0, 32),
115-
MLXSW_AFK_ELEMENT_INFO_BUF(SRC_IP6_HI, 0x18, 8),
116-
MLXSW_AFK_ELEMENT_INFO_BUF(SRC_IP6_LO, 0x20, 8),
117-
MLXSW_AFK_ELEMENT_INFO_BUF(DST_IP6_HI, 0x28, 8),
118-
MLXSW_AFK_ELEMENT_INFO_BUF(DST_IP6_LO, 0x30, 8),
119110
MLXSW_AFK_ELEMENT_INFO_U32(DST_L4_PORT, 0x14, 0, 16),
120111
MLXSW_AFK_ELEMENT_INFO_U32(SRC_L4_PORT, 0x14, 16, 16),
112+
MLXSW_AFK_ELEMENT_INFO_U32(IP_TTL_, 0x18, 0, 8),
113+
MLXSW_AFK_ELEMENT_INFO_U32(IP_ECN, 0x18, 9, 2),
114+
MLXSW_AFK_ELEMENT_INFO_U32(IP_DSCP, 0x18, 11, 6),
115+
MLXSW_AFK_ELEMENT_INFO_U32(SRC_IP4, 0x20, 0, 32),
116+
MLXSW_AFK_ELEMENT_INFO_U32(DST_IP4, 0x24, 0, 32),
117+
MLXSW_AFK_ELEMENT_INFO_BUF(SRC_IP6_HI, 0x20, 8),
118+
MLXSW_AFK_ELEMENT_INFO_BUF(SRC_IP6_LO, 0x28, 8),
119+
MLXSW_AFK_ELEMENT_INFO_BUF(DST_IP6_HI, 0x30, 8),
120+
MLXSW_AFK_ELEMENT_INFO_BUF(DST_IP6_LO, 0x38, 8),
121121
};
122122

123-
#define MLXSW_AFK_ELEMENT_STORAGE_SIZE 0x38
123+
#define MLXSW_AFK_ELEMENT_STORAGE_SIZE 0x40
124124

125125
struct mlxsw_afk_element_inst { /* element instance in actual block */
126126
const struct mlxsw_afk_element_info *info;

0 commit comments

Comments
 (0)