1. 21 Jul, 2015 18 commits
  2. 20 Jul, 2015 22 commits
    • David S. Miller's avatar
      Merge branch 'bpf-push-pop-helpers' · 500322ec
      David S. Miller authored
      
      
      Alexei Starovoitov says:
      
      ====================
      bpf: introduce bpf_skb_vlan_push/pop() helpers
      
      Let TC+eBPF programs call skb_vlan_push/pop via helpers.
      
      v1->v2:
      - reworded commit log to better explain correctness of re-caching
        and fixed comparison of mixed endiannes (suggested by Eric)
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      500322ec
    • Alexei Starovoitov's avatar
      test_bpf: add bpf_skb_vlan_push/pop() tests · 4d9c5c53
      Alexei Starovoitov authored
      
      
      improve accuracy of timing in test_bpf and add two stress tests:
      - {skb->data[0], get_smp_processor_id} repeated 2k times
      - {skb->data[0], vlan_push} x 68 followed by {skb->data[0], vlan_pop} x 68
      
      1st test is useful to test performance of JIT implementation of BPF_LD_ABS
      together with BPF_CALL instructions.
      2nd test is stressing skb_vlan_push/pop logic together with skb->data access
      via BPF_LD_ABS insn which checks that re-caching of skb->data is done correctly.
      
      In order to call bpf_skb_vlan_push() from test_bpf.ko have to add
      three export_symbol_gpl.
      Signed-off-by: default avatarAlexei Starovoitov <ast@plumgrid.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4d9c5c53
    • Alexei Starovoitov's avatar
      bpf: introduce bpf_skb_vlan_push/pop() helpers · 4e10df9a
      Alexei Starovoitov authored
      
      
      Allow eBPF programs attached to TC qdiscs call skb_vlan_push/pop via
      helper functions. These functions may change skb->data/hlen which are
      cached by some JITs to improve performance of ld_abs/ld_ind instructions.
      Therefore JITs need to recognize bpf_skb_vlan_push/pop() calls,
      re-compute header len and re-cache skb->data/hlen back into cpu registers.
      Note, skb->data/hlen are not directly accessible from the programs,
      so any changes to skb->data done either by these helpers or by other
      TC actions are safe.
      
      eBPF JIT supported by three architectures:
      - arm64 JIT is using bpf_load_pointer() without caching, so it's ok as-is.
      - x64 JIT re-caches skb->data/hlen unconditionally after vlan_push/pop calls
        (experiments showed that conditional re-caching is slower).
      - s390 JIT falls back to interpreter for now when bpf_skb_vlan_push() is present
        in the program (re-caching is tbd).
      
      These helpers allow more scalable handling of vlan from the programs.
      Instead of creating thousands of vlan netdevs on top of eth0 and attaching
      TC+ingress+bpf to all of them, the program can be attached to eth0 directly
      and manipulate vlans as necessary.
      Signed-off-by: default avatarAlexei Starovoitov <ast@plumgrid.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4e10df9a
    • David S. Miller's avatar
      Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue · f3120acc
      David S. Miller authored
      
      
      Jeff Kirsher says:
      
      ====================
      Intel Wired LAN Driver Updates 2015-07-17
      
      This series contains updates to igb, ixgbe, ixgbevf, i40e, bnx2x,
      freescale, siena and dp83640.
      
      Jacob provides several patches to clarify the intended way to implement
      both SIOCSHWTSTAMP and ethtool's get_ts_info().  It is okay to support
      the specific filters in SIOCSHWTSTAMP by upscaling them to the generic
      filters.
      
      Alex Duyck provides a igb patch to pull the time stamp from the fragment
      before it gets added to the skb, to avoid a possible issue in which the
      fragment can possibly be less than IGB_RX_HDR_LEN due to the time stamp
      being pulled after the copybreak check.  Also provides a ixgbevf patch to
      fold the ixgbevf_pull_tail() call into ixgbevf_add_rx_frag(), which gives
      the advantage that the fragment does not have to be modified after it is
      added to the skb.
      
      Fan provides patches for ixgbe/ixgbevf to set the receive hash type
      based on receive descriptor RSS type.
      
      Todd provides a fix for igb where on check for link on any media other
      than copper was not being detected since it was looking on the incorrect
      PHY page (due to the page being used gets switched before the function
      to check link gets executed).
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f3120acc
    • David S. Miller's avatar
      Merge branch 'bcmgenet-phy-rework' · 0e55a42a
      David S. Miller authored
      
      
      Florian Fainelli says:
      
      ====================
      net: bcmgenet: PHY initialization rework
      
      This patch series reworks how we perform PHY initialization and resets in the
      GENET driver. Although this contains mostly fixes, some of the changes are a
      bit too intrusive to be backported to 'net' at the moment.
      
      Some of the motivations behind these changes were to reduce the time spent in how
      performing MDIO transactions, since it is better to perform then when we have
      interrupts enabled. This reduces the bring-up time of GENET from ~600 msecs down
      to ~8 msecs, and about the same time for suspend/resume.
      
      Since I do not currently have a system which is not DT-aware, can you (Petri,
      Jaedon) give this a try and confirm things keep working as expected?
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0e55a42a
    • Florian Fainelli's avatar
      net: bcmgenet: Remove init parameter from bcmgenet_mii_config · 28b45910
      Florian Fainelli authored
      
      
      Now that we have reworked the way we perform the PHY initialization, we
      no longer need to differentiate between init time vs. non-init time
      calls, just use a dev_info_once() print to print the PHY type.
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      28b45910
    • Florian Fainelli's avatar
      net: bcmgenet: Delay PHY initialization to bcmgenet_open() · 6cc8e6d4
      Florian Fainelli authored
      We are currently doing a full PHY initialization and even starting the
      pHY state machine during bcmgenet_mii_init() which is executed in the
      driver's probe function. This is convenient to determine whether we can
      attach to a proper PHY device but comes at the expense of spending up to
      10ms per MDIO transactions (to reach the waitqueue timeout), which slows
      things down.
      
      This also creates a sitaution where we end-up attaching twice to the
      PHY, which is not quite correct either.
      
      Fix this by moving bcmgenet_mii_probe() into bcmgenet_open() and update
      its error path accordingly.
      
      Avoid printing the message "attached PHY at address 1 [...]" every time
      we bring up/down the interface and remove this print since it duplicates
      what the PHY driver already does for us.
      
      Fixes: 1c1008c7
      
       ("net: bcmgenet: add main driver file")
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6cc8e6d4
    • Florian Fainelli's avatar
      net: bcmgenet: Determine PHY type before scanning MDIO bus · c624f891
      Florian Fainelli authored
      Our internal GPHY might be powered off before we attempt scanning the
      MDIO bus and bind a driver to it. The way we are currently determining
      whether a PHY is internal or not is done *after* we have successfully
      matched its driver. If the PHY is powered down, it will not respond to
      the MDIO bus, so we will not be able to bind a driver to it.
      
      Our Device Tree for GENET interfaces specifies a "phy-mode" value:
      "internal" which tells if this internal uses an internal PHY or not.
      
      If of_get_phy_mode() fails to parse the 'phy-mode' property, do an
      additional manual lookup, and if we find "internal" set the
      corresponding internal variable accordingly.
      
      Replace all uses of phy_is_internal() with a check against
      priv->internal_phy to avoid having to rely on whether or not
      priv->phydev is set correctly.
      
      Fixes: 1c1008c7
      
       ("net: bcmgenet: add main driver file")
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c624f891
    • Florian Fainelli's avatar
      net: bcmgenet: Power on integrated GPHY in bcmgenet_power_up() · bd4060a6
      Florian Fainelli authored
      We are currently disabling the GPHY interface during bcmgenet_close(),
      and attempting to power it back on during bcmgenet_open(). This works
      fine for the first time, because we called bcmgenet_mii_config() which
      took care of enabling the interface, however, bcmgenet_power_up() really
      needs to power on the GPHY for correctness.
      
      This will be particularly important as we want to move
      bcmgenet_mii_probe() down to bcmgenet_open() to avoid seeing the "PHY
      already attached" message.
      
      Fixes: a642c4f7
      
       ("net: bcmgenet: power up and down integrated GPHY when unused")
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bd4060a6
    • Florian Fainelli's avatar
      net: bcmgenet: Use correct dev_id for free_irq · 978ffac4
      Florian Fainelli authored
      bcmgenet_open()'s error path call free_irq() with a dev_id argument
      different from the one we used to call request_irq() with, this will
      make us trip over the warning in kernel/irq/manage.c:__free_irq()
      
      Fixes: 1c1008c7
      
       ("net: bcmgenet: add main driver file")
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      978ffac4
    • Florian Fainelli's avatar
      net: bcmgenet: Remove excessive PHY reset · 6ac3ce82
      Florian Fainelli authored
      We are currently issuing multiple PHY resets during a suspend/resume,
      first during bcmgenet_power_up() which does a hardware reset, then a
      software reset by calling bcmgenet_mii_reset(). This is both unnecessary
      and can take as long as 10ms per MDIO transactions while we re-apply
      workarounds because we do not yet have MDIO interrupts enabled.
      
      phy_resume() takes care of re-apply our workarounds in case we need any,
      and bcmgenet_power_up() does a PHY hardware reset, all of this is more
      than enough to guarantee that the PHY operates correctly.
      
      Fixes: 1c1008c7
      
       ("net: bcmgenet: add main driver file")
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6ac3ce82
    • David S. Miller's avatar
      Merge branch 'stmmac-cleanup' · 2c1bcaff
      David S. Miller authored
      Joachim Eastwood says:
      
      ====================
      stmmac clean up for 4.3 part1
      
      This patch set continues the conversion of the dwmac glue layers
      to more proper platform drivers. The first part of the patch set
      cleans up stmmac_platform a bit. Refactors code from the common
      probe function and exports two functions that will be used in
      the dwmac-* drivers.
      
      Second part converts two simple dwmac-* drivers to have their
      own probe function and use the exported functions. This brings
      us closer to point where stmmac_platform is only a library of
      common functions for the dwmac-* drivers to use.
      
      The plan next is:
       * add probe functions to the rest of the dwmac-* drivers
       * move probe function in stmmac_platform to dwmac-generic
       * remove struct stmmac_of_data and let those drivers
         that actually need match data handle it themselves
       * clean up include/linux/stmmac.h
      
      Note that this patch set has only been tested on lpc18xx so
      testing on other platforms is greatly appreciated.
      
      Previous parts can be found here:
      http://www.spinics.net/lists/netdev/msg328997.html
      http://www.spinics.net/lists/netdev/msg329932.html
      
      
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2c1bcaff
    • Joachim Eastwood's avatar
      stmmac: drop custom_* fields from plat_stmmacenet_data · f4c190eb
      Joachim Eastwood authored
      
      
      Both of these fields are unused and has been unused since they
      were added 3 and 5 years ago. Drop them since they are clearly
      not very useful.
      Signed-off-by: default avatarJoachim Eastwood <manabian@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f4c190eb
    • Joachim Eastwood's avatar
      stmmac: add proper probe function to dwmac-meson · 1734befd
      Joachim Eastwood authored
      
      
      By using a few functions from stmmac_platform we can now create
      a proper probe function in this driver. By doing so we can drop
      the OF match data and simplify the overall driver.
      Signed-off-by: default avatarJoachim Eastwood <manabian@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1734befd
    • Joachim Eastwood's avatar
      stmmac: add proper probe function to dwmac-lpc18xx · f4f8dfde
      Joachim Eastwood authored
      
      
      By using a few functions from stmmac_platform we can now create
      a proper probe function in this driver. By doing so we can drop
      the OF match data and simplify the overall driver.
      Signed-off-by: default avatarJoachim Eastwood <manabian@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f4f8dfde
    • Joachim Eastwood's avatar
      stmmac: export probe_config_dt() and get_platform_resources() · 402dae0b
      Joachim Eastwood authored
      
      
      Export stmmac_probe_config_dt() and stmmac_get_platform_resources()
      so they can be used in the dwmac-* drivers themselves. This will
      allow us to build more flexible and standalone drivers which just
      use stmmac_platform as a library for setup functions.
      Signed-off-by: default avatarJoachim Eastwood <manabian@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      402dae0b
    • Joachim Eastwood's avatar
      stmmac: make stmmac_probe_config_dt return the platform data struct · b0003ead
      Joachim Eastwood authored
      
      
      Since stmmac_probe_config_dt() allocates the platform data structure
      it is cleaner if it just returned this structure directly. This
      function will later be used in the probe function in dwmac-* drivers.
      Signed-off-by: default avatarJoachim Eastwood <manabian@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b0003ead
    • Joachim Eastwood's avatar
      stmmac: introduce stmmac_get_platform_resources() · f396cb01
      Joachim Eastwood authored
      
      
      Refactor all code that deals with platform resources into it's
      own get function. This function will later be used in the probe
      function in dwmac-* drivers.
      Signed-off-by: default avatarJoachim Eastwood <manabian@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f396cb01
    • Joachim Eastwood's avatar
      stmmac: clean up platform/of_match data retrieval · 4ed2d8fc
      Joachim Eastwood authored
      
      
      Refactor code to clearly separate probing non-dt versus dt. In the
      non-dt case platform data must be supplied to probe successfully.
      For dt the platform data structure is created and match data is
      copied into it. Note that support for supplying platform data in
      dt from AUXDATA is dropped as no users in mainline does this.
      
      This change will allow dt dwmac-* drivers to call the config_dt()
      function from probe to create the needed platform data struct and
      retrieve common dt properties.
      Signed-off-by: default avatarJoachim Eastwood <manabian@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4ed2d8fc
    • Joachim Eastwood's avatar
      stmmac: use of_device_get_match_data to retrieve of match data · 0dacf3f6
      Joachim Eastwood authored
      
      
      By using of_device_get_match_data() the code that retrieve
      match data can be simplified quite a bit.
      Signed-off-by: default avatarJoachim Eastwood <manabian@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0dacf3f6
    • David S. Miller's avatar
      Merge branch 'tipc-separate-link-and-aggregation' · 7781e5d1
      David S. Miller authored
      
      
      Jon Maloy says:
      
      ====================
      tipc: separate link and link aggregation layer
      
      This is the first batch of a longer series that has two main objectives:
      
      o Finer lock granularity during message sending and reception,
        especially regarding usage of the node spinlock.
      
      o Better separation between the link layer implementation and the link
        aggregation layer, represented by node.c::struct tipc_node.
      
      Hopefully these changes also make this part of code somewhat easier
      to comprehend and maintain.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7781e5d1
    • Jon Paul Maloy's avatar
      tipc: reduce locking scope during packet reception · d999297c
      Jon Paul Maloy authored
      
      
      We convert packet/message reception according to the same principle
      we have been using for message sending and timeout handling:
      
      We move the function tipc_rcv() to node.c, hence handling the initial
      packet reception at the link aggregation level. The function grabs
      the node lock, selects the receiving link, and accesses it via a new
      call tipc_link_rcv(). This function appends buffers to the input
      queue for delivery upwards, but it may also append outgoing packets
      to the xmit queue, just as we do during regular message sending. The
      latter will happen when buffers are forwarded from the link backlog,
      or when retransmission is requested.
      
      Upon return of this function, and after having released the node lock,
      tipc_rcv() delivers/tranmsits the contents of those queues, but it may
      also perform actions such as link activation or reset, as indicated by
      the return flags from the link.
      
      This reduces the number of cpu cycles spent inside the node spinlock,
      and reduces contention on that lock.
      Reviewed-by: default avatarYing Xue <ying.xue@windriver.com>
      Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d999297c