1. 17 Jun, 2015 4 commits
    • Jacob Keller's avatar
      fm10k: move setting shinfo inside ts_tx_enqueue · e075996e
      Jacob Keller authored
      This patch simplifies the code flow for setting the IN_PROGRESS bit of
      the shinfo for an skb we will be timestamping.
      Reported-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Tested-by: default avatarKrishneil Singh <Krishneil.k.singh@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      e075996e
    • Jacob Keller's avatar
      fm10k: use correct ethernet driver Tx timestamp function · 608bb146
      Jacob Keller authored
      skb_complete_tx_timestamp is intended for use by PHY drivers which
      implement a different method of returning timestamps. This method is
      intended to be used after a PHY driver accepts a cloned packet via its
      phy_driver.txtstamp function. It is not correct to use in the standard
      ethernet driver such as fm10k. This patch fixes the following possible
      kernel panic.
      
      [ 2744.552896] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G        W  OE  3.19.3-200.fc21.x86_64 #1
      [ 2744.552899] Hardware name: Intel Corporation S2600CO/S2600CO, BIOS SE5C600.86B.02.03.8x23.060520140825 06/05/2014
      [ 2744.552901]  0000000000000000 2f4c8b10ea3f9848 ffff88081ee03a38 ffffffff8176e215
      [ 2744.552906]  0000000000000000 0000000000000000 ffff88081ee03a78 ffffffff8109bc1a
      [ 2744.552910]  ffff88081ee03c50 ffff88080e55fc00 ffff88080e55fc00 ffffffff81647c50
      [ 2744.552914] Call Trace:
      [ 2744.552917]  <IRQ>  [<ffffffff8176e215>] dump_stack+0x45/0x57
      [ 2744.552931]  [<ffffffff8109bc1a>] warn_slowpath_common+0x8a/0xc0
      [ 2744.552936]  [<ffffffff81647c50>] ? skb_queue_purge+0x20/0x40
      [ 2744.552941]  [<ffffffff8109bd4a>] warn_slowpath_null+0x1a/0x20
      [ 2744.552946]  [<ffffffff81646911>] skb_release_head_state+0xe1/0xf0
      [ 2744.552950]  [<ffffffff81647b26>] skb_release_all+0x16/0x30
      [ 2744.552954]  [<ffffffff81647ba6>] kfree_skb+0x36/0x90
      [ 2744.552958]  [<ffffffff81647c50>] skb_queue_purge+0x20/0x40
      [ 2744.552964]  [<ffffffff81751f8d>] packet_sock_destruct+0x1d/0x90
      [ 2744.552968]  [<ffffffff81642053>] __sk_free+0x23/0x140
      [ 2744.552973]  [<ffffffff81642189>] sk_free+0x19/0x20
      [ 2744.552977]  [<ffffffff81647d60>] skb_complete_tx_timestamp+0x50/0x60
      [ 2744.552988]  [<ffffffffa02eee40>] fm10k_ts_tx_hwtstamp+0xd0/0x100 [fm10k]
      [ 2744.552994]  [<ffffffffa02e054e>] fm10k_1588_msg_pf+0x12e/0x140 [fm10k]
      [ 2744.553002]  [<ffffffffa02edf1d>] fm10k_tlv_msg_parse+0x8d/0xc0 [fm10k]
      [ 2744.553010]  [<ffffffffa02eb2d0>] fm10k_mbx_dequeue_rx+0x60/0xb0 [fm10k]
      [ 2744.553016]  [<ffffffffa02ebf98>] fm10k_sm_mbx_process+0x178/0x3c0 [fm10k]
      [ 2744.553022]  [<ffffffffa02e09ca>] fm10k_msix_mbx_pf+0xfa/0x360 [fm10k]
      [ 2744.553030]  [<ffffffff811030a7>] ? get_next_timer_interrupt+0x1f7/0x270
      [ 2744.553036]  [<ffffffff810f2a47>] handle_irq_event_percpu+0x77/0x1a0
      [ 2744.553041]  [<ffffffff810f2bab>] handle_irq_event+0x3b/0x60
      [ 2744.553045]  [<ffffffff810f5d6e>] handle_edge_irq+0x6e/0x120
      [ 2744.553054]  [<ffffffff81017414>] handle_irq+0x74/0x140
      [ 2744.553061]  [<ffffffff810bb54a>] ? atomic_notifier_call_chain+0x1a/0x20
      [ 2744.553066]  [<ffffffff8177777f>] do_IRQ+0x4f/0xf0
      [ 2744.553072]  [<ffffffff8177556d>] common_interrupt+0x6d/0x6d
      [ 2744.553074]  <EOI>  [<ffffffff81609b16>] ? cpuidle_enter_state+0x66/0x160
      [ 2744.553084]  [<ffffffff81609b01>] ? cpuidle_enter_state+0x51/0x160
      [ 2744.553087]  [<ffffffff81609cf7>] cpuidle_enter+0x17/0x20
      [ 2744.553092]  [<ffffffff810de101>] cpu_startup_entry+0x321/0x3c0
      [ 2744.553098]  [<ffffffff81764497>] rest_init+0x77/0x80
      [ 2744.553103]  [<ffffffff81d4f02c>] start_kernel+0x4a4/0x4c5
      [ 2744.553107]  [<ffffffff81d4e120>] ? early_idt_handlers+0x120/0x120
      [ 2744.553110]  [<ffffffff81d4e4d7>] x86_64_start_reservations+0x2a/0x2c
      [ 2744.553114]  [<ffffffff81d4e62b>] x86_64_start_kernel+0x152/0x175
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Tested-by: default avatarKrishneil Singh <Krishneil.k.singh@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      608bb146
    • Jacob Keller's avatar
      fm10k: ignore invalid multicast address entries · 745136a8
      Jacob Keller authored
      This change fixes an issue with adding an invalid multicast address
      using the iproute2 tool (ip maddr add <MADDR> dev <dev>). The iproute2
      tool and the kernel do not validate or filter the multicast addresses
      when adding them to the multicast list. Thus, when synchronizing this
      list with an invalid entry, the action will be aborted with an error
      since the fm10k driver currently validates the list. Consequently,
      multicast entries beyond the invalid one will not be processed and
      communicated with the switch via the mailbox. This change makes it so
      that invalid addresses will simply be skipped and allows synchronizing
      the full list to proceed.
      Signed-off-by: default avatarNgai-Mint Kwan <ngai-mint.kwan@intel.com>
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Tested-by: default avatarKrishneil Singh <Krishneil.k.singh@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      745136a8
    • Alexander Duyck's avatar
      fm10k: fold fm10k_pull_tail into fm10k_add_rx_frag · 1a8782e5
      Alexander Duyck authored
      This change folds the fm10k_pull_tail call into fm10k_add_rx_frag.  The
      advantage to doing this is that the fragment doesn't have to be modified
      after it is added to the skb.
      Signed-off-by: default avatarAlexander Duyck <alexander.h.duyck@redhat.com>
      Tested-by: default avatarKrishneil Singh <Krishneil.k.singh@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      1a8782e5
  2. 16 Jun, 2015 21 commits
  3. 15 Jun, 2015 15 commits
    • David S. Miller's avatar
      Merge tag 'nfc-next-4.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/nfc-next · 023033b1
      David S. Miller authored
      Samuel Ortiz says:
      
      ====================
      NFC 4.2 pull request
      
      This is the NFC pull request for 4.2.
      
      - NCI drivers can now define their own handlers for processing
        proprietary NCI responses and notifications.
      
      - NFC vendors can use a dedicated netlink API to send their own
        proprietary commands, like e.g. all commands needed to implement
        vendor specific manufacturing tools.
      
      - A new generic NCI over UART driver against which any NCI chipset
        running on top of a serial interface can register.
      
      - The st21nfcb driver is renamed to st-nci as it can and will support
        most of ST Microelectronics NCI chipsets.
      
      - The st21nfcb driver can put its CLF in hibernate mode and save
        significant amount of power.
      
      - A few st21nfcb minor fixes.
      
      - The NXP NCI driver now supports ACPI enumeration.
      
      - The Marvell NCI driver now supports both USB and serial
        physical interfaces.
      
      - The Marvell NCI drivers also supports NCI frames being muxed
        over HCI. This is a setting that can be defined by a DT property.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      023033b1
    • David S. Miller's avatar
      Merge branch 'bond-netlink-3ad-attrs' · cadfaf43
      David S. Miller authored
      Nikolay Aleksandrov says:
      
      ====================
      bonding: extend the 3ad exported attributes
      
      These are two small patches that export actor_oper_port_state and
      partner_oper_port_state via netlink and sysfs, until now they were only
      exported via bond's proc entry. If this set gets accepted I have an iproute2
      patch prepared that will export them with which I tested these changes.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cadfaf43
    • Nikolay Aleksandrov's avatar
      bonding: export slave's partner_oper_port_state via sysfs and netlink · 46ea297e
      Nikolay Aleksandrov authored
      Export the partner_oper_port_state of each port via sysfs and netlink.
      In 802.3ad mode it is valuable for the user to be able to check the
      partner_oper state, it is already exported via bond's proc entry.
      Signed-off-by: default avatarNikolay Aleksandrov <razor@blackwall.org>
      Signed-off-by: default avatarAndy Gospodarek <gospo@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      46ea297e
    • Nikolay Aleksandrov's avatar
      bonding: export slave's actor_oper_port_state via sysfs and netlink · 254cb6db
      Nikolay Aleksandrov authored
      Export the actor_oper_port_state of each port via sysfs and netlink.
      In 802.3ad mode it is valuable for the user to be able to check the
      actor_oper state, it is already exported via bond's proc entry.
      Signed-off-by: default avatarNikolay Aleksandrov <razor@blackwall.org>
      Signed-off-by: default avatarAndy Gospodarek <gospo@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      254cb6db
    • David S. Miller's avatar
      Merge branch 'rocker-no-wait' · 4d367963
      David S. Miller authored
      Scott Feldman says:
      
      ====================
      rocker: revert back to support for nowait processes
      
      One of the items removed from the rocker driver in the Spring Cleanup patch
      series was the ability to mark processing in the driver as "no wait" for
      those contexts where we cannot sleep.  Turns out, we have "no wait"
      contexts where we want to program the device and we don't want to defer the
      processing to a process context.  So re-add the ROCKER_OP_FLAG_NOWAIT flag
      to mark such processes, and propagate flags to mem allocator and to the
      device cmd executor.  With NOWAIT, mem allocs are GFP_ATOMIC and device
      cmds are queued to the device, but the driver will not wait (sleep) for the
      response back from the device.
      
      My bad for removing NOWAIT support in the first place; I thought we could
      swing non-sleep contexts to process context using a work queue, for
      example, but there is push-back to keep processing in original context.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4d367963
    • Scott Feldman's avatar
      rocker: move port stop to 'no wait' processing · f66feaa9
      Scott Feldman authored
      rocker_port_stop can be called from atomic and non-atomic contexts.  Since
      we can't test what context we're getting called in, do the processing as
      'no wait', which will cover all cases.
      Signed-off-by: default avatarScott Feldman <sfeldma@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f66feaa9
    • Scott Feldman's avatar
    • Scott Feldman's avatar
      rocker: mark STP update as 'no wait' processing · ac28393e
      Scott Feldman authored
      We can get STP updates from the bridge driver in atomic and non-atomic
      contexts.  Since we can't test what context we're getting called in,
      do the STP processing as 'no wait', which will cover all cases.
      Signed-off-by: default avatarScott Feldman <sfeldma@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ac28393e
    • Scott Feldman's avatar
      rocker: mark neigh update event processing as 'no wait' · 02a9fbfc
      Scott Feldman authored
      Neigh update event handler runs in a context where we can't sleep, so mark
      processing in driver with ROCKER_OP_FLAG_NOWAIT.  NOWAIT will use
      GFP_ATOMIC for allocations and will queue cmds to the device's cmd ring but
      will not wait (sleep) for cmd response back from device.
      Signed-off-by: default avatarScott Feldman <sfeldma@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      02a9fbfc
    • Scott Feldman's avatar
      rocker: revert back to support for nowait processes · 179f9a25
      Scott Feldman authored
      One of the items removed from the rocker driver in the Spring Cleanup patch
      series was the ability to mark processing in the driver as "no wait" for
      those contexts where we cannot sleep.  Turns out, we have "no wait"
      contexts where we want to program the device.  So re-add the
      ROCKER_OP_FLAG_NOWAIT flag to mark such processes, and propagate flags to
      mem allocator and to the device cmd executor.  With NOWAIT, mem allocs are
      GFP_ATOMIC and device cmds are queued to the device, but the driver will
      not wait (sleep) for the response back from the device.
      
      My bad for removing NOWAIT support in the first place; I thought we could
      swing non-sleep contexts to process context using a work queue, for
      example, but there is push-back to keep processing in original context.
      Signed-off-by: default avatarScott Feldman <sfeldma@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      179f9a25
    • Scott Feldman's avatar
      rocker: fix neigh tbl index increment race · 4d81db41
      Scott Feldman authored
      rocker->neigh_tbl_next_index is used to generate unique indices for neigh
      entries programmed into the device.  The way new indices were generated was
      racy with the new prepare-commit transaction model.  A simple fix here
      removes the race.  The race was with two processes getting the same index,
      one process using prepare-commit, the other not:
      
      Proc A					Proc B
      
      PREPARE phase
      get neigh_tbl_next_index
      
      					NONE phase
      					get neigh_tbl_next_index
      					neigh_tbl_next_index++
      
      COMMIT phase
      neigh_tbl_next_index++
      
      Both A and B got the same index.  The fix is to store and increment
      neigh_tbl_next_index in the PREPARE (or NONE) phase and use value in COMMIT
      phase:
      
      Proc A					Proc B
      
      PREPARE phase
      get neigh_tbl_next_index
      neigh_tbl_next_index++
      
      					NONE phase
      					get neigh_tbl_next_index
      					neigh_tbl_next_index++
      
      COMMIT phase
      // use value stashed in PREPARE phase
      Reported-by: default avatarSimon Horman <simon.horman@netronome.com>
      Signed-off-by: default avatarScott Feldman <sfeldma@gmail.com>
      Reviewed-by: default avatarSimon Horman <simon.horman@netronome.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4d81db41
    • Scott Feldman's avatar
      rocker: gaurd against NULL rocker_port when removing ports · a0720310
      Scott Feldman authored
      The ports array is filled in as ports are probed, but if probing doesn't
      finish, we need to stop only those ports that where probed successfully.
      Check the ports array for NULL to skip un-probed ports when stopping.
      Signed-off-by: default avatarScott Feldman <sfeldma@gmail.com>
      Acked-by: default avatarJiri Pirko <jiri@resnulli.us>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a0720310
    • Eric Dumazet's avatar
      net: make u64_stats_init() a function · 9464ca65
      Eric Dumazet authored
      Using a function instead of a macro is cleaner and remove
      following W=1 warnings (extract)
      
      In file included from net/ipv6/ip6_vti.c:29:0:
      net/ipv6/ip6_vti.c: In function ‘vti6_dev_init_gen’:
      include/linux/netdevice.h:2029:18: warning: variable ‘stat’ set but not
      used [-Wunused-but-set-variable]
          typeof(type) *stat;   \
                        ^
      net/ipv6/ip6_vti.c:862:16: note: in expansion of macro
      ‘netdev_alloc_pcpu_stats’
        dev->tstats = netdev_alloc_pcpu_stats(struct pcpu_sw_netstats);
                      ^
        CC [M]  net/ipv6/sit.o
      In file included from net/ipv6/sit.c:30:0:
      net/ipv6/sit.c: In function ‘ipip6_tunnel_init’:
      include/linux/netdevice.h:2029:18: warning: variable ‘stat’ set but not
      used [-Wunused-but-set-variable]
          typeof(type) *stat;   \
                        ^
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9464ca65
    • Scott Feldman's avatar
      bridge: use either ndo VLAN ops or switchdev VLAN ops to install MASTER vlans · 7f109539
      Scott Feldman authored
      v2:
      
      Move struct switchdev_obj automatics to inner scope where there used.
      
      v1:
      
      To maintain backward compatibility with the existing iproute2 "bridge vlan"
      command, let bridge's setlink/dellink handler call into either the port
      driver's 8021q ndo ops or the port driver's bridge_setlink/dellink ops.
      
      This allows port driver to choose 8021q ops or the newer
      bridge_setlink/dellink ops when implementing VLAN add/del filtering on the
      device.  The iproute "bridge vlan" command does not need to be modified.
      
      To summarize using the "bridge vlan" command examples, we have:
      
      1) bridge vlan add|del vid VID dev DEV
      
      Here iproute2 sets MASTER flag.  Bridge's bridge_setlink/dellink is called.
      Vlan is set on bridge for port.  If port driver implements ndo 8021q ops,
      call those to port driver can install vlan filter on device.  Otherwise, if
      port driver implements bridge_setlink/dellink ops, call those to install
      vlan filter to device.  This option only works if port is bridged.
      
      2) bridge vlan add|del vid VID dev DEV master
      
      Same as 1)
      
      3) bridge vlan add|del vid VID dev DEV self
      
      Bridge's bridge_setlink/dellink isn't called.  Port driver's
      bridge_setlink/dellink is called, if implemented.  This option works if
      port is bridged or not.  If port is not bridged, a VLAN can still be
      added/deleted to device filter using this variant.
      
      4) bridge vlan add|del vid VID dev DEV master self
      
      This is a combination of 1) and 3), but will only work if port is bridged.
      Signed-off-by: default avatarScott Feldman <sfeldma@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7f109539
    • David S. Miller's avatar
      Merge branch 'bpf-share-helpers' · 9f42c8b3
      David S. Miller authored
      Alexei Starovoitov says:
      
      ====================
      v1->v2: switched to init_user_ns from current_user_ns as suggested by Andy
      
      Introduce new helpers to access 'struct task_struct'->pid, tgid, uid, gid, comm
      fields in tracing and networking.
      
      Share bpf_trace_printk() and bpf_get_smp_processor_id() helpers between
      tracing and networking.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9f42c8b3