1. 30 Aug, 2017 24 commits
    • Ahmed Abdelsalam's avatar
      ipv6: sr: fix get_srh() to comply with IPv6 standard "RFC 8200" · 5829d70b
      Ahmed Abdelsalam authored
      IPv6 packet may carry more than one extension header, and IPv6 nodes must
      accept and attempt to process extension headers in any order and occurring
      any number of times in the same packet. Hence, there should be no
      assumption that Segment Routing extension header is to appear immediately
      after the IPv6 header.
      
      Moreover, section 4.1 of RFC 8200 gives a recommendation on the order of
      appearance of those extension headers within an IPv6 packet. According to
      this recommendation, Segment Routing extension header should appear after
      Hop-by-Hop and Destination Options headers (if they present).
      
      This patch fixes the get_srh(), so it gets the segment routing header
      regardless of its position in the chain of the extension headers in IPv6
      packet, and makes sure that the IPv6 routing extension header is of Type 4.
      Signed-off-by: default avatarAhmed Abdelsalam <amsalam20@gmail.com>
      Acked-by: default avatarDavid Lebrun <david.lebrun@uclouvain.be>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5829d70b
    • David S. Miller's avatar
      Merge branch 'mvpp2-comphy' · 35aed4ac
      David S. Miller authored
      Antoine Tenart says:
      
      ====================
      net: mvpp2: comphy configuration
      
      This series, following up the one one the GoP/MAC configuration, aims at
      stopping to depend on the firmware/bootloader configuration when using
      the PPv2 engine. With this series the PPv2 driver does not need to rely
      on a previous configuration, and dynamic reconfiguration while the
      kernel is running can be done (i.e. switch one port from SGMII to 10G,
      or the opposite). A port can now be configured in a different mode than
      what's done in the firmware/bootloader as well.
      
      The series first contain patches in the generic PHY framework to support
      what is called the comphy (common PHYs), which is an h/w block providing
      PHYs that can be configured in various modes ranging from SGMII, 10G
      to SATA and others. As of now only the SGMII and 10G modes are
      supported by the comphy driver.
      
      Then patches are modifying the PPv2 driver to first add the comphy
      initialization sequence (i.e. calls to the generic PHY framework) and to
      then take advantage of this to allow dynamic reconfiguration (i.e.
      configuring the mode of a port given what's connected, between sgmii and
      10G). Note the use of the comphy in the PPv2 driver is kept optional
      (i.e. if not described in dt the driver still as before an relies on the
      firmware/bootloader configuration).
      
      Finally there are dt/defconfig patches to describe and take advantage of
      this.
      
      This was tested on a range of devices: 8040-db, 8040-mcbin and 7040-db.
      
      @Dave: the dt patches should go through the mvebu tree (patches 9-13).
      
      Thanks!
      Antoine
      
      Since v3:
        - Now use of_phy_simple_xlate() to retrieve the phy.
        - Added an owner in the phy_ops structure.
        - Now allow the module to be selected with COMPILE_TEST.
        - Removed unused parameter in the comphy set_mode functions.
        - Added Kishon Acked-by in patch 1.
      
      Since v2:
        - Kept the link mode enforcement.
        - Removed the netif_running() check.
        - Reworded the "dynamic reconfiguration of the PHY mode" commit log.
        - Added one patch not to force the GMAC autoneg parameters when using
          the XLG MAC.
      
      Since v1:
        - Updated the mode settings variable name in the comphy driver to
          have 'cp110' in it.
        - Documented the PHY cell argument in the dt documentation.
        - New patch adding comphy phandles for the 7040-db board.
        - Checked if the carrier_on/off functions were needed. They are.
        - s/PHY/generic PHY/ in commit log of patch 1.
        - Rebased on the latest net-next/master.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      35aed4ac
    • Antoine Tenart's avatar
      net: mvpp2: dynamic reconfiguration of the comphy/GoP/MAC · 89273bc0
      Antoine Tenart authored
      This patch adds logic to reconfigure the comphy/GoP/MAC when the link
      state is updated at runtime. This is very useful on boards where many
      link speed are supported: depending on what is negotiated the PPv2
      driver will automatically reconfigures the link between the PHY and the
      MAC.
      Signed-off-by: default avatarAntoine Tenart <antoine.tenart@free-electrons.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      89273bc0
    • Antoine Tenart's avatar
      net: mvpp2: do not set GMAC autoneg when using XLG MAC · 65a2c09a
      Antoine Tenart authored
      When using the XLG MAC, it does not make sense to force the GMAC autoneg
      parameters. This patch adds checks to only set the GMAC autoneg
      parameters when needed (i.e. when not using the XLG MAC).
      Signed-off-by: default avatarAntoine Tenart <antoine.tenart@free-electrons.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      65a2c09a
    • Antoine Tenart's avatar
      net: mvpp2: improve the link management function · f55744ad
      Antoine Tenart authored
      When the link status changes, the phylib calls the link_event function
      in the mvpp2 driver. Before this patch only the egress/ingress transmit
      was enabled/disabled. This patch adds more functionality to the link
      status management code by enabling/disabling the port per-cpu
      interrupts, and the port itself. The queues are now stopped as well, and
      the netif carrier helpers are called.
      Signed-off-by: default avatarAntoine Tenart <antoine.tenart@free-electrons.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f55744ad
    • Antoine Tenart's avatar
      net: mvpp2: simplify the link_event function · 968b211c
      Antoine Tenart authored
      The link_event function is somewhat complicated. This cosmetic patch
      simplifies it.
      Signed-off-by: default avatarAntoine Tenart <antoine.tenart@free-electrons.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      968b211c
    • Antoine Tenart's avatar
      net: mvpp2: initialize the comphy · 542897d9
      Antoine Tenart authored
      On some platforms, the comphy is between the MAC GoP and the PHYs. The
      mvpp2 driver currently relies on the firmware/bootloader to configure
      the comphy. As a comphy driver was added to the generic PHY framework,
      this patch uses it in the mvpp2 driver to configure the comphy at boot
      time to avoid relying on the bootloader.
      Signed-off-by: default avatarAntoine Tenart <antoine.tenart@free-electrons.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      542897d9
    • Antoine Tenart's avatar
      Documentation/bindings: phy: document the Marvell comphy driver · 9c2cbd47
      Antoine Tenart authored
      The Marvell Armada 7K/8K SoCs contains an hardware block called COMPHY
      that provides a number of shared PHYs used by various interfaces in the
      SoC: network, SATA, PCIe, etc. This Device Tree binding allows to
      describe this COMPHY hardware block.
      Signed-off-by: default avatarAntoine Tenart <antoine.tenart@free-electrons.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9c2cbd47
    • Antoine Tenart's avatar
      phy: add the mvebu cp110 comphy driver · d0438bd6
      Antoine Tenart authored
      On the CP110 unit, which can be found on various Marvell platforms such
      as the 7k and 8k (currently), a comphy (common PHYs) hardware block can
      be found. This block provides a number of PHYs which can be used in
      various modes by other controllers (network, SATA ...). These common
      PHYs must be configured for the controllers using them to work correctly
      either at boot time, or when the system runs to switch the mode used.
      This patch adds a driver for this comphy hardware block, providing
      callbacks for the its PHYs so that consumers can configure the modes
      used.
      
      As of this commit, two modes are supported by the comphy driver: sgmii
      and 10gkr.
      Signed-off-by: default avatarAntoine Tenart <antoine.tenart@free-electrons.com>
      Acked-by: default avatarKishon Vijay Abraham I <kishon@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d0438bd6
    • Antoine Tenart's avatar
      phy: add sgmii and 10gkr modes to the phy_mode enum · 5c23f2dc
      Antoine Tenart authored
      This patch adds more generic PHY modes to the phy_mode enum, to
      allow configuring generic PHYs to the SGMII and/or the 10GKR mode
      by using the set_mode callback.
      Signed-off-by: default avatarAntoine Tenart <antoine.tenart@free-electrons.com>
      Acked-by: default avatarKishon Vijay Abraham I <kishon@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5c23f2dc
    • Stefan Sørensen's avatar
      dp83640: don't hold spinlock while calling netif_rx_ni · d36b82bc
      Stefan Sørensen authored
      We should not hold a spinlock while pushing the skb into the networking
      stack, so move the call to netif_rx_ni out of the critical region to where
      we have dropped the spinlock.
      Signed-off-by: default avatarStefan Sørensen <stefan.sorensen@spectralink.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d36b82bc
    • David S. Miller's avatar
      Merge branch 'net_sched-idr' · f379fdf1
      David S. Miller authored
      Chris Mi says:
      
      ====================
      net/sched: Improve getting objects by indexes
      
      Using current TC code, it is very slow to insert a lot of rules.
      
      In order to improve the rules update rate in TC,
      we introduced the following two changes:
              1) changed cls_flower to use IDR to manage the filters.
              2) changed all act_xxx modules to use IDR instead of
                 a small hash table
      
      But IDR has a limitation that it uses int. TC handle uses u32.
      To make sure there is no regression, we add several new IDR APIs
      to support unsigned long.
      
      v2
      ==
      
      Addressed Hannes's comment:
      express idr_alloc in terms of idr_alloc_ext and most of the other functions
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f379fdf1
    • Chris Mi's avatar
      net/sched: Change act_api and act_xxx modules to use IDR · 65a206c0
      Chris Mi authored
      Typically, each TC filter has its own action. All the actions of the
      same type are saved in its hash table. But the hash buckets are too
      small that it degrades to a list. And the performance is greatly
      affected. For example, it takes about 0m11.914s to insert 64K rules.
      If we convert the hash table to IDR, it only takes about 0m1.500s.
      The improvement is huge.
      
      But please note that the test result is based on previous patch that
      cls_flower uses IDR.
      Signed-off-by: default avatarChris Mi <chrism@mellanox.com>
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Acked-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      65a206c0
    • Chris Mi's avatar
      net/sched: Change cls_flower to use IDR · c15ab236
      Chris Mi authored
      Currently, all filters with the same priority are linked in a doubly
      linked list. Every filter should have a unique handle. To make the
      handle unique, we need to iterate the list every time to see if the
      handle exists or not when inserting a new filter. It is time-consuming.
      For example, it takes about 5m3.169s to insert 64K rules.
      
      This patch changes cls_flower to use IDR. With this patch, it
      takes about 0m1.127s to insert 64K rules. The improvement is huge.
      
      But please note that in this testing, all filters share the same action.
      If every filter has a unique action, that is another bottleneck.
      Follow-up patch in this patchset addresses that.
      Signed-off-by: default avatarChris Mi <chrism@mellanox.com>
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Acked-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c15ab236
    • Chris Mi's avatar
      idr: Add new APIs to support unsigned long · 388f79fd
      Chris Mi authored
      The following new APIs are added:
      
      int idr_alloc_ext(struct idr *idr, void *ptr, unsigned long *index,
                        unsigned long start, unsigned long end, gfp_t gfp);
      void *idr_remove_ext(struct idr *idr, unsigned long id);
      void *idr_find_ext(const struct idr *idr, unsigned long id);
      void *idr_replace_ext(struct idr *idr, void *ptr, unsigned long id);
      void *idr_get_next_ext(struct idr *idr, unsigned long *nextid);
      Signed-off-by: default avatarChris Mi <chrism@mellanox.com>
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      388f79fd
    • David S. Miller's avatar
      Merge branch 'add-rmnet-driver' · c2f8a6ce
      David S. Miller authored
      Subash Abhinov Kasiviswanathan says:
      
      ====================
      net: Add support for rmnet driver
      
      This patch series adds support for the rmnet driver which is required to
      support recent chipsets using Qualcomm Technologies, Inc. modems. The data
      from hardware follows the multiplexing and aggregation protocol (MAP).
      
      This driver can be used to register onto any physical network device in
      IP mode. Physical transports include USB, HSIC, PCIe and IP accelerator.
      
      rmnet driver helps to decode these packets and queue them to network
      stack (and encode and transmit it to the physical device).
      
      v1: Same as the RFC patch with some minor fixes for issues reported by
      kbuild test robot.
      
      v1->v2: Change datatypes and remove config IOCTL as mentioned by David.
      Also fix checkpatch issues and remove some unused code.
      
      v2->v3: Move location to drivers/net and rename to rmnet. Change the
      userspace - netlink communication from custom netlink to rtnl_link_ops.
      Refactor some code. Use a fixed config for ingress and egress.
      
      v3->v4: Move location to drivers/net/ethernet/qualcomm/.
      Fix comments from Stephen and Jiri -
      Split the ether and arp type changes into seperate patches.
      Remove debug and custom logging and switch to standard netdevice log.
      Remove module parameters. Refactor and change some code style issues.
      
      v4->v5: Rename some structs and variables. Move the initializer
      before the for loop start. Put the arp type in correct sequence.
      
      v5->v6: Fix comments from Dan -
      Use the upper link API. As a result, remove all the refcounting logic.
      Device refcount is explicitly held on real_dev on rx_handler
      registration only. Modifiy the flow control struct. Remove the unused
      ethernet mode handling.
      
      v6->v7: Fix comments from David - Add newline to end of Makefile. Remove
      inline from .c files. Move the module init/exit to rmnet config. Fix an
      error reported by kbuild test robot for an unused file.
      
      v7->v8: Use a smaller value for ETH_P_MAP as mentioned by David. Change
      netdev_info to netdev_dbg as mentioned by Andew. Fix comments from
      Stephen regarding netdev_priv and sparse related errors of using 0 as NULL
      
      v8->v9: Fix comments from David - Remove the CFLAG rule. Change the way
      rmnet devices are freed. Instead of using a workqueue to unregister devices
      individually, go through the list and free all devices within the rtnl_lock().
      
      v9->v10: Actually fix the locking as mentioned by David. The locking scheme is
      mentioned in a comment in rmnet_config.c. Change comment near MAP type
      definition as mentioned by Dan. Refactor some code.
      
      v10->v11: Allow RMNET to compile as a module as mentioned by David
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c2f8a6ce
    • Subash Abhinov Kasiviswanathan's avatar
      drivers: net: ethernet: qualcomm: rmnet: Initial implementation · ceed73a2
      Subash Abhinov Kasiviswanathan authored
      RmNet driver provides a transport agnostic MAP (multiplexing and
      aggregation protocol) support in embedded module. Module provides
      virtual network devices which can be attached to any IP-mode
      physical device. This will be used to provide all MAP functionality
      on future hardware in a single consistent location.
      Signed-off-by: default avatarSubash Abhinov Kasiviswanathan <subashab@codeaurora.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ceed73a2
    • Subash Abhinov Kasiviswanathan's avatar
      net: arp: Add support for raw IP device · cdf4969c
      Subash Abhinov Kasiviswanathan authored
      Define the raw IP type. This is needed for raw IP net devices
      like rmnet.
      Signed-off-by: default avatarSubash Abhinov Kasiviswanathan <subashab@codeaurora.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cdf4969c
    • Subash Abhinov Kasiviswanathan's avatar
      net: ether: Add support for multiplexing and aggregation type · 7373ae7e
      Subash Abhinov Kasiviswanathan authored
      Define the Qualcomm multiplexing and aggregation (MAP) ether type 0x00F9.
      This is needed for receiving data in the MAP protocol like RMNET. This is
      not an officially registered ID.
      Signed-off-by: default avatarSubash Abhinov Kasiviswanathan <subashab@codeaurora.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7373ae7e
    • David S. Miller's avatar
      Merge branch 'tcp-readd-hp' · 2c667d40
      David S. Miller authored
      Florian Westphal says:
      
      ====================
      tcp: re-add header prediction
      
      Eric reported a performance regression caused by header prediction
      removal.
      
      We now call tcp_ack() much more frequently, for some workloads
      this brings in enough cache line misses to become noticeable.
      
      We could possibly still kill HP provided we find a different
      way to suppress unneeded tcp_ack, but given we're late in
      the cycle it seems preferable to revert.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2c667d40
    • Florian Westphal's avatar
      tcp: Revert "tcp: remove header prediction" · 31770e34
      Florian Westphal authored
      This reverts commit 45f119bf.
      
      Eric Dumazet says:
        We found at Google a significant regression caused by
        45f119bf tcp: remove header prediction
      
        In typical RPC  (TCP_RR), when a TCP socket receives data, we now call
        tcp_ack() while we used to not call it.
      
        This touches enough cache lines to cause a slowdown.
      
      so problem does not seem to be HP removal itself but the tcp_ack()
      call.  Therefore, it might be possible to remove HP after all, provided
      one finds a way to elide tcp_ack for most cases.
      Reported-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      31770e34
    • Florian Westphal's avatar
      tcp: Revert "tcp: remove CA_ACK_SLOWPATH" · c1d2b4c3
      Florian Westphal authored
      This change was a followup to the header prediction removal,
      so first revert this as a prerequisite to back out hp removal.
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c1d2b4c3
    • Greg KH's avatar
      staging: irda: fix init level for irda core · 0da93d2e
      Greg KH authored
      When moving the IRDA code out of net/ into drivers/staging/irda/net, the
      link order changes when IRDA is built into the kernel.  That causes a
      kernel crash at boot time as netfilter isn't initialized yet.
      
      To fix this, move the init call level of the irda core to be
      device_initcall() as the link order keeps this being initialized at the
      correct time.
      Reported-by: default avatarkernel test robot <fengguang.wu@intel.com>
      Reported-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0da93d2e
    • Florian Fainelli's avatar
      net: bcmgenet: Do not return from void function · d081a16d
      Florian Fainelli authored
      A stray return was added in the macro bcmgenet_##name##_writel where it
      should not, drop it.
      Reported-by: default avatarkbuild test robot <fengguang.wu@intel.com>
      Fixes: 69d2ea9c ("net: bcmgenet: Use correct I/O accessors")
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d081a16d
  2. 29 Aug, 2017 16 commits