1. 11 1月, 2014 4 次提交
    • J
      net: core: explicitly select a txq before doing l2 forwarding · f663dd9a
      Jason Wang 提交于
      Currently, the tx queue were selected implicitly in ndo_dfwd_start_xmit(). The
      will cause several issues:
      
      - NETIF_F_LLTX were removed for macvlan, so txq lock were done for macvlan
        instead of lower device which misses the necessary txq synchronization for
        lower device such as txq stopping or frozen required by dev watchdog or
        control path.
      - dev_hard_start_xmit() was called with NULL txq which bypasses the net device
        watchdog.
      - dev_hard_start_xmit() does not check txq everywhere which will lead a crash
        when tso is disabled for lower device.
      
      Fix this by explicitly introducing a new param for .ndo_select_queue() for just
      selecting queues in the case of l2 forwarding offload. netdev_pick_tx() was also
      extended to accept this parameter and dev_queue_xmit_accel() was used to do l2
      forwarding transmission.
      
      With this fixes, NETIF_F_LLTX could be preserved for macvlan and there's no need
      to check txq against NULL in dev_hard_start_xmit(). Also there's no need to keep
      a dedicated ndo_dfwd_start_xmit() and we can just reuse the code of
      dev_queue_xmit() to do the transmission.
      
      In the future, it was also required for macvtap l2 forwarding support since it
      provides a necessary synchronization method.
      
      Cc: John Fastabend <john.r.fastabend@intel.com>
      Cc: Neil Horman <nhorman@tuxdriver.com>
      Cc: e1000-devel@lists.sourceforge.net
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      Acked-by: NNeil Horman <nhorman@tuxdriver.com>
      Acked-by: NJohn Fastabend <john.r.fastabend@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f663dd9a
    • J
      macvlan: forbid L2 fowarding offload for macvtap · b13ba1b8
      Jason Wang 提交于
      L2 fowarding offload will bypass the rx handler of real device. This will make
      the packet could not be forwarded to macvtap device. Another problem is the
      dev_hard_start_xmit() called for macvtap does not have any synchronization.
      
      Fix this by forbidding L2 forwarding for macvtap.
      
      Cc: John Fastabend <john.r.fastabend@intel.com>
      Cc: Neil Horman <nhorman@tuxdriver.com>
      Acked-by: NNeil Horman <nhorman@tuxdriver.com>
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      Acked-by: NJohn Fastabend <john.r.fastabend@intel.com.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b13ba1b8
    • D
      Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless · c4d70998
      David S. Miller 提交于
      John W. Linville says:
      
      ====================
      For the mac80211 bits, Johannes says:
      
      "I have a fix from Javier for mac80211_hwsim when used with wmediumd
      userspace, and a fix from Felix for buffering in AP mode."
      
      For the NFC bits, Samuel says:
      
      "This pull request only contains one fix for a regression introduced with
      commit e29a9e2a. Without this fix, we can not establish a p2p link
      in target mode. Only initiator mode works."
      
      For the iwlwifi bits, Emmanuel says:
      
      "It only includes new device IDs so it's not vital. If you have a pull
      request to net.git anyway, I'd happy to have this in."
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c4d70998
    • M
      bnx2x: fix DMA unmapping of TSO split BDs · 95e92fd4
      Michal Schmidt 提交于
      bnx2x triggers warnings with CONFIG_DMA_API_DEBUG=y:
      
        WARNING: CPU: 0 PID: 2253 at lib/dma-debug.c:887 check_unmap+0xf8/0x920()
        bnx2x 0000:28:00.0: DMA-API: device driver frees DMA memory with
        different size [device address=0x00000000da2b389e] [map size=1490 bytes]
        [unmap size=66 bytes]
      
      The reason is that bnx2x splits a TSO BD into two BDs (headers + data)
      using one DMA mapping for both, but it uses only the length of the first
      BD when unmapping.
      
      This patch fixes the bug by unmapping the whole length of the two BDs.
      Signed-off-by: NMichal Schmidt <mschmidt@redhat.com>
      Reviewed-by: NEric Dumazet <edumazet@google.com>
      Acked-by: NDmitry Kravkov <dmitry@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      95e92fd4
  2. 10 1月, 2014 2 次提交
  3. 09 1月, 2014 2 次提交
  4. 08 1月, 2014 3 次提交
    • D
      Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf · a04c0e2c
      David S. Miller 提交于
      Pablo Neira Ayuso says:
      
      ====================
      The following patchset contains two patches:
      
      * fix the IRC NAT helper which was broken when adding (incomplete) IPv6
        support, from Daniel Borkmann.
      
      * Refine the previous bugtrap that Jesper added to catch problems for the
        usage of the sequence adjustment extension in IPVs in Dec 16th, it may
        spam messages in case of finding a real bug.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a04c0e2c
    • E
      tipc: correctly unlink packets from deferred packet queue · 732256b9
      Erik Hugne 提交于
      When we pull a received packet from a link's 'deferred packets' queue
      for processing, its 'next' pointer is not cleared, and still refers to
      the next packet in that queue, if any. This is incorrect, but caused
      no harm before commit 40ba3cdf ("tipc:
      message reassembly using fragment chain") was introduced. After that
      commit, it may sometimes lead to the following oops:
      
      general protection fault: 0000 [#1] SMP DEBUG_PAGEALLOC
      Modules linked in: tipc
      CPU: 4 PID: 0 Comm: swapper/4 Tainted: G        W 3.13.0-rc2+ #6
      Hardware name: Bochs Bochs, BIOS Bochs 01/01/2007
      task: ffff880017af4880 ti: ffff880017aee000 task.ti: ffff880017aee000
      RIP: 0010:[<ffffffff81710694>]  [<ffffffff81710694>] skb_try_coalesce+0x44/0x3d0
      RSP: 0018:ffff880016603a78  EFLAGS: 00010212
      RAX: 6b6b6b6bd6d6d6d6 RBX: ffff880013106ac0 RCX: ffff880016603ad0
      RDX: ffff880016603ad7 RSI: ffff88001223ed00 RDI: ffff880013106ac0
      RBP: ffff880016603ab8 R08: 0000000000000000 R09: 0000000000000000
      R10: 0000000000000001 R11: 0000000000000000 R12: ffff88001223ed00
      R13: ffff880016603ad0 R14: 000000000000058c R15: ffff880012297650
      FS:  0000000000000000(0000) GS:ffff880016600000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
      CR2: 000000000805b000 CR3: 0000000011f5d000 CR4: 00000000000006e0
      Stack:
       ffff880016603a88 ffffffff810a38ed ffff880016603aa8 ffff88001223ed00
       0000000000000001 ffff880012297648 ffff880016603b68 ffff880012297650
       ffff880016603b08 ffffffffa0006c51 ffff880016603b08 00ffffffa00005fc
      Call Trace:
       <IRQ>
       [<ffffffff810a38ed>] ? trace_hardirqs_on+0xd/0x10
       [<ffffffffa0006c51>] tipc_link_recv_fragment+0xd1/0x1b0 [tipc]
       [<ffffffffa0007214>] tipc_recv_msg+0x4e4/0x920 [tipc]
       [<ffffffffa00016f0>] ? tipc_l2_rcv_msg+0x40/0x250 [tipc]
       [<ffffffffa000177c>] tipc_l2_rcv_msg+0xcc/0x250 [tipc]
       [<ffffffffa00016f0>] ? tipc_l2_rcv_msg+0x40/0x250 [tipc]
       [<ffffffff8171e65b>] __netif_receive_skb_core+0x80b/0xd00
       [<ffffffff8171df94>] ? __netif_receive_skb_core+0x144/0xd00
       [<ffffffff8171eb76>] __netif_receive_skb+0x26/0x70
       [<ffffffff8171ed6d>] netif_receive_skb+0x2d/0x200
       [<ffffffff8171fe70>] napi_gro_receive+0xb0/0x130
       [<ffffffff815647c2>] e1000_clean_rx_irq+0x2c2/0x530
       [<ffffffff81565986>] e1000_clean+0x266/0x9c0
       [<ffffffff81985f7b>] ? notifier_call_chain+0x2b/0x160
       [<ffffffff8171f971>] net_rx_action+0x141/0x310
       [<ffffffff81051c1b>] __do_softirq+0xeb/0x480
       [<ffffffff819817bb>] ? _raw_spin_unlock+0x2b/0x40
       [<ffffffff810b8c42>] ? handle_fasteoi_irq+0x72/0x100
       [<ffffffff81052346>] irq_exit+0x96/0xc0
       [<ffffffff8198cbc3>] do_IRQ+0x63/0xe0
       [<ffffffff81981def>] common_interrupt+0x6f/0x6f
       <EOI>
      
      This happens when the last fragment of a message has passed through the
      the receiving link's 'deferred packets' queue, and at least one other
      packet was added to that queue while it was there. After the fragment
      chain with the complete message has been successfully delivered to the
      receiving socket, it is released. Since 'next' pointer of the last
      fragment in the released chain now is non-NULL, we get the crash shown
      above.
      
      We fix this by clearing the 'next' pointer of all received packets,
      including those being pulled from the 'deferred' queue, before they
      undergo any further processing.
      
      Fixes: 40ba3cdf ("tipc: message reassembly using fragment chain")
      Signed-off-by: NErik Hugne <erik.hugne@ericsson.com>
      Reported-by: NYing Xue <ying.xue@windriver.com>
      Reviewed-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: NJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      732256b9
    • L
      ipv6: pcpu_tstats.syncp should be initialised in ip6_vti.c · 657e5d19
      Li RongQing 提交于
      initialise pcpu_tstats.syncp to kill the calltrace
      [   11.973950] Call Trace:
      [   11.973950]  [<819bbaff>] dump_stack+0x48/0x60
      [   11.973950]  [<819bbaff>] dump_stack+0x48/0x60
      [   11.973950]  [<81078dcf>] __lock_acquire.isra.22+0x1bf/0xc10
      [   11.973950]  [<81078dcf>] __lock_acquire.isra.22+0x1bf/0xc10
      [   11.973950]  [<81079fa7>] lock_acquire+0x77/0xa0
      [   11.973950]  [<81079fa7>] lock_acquire+0x77/0xa0
      [   11.973950]  [<817ca7ab>] ? dev_get_stats+0xcb/0x130
      [   11.973950]  [<817ca7ab>] ? dev_get_stats+0xcb/0x130
      [   11.973950]  [<8183862d>] ip_tunnel_get_stats64+0x6d/0x230
      [   11.973950]  [<8183862d>] ip_tunnel_get_stats64+0x6d/0x230
      [   11.973950]  [<817ca7ab>] ? dev_get_stats+0xcb/0x130
      [   11.973950]  [<817ca7ab>] ? dev_get_stats+0xcb/0x130
      [   11.973950]  [<811cf8c1>] ? __nla_reserve+0x21/0xd0
      [   11.973950]  [<811cf8c1>] ? __nla_reserve+0x21/0xd0
      [   11.973950]  [<817ca7ab>] dev_get_stats+0xcb/0x130
      [   11.973950]  [<817ca7ab>] dev_get_stats+0xcb/0x130
      [   11.973950]  [<817d5409>] rtnl_fill_ifinfo+0x569/0xe20
      [   11.973950]  [<817d5409>] rtnl_fill_ifinfo+0x569/0xe20
      [   11.973950]  [<810352e0>] ? kvm_clock_read+0x20/0x30
      [   11.973950]  [<810352e0>] ? kvm_clock_read+0x20/0x30
      [   11.973950]  [<81008e38>] ? sched_clock+0x8/0x10
      [   11.973950]  [<81008e38>] ? sched_clock+0x8/0x10
      [   11.973950]  [<8106ba45>] ? sched_clock_local+0x25/0x170
      [   11.973950]  [<8106ba45>] ? sched_clock_local+0x25/0x170
      [   11.973950]  [<810da6bd>] ? __kmalloc+0x3d/0x90
      [   11.973950]  [<810da6bd>] ? __kmalloc+0x3d/0x90
      [   11.973950]  [<817b8c10>] ? __kmalloc_reserve.isra.41+0x20/0x70
      [   11.973950]  [<817b8c10>] ? __kmalloc_reserve.isra.41+0x20/0x70
      [   11.973950]  [<810da81a>] ? slob_alloc_node+0x2a/0x60
      [   11.973950]  [<810da81a>] ? slob_alloc_node+0x2a/0x60
      [   11.973950]  [<817b919a>] ? __alloc_skb+0x6a/0x2b0
      [   11.973950]  [<817b919a>] ? __alloc_skb+0x6a/0x2b0
      [   11.973950]  [<817d8795>] rtmsg_ifinfo+0x65/0xe0
      [   11.973950]  [<817d8795>] rtmsg_ifinfo+0x65/0xe0
      [   11.973950]  [<817cbd31>] register_netdevice+0x531/0x5a0
      [   11.973950]  [<817cbd31>] register_netdevice+0x531/0x5a0
      [   11.973950]  [<81892b87>] ? ip6_tnl_get_cap+0x27/0x90
      [   11.973950]  [<81892b87>] ? ip6_tnl_get_cap+0x27/0x90
      [   11.973950]  [<817cbdb6>] register_netdev+0x16/0x30
      [   11.973950]  [<817cbdb6>] register_netdev+0x16/0x30
      [   11.973950]  [<81f574a6>] vti6_init_net+0x1c4/0x1d4
      [   11.973950]  [<81f574a6>] vti6_init_net+0x1c4/0x1d4
      [   11.973950]  [<81f573af>] ? vti6_init_net+0xcd/0x1d4
      [   11.973950]  [<81f573af>] ? vti6_init_net+0xcd/0x1d4
      [   11.973950]  [<817c16df>] ops_init.constprop.11+0x17f/0x1c0
      [   11.973950]  [<817c16df>] ops_init.constprop.11+0x17f/0x1c0
      [   11.973950]  [<817c1779>] register_pernet_operations.isra.9+0x59/0x90
      [   11.973950]  [<817c1779>] register_pernet_operations.isra.9+0x59/0x90
      [   11.973950]  [<817c18d1>] register_pernet_device+0x21/0x60
      [   11.973950]  [<817c18d1>] register_pernet_device+0x21/0x60
      [   11.973950]  [<81f574b6>] ? vti6_init_net+0x1d4/0x1d4
      [   11.973950]  [<81f574b6>] ? vti6_init_net+0x1d4/0x1d4
      [   11.973950]  [<81f574c7>] vti6_tunnel_init+0x11/0x68
      [   11.973950]  [<81f574c7>] vti6_tunnel_init+0x11/0x68
      [   11.973950]  [<81f572a1>] ? mip6_init+0x73/0xb4
      [   11.973950]  [<81f572a1>] ? mip6_init+0x73/0xb4
      [   11.973950]  [<81f0cba4>] do_one_initcall+0xbb/0x15b
      [   11.973950]  [<81f0cba4>] do_one_initcall+0xbb/0x15b
      [   11.973950]  [<811a00d8>] ? sha_transform+0x528/0x1150
      [   11.973950]  [<811a00d8>] ? sha_transform+0x528/0x1150
      [   11.973950]  [<81f0c544>] ? repair_env_string+0x12/0x51
      [   11.973950]  [<81f0c544>] ? repair_env_string+0x12/0x51
      [   11.973950]  [<8105c30d>] ? parse_args+0x2ad/0x440
      [   11.973950]  [<8105c30d>] ? parse_args+0x2ad/0x440
      [   11.973950]  [<810546be>] ? __usermodehelper_set_disable_depth+0x3e/0x50
      [   11.973950]  [<810546be>] ? __usermodehelper_set_disable_depth+0x3e/0x50
      [   11.973950]  [<81f0cd27>] kernel_init_freeable+0xe3/0x182
      [   11.973950]  [<81f0cd27>] kernel_init_freeable+0xe3/0x182
      [   11.973950]  [<81f0c532>] ? do_early_param+0x7a/0x7a
      [   11.973950]  [<81f0c532>] ? do_early_param+0x7a/0x7a
      [   11.973950]  [<819b5b1b>] kernel_init+0xb/0x100
      [   11.973950]  [<819b5b1b>] kernel_init+0xb/0x100
      [   11.973950]  [<819cebf7>] ret_from_kernel_thread+0x1b/0x28
      [   11.973950]  [<819cebf7>] ret_from_kernel_thread+0x1b/0x28
      [   11.973950]  [<819b5b10>] ? rest_init+0xc0/0xc0
      [   11.973950]  [<819b5b10>] ? rest_init+0xc0/0xc0
      
      Before 469bdcef ("ipv6: fix the use of pcpu_tstats in ip6_vti.c"),
      the pcpu_tstats.syncp is not used to pretect the 64bit elements of
      pcpu_tstats, so not appear this calltrace.
      Reported-by: NFengguang Wu <fengguang.wu@intel.com>
      Signed-off-by: NLi RongQing <roy.qing.li@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      657e5d19
  5. 07 1月, 2014 13 次提交
  6. 06 1月, 2014 12 次提交
  7. 05 1月, 2014 4 次提交
    • R
      ARM: 7933/1: rename ioremap_cached to ioremap_cache · 0a5ccc86
      Rob Herring 提交于
      ioremap_cache is more aligned with other architectures.
      There are only 2 users of this in the kernel: pxa2xx-flash and Xen.
      
      This fixes Xen build failures on arm64:
      
      drivers/tty/hvc/hvc_xen.c:233:2: error: implicit declaration of function 'ioremap_cached' [-Werror=implicit-function-declaration]
      drivers/xen/grant-table.c:1174:3: error: implicit declaration of function 'ioremap_cached' [-Werror=implicit-function-declaration]
      drivers/xen/xenbus/xenbus_probe.c:778:4: error: implicit declaration of function 'ioremap_cached' [-Werror=implicit-function-declaration]
      Signed-off-by: NRob Herring <rob.herring@calxeda.com>
      Signed-off-by: NStefano Stabellini <stefano.stabellini@eu.citrix.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      0a5ccc86
    • R
      ARM: fix "bad mode in ... handler" message for undefined instructions · 29c350bf
      Russell King 提交于
      The array was missing the final entry for the undefined instruction
      exception handler; this commit adds it.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      29c350bf
    • R
      CRYPTO: Fix more AES build errors · d2eca20d
      Russell King 提交于
      Building a multi-arch kernel results in:
      
      arch/arm/crypto/built-in.o: In function `aesbs_xts_decrypt':
      sha1_glue.c:(.text+0x15c8): undefined reference to `bsaes_xts_decrypt'
      arch/arm/crypto/built-in.o: In function `aesbs_xts_encrypt':
      sha1_glue.c:(.text+0x1664): undefined reference to `bsaes_xts_encrypt'
      arch/arm/crypto/built-in.o: In function `aesbs_ctr_encrypt':
      sha1_glue.c:(.text+0x184c): undefined reference to `bsaes_ctr32_encrypt_blocks'
      arch/arm/crypto/built-in.o: In function `aesbs_cbc_decrypt':
      sha1_glue.c:(.text+0x19b4): undefined reference to `bsaes_cbc_encrypt'
      
      This code is already runtime-conditional on NEON being supported, so
      there's no point compiling it out depending on the minimum build
      architecture.
      Acked-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      d2eca20d
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc · d11739e6
      Linus Torvalds 提交于
      Pull sparc bugfixes from David Miller:
      
       1) Missing include can lead to build failure, from Kirill Tkhai.
      
       2) Use dev_is_pci() where applicable, from Yijing Wang.
      
       3) Enable irqs after we enable preemption in cpu startup path, from
          Kirill Tkhai.
      
       4) Revert a __copy_{to,from}_user_inatomic change that broke
          iov_iter_copy_from_user_atomic() and thus several tests in xfstests
          and LTP.  From Dave Kleikamp.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
        Revert "sparc64: Fix __copy_{to,from}_user_inatomic defines."
        sparc64: smp_callin: Enable irqs after preemption is disabled
        sparc/PCI: Use dev_is_pci() to identify PCI devices
        sparc64: Fix build regression
      d11739e6