1. 19 Jan, 2015 13 commits
    • David S. Miller's avatar
      Merge branch 'netcp' · b66a4eaa
      David S. Miller authored
      Murali Karicheri says:
      
      ====================
      net: Add Keystone NetCP ethernet driver support
      
      The Network Coprocessor (NetCP) is a hardware accelerator that processes
      Ethernet packets. NetCP has a gigabit Ethernet (GbE) subsystem with a ethernet
      switch sub-module to send and receive packets. NetCP also includes a packet
      accelerator (PA) module to perform packet classification operations such as
      header matching, and packet modification operations such as checksum
      generation. NetCP can also optionally include a Security Accelerator(SA)
      capable of performing IPSec operations on ingress/egress packets.
      
      Keystone SoC's also have a 10 Gigabit Ethernet Subsystem (XGbE) which
      includes a 3-port Ethernet switch sub-module capable of 10Gb/s and
      1Gb/s rates per Ethernet port.
      
      Both GBE and XGBE network processors supported using common driver. It
      is also designed to handle future variants of NetCP.
      
      version history
      ---------------
      v7->v8
      
       - Reworked comments against v7, related to checker warning.
       - Patch 2/4 that has all of the driver code in v7 is now split into 3
         patches based on functionality so that we have 3 smaller patches
         review instead of a big patch.
       - Patch for MAINTAINER is merged to 2/4 along with netcp core driver
       - Separate patch (3/4) for 1G and  (4/4) for 10G
       - Removed big endian support for initial version (will add it later)
      
      v6->v7
       - Fixed some minor documentation error and also modified the netcp driver
         to fix the set* functions to include correct le/be macros.
      
      v5->v6
       - updated version after incorporating comments [6] from David Miller,
         David Laight & Geert Uytterhoeven on v5. I would like get this in
         for v3.19 merge window if the latest version is acceptable.
      
      v4->v5
       - Sorry to spin v5 quickly but I missed few check-patch warnings which
         were pointed by Joe Perches(thanks). I folded his changes [5] along with
         few more check-patch warning fixes. I would like get this in for v3.18
         merge window if David is happy with this version.
      
      v3->v4
       - Couple of fixes in in error path as pointed [4] out by David. Rest of
         the patches are unchanged from v3.
      
      v2->v3
       - Update v3 after incorporating Jamal and David Miller's comment/suggestion
         from earlier versions [1] [2].  After per the discussion here [3], the
         controversial custom exports have been dropped now. And for future
         future offload support additions, we will plug into generic frameworks
         as an when they are available.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b66a4eaa
    • Wingman Kwok's avatar
      net: netcp: Enhance GBE driver to support 10G Ethernet · 90cff9e2
      Wingman Kwok authored
      This patch enhances the NetCP gbe driver to support 10GbE subsystem
      available in Keystone NetCP. The 3-port 10GbE switch sub-module contains
      the following components:- 10GbE Switch, MDIO Module, 2 PCS-R Modules
      (10GBase-R) and 2 SGMII modules (10/100/1000Base-T). The GBE driver
      together with netcp core driver provides support for 10G Ethernet
      on Keystone SoCs.
      
      10GbE hardware spec is available at
      
      http://www.ti.com/general/docs/lit/getliterature.tsp?baseLiteratureNumber=spruhj5&fileType=pdf
      
       Cc: David Miller <davem@davemloft.net>
       Cc: Rob Herring <robh+dt@kernel.org>
       Cc: Grant Likely <grant.likely@linaro.org>
       Cc: Santosh Shilimkar <santosh.shilimkar@kernel.org>
       Cc: Pawel Moll <pawel.moll@arm.com>
       Cc: Mark Rutland <mark.rutland@arm.com>
       Cc: Ian Campbell <ijc+devicetree@hellion.org.uk>
       Cc: Kumar Gala <galak@codeaurora.org>
      Signed-off-by: default avatarWingman Kwok <w-kwok2@ti.com>
      Signed-off-by: default avatarMurali Karicheri <m-karicheri2@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      90cff9e2
    • Wingman Kwok's avatar
      net: netcp: Add Keystone NetCP GbE driver · 6f8d3f33
      Wingman Kwok authored
      This patch add support for 1G Ethernet driver based on Keystone
      NetCP hardware. The gigabit Ethernet (GbE) switch subsystem is one of the main
      components of the network coprocessor (NETCP) peripheral. The purpose of the
      gigabit Ethernet switch subsystem in the NETCP is to provide an interface to
      transfer data between the host device and another connected device in
      compliance with the Ethernet protocol. GbE consists of 5 port Ethernet Switch
      module, 4 Serial Gigabit Media Independent Interface (SGMII) modules, MDIO
      module and SerDes.
      
      Driver for 5 port GbE switch and SGMII module is added in this patch. These
      hardware modules along with netcp core driver provides Network driver functions
      for 1G Ethernet.
      
      Detailed hardware spec is available at
      
      http://www.ti.com/lit/ug/sprugv9d/sprugv9d.pdf
      
       Cc: David Miller <davem@davemloft.net>
       Cc: Rob Herring <robh+dt@kernel.org>
       Cc: Grant Likely <grant.likely@linaro.org>
       Cc: Santosh Shilimkar <santosh.shilimkar@kernel.org>
       Cc: Pawel Moll <pawel.moll@arm.com>
       Cc: Mark Rutland <mark.rutland@arm.com>
       Cc: Ian Campbell <ijc+devicetree@hellion.org.uk>
       Cc: Kumar Gala <galak@codeaurora.org>
      Signed-off-by: default avatarWingman Kwok <w-kwok2@ti.com>
      Signed-off-by: default avatarMurali Karicheri <m-karicheri2@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6f8d3f33
    • Karicheri, Muralidharan's avatar
      net: netcp: Add Keystone NetCP core ethernet driver · 84640e27
      Karicheri, Muralidharan authored
      The network coprocessor (NetCP) is a hardware accelerator available in
      Keystone SoCs that processes Ethernet packets. NetCP consists of following
      hardware components
      
       1 Gigabit Ethernet (GbE) subsystem with a Ethernet switch sub-module to
         send and receive packets.
       2 Packet Accelerator (PA) module to perform packet classification
         operations such as header matching, and packet modification operations
         such as checksum generation.
       3 Security Accelerator(SA) capable of performing IPSec operations on
         ingress/egress packets.
       4 An optional 10 Gigabit Ethernet Subsystem (XGbE) which includes a
         3-port Ethernet switch sub-module capable of 10Gb/s and 1Gb/s rates
         per Ethernet port.
       5 Packet DMA and Queue Management Subsystem (QMSS) to enqueue and dequeue
         packets and DMA the packets between memory and NetCP hardware components
         described above.
      
      NetCP core driver make use of the Keystone Navigator driver API to allocate
      DMA channel for the Ethenet device and to handle packet queue/de-queue,
      Please refer API's in include/linux/soc/ti/knav_dma.h and
      drivers/soc/ti/knav_qmss.h for details.
      
      NetCP driver consists of NetCP core driver and at a minimum Gigabit
      Ethernet (GBE) module (1) driver to implement the Network device function.
      Other modules (2,3) can be optionally added to achieve supported hardware
      acceleration function. The initial version of the driver include NetCP
      core driver and GBE driver modules.
      
      Please refer Documentation/devicetree/bindings/net/keystone-netcp.txt
      for design of the driver.
      
       Cc: David Miller <davem@davemloft.net>
       Cc: Rob Herring <robh+dt@kernel.org>
       Cc: Grant Likely <grant.likely@linaro.org>
       Cc: Santosh Shilimkar <santosh.shilimkar@kernel.org>
       Cc: Pawel Moll <pawel.moll@arm.com>
       Cc: Mark Rutland <mark.rutland@arm.com>
       Cc: Ian Campbell <ijc+devicetree@hellion.org.uk>
       Cc: Kumar Gala <galak@codeaurora.org>
      Signed-off-by: default avatarMurali Karicheri <m-karicheri2@ti.com>
      Signed-off-by: default avatarWingman Kwok <w-kwok2@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      84640e27
    • Karicheri, Muralidharan's avatar
      Documentation: dt: net: Add binding doc for Keystone NetCP ethernet driver · 44eefcdf
      Karicheri, Muralidharan authored
      The network coprocessor (NetCP) is a hardware accelerator that processes
      Ethernet packets. NetCP has a gigabit Ethernet (GbE) subsystem with a ethernet
      switch sub-module to send and receive packets. NetCP also includes a packet
      accelerator (PA) module to perform packet classification operations such as
      header matching, and packet modification operations such as checksum
      generation. NetCP can also optionally include a Security Accelerator(SA)
      capable of performing IPSec operations on ingress/egress packets.
      
      Keystone SoC's also have a 10 Gigabit Ethernet Subsystem (XGbE) which
      includes a 3-port Ethernet switch sub-module capable of 10Gb/s and
      1Gb/s rates per Ethernet port.
      
      NetCP Subsystem device tree layout looks something like below:
      
      -----------------------------
        NetCP subsystem(10G or 1G)
      -----------------------------
      	|
      	|-> NetCP Devices ->	|
      	|			|-> GBE/XGBE Switch
      	|			|
      	|			|-> Packet Accelerator
      	|			|
      	|			|-> Security Accelerator
      	|
      	|
      	|
      	|-> NetCP Interfaces ->	|
      				|-> Ethernet Port 0
      				|
      				|-> Ethernet Port 1
      				|
      				|-> Ethernet Port 2
      				|
      				|-> Ethernet Port 3
      
      Common driver supports GBE as well XGBE network processors.
      
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: Grant Likely <grant.likely@linaro.org>
      Cc: Pawel Moll <pawel.moll@arm.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Ian Campbell <ijc+devicetree@hellion.org.uk>
      Cc: Kumar Gala <galak@codeaurora.org>
      Cc: David Miller <davem@davemloft.net>
      Cc: Santosh Shilimkar <santosh.shilimkar@kernel.org>
      Signed-off-by: default avatarMurali Karicheri <m-karicheri2@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      44eefcdf
    • Felipe Balbi's avatar
      net: ethernet: ti: cpsw: fix buld break when NET_POLL_CONTROLLER · 92cb13fb
      Felipe Balbi authored
      Commit c03abd84 (net: ethernet: cpsw: don't requests IRQs we don't
      use) left one build breakage when NET_POLL_CONTROLLER is enabled.
      
      Fix this build break by referring to the correct irqs_table array.
      
      Fixes: c03abd84 (net: ethernet: cpsw: don't requests IRQs we don't use)
      Reported-by: default avatarkbuild test robot <fengguang.wu@intel.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      92cb13fb
    • David S. Miller's avatar
      Merge branch 'link_netns' · 7f9091f0
      David S. Miller authored
      Merge branch 'link_netns'
      
      Nicolas Dichtel says:
      
      ====================
      netns: allow to identify peer netns
      
      The goal of this serie is to be able to multicast netlink messages with an
      attribute that identify a peer netns.
      This is needed by the userland to interpret some information contained in
      netlink messages (like IFLA_LINK value, but also some other attributes in case
      of x-netns netdevice (see also
      http://thread.gmane.org/gmane.linux.network/315933/focus=316064 and
      http://thread.gmane.org/gmane.linux.kernel.containers/28301/focus=4239)).
      
      Ids of peer netns can be set by userland via a new rtnl cmd RTM_NEWNSID. When
      the kernel needs an id for a peer (for example when advertising a new x-netns
      interface via netlink), if the user didn't allocate an id, one will be
      automatically allocated.
      These ids are stored per netns and are local (ie only valid in the netns where
      they are set). To avoid allocating an int for each peer netns, I use
      idr_for_each() to retrieve the id of a peer netns. Note that it will be possible
      to add a table (struct net -> id) later to optimize this lookup if needed.
      
      Patch 1/4 introduces the rtnetlink API mechanism to set and get these ids.
      Patch 2/4 and 3/4 implements an example of how to use these ids when advertising
      information about a x-netns interface.
      And patch 4/4 shows that the netlink messages can be symetric between a GET and
      a SET.
      
      iproute2 patches are available, I can send them on demand.
      
      Here is a small screenshot to show how it can be used by userland.
      
      $ ip netns add foo
      $ ip netns del foo
      $ ip netns
      $ touch /var/run/netns/init_net
      $ mount --bind /proc/1/ns/net /var/run/netns/init_net
      $ ip netns add foo
      $ ip -n foo netns
      foo
      init_net
      $ ip -n foo netns set init_net 0
      $ ip -n foo netns set foo 1
      
      $ ip netns
      foo
      init_net
      $ ip -n foo netns
      foo (id: 1)
      init_net (id: 0)
      
      $ ip -n foo link add ipip1 link-netnsid 0 type ipip remote 10.16.0.121 local 10.16.0.249
      $ ip -n foo link ls ipip1
      6: ipip1@NONE: <POINTOPOINT,NOARP> mtu 1480 qdisc noop state DOWN mode DEFAULT group default
          link/ipip 10.16.0.249 peer 10.16.0.121 link-netnsid 0
      
      $ ip netns
      foo
      init_net
      $ ip -n foo link add ipip2 type ipip remote 10.16.0.121 local 10.16.0.249
      $ ip -n foo link set ipip2 netns init_net
      $ ip link ls ipip2
      7: ipip2@NONE: <POINTOPOINT,NOARP> mtu 1480 qdisc noop state DOWN mode DEFAULT group default
          link/ipip 10.16.0.249 peer 10.16.0.121 link-netnsid 0
      $ ip netns
      foo (id: 0)
      init_net
      
      v4 -> v5:
        use rtnetlink instead of genetlink
        allocate automatically an id if user didn't assign one
        rename include/uapi/linux/netns.h to include/uapi/linux/net_namespace.h
        add vxlan in patch #3
      
      RFCv3 -> v4:
        rebase on net-next
        add copyright text in the new netns.h file
      
      RFCv2 -> RFCv3:
        ids are now defined by userland (via netlink). Ids are stored in each netns
        (and they are local to this netns).
        add get_link_net support for ip6 tunnels
        netnsid is now a s32 instead of a u32
      
      RFCv1 -> RFCv2:
        remove useless ()
        ids are now stored in the user ns. It's possible to get an id for a peer netns
        only if the current netns and the peer netns have the same user ns parent.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7f9091f0
    • Nicolas Dichtel's avatar
      rtnl: allow to create device with IFLA_LINK_NETNSID set · 317f4810
      Nicolas Dichtel authored
      This patch adds the ability to create a netdevice in a specified netns and
      then move it into the final netns. In fact, it allows to have a symetry between
      get and set rtnl messages.
      Signed-off-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      317f4810
    • Nicolas Dichtel's avatar
      tunnels: advertise link netns via netlink · 1728d4fa
      Nicolas Dichtel authored
      Implement rtnl_link_ops->get_link_net() callback so that IFLA_LINK_NETNSID is
      added to rtnetlink messages.
      Signed-off-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1728d4fa
    • Nicolas Dichtel's avatar
      rtnl: add link netns id to interface messages · d37512a2
      Nicolas Dichtel authored
      This patch adds a new attribute (IFLA_LINK_NETNSID) which contains the 'link'
      netns id when this netns is different from the netns where the interface
      stands (for example for x-net interfaces like ip tunnels).
      With this attribute, it's possible to interpret correctly all advertised
      information (like IFLA_LINK, etc.).
      Signed-off-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d37512a2
    • Nicolas Dichtel's avatar
      netns: add rtnl cmd to add and get peer netns ids · 0c7aecd4
      Nicolas Dichtel authored
      With this patch, a user can define an id for a peer netns by providing a FD or a
      PID. These ids are local to the netns where it is added (ie valid only into this
      netns).
      
      The main function (ie the one exported to other module), peernet2id(), allows to
      get the id of a peer netns. If no id has been assigned by the user, this
      function allocates one.
      
      These ids will be used in netlink messages to point to a peer netns, for example
      in case of a x-netns interface.
      Signed-off-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0c7aecd4
    • Rosen, Rami's avatar
      bridge: remove oflags from setlink/dellink. · 4de8b413
      Rosen, Rami authored
      Commit 02dba438 ("bridge: fix setlink/dellink notifications") removed usage of oflags in
      both rtnl_bridge_setlink() and rtnl_bridge_dellink() methods. This patch removes this variable as it is no
      longer needed.
      Signed-off-by: default avatarRami Rosen <rami.rosen@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4de8b413
    • David S. Miller's avatar
      netlink: Fix bugs in nlmsg_end() conversions. · 7b46a644
      David S. Miller authored
      Commit 053c095a ("netlink: make nlmsg_end() and genlmsg_end()
      void") didn't catch all of the cases where callers were breaking out
      on the return value being equal to zero, which they no longer should
      when zero means success.
      
      Fix all such cases.
      Reported-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      Reported-by: default avatarScott Feldman <sfeldma@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7b46a644
  2. 18 Jan, 2015 24 commits
  3. 17 Jan, 2015 3 commits
    • David S. Miller's avatar
      Merge branch 'amd-xgbe' · 93d62ef9
      David S. Miller authored
      Tom Lendacky says:
      
      ====================
      amd-xgbe: AMD XGBE driver updates 2015-01-16
      
      The following series of patches includes functional updates to the
      driver as well as some trivial changes.
      
      - Fix checks/warnings from checkpatch in the amd-xgbe driver
      - Fix checks/warnings from checkpatch in the amd-xgbe-phy driver
      - Add a check to be sure that the amd-xgbe driver is using the
        amd-xgbe-phy driver
      - Use a saved control register value when bringing the PCS out of
        suspend
      - Clear all device state during a device restart
      - Simplify the Rx descriptor ring tracking
      - Remove the need for Tx path spinlocks
      - Update the auto-negotiation logic to make use of the auto-negotiation
        interrupt
      - Properly support/advertise the FEC capability of the device
      - Use the proper page registers during auto-negotiation extended next
        page exchange
      - Add ACPI support to the amd-xgbe and amd-xgbe-phy drivers
      - Allow platform specific phy settings to be supplied by UEFI
      
      This patch series is based on net-next.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      93d62ef9
    • Lendacky, Thomas's avatar
      amd-xgbe-phy: Allow certain PHY settings to be set by UEFI · 8fdb1a09
      Lendacky, Thomas authored
      Certain PHY settings need to be configurable by UEFI depending on the
      platform being used.  Add new device tree / ACPI properties that, if
      present, will override the pre-determined values currently used.
      Signed-off-by: default avatarTom Lendacky <thomas.lendacky@amd.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8fdb1a09
    • Lendacky, Thomas's avatar
      amd-xgbe: Add ACPI support · 82a19035
      Lendacky, Thomas authored
      Add support for ACPI to the amd-xgbe and amd-xgbe-phy drivers. This
      support converts many of the device tree APIs to the new device_property
      APIs.
      Signed-off-by: default avatarTom Lendacky <thomas.lendacky@amd.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      82a19035