diff options
-rw-r--r-- | MAINTAINERS | 3 | ||||
-rw-r--r-- | arch/arm/net/bpf_jit_32.c | 6 | ||||
-rw-r--r-- | arch/parisc/include/uapi/asm/socket.h | 2 | ||||
-rw-r--r-- | arch/powerpc/net/bpf_jit_comp.c | 7 | ||||
-rw-r--r-- | arch/s390/net/bpf_jit_comp.c | 29 | ||||
-rw-r--r-- | arch/sparc/net/bpf_jit_comp.c | 17 | ||||
-rw-r--r-- | arch/x86/net/bpf_jit_comp.c | 14 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 29 | ||||
-rw-r--r-- | drivers/net/ethernet/chelsio/cxgb4/l2t.c | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/emulex/benet/be_main.c | 11 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/e1000e/netdev.c | 8 | ||||
-rw-r--r-- | drivers/net/ethernet/qlogic/qlge/qlge_main.c | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/via/via-rhine.c | 1 | ||||
-rw-r--r-- | drivers/net/usb/dm9601.c | 12 | ||||
-rw-r--r-- | drivers/net/usb/usbnet.c | 2 | ||||
-rw-r--r-- | include/net/if_inet6.h | 1 | ||||
-rw-r--r-- | net/batman-adv/main.c | 2 | ||||
-rw-r--r-- | net/core/filter.c | 30 | ||||
-rw-r--r-- | net/ieee802154/nl-phy.c | 6 | ||||
-rw-r--r-- | net/ipv4/inet_diag.c | 5 | ||||
-rw-r--r-- | net/ipv4/ipmr.c | 7 | ||||
-rw-r--r-- | net/ipv4/tcp_metrics.c | 51 | ||||
-rw-r--r-- | net/ipv6/addrconf.c | 38 | ||||
-rw-r--r-- | net/ipv6/ip6mr.c | 7 | ||||
-rw-r--r-- | net/rds/ib_recv.c | 7 |
25 files changed, 169 insertions, 130 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index 31a046213274..6a6e4ac72287 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -9231,6 +9231,7 @@ F: include/media/videobuf2-* | |||
9231 | 9231 | ||
9232 | VIRTIO CONSOLE DRIVER | 9232 | VIRTIO CONSOLE DRIVER |
9233 | M: Amit Shah <amit.shah@redhat.com> | 9233 | M: Amit Shah <amit.shah@redhat.com> |
9234 | L: virtio-dev@lists.oasis-open.org | ||
9234 | L: virtualization@lists.linux-foundation.org | 9235 | L: virtualization@lists.linux-foundation.org |
9235 | S: Maintained | 9236 | S: Maintained |
9236 | F: drivers/char/virtio_console.c | 9237 | F: drivers/char/virtio_console.c |
@@ -9240,6 +9241,7 @@ F: include/uapi/linux/virtio_console.h | |||
9240 | VIRTIO CORE, NET AND BLOCK DRIVERS | 9241 | VIRTIO CORE, NET AND BLOCK DRIVERS |
9241 | M: Rusty Russell <rusty@rustcorp.com.au> | 9242 | M: Rusty Russell <rusty@rustcorp.com.au> |
9242 | M: "Michael S. Tsirkin" <mst@redhat.com> | 9243 | M: "Michael S. Tsirkin" <mst@redhat.com> |
9244 | L: virtio-dev@lists.oasis-open.org | ||
9243 | L: virtualization@lists.linux-foundation.org | 9245 | L: virtualization@lists.linux-foundation.org |
9244 | S: Maintained | 9246 | S: Maintained |
9245 | F: drivers/virtio/ | 9247 | F: drivers/virtio/ |
@@ -9252,6 +9254,7 @@ F: include/uapi/linux/virtio_*.h | |||
9252 | VIRTIO HOST (VHOST) | 9254 | VIRTIO HOST (VHOST) |
9253 | M: "Michael S. Tsirkin" <mst@redhat.com> | 9255 | M: "Michael S. Tsirkin" <mst@redhat.com> |
9254 | L: kvm@vger.kernel.org | 9256 | L: kvm@vger.kernel.org |
9257 | L: virtio-dev@lists.oasis-open.org | ||
9255 | L: virtualization@lists.linux-foundation.org | 9258 | L: virtualization@lists.linux-foundation.org |
9256 | L: netdev@vger.kernel.org | 9259 | L: netdev@vger.kernel.org |
9257 | S: Maintained | 9260 | S: Maintained |
diff --git a/arch/arm/net/bpf_jit_32.c b/arch/arm/net/bpf_jit_32.c index 9ed155ad0f97..271b5e971568 100644 --- a/arch/arm/net/bpf_jit_32.c +++ b/arch/arm/net/bpf_jit_32.c | |||
@@ -641,10 +641,10 @@ load_ind: | |||
641 | emit(ARM_MUL(r_A, r_A, r_X), ctx); | 641 | emit(ARM_MUL(r_A, r_A, r_X), ctx); |
642 | break; | 642 | break; |
643 | case BPF_S_ALU_DIV_K: | 643 | case BPF_S_ALU_DIV_K: |
644 | /* current k == reciprocal_value(userspace k) */ | 644 | if (k == 1) |
645 | break; | ||
645 | emit_mov_i(r_scratch, k, ctx); | 646 | emit_mov_i(r_scratch, k, ctx); |
646 | /* A = top 32 bits of the product */ | 647 | emit_udiv(r_A, r_A, r_scratch, ctx); |
647 | emit(ARM_UMULL(r_scratch, r_A, r_A, r_scratch), ctx); | ||
648 | break; | 648 | break; |
649 | case BPF_S_ALU_DIV_X: | 649 | case BPF_S_ALU_DIV_X: |
650 | update_on_xread(ctx); | 650 | update_on_xread(ctx); |
diff --git a/arch/parisc/include/uapi/asm/socket.h b/arch/parisc/include/uapi/asm/socket.h index f33113a6141e..70b3674dac4e 100644 --- a/arch/parisc/include/uapi/asm/socket.h +++ b/arch/parisc/include/uapi/asm/socket.h | |||
@@ -75,6 +75,6 @@ | |||
75 | 75 | ||
76 | #define SO_BUSY_POLL 0x4027 | 76 | #define SO_BUSY_POLL 0x4027 |
77 | 77 | ||
78 | #define SO_MAX_PACING_RATE 0x4048 | 78 | #define SO_MAX_PACING_RATE 0x4028 |
79 | 79 | ||
80 | #endif /* _UAPI_ASM_SOCKET_H */ | 80 | #endif /* _UAPI_ASM_SOCKET_H */ |
diff --git a/arch/powerpc/net/bpf_jit_comp.c b/arch/powerpc/net/bpf_jit_comp.c index ac3c2a10dafd..555034f8505e 100644 --- a/arch/powerpc/net/bpf_jit_comp.c +++ b/arch/powerpc/net/bpf_jit_comp.c | |||
@@ -223,10 +223,11 @@ static int bpf_jit_build_body(struct sk_filter *fp, u32 *image, | |||
223 | } | 223 | } |
224 | PPC_DIVWU(r_A, r_A, r_X); | 224 | PPC_DIVWU(r_A, r_A, r_X); |
225 | break; | 225 | break; |
226 | case BPF_S_ALU_DIV_K: /* A = reciprocal_divide(A, K); */ | 226 | case BPF_S_ALU_DIV_K: /* A /= K */ |
227 | if (K == 1) | ||
228 | break; | ||
227 | PPC_LI32(r_scratch1, K); | 229 | PPC_LI32(r_scratch1, K); |
228 | /* Top 32 bits of 64bit result -> A */ | 230 | PPC_DIVWU(r_A, r_A, r_scratch1); |
229 | PPC_MULHWU(r_A, r_A, r_scratch1); | ||
230 | break; | 231 | break; |
231 | case BPF_S_ALU_AND_X: | 232 | case BPF_S_ALU_AND_X: |
232 | ctx->seen |= SEEN_XREG; | 233 | ctx->seen |= SEEN_XREG; |
diff --git a/arch/s390/net/bpf_jit_comp.c b/arch/s390/net/bpf_jit_comp.c index 16871da37371..708d60e40066 100644 --- a/arch/s390/net/bpf_jit_comp.c +++ b/arch/s390/net/bpf_jit_comp.c | |||
@@ -368,14 +368,16 @@ static int bpf_jit_insn(struct bpf_jit *jit, struct sock_filter *filter, | |||
368 | EMIT4_PCREL(0xa7840000, (jit->ret0_ip - jit->prg)); | 368 | EMIT4_PCREL(0xa7840000, (jit->ret0_ip - jit->prg)); |
369 | /* lhi %r4,0 */ | 369 | /* lhi %r4,0 */ |
370 | EMIT4(0xa7480000); | 370 | EMIT4(0xa7480000); |
371 | /* dr %r4,%r12 */ | 371 | /* dlr %r4,%r12 */ |
372 | EMIT2(0x1d4c); | 372 | EMIT4(0xb997004c); |
373 | break; | 373 | break; |
374 | case BPF_S_ALU_DIV_K: /* A = reciprocal_divide(A, K) */ | 374 | case BPF_S_ALU_DIV_K: /* A /= K */ |
375 | /* m %r4,<d(K)>(%r13) */ | 375 | if (K == 1) |
376 | EMIT4_DISP(0x5c40d000, EMIT_CONST(K)); | 376 | break; |
377 | /* lr %r5,%r4 */ | 377 | /* lhi %r4,0 */ |
378 | EMIT2(0x1854); | 378 | EMIT4(0xa7480000); |
379 | /* dl %r4,<d(K)>(%r13) */ | ||
380 | EMIT6_DISP(0xe340d000, 0x0097, EMIT_CONST(K)); | ||
379 | break; | 381 | break; |
380 | case BPF_S_ALU_MOD_X: /* A %= X */ | 382 | case BPF_S_ALU_MOD_X: /* A %= X */ |
381 | jit->seen |= SEEN_XREG | SEEN_RET0; | 383 | jit->seen |= SEEN_XREG | SEEN_RET0; |
@@ -385,16 +387,21 @@ static int bpf_jit_insn(struct bpf_jit *jit, struct sock_filter *filter, | |||
385 | EMIT4_PCREL(0xa7840000, (jit->ret0_ip - jit->prg)); | 387 | EMIT4_PCREL(0xa7840000, (jit->ret0_ip - jit->prg)); |
386 | /* lhi %r4,0 */ | 388 | /* lhi %r4,0 */ |
387 | EMIT4(0xa7480000); | 389 | EMIT4(0xa7480000); |
388 | /* dr %r4,%r12 */ | 390 | /* dlr %r4,%r12 */ |
389 | EMIT2(0x1d4c); | 391 | EMIT4(0xb997004c); |
390 | /* lr %r5,%r4 */ | 392 | /* lr %r5,%r4 */ |
391 | EMIT2(0x1854); | 393 | EMIT2(0x1854); |
392 | break; | 394 | break; |
393 | case BPF_S_ALU_MOD_K: /* A %= K */ | 395 | case BPF_S_ALU_MOD_K: /* A %= K */ |
396 | if (K == 1) { | ||
397 | /* lhi %r5,0 */ | ||
398 | EMIT4(0xa7580000); | ||
399 | break; | ||
400 | } | ||
394 | /* lhi %r4,0 */ | 401 | /* lhi %r4,0 */ |
395 | EMIT4(0xa7480000); | 402 | EMIT4(0xa7480000); |
396 | /* d %r4,<d(K)>(%r13) */ | 403 | /* dl %r4,<d(K)>(%r13) */ |
397 | EMIT4_DISP(0x5d40d000, EMIT_CONST(K)); | 404 | EMIT6_DISP(0xe340d000, 0x0097, EMIT_CONST(K)); |
398 | /* lr %r5,%r4 */ | 405 | /* lr %r5,%r4 */ |
399 | EMIT2(0x1854); | 406 | EMIT2(0x1854); |
400 | break; | 407 | break; |
diff --git a/arch/sparc/net/bpf_jit_comp.c b/arch/sparc/net/bpf_jit_comp.c index 218b6b23c378..01fe9946d388 100644 --- a/arch/sparc/net/bpf_jit_comp.c +++ b/arch/sparc/net/bpf_jit_comp.c | |||
@@ -497,9 +497,20 @@ void bpf_jit_compile(struct sk_filter *fp) | |||
497 | case BPF_S_ALU_MUL_K: /* A *= K */ | 497 | case BPF_S_ALU_MUL_K: /* A *= K */ |
498 | emit_alu_K(MUL, K); | 498 | emit_alu_K(MUL, K); |
499 | break; | 499 | break; |
500 | case BPF_S_ALU_DIV_K: /* A /= K */ | 500 | case BPF_S_ALU_DIV_K: /* A /= K with K != 0*/ |
501 | emit_alu_K(MUL, K); | 501 | if (K == 1) |
502 | emit_read_y(r_A); | 502 | break; |
503 | emit_write_y(G0); | ||
504 | #ifdef CONFIG_SPARC32 | ||
505 | /* The Sparc v8 architecture requires | ||
506 | * three instructions between a %y | ||
507 | * register write and the first use. | ||
508 | */ | ||
509 | emit_nop(); | ||
510 | emit_nop(); | ||
511 | emit_nop(); | ||
512 | #endif | ||
513 | emit_alu_K(DIV, K); | ||
503 | break; | 514 | break; |
504 | case BPF_S_ALU_DIV_X: /* A /= X; */ | 515 | case BPF_S_ALU_DIV_X: /* A /= X; */ |
505 | emit_cmpi(r_X, 0); | 516 | emit_cmpi(r_X, 0); |
diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c index 26328e800869..4ed75dd81d05 100644 --- a/arch/x86/net/bpf_jit_comp.c +++ b/arch/x86/net/bpf_jit_comp.c | |||
@@ -359,15 +359,21 @@ void bpf_jit_compile(struct sk_filter *fp) | |||
359 | EMIT2(0x89, 0xd0); /* mov %edx,%eax */ | 359 | EMIT2(0x89, 0xd0); /* mov %edx,%eax */ |
360 | break; | 360 | break; |
361 | case BPF_S_ALU_MOD_K: /* A %= K; */ | 361 | case BPF_S_ALU_MOD_K: /* A %= K; */ |
362 | if (K == 1) { | ||
363 | CLEAR_A(); | ||
364 | break; | ||
365 | } | ||
362 | EMIT2(0x31, 0xd2); /* xor %edx,%edx */ | 366 | EMIT2(0x31, 0xd2); /* xor %edx,%edx */ |
363 | EMIT1(0xb9);EMIT(K, 4); /* mov imm32,%ecx */ | 367 | EMIT1(0xb9);EMIT(K, 4); /* mov imm32,%ecx */ |
364 | EMIT2(0xf7, 0xf1); /* div %ecx */ | 368 | EMIT2(0xf7, 0xf1); /* div %ecx */ |
365 | EMIT2(0x89, 0xd0); /* mov %edx,%eax */ | 369 | EMIT2(0x89, 0xd0); /* mov %edx,%eax */ |
366 | break; | 370 | break; |
367 | case BPF_S_ALU_DIV_K: /* A = reciprocal_divide(A, K); */ | 371 | case BPF_S_ALU_DIV_K: /* A /= K */ |
368 | EMIT3(0x48, 0x69, 0xc0); /* imul imm32,%rax,%rax */ | 372 | if (K == 1) |
369 | EMIT(K, 4); | 373 | break; |
370 | EMIT4(0x48, 0xc1, 0xe8, 0x20); /* shr $0x20,%rax */ | 374 | EMIT2(0x31, 0xd2); /* xor %edx,%edx */ |
375 | EMIT1(0xb9);EMIT(K, 4); /* mov imm32,%ecx */ | ||
376 | EMIT2(0xf7, 0xf1); /* div %ecx */ | ||
371 | break; | 377 | break; |
372 | case BPF_S_ALU_AND_X: | 378 | case BPF_S_ALU_AND_X: |
373 | seen |= SEEN_XREG; | 379 | seen |= SEEN_XREG; |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c index 8b3107b2fcc1..0067b975873f 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | |||
@@ -12942,25 +12942,26 @@ static void __bnx2x_remove(struct pci_dev *pdev, | |||
12942 | pci_set_power_state(pdev, PCI_D3hot); | 12942 | pci_set_power_state(pdev, PCI_D3hot); |
12943 | } | 12943 | } |
12944 | 12944 | ||
12945 | if (bp->regview) | 12945 | if (remove_netdev) { |
12946 | iounmap(bp->regview); | 12946 | if (bp->regview) |
12947 | iounmap(bp->regview); | ||
12947 | 12948 | ||
12948 | /* for vf doorbells are part of the regview and were unmapped along with | 12949 | /* For vfs, doorbells are part of the regview and were unmapped |
12949 | * it. FW is only loaded by PF. | 12950 | * along with it. FW is only loaded by PF. |
12950 | */ | 12951 | */ |
12951 | if (IS_PF(bp)) { | 12952 | if (IS_PF(bp)) { |
12952 | if (bp->doorbells) | 12953 | if (bp->doorbells) |
12953 | iounmap(bp->doorbells); | 12954 | iounmap(bp->doorbells); |
12954 | 12955 | ||
12955 | bnx2x_release_firmware(bp); | 12956 | bnx2x_release_firmware(bp); |
12956 | } | 12957 | } |
12957 | bnx2x_free_mem_bp(bp); | 12958 | bnx2x_free_mem_bp(bp); |
12958 | 12959 | ||
12959 | if (remove_netdev) | ||
12960 | free_netdev(dev); | 12960 | free_netdev(dev); |
12961 | 12961 | ||
12962 | if (atomic_read(&pdev->enable_cnt) == 1) | 12962 | if (atomic_read(&pdev->enable_cnt) == 1) |
12963 | pci_release_regions(pdev); | 12963 | pci_release_regions(pdev); |
12964 | } | ||
12964 | 12965 | ||
12965 | pci_disable_device(pdev); | 12966 | pci_disable_device(pdev); |
12966 | } | 12967 | } |
diff --git a/drivers/net/ethernet/chelsio/cxgb4/l2t.c b/drivers/net/ethernet/chelsio/cxgb4/l2t.c index cb05be905def..81e8402a74b4 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/l2t.c +++ b/drivers/net/ethernet/chelsio/cxgb4/l2t.c | |||
@@ -423,7 +423,7 @@ u64 cxgb4_select_ntuple(struct net_device *dev, | |||
423 | * in the Compressed Filter Tuple. | 423 | * in the Compressed Filter Tuple. |
424 | */ | 424 | */ |
425 | if (tp->vlan_shift >= 0 && l2t->vlan != VLAN_NONE) | 425 | if (tp->vlan_shift >= 0 && l2t->vlan != VLAN_NONE) |
426 | ntuple |= (F_FT_VLAN_VLD | l2t->vlan) << tp->vlan_shift; | 426 | ntuple |= (u64)(F_FT_VLAN_VLD | l2t->vlan) << tp->vlan_shift; |
427 | 427 | ||
428 | if (tp->port_shift >= 0) | 428 | if (tp->port_shift >= 0) |
429 | ntuple |= (u64)l2t->lport << tp->port_shift; | 429 | ntuple |= (u64)l2t->lport << tp->port_shift; |
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c index bf40fdaecfa3..a37039d353c5 100644 --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c | |||
@@ -1776,6 +1776,7 @@ static void be_post_rx_frags(struct be_rx_obj *rxo, gfp_t gfp) | |||
1776 | struct be_rx_page_info *page_info = NULL, *prev_page_info = NULL; | 1776 | struct be_rx_page_info *page_info = NULL, *prev_page_info = NULL; |
1777 | struct be_queue_info *rxq = &rxo->q; | 1777 | struct be_queue_info *rxq = &rxo->q; |
1778 | struct page *pagep = NULL; | 1778 | struct page *pagep = NULL; |
1779 | struct device *dev = &adapter->pdev->dev; | ||
1779 | struct be_eth_rx_d *rxd; | 1780 | struct be_eth_rx_d *rxd; |
1780 | u64 page_dmaaddr = 0, frag_dmaaddr; | 1781 | u64 page_dmaaddr = 0, frag_dmaaddr; |
1781 | u32 posted, page_offset = 0; | 1782 | u32 posted, page_offset = 0; |
@@ -1788,9 +1789,15 @@ static void be_post_rx_frags(struct be_rx_obj *rxo, gfp_t gfp) | |||
1788 | rx_stats(rxo)->rx_post_fail++; | 1789 | rx_stats(rxo)->rx_post_fail++; |
1789 | break; | 1790 | break; |
1790 | } | 1791 | } |
1791 | page_dmaaddr = dma_map_page(&adapter->pdev->dev, pagep, | 1792 | page_dmaaddr = dma_map_page(dev, pagep, 0, |
1792 | 0, adapter->big_page_size, | 1793 | adapter->big_page_size, |
1793 | DMA_FROM_DEVICE); | 1794 | DMA_FROM_DEVICE); |
1795 | if (dma_mapping_error(dev, page_dmaaddr)) { | ||
1796 | put_page(pagep); | ||
1797 | pagep = NULL; | ||
1798 | rx_stats(rxo)->rx_post_fail++; | ||
1799 | break; | ||
1800 | } | ||
1794 | page_info->page_offset = 0; | 1801 | page_info->page_offset = 0; |
1795 | } else { | 1802 | } else { |
1796 | get_page(pagep); | 1803 | get_page(pagep); |
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c index c30d41d6e426..6d14eea17918 100644 --- a/drivers/net/ethernet/intel/e1000e/netdev.c +++ b/drivers/net/ethernet/intel/e1000e/netdev.c | |||
@@ -6174,7 +6174,7 @@ static int __e1000_resume(struct pci_dev *pdev) | |||
6174 | return 0; | 6174 | return 0; |
6175 | } | 6175 | } |
6176 | 6176 | ||
6177 | #ifdef CONFIG_PM | 6177 | #ifdef CONFIG_PM_SLEEP |
6178 | static int e1000_suspend(struct device *dev) | 6178 | static int e1000_suspend(struct device *dev) |
6179 | { | 6179 | { |
6180 | struct pci_dev *pdev = to_pci_dev(dev); | 6180 | struct pci_dev *pdev = to_pci_dev(dev); |
@@ -6193,7 +6193,7 @@ static int e1000_resume(struct device *dev) | |||
6193 | 6193 | ||
6194 | return __e1000_resume(pdev); | 6194 | return __e1000_resume(pdev); |
6195 | } | 6195 | } |
6196 | #endif /* CONFIG_PM */ | 6196 | #endif /* CONFIG_PM_SLEEP */ |
6197 | 6197 | ||
6198 | #ifdef CONFIG_PM_RUNTIME | 6198 | #ifdef CONFIG_PM_RUNTIME |
6199 | static int e1000_runtime_suspend(struct device *dev) | 6199 | static int e1000_runtime_suspend(struct device *dev) |
@@ -7015,13 +7015,11 @@ static DEFINE_PCI_DEVICE_TABLE(e1000_pci_tbl) = { | |||
7015 | }; | 7015 | }; |
7016 | MODULE_DEVICE_TABLE(pci, e1000_pci_tbl); | 7016 | MODULE_DEVICE_TABLE(pci, e1000_pci_tbl); |
7017 | 7017 | ||
7018 | #ifdef CONFIG_PM | ||
7019 | static const struct dev_pm_ops e1000_pm_ops = { | 7018 | static const struct dev_pm_ops e1000_pm_ops = { |
7020 | SET_SYSTEM_SLEEP_PM_OPS(e1000_suspend, e1000_resume) | 7019 | SET_SYSTEM_SLEEP_PM_OPS(e1000_suspend, e1000_resume) |
7021 | SET_RUNTIME_PM_OPS(e1000_runtime_suspend, e1000_runtime_resume, | 7020 | SET_RUNTIME_PM_OPS(e1000_runtime_suspend, e1000_runtime_resume, |
7022 | e1000_idle) | 7021 | e1000_idle) |
7023 | }; | 7022 | }; |
7024 | #endif | ||
7025 | 7023 | ||
7026 | /* PCI Device API Driver */ | 7024 | /* PCI Device API Driver */ |
7027 | static struct pci_driver e1000_driver = { | 7025 | static struct pci_driver e1000_driver = { |
@@ -7029,11 +7027,9 @@ static struct pci_driver e1000_driver = { | |||
7029 | .id_table = e1000_pci_tbl, | 7027 | .id_table = e1000_pci_tbl, |
7030 | .probe = e1000_probe, | 7028 | .probe = e1000_probe, |
7031 | .remove = e1000_remove, | 7029 | .remove = e1000_remove, |
7032 | #ifdef CONFIG_PM | ||
7033 | .driver = { | 7030 | .driver = { |
7034 | .pm = &e1000_pm_ops, | 7031 | .pm = &e1000_pm_ops, |
7035 | }, | 7032 | }, |
7036 | #endif | ||
7037 | .shutdown = e1000_shutdown, | 7033 | .shutdown = e1000_shutdown, |
7038 | .err_handler = &e1000_err_handler | 7034 | .err_handler = &e1000_err_handler |
7039 | }; | 7035 | }; |
diff --git a/drivers/net/ethernet/qlogic/qlge/qlge_main.c b/drivers/net/ethernet/qlogic/qlge/qlge_main.c index 449f506d2e8f..f705aeeba767 100644 --- a/drivers/net/ethernet/qlogic/qlge/qlge_main.c +++ b/drivers/net/ethernet/qlogic/qlge/qlge_main.c | |||
@@ -4765,6 +4765,8 @@ static int qlge_probe(struct pci_dev *pdev, | |||
4765 | NETIF_F_RXCSUM; | 4765 | NETIF_F_RXCSUM; |
4766 | ndev->features = ndev->hw_features; | 4766 | ndev->features = ndev->hw_features; |
4767 | ndev->vlan_features = ndev->hw_features; | 4767 | ndev->vlan_features = ndev->hw_features; |
4768 | /* vlan gets same features (except vlan filter) */ | ||
4769 | ndev->vlan_features &= ~NETIF_F_HW_VLAN_CTAG_FILTER; | ||
4768 | 4770 | ||
4769 | if (test_bit(QL_DMA64, &qdev->flags)) | 4771 | if (test_bit(QL_DMA64, &qdev->flags)) |
4770 | ndev->features |= NETIF_F_HIGHDMA; | 4772 | ndev->features |= NETIF_F_HIGHDMA; |
diff --git a/drivers/net/ethernet/via/via-rhine.c b/drivers/net/ethernet/via/via-rhine.c index cce6c4bc556a..ef312bc6b865 100644 --- a/drivers/net/ethernet/via/via-rhine.c +++ b/drivers/net/ethernet/via/via-rhine.c | |||
@@ -1618,6 +1618,7 @@ static void rhine_reset_task(struct work_struct *work) | |||
1618 | goto out_unlock; | 1618 | goto out_unlock; |
1619 | 1619 | ||
1620 | napi_disable(&rp->napi); | 1620 | napi_disable(&rp->napi); |
1621 | netif_tx_disable(dev); | ||
1621 | spin_lock_bh(&rp->lock); | 1622 | spin_lock_bh(&rp->lock); |
1622 | 1623 | ||
1623 | /* clear all descriptors */ | 1624 | /* clear all descriptors */ |
diff --git a/drivers/net/usb/dm9601.c b/drivers/net/usb/dm9601.c index 14aa48fa8d7e..e80219877730 100644 --- a/drivers/net/usb/dm9601.c +++ b/drivers/net/usb/dm9601.c | |||
@@ -614,6 +614,18 @@ static const struct usb_device_id products[] = { | |||
614 | USB_DEVICE(0x0a46, 0x9621), /* DM9621A USB to Fast Ethernet Adapter */ | 614 | USB_DEVICE(0x0a46, 0x9621), /* DM9621A USB to Fast Ethernet Adapter */ |
615 | .driver_info = (unsigned long)&dm9601_info, | 615 | .driver_info = (unsigned long)&dm9601_info, |
616 | }, | 616 | }, |
617 | { | ||
618 | USB_DEVICE(0x0a46, 0x9622), /* DM9622 USB to Fast Ethernet Adapter */ | ||
619 | .driver_info = (unsigned long)&dm9601_info, | ||
620 | }, | ||
621 | { | ||
622 | USB_DEVICE(0x0a46, 0x0269), /* DM962OA USB to Fast Ethernet Adapter */ | ||
623 | .driver_info = (unsigned long)&dm9601_info, | ||
624 | }, | ||
625 | { | ||
626 | USB_DEVICE(0x0a46, 0x1269), /* DM9621A USB to Fast Ethernet Adapter */ | ||
627 | .driver_info = (unsigned long)&dm9601_info, | ||
628 | }, | ||
617 | {}, // END | 629 | {}, // END |
618 | }; | 630 | }; |
619 | 631 | ||
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index 8494bb53ebdc..aba04f561760 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c | |||
@@ -1245,7 +1245,7 @@ static int build_dma_sg(const struct sk_buff *skb, struct urb *urb) | |||
1245 | return -ENOMEM; | 1245 | return -ENOMEM; |
1246 | 1246 | ||
1247 | urb->num_sgs = num_sgs; | 1247 | urb->num_sgs = num_sgs; |
1248 | sg_init_table(urb->sg, urb->num_sgs); | 1248 | sg_init_table(urb->sg, urb->num_sgs + 1); |
1249 | 1249 | ||
1250 | sg_set_buf(&urb->sg[s++], skb->data, skb_headlen(skb)); | 1250 | sg_set_buf(&urb->sg[s++], skb->data, skb_headlen(skb)); |
1251 | total_len += skb_headlen(skb); | 1251 | total_len += skb_headlen(skb); |
diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h index 76d54270f2e2..65bb13035598 100644 --- a/include/net/if_inet6.h +++ b/include/net/if_inet6.h | |||
@@ -165,7 +165,6 @@ struct inet6_dev { | |||
165 | struct net_device *dev; | 165 | struct net_device *dev; |
166 | 166 | ||
167 | struct list_head addr_list; | 167 | struct list_head addr_list; |
168 | int valid_ll_addr_cnt; | ||
169 | 168 | ||
170 | struct ifmcaddr6 *mc_list; | 169 | struct ifmcaddr6 *mc_list; |
171 | struct ifmcaddr6 *mc_tomb; | 170 | struct ifmcaddr6 *mc_tomb; |
diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c index 1511f64a6cea..faba0f61ad53 100644 --- a/net/batman-adv/main.c +++ b/net/batman-adv/main.c | |||
@@ -277,7 +277,7 @@ int batadv_max_header_len(void) | |||
277 | sizeof(struct batadv_coded_packet)); | 277 | sizeof(struct batadv_coded_packet)); |
278 | #endif | 278 | #endif |
279 | 279 | ||
280 | return header_len; | 280 | return header_len + ETH_HLEN; |
281 | } | 281 | } |
282 | 282 | ||
283 | /** | 283 | /** |
diff --git a/net/core/filter.c b/net/core/filter.c index 01b780856db2..ad30d626a5bd 100644 --- a/net/core/filter.c +++ b/net/core/filter.c | |||
@@ -36,7 +36,6 @@ | |||
36 | #include <asm/uaccess.h> | 36 | #include <asm/uaccess.h> |
37 | #include <asm/unaligned.h> | 37 | #include <asm/unaligned.h> |
38 | #include <linux/filter.h> | 38 | #include <linux/filter.h> |
39 | #include <linux/reciprocal_div.h> | ||
40 | #include <linux/ratelimit.h> | 39 | #include <linux/ratelimit.h> |
41 | #include <linux/seccomp.h> | 40 | #include <linux/seccomp.h> |
42 | #include <linux/if_vlan.h> | 41 | #include <linux/if_vlan.h> |
@@ -166,7 +165,7 @@ unsigned int sk_run_filter(const struct sk_buff *skb, | |||
166 | A /= X; | 165 | A /= X; |
167 | continue; | 166 | continue; |
168 | case BPF_S_ALU_DIV_K: | 167 | case BPF_S_ALU_DIV_K: |
169 | A = reciprocal_divide(A, K); | 168 | A /= K; |
170 | continue; | 169 | continue; |
171 | case BPF_S_ALU_MOD_X: | 170 | case BPF_S_ALU_MOD_X: |
172 | if (X == 0) | 171 | if (X == 0) |
@@ -553,11 +552,6 @@ int sk_chk_filter(struct sock_filter *filter, unsigned int flen) | |||
553 | /* Some instructions need special checks */ | 552 | /* Some instructions need special checks */ |
554 | switch (code) { | 553 | switch (code) { |
555 | case BPF_S_ALU_DIV_K: | 554 | case BPF_S_ALU_DIV_K: |
556 | /* check for division by zero */ | ||
557 | if (ftest->k == 0) | ||
558 | return -EINVAL; | ||
559 | ftest->k = reciprocal_value(ftest->k); | ||
560 | break; | ||
561 | case BPF_S_ALU_MOD_K: | 555 | case BPF_S_ALU_MOD_K: |
562 | /* check for division by zero */ | 556 | /* check for division by zero */ |
563 | if (ftest->k == 0) | 557 | if (ftest->k == 0) |
@@ -853,27 +847,7 @@ void sk_decode_filter(struct sock_filter *filt, struct sock_filter *to) | |||
853 | to->code = decodes[code]; | 847 | to->code = decodes[code]; |
854 | to->jt = filt->jt; | 848 | to->jt = filt->jt; |
855 | to->jf = filt->jf; | 849 | to->jf = filt->jf; |
856 | 850 | to->k = filt->k; | |
857 | if (code == BPF_S_ALU_DIV_K) { | ||
858 | /* | ||
859 | * When loaded this rule user gave us X, which was | ||
860 | * translated into R = r(X). Now we calculate the | ||
861 | * RR = r(R) and report it back. If next time this | ||
862 | * value is loaded and RRR = r(RR) is calculated | ||
863 | * then the R == RRR will be true. | ||
864 | * | ||
865 | * One exception. X == 1 translates into R == 0 and | ||
866 | * we can't calculate RR out of it with r(). | ||
867 | */ | ||
868 | |||
869 | if (filt->k == 0) | ||
870 | to->k = 1; | ||
871 | else | ||
872 | to->k = reciprocal_value(filt->k); | ||
873 | |||
874 | BUG_ON(reciprocal_value(to->k) != filt->k); | ||
875 | } else | ||
876 | to->k = filt->k; | ||
877 | } | 851 | } |
878 | 852 | ||
879 | int sk_get_filter(struct sock *sk, struct sock_filter __user *ubuf, unsigned int len) | 853 | int sk_get_filter(struct sock *sk, struct sock_filter __user *ubuf, unsigned int len) |
diff --git a/net/ieee802154/nl-phy.c b/net/ieee802154/nl-phy.c index d08c7a43dcd1..89b265aea151 100644 --- a/net/ieee802154/nl-phy.c +++ b/net/ieee802154/nl-phy.c | |||
@@ -221,8 +221,10 @@ int ieee802154_add_iface(struct sk_buff *skb, struct genl_info *info) | |||
221 | 221 | ||
222 | if (info->attrs[IEEE802154_ATTR_DEV_TYPE]) { | 222 | if (info->attrs[IEEE802154_ATTR_DEV_TYPE]) { |
223 | type = nla_get_u8(info->attrs[IEEE802154_ATTR_DEV_TYPE]); | 223 | type = nla_get_u8(info->attrs[IEEE802154_ATTR_DEV_TYPE]); |
224 | if (type >= __IEEE802154_DEV_MAX) | 224 | if (type >= __IEEE802154_DEV_MAX) { |
225 | return -EINVAL; | 225 | rc = -EINVAL; |
226 | goto nla_put_failure; | ||
227 | } | ||
226 | } | 228 | } |
227 | 229 | ||
228 | dev = phy->add_iface(phy, devname, type); | 230 | dev = phy->add_iface(phy, devname, type); |
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c index a0f52dac8940..e34dccbc4d70 100644 --- a/net/ipv4/inet_diag.c +++ b/net/ipv4/inet_diag.c | |||
@@ -930,12 +930,15 @@ skip_listen_ht: | |||
930 | spin_lock_bh(lock); | 930 | spin_lock_bh(lock); |
931 | sk_nulls_for_each(sk, node, &head->chain) { | 931 | sk_nulls_for_each(sk, node, &head->chain) { |
932 | int res; | 932 | int res; |
933 | int state; | ||
933 | 934 | ||
934 | if (!net_eq(sock_net(sk), net)) | 935 | if (!net_eq(sock_net(sk), net)) |
935 | continue; | 936 | continue; |
936 | if (num < s_num) | 937 | if (num < s_num) |
937 | goto next_normal; | 938 | goto next_normal; |
938 | if (!(r->idiag_states & (1 << sk->sk_state))) | 939 | state = (sk->sk_state == TCP_TIME_WAIT) ? |
940 | inet_twsk(sk)->tw_substate : sk->sk_state; | ||
941 | if (!(r->idiag_states & (1 << state))) | ||
939 | goto next_normal; | 942 | goto next_normal; |
940 | if (r->sdiag_family != AF_UNSPEC && | 943 | if (r->sdiag_family != AF_UNSPEC && |
941 | sk->sk_family != r->sdiag_family) | 944 | sk->sk_family != r->sdiag_family) |
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c index 62212c772a4b..1672409f5ba5 100644 --- a/net/ipv4/ipmr.c +++ b/net/ipv4/ipmr.c | |||
@@ -157,9 +157,12 @@ static struct mr_table *ipmr_get_table(struct net *net, u32 id) | |||
157 | static int ipmr_fib_lookup(struct net *net, struct flowi4 *flp4, | 157 | static int ipmr_fib_lookup(struct net *net, struct flowi4 *flp4, |
158 | struct mr_table **mrt) | 158 | struct mr_table **mrt) |
159 | { | 159 | { |
160 | struct ipmr_result res; | ||
161 | struct fib_lookup_arg arg = { .result = &res, }; | ||
162 | int err; | 160 | int err; |
161 | struct ipmr_result res; | ||
162 | struct fib_lookup_arg arg = { | ||
163 | .result = &res, | ||
164 | .flags = FIB_LOOKUP_NOREF, | ||
165 | }; | ||
163 | 166 | ||
164 | err = fib_rules_lookup(net->ipv4.mr_rules_ops, | 167 | err = fib_rules_lookup(net->ipv4.mr_rules_ops, |
165 | flowi4_to_flowi(flp4), 0, &arg); | 168 | flowi4_to_flowi(flp4), 0, &arg); |
diff --git a/net/ipv4/tcp_metrics.c b/net/ipv4/tcp_metrics.c index 06493736fbc8..098b3a29f6f3 100644 --- a/net/ipv4/tcp_metrics.c +++ b/net/ipv4/tcp_metrics.c | |||
@@ -22,6 +22,9 @@ | |||
22 | 22 | ||
23 | int sysctl_tcp_nometrics_save __read_mostly; | 23 | int sysctl_tcp_nometrics_save __read_mostly; |
24 | 24 | ||
25 | static struct tcp_metrics_block *__tcp_get_metrics(const struct inetpeer_addr *addr, | ||
26 | struct net *net, unsigned int hash); | ||
27 | |||
25 | struct tcp_fastopen_metrics { | 28 | struct tcp_fastopen_metrics { |
26 | u16 mss; | 29 | u16 mss; |
27 | u16 syn_loss:10; /* Recurring Fast Open SYN losses */ | 30 | u16 syn_loss:10; /* Recurring Fast Open SYN losses */ |
@@ -130,16 +133,41 @@ static void tcpm_suck_dst(struct tcp_metrics_block *tm, struct dst_entry *dst, | |||
130 | } | 133 | } |
131 | } | 134 | } |
132 | 135 | ||
136 | #define TCP_METRICS_TIMEOUT (60 * 60 * HZ) | ||
137 | |||
138 | static void tcpm_check_stamp(struct tcp_metrics_block *tm, struct dst_entry *dst) | ||
139 | { | ||
140 | if (tm && unlikely(time_after(jiffies, tm->tcpm_stamp + TCP_METRICS_TIMEOUT))) | ||
141 | tcpm_suck_dst(tm, dst, false); | ||
142 | } | ||
143 | |||
144 | #define TCP_METRICS_RECLAIM_DEPTH 5 | ||
145 | #define TCP_METRICS_RECLAIM_PTR (struct tcp_metrics_block *) 0x1UL | ||
146 | |||
133 | static struct tcp_metrics_block *tcpm_new(struct dst_entry *dst, | 147 | static struct tcp_metrics_block *tcpm_new(struct dst_entry *dst, |
134 | struct inetpeer_addr *addr, | 148 | struct inetpeer_addr *addr, |
135 | unsigned int hash, | 149 | unsigned int hash) |
136 | bool reclaim) | ||
137 | { | 150 | { |
138 | struct tcp_metrics_block *tm; | 151 | struct tcp_metrics_block *tm; |
139 | struct net *net; | 152 | struct net *net; |
153 | bool reclaim = false; | ||
140 | 154 | ||
141 | spin_lock_bh(&tcp_metrics_lock); | 155 | spin_lock_bh(&tcp_metrics_lock); |
142 | net = dev_net(dst->dev); | 156 | net = dev_net(dst->dev); |
157 | |||
158 | /* While waiting for the spin-lock the cache might have been populated | ||
159 | * with this entry and so we have to check again. | ||
160 | */ | ||
161 | tm = __tcp_get_metrics(addr, net, hash); | ||
162 | if (tm == TCP_METRICS_RECLAIM_PTR) { | ||
163 | reclaim = true; | ||
164 | tm = NULL; | ||
165 | } | ||
166 | if (tm) { | ||
167 | tcpm_check_stamp(tm, dst); | ||
168 | goto out_unlock; | ||
169 | } | ||
170 | |||
143 | if (unlikely(reclaim)) { | 171 | if (unlikely(reclaim)) { |
144 | struct tcp_metrics_block *oldest; | 172 | struct tcp_metrics_block *oldest; |
145 | 173 | ||
@@ -169,17 +197,6 @@ out_unlock: | |||
169 | return tm; | 197 | return tm; |
170 | } | 198 | } |
171 | 199 | ||
172 | #define TCP_METRICS_TIMEOUT (60 * 60 * HZ) | ||
173 | |||
174 | static void tcpm_check_stamp(struct tcp_metrics_block *tm, struct dst_entry *dst) | ||
175 | { | ||
176 | if (tm && unlikely(time_after(jiffies, tm->tcpm_stamp + TCP_METRICS_TIMEOUT))) | ||
177 | tcpm_suck_dst(tm, dst, false); | ||
178 | } | ||
179 | |||
180 | #define TCP_METRICS_RECLAIM_DEPTH 5 | ||
181 | #define TCP_METRICS_RECLAIM_PTR (struct tcp_metrics_block *) 0x1UL | ||
182 | |||
183 | static struct tcp_metrics_block *tcp_get_encode(struct tcp_metrics_block *tm, int depth) | 200 | static struct tcp_metrics_block *tcp_get_encode(struct tcp_metrics_block *tm, int depth) |
184 | { | 201 | { |
185 | if (tm) | 202 | if (tm) |
@@ -282,7 +299,6 @@ static struct tcp_metrics_block *tcp_get_metrics(struct sock *sk, | |||
282 | struct inetpeer_addr addr; | 299 | struct inetpeer_addr addr; |
283 | unsigned int hash; | 300 | unsigned int hash; |
284 | struct net *net; | 301 | struct net *net; |
285 | bool reclaim; | ||
286 | 302 | ||
287 | addr.family = sk->sk_family; | 303 | addr.family = sk->sk_family; |
288 | switch (addr.family) { | 304 | switch (addr.family) { |
@@ -304,13 +320,10 @@ static struct tcp_metrics_block *tcp_get_metrics(struct sock *sk, | |||
304 | hash = hash_32(hash, net->ipv4.tcp_metrics_hash_log); | 320 | hash = hash_32(hash, net->ipv4.tcp_metrics_hash_log); |
305 | 321 | ||
306 | tm = __tcp_get_metrics(&addr, net, hash); | 322 | tm = __tcp_get_metrics(&addr, net, hash); |
307 | reclaim = false; | 323 | if (tm == TCP_METRICS_RECLAIM_PTR) |
308 | if (tm == TCP_METRICS_RECLAIM_PTR) { | ||
309 | reclaim = true; | ||
310 | tm = NULL; | 324 | tm = NULL; |
311 | } | ||
312 | if (!tm && create) | 325 | if (!tm && create) |
313 | tm = tcpm_new(dst, &addr, hash, reclaim); | 326 | tm = tcpm_new(dst, &addr, hash); |
314 | else | 327 | else |
315 | tcpm_check_stamp(tm, dst); | 328 | tcpm_check_stamp(tm, dst); |
316 | 329 | ||
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index abe46a4228ce..4b6b720971b9 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -3189,6 +3189,22 @@ out: | |||
3189 | in6_ifa_put(ifp); | 3189 | in6_ifa_put(ifp); |
3190 | } | 3190 | } |
3191 | 3191 | ||
3192 | /* ifp->idev must be at least read locked */ | ||
3193 | static bool ipv6_lonely_lladdr(struct inet6_ifaddr *ifp) | ||
3194 | { | ||
3195 | struct inet6_ifaddr *ifpiter; | ||
3196 | struct inet6_dev *idev = ifp->idev; | ||
3197 | |||
3198 | list_for_each_entry(ifpiter, &idev->addr_list, if_list) { | ||
3199 | if (ifp != ifpiter && ifpiter->scope == IFA_LINK && | ||
3200 | (ifpiter->flags & (IFA_F_PERMANENT|IFA_F_TENTATIVE| | ||
3201 | IFA_F_OPTIMISTIC|IFA_F_DADFAILED)) == | ||
3202 | IFA_F_PERMANENT) | ||
3203 | return false; | ||
3204 | } | ||
3205 | return true; | ||
3206 | } | ||
3207 | |||
3192 | static void addrconf_dad_completed(struct inet6_ifaddr *ifp) | 3208 | static void addrconf_dad_completed(struct inet6_ifaddr *ifp) |
3193 | { | 3209 | { |
3194 | struct net_device *dev = ifp->idev->dev; | 3210 | struct net_device *dev = ifp->idev->dev; |
@@ -3208,14 +3224,11 @@ static void addrconf_dad_completed(struct inet6_ifaddr *ifp) | |||
3208 | */ | 3224 | */ |
3209 | 3225 | ||
3210 | read_lock_bh(&ifp->idev->lock); | 3226 | read_lock_bh(&ifp->idev->lock); |
3211 | spin_lock(&ifp->lock); | 3227 | send_mld = ifp->scope == IFA_LINK && ipv6_lonely_lladdr(ifp); |
3212 | send_mld = ipv6_addr_type(&ifp->addr) & IPV6_ADDR_LINKLOCAL && | ||
3213 | ifp->idev->valid_ll_addr_cnt == 1; | ||
3214 | send_rs = send_mld && | 3228 | send_rs = send_mld && |
3215 | ipv6_accept_ra(ifp->idev) && | 3229 | ipv6_accept_ra(ifp->idev) && |
3216 | ifp->idev->cnf.rtr_solicits > 0 && | 3230 | ifp->idev->cnf.rtr_solicits > 0 && |
3217 | (dev->flags&IFF_LOOPBACK) == 0; | 3231 | (dev->flags&IFF_LOOPBACK) == 0; |
3218 | spin_unlock(&ifp->lock); | ||
3219 | read_unlock_bh(&ifp->idev->lock); | 3232 | read_unlock_bh(&ifp->idev->lock); |
3220 | 3233 | ||
3221 | /* While dad is in progress mld report's source address is in6_addrany. | 3234 | /* While dad is in progress mld report's source address is in6_addrany. |
@@ -4512,19 +4525,6 @@ errout: | |||
4512 | rtnl_set_sk_err(net, RTNLGRP_IPV6_PREFIX, err); | 4525 | rtnl_set_sk_err(net, RTNLGRP_IPV6_PREFIX, err); |
4513 | } | 4526 | } |
4514 | 4527 | ||
4515 | static void update_valid_ll_addr_cnt(struct inet6_ifaddr *ifp, int count) | ||
4516 | { | ||
4517 | write_lock_bh(&ifp->idev->lock); | ||
4518 | spin_lock(&ifp->lock); | ||
4519 | if (((ifp->flags & (IFA_F_PERMANENT|IFA_F_TENTATIVE|IFA_F_OPTIMISTIC| | ||
4520 | IFA_F_DADFAILED)) == IFA_F_PERMANENT) && | ||
4521 | (ipv6_addr_type(&ifp->addr) & IPV6_ADDR_LINKLOCAL)) | ||
4522 | ifp->idev->valid_ll_addr_cnt += count; | ||
4523 | WARN_ON(ifp->idev->valid_ll_addr_cnt < 0); | ||
4524 | spin_unlock(&ifp->lock); | ||
4525 | write_unlock_bh(&ifp->idev->lock); | ||
4526 | } | ||
4527 | |||
4528 | static void __ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp) | 4528 | static void __ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp) |
4529 | { | 4529 | { |
4530 | struct net *net = dev_net(ifp->idev->dev); | 4530 | struct net *net = dev_net(ifp->idev->dev); |
@@ -4533,8 +4533,6 @@ static void __ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp) | |||
4533 | 4533 | ||
4534 | switch (event) { | 4534 | switch (event) { |
4535 | case RTM_NEWADDR: | 4535 | case RTM_NEWADDR: |
4536 | update_valid_ll_addr_cnt(ifp, 1); | ||
4537 | |||
4538 | /* | 4536 | /* |
4539 | * If the address was optimistic | 4537 | * If the address was optimistic |
4540 | * we inserted the route at the start of | 4538 | * we inserted the route at the start of |
@@ -4550,8 +4548,6 @@ static void __ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp) | |||
4550 | ifp->idev->dev, 0, 0); | 4548 | ifp->idev->dev, 0, 0); |
4551 | break; | 4549 | break; |
4552 | case RTM_DELADDR: | 4550 | case RTM_DELADDR: |
4553 | update_valid_ll_addr_cnt(ifp, -1); | ||
4554 | |||
4555 | if (ifp->idev->cnf.forwarding) | 4551 | if (ifp->idev->cnf.forwarding) |
4556 | addrconf_leave_anycast(ifp); | 4552 | addrconf_leave_anycast(ifp); |
4557 | addrconf_leave_solict(ifp->idev, &ifp->addr); | 4553 | addrconf_leave_solict(ifp->idev, &ifp->addr); |
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c index f365310bfcca..0eb4038a4d63 100644 --- a/net/ipv6/ip6mr.c +++ b/net/ipv6/ip6mr.c | |||
@@ -141,9 +141,12 @@ static struct mr6_table *ip6mr_get_table(struct net *net, u32 id) | |||
141 | static int ip6mr_fib_lookup(struct net *net, struct flowi6 *flp6, | 141 | static int ip6mr_fib_lookup(struct net *net, struct flowi6 *flp6, |
142 | struct mr6_table **mrt) | 142 | struct mr6_table **mrt) |
143 | { | 143 | { |
144 | struct ip6mr_result res; | ||
145 | struct fib_lookup_arg arg = { .result = &res, }; | ||
146 | int err; | 144 | int err; |
145 | struct ip6mr_result res; | ||
146 | struct fib_lookup_arg arg = { | ||
147 | .result = &res, | ||
148 | .flags = FIB_LOOKUP_NOREF, | ||
149 | }; | ||
147 | 150 | ||
148 | err = fib_rules_lookup(net->ipv6.mr6_rules_ops, | 151 | err = fib_rules_lookup(net->ipv6.mr6_rules_ops, |
149 | flowi6_to_flowi(flp6), 0, &arg); | 152 | flowi6_to_flowi(flp6), 0, &arg); |
diff --git a/net/rds/ib_recv.c b/net/rds/ib_recv.c index 8eb9501e3d60..b7ebe23cdedf 100644 --- a/net/rds/ib_recv.c +++ b/net/rds/ib_recv.c | |||
@@ -421,8 +421,7 @@ static void rds_ib_recv_cache_put(struct list_head *new_item, | |||
421 | struct rds_ib_refill_cache *cache) | 421 | struct rds_ib_refill_cache *cache) |
422 | { | 422 | { |
423 | unsigned long flags; | 423 | unsigned long flags; |
424 | struct list_head *old; | 424 | struct list_head *old, *chpfirst; |
425 | struct list_head __percpu *chpfirst; | ||
426 | 425 | ||
427 | local_irq_save(flags); | 426 | local_irq_save(flags); |
428 | 427 | ||
@@ -432,7 +431,7 @@ static void rds_ib_recv_cache_put(struct list_head *new_item, | |||
432 | else /* put on front */ | 431 | else /* put on front */ |
433 | list_add_tail(new_item, chpfirst); | 432 | list_add_tail(new_item, chpfirst); |
434 | 433 | ||
435 | __this_cpu_write(chpfirst, new_item); | 434 | __this_cpu_write(cache->percpu->first, new_item); |
436 | __this_cpu_inc(cache->percpu->count); | 435 | __this_cpu_inc(cache->percpu->count); |
437 | 436 | ||
438 | if (__this_cpu_read(cache->percpu->count) < RDS_IB_RECYCLE_BATCH_COUNT) | 437 | if (__this_cpu_read(cache->percpu->count) < RDS_IB_RECYCLE_BATCH_COUNT) |
@@ -452,7 +451,7 @@ static void rds_ib_recv_cache_put(struct list_head *new_item, | |||
452 | } while (old); | 451 | } while (old); |
453 | 452 | ||
454 | 453 | ||
455 | __this_cpu_write(chpfirst, NULL); | 454 | __this_cpu_write(cache->percpu->first, NULL); |
456 | __this_cpu_write(cache->percpu->count, 0); | 455 | __this_cpu_write(cache->percpu->count, 0); |
457 | end: | 456 | end: |
458 | local_irq_restore(flags); | 457 | local_irq_restore(flags); |