1. 05 Mar, 2015 17 commits
  2. 04 Mar, 2015 23 commits
    • David S. Miller's avatar
      Merge tag 'linux-can-next-for-4.1-20150304' of... · 3a65f63f
      David S. Miller authored
      Merge tag 'linux-can-next-for-4.1-20150304' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next
      
      Marc Kleine-Budde says:
      
      ====================
      pull-request: can-next 2015-03-04
      
      this is a pull request of 3 patches for net-next/master.
      
      Aaron Wu contributes three patches for the blackfin can driver, which
      cleans up the driver and makes use of more platform independent code.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3a65f63f
    • Wu Fengguang's avatar
      f0126539
    • David S. Miller's avatar
      Merge branch 'be2net-next' · c473463c
      David S. Miller authored
      Sathya Perla says:
      
      ====================
      be2net: patch set
      
      Hi Dave, the following patch set includes three feature additions relating
      to SR-IOV to be2net.
      
      Patch 1 avoid creating a non-RSS default RXQ when FW allows it.
      This prevents wasting one RXQ for each VF.
      
      Patch 2 adds support for evenly distributing all queue & filter resources
      across VFs. The FW informs the driver as to which resources are distributable.
      
      Patch 3 implements the sriov_configure PCI method to allow runtime
      enablement of VFs via sysfs.
      
      Pls consider applying this patch-set to the net-next tree. Thanks!
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c473463c
    • Vasundhara Volam's avatar
      be2net: implement .sriov_configure() PCI callback · ace40aff
      Vasundhara Volam authored
      This patch implements the .sriov_configure() PCI method to allow for
      runtime enabling/disabling of VFs. The module param "num_vfs" is now
      deprecated.
      At the time of driver load the PF-pool resources are allocated to the PF.
      When the user enables VFs, the resources are then re-distributed across
      PFs and VFs based on the number of VFs enabled.
      Signed-off-by: default avatarVasundhara Volam <vasundhara.volam@emulex.com>
      Signed-off-by: default avatarSathya Perla <sathya.perla@emulex.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ace40aff
    • Vasundhara Volam's avatar
      be2net: re-distribute SRIOV resources allowed by FW · f2858738
      Vasundhara Volam authored
      When SR-IOV is enabled in the adapter, the FW distributes resources
      evenly across the PF and it's VFs. This is currently done only for some
      resources.
      
      This patch adds support for a new cmd that queries the FW for the list
      of resources for which the distribution is allowed and distributes them
      accordingly.
      Signed-off-by: default avatarVasundhara Volam <vasundhara.volam@emulex.com>
      Signed-off-by: default avatarSathya Perla <sathya.perla@emulex.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f2858738
    • Vasundhara Volam's avatar
      be2net: avoid creating the non-RSS default RXQ if FW allows to · 71bb8bd0
      Vasundhara Volam authored
      On BE2, BE3 and Skhawk-R chips one non-RSS (called "default") RXQ was
      needed to receive non-IP traffic. Some FW versions now export a
      capability called IFACE_FLAGS_DEFQ_RSS where this requirement doesn't hold.
      On such FWs the driver now does not create the non-RSS default queue.
      This prevents wasting one RXQ per VF.
      Signed-off-by: default avatarVasundhara Volam <vasundhara.volam@emulex.com>
      Signed-off-by: default avatarSathya Perla <sathya.perla@emulex.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      71bb8bd0
    • Michal Simek's avatar
      net: cadence: Remove Kconfig dependency on ARCH · 28811a8c
      Michal Simek authored
      Remove Kconfig dependency and enable driver for
      all ARCHs.
      Signed-off-by: default avatarMichal Simek <michal.simek@xilinx.com>
      Acked-by: default avatarSören Brinkmann <soren.brinkmann@xilinx.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      28811a8c
    • David S. Miller's avatar
      Merge branch 'sh_eth-next' · 4f075a58
      David S. Miller authored
      Ben Hutchings says:
      
      ====================
      sh_eth changes for net-next
      
      Some minor new features and fixes.
      
      These depend in part on the series I sent earlier for net, specifically
      "sh_eth: WARN on access to a register not implemented in a particular
      chip" depends on "sh_eth: Fix RX recovery on R-Car in case of RX ring
      underrun".
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4f075a58
    • Ben Hutchings's avatar
      sh_eth: Mitigate lost statistics updates · 4398f9c8
      Ben Hutchings authored
      The statistics registers have write-clear behaviour, which means we
      will lose any increment between the read and write.  Mitigate this by
      only clearing when we read a non-zero value, so we will never falsely
      report a total of zero.  This also saves time as we only handle
      error statistics here and they won't often be incremented.
      Signed-off-by: default avatarBen Hutchings <ben.hutchings@codethink.co.uk>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4398f9c8
    • Ben Hutchings's avatar
    • Ben Hutchings's avatar
      sh_eth: Implement ethtool register dump operations · 6b4b4fea
      Ben Hutchings authored
      There are many different sets of registers implemented by the
      different versions of this controller, and we can only expect this to
      get more complicated in future.  Limit how much ethtool needs to know
      by including an explicit bitmap of which registers are included in the
      dump, allowing room for future growth in the number of possible
      registers.
      
      As I don't have datasheets for all of these, I've only included
      registers that are:
      
      - defined in all 5 register type arrays, or
      - used by the driver, or
      - documented in the datasheet I have
      
      Add one new capability flag so we can tell whether the RTRATE
      register is implemented.
      
      Delete the TSU_ADRL0 and TSU_ADR{H,L}31 definitions, as they weren't
      used and the address table is already assumed to be contiguous.
      Signed-off-by: default avatarBen Hutchings <ben.hutchings@codethink.co.uk>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6b4b4fea
    • Ben Hutchings's avatar
      sh_eth: WARN on access to a register not implemented in a particular chip · 3365711d
      Ben Hutchings authored
      Currently we may silently read/write a register at offset 0.  Change
      this to WARN and then ignore the write or read-back all-ones.
      Signed-off-by: default avatarBen Hutchings <ben.hutchings@codethink.co.uk>
      Acked-by: default avatarSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3365711d
    • Ben Hutchings's avatar
      sh_eth: Implement multicast statistic based on the RFS8 status bit · 25b77ad7
      Ben Hutchings authored
      At least on the R8A7790, RFS8 reflects the RINT8 (multicast) MAC
      status flag.
      Signed-off-by: default avatarBen Hutchings <ben.hutchings@codethink.co.uk>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      25b77ad7
    • Aaron Wu's avatar
      bfin_can: Merge header file from arch dependent location · 400aff5d
      Aaron Wu authored
      Header file was in arch dependent location arch/blackfin/include/asm/bfin_can.h,
      Now move and merge the useful contents of header file into driver code, note
      the original header file is reserved for full registers set access test by other
      code so it survives.
      Signed-off-by: default avatarAaron Wu <Aaron.wu@analog.com>
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      400aff5d
    • Aaron Wu's avatar
      bfin_can: introduce ioremap to comply to archs with MMU · dead8389
      Aaron Wu authored
      Blackfin was built without MMU, old driver code access the IO space by
      physical address, introduce the ioremap approach to be compitable with
      the common style supporting MMU enabled arch.
      Signed-off-by: default avatarAaron Wu <Aaron.wu@analog.com>
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      dead8389
    • Aaron Wu's avatar
      bfin_can: rewrite the blackfin style of read/write to common ones · e4936e01
      Aaron Wu authored
      Replace the blackfin arch dependent style of bfin_read/bfin_write with
      common readw/writew
      Signed-off-by: default avatarAaron Wu <Aaron.wu@analog.com>
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      e4936e01
    • David S. Miller's avatar
      Merge branch 'basic-mpls-support' · 27db730c
      David S. Miller authored
      Eric W. Biederman says:
      
      ====================
      Basic MPLS support take 2
      
      On top of my two pending neighbour table prep patches here is the mpls
      support refactored to use them, and edited to not drop routes when
      an interface goes down.  Additionally the addition of RTA_LLGATEWAY
      has been replaced with the addtion of RTA_VIA.  RTA_VIA being an
      attribute that includes the address family as well as the address
      of the next hop.
      
      MPLS is at it's heart simple and I have endeavoured to maintain that
      simplicity in my implemenation.
      
      This is an implementation of a RFC3032 forwarding engine, and basic MPLS
      egress logic.  Which should make linux sufficient to be a mpls
      forwarding node or to be a LSA (Label Switched Router) as it says in all
      of the MPLS documents.  The ingress support will follow but it deserves
      it's own discussion so I am pushing it separately.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      27db730c
    • Eric W. Biederman's avatar
      mpls: Multicast route table change notifications · 8de147dc
      Eric W. Biederman authored
      Unlike IPv4 this code notifies on all cases where mpls routes
      are added or removed and it never automatically removes routes.
      Avoiding both the userspace confusion that is caused by omitting
      route updates and the possibility of a flood of netlink traffic
      when an interface goes doew.
      
      For now reserved labels are handled automatically and userspace
      is not notified.
      Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8de147dc
    • Eric W. Biederman's avatar
      mpls: Netlink commands to add, remove, and dump routes · 03c05665
      Eric W. Biederman authored
      This change adds two new netlink routing attributes:
      RTA_VIA and RTA_NEWDST.
      
      RTA_VIA specifies the specifies the next machine to send a packet to
      like RTA_GATEWAY.  RTA_VIA differs from RTA_GATEWAY in that it
      includes the address family of the address of the next machine to send
      a packet to.  Currently the MPLS code supports addresses in AF_INET,
      AF_INET6 and AF_PACKET.  For AF_INET and AF_INET6 the destination mac
      address is acquired from the neighbour table.  For AF_PACKET the
      destination mac_address is specified in the netlink configuration.
      
      I think raw destination mac address support with the family AF_PACKET
      will prove useful.  There is MPLS-TP which is defined to operate
      on machines that do not support internet packets of any flavor.  Further
      seem to be corner cases where it can be useful.  At this point
      I don't care much either way.
      
      RTA_NEWDST specifies the destination address to forward the packet
      with.  MPLS typically changes it's destination address at every hop.
      For a swap operation RTA_NEWDST is specified with a length of one label.
      For a push operation RTA_NEWDST is specified with two or more labels.
      For a pop operation RTA_NEWDST is not specified or equivalently an emtpy
      RTAN_NEWDST is specified.
      
      Those new netlink attributes are used to implement handling of rt-netlink
      RTM_NEWROUTE, RTM_DELROUTE, and RTM_GETROUTE messages, to maintain the
      MPLS label table.
      
      rtm_to_route_config parses a netlink RTM_NEWROUTE or RTM_DELROUTE message,
      verify no unhandled attributes or unhandled values are present and sets
      up the data structures for mpls_route_add and mpls_route_del.
      
      I did my best to match up with the existing conventions with the caveats
      that MPLS addresses are all destination-specific-addresses, and so
      don't properly have a scope.
      Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      03c05665
    • Eric W. Biederman's avatar
      mpls: Functions for reading and wrinting mpls labels over netlink · 966bae33
      Eric W. Biederman authored
      Reading and writing addresses in network byte order in netlink is
      traditional and I see no reason to change that.  MPLS is interesting
      as effectively it has variabely length addresses (the MPLS label
      stack).  To represent these variable length addresses in netlink
      I use a valid MPLS label stack (complete with stop bit).
      
      This achieves two things: a well defined existing format is used,
      and the data can be interpreted without looking at it's length.
      
      Not needed to look at the length to decode the variable length
      network representation allows existing userspace functions
      such as inet_ntop to be used without needed to change their
      prototype.
      Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      966bae33
    • Eric W. Biederman's avatar
      mpls: Basic support for adding and removing routes · a2519929
      Eric W. Biederman authored
      mpls_route_add and mpls_route_del implement the basic logic for adding
      and removing Next Hop Label Forwarding Entries from the MPLS input
      label map.  The addition and subtraction is done in a way that is
      consistent with how the existing routing table in Linux are
      maintained.  Thus all of the work to deal with NLM_F_APPEND,
      NLM_F_EXCL, NLM_F_REPLACE, and NLM_F_CREATE.
      
      Cases that are not clearly defined such as changing the interpretation
      of the mpls reserved labels is not allowed.
      
      Because it seems like the right thing to do adding an MPLS route without
      specifying an input label and allowing the kernel to pick a free label
      table entry is supported.   The implementation is currently less than optimal
      but that can be changed.
      
      As I don't have anything else to test with only ethernet and the loopback
      device are the only two device types currently supported for forwarding
      MPLS over.
      Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a2519929
    • Eric W. Biederman's avatar
      mpls: Add a sysctl to control the size of the mpls label table · 7720c01f
      Eric W. Biederman authored
      This sysctl gives two benefits.  By defaulting the table size to 0
      mpls even when compiled in and enabled defaults to not forwarding
      any packets.  This prevents unpleasant surprises for users.
      
      The other benefit is that as mpls labels are allocated locally a dense
      table a small dense label table may be used which saves memory and
      is extremely simple and efficient to implement.
      
      This sysctl allows userspace to choose the restrictions on the label
      table size userspace applications need to cope with.
      Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7720c01f
    • Eric W. Biederman's avatar
      mpls: Basic routing support · 0189197f
      Eric W. Biederman authored
      This change adds a new Kconfig option MPLS_ROUTING.
      
      The core of this change is the code to look at an mpls packet received
      from another machine.  Look that packet up in a routing table and
      forward the packet on.
      
      Support of MPLS over ATM is not considered or attempted here.  This
      implemntation follows RFC3032 and implements the MPLS shim header that
      can pass over essentially any network.
      
      What RFC3021 refers to as the as the Incoming Label Map (ILM) I call
      net->mpls.platform_label[].  What RFC3031 refers to as the Next Label
      Hop Forwarding Entry (NHLFE) I call mpls_route.  Though calling it the
      label fordwarding information base (lfib) might also be valid.
      
      Further the implemntation forwards packets as described in RFC3032.
      There is no need and given the original motivation for MPLS a strong
      discincentive to have a flexible label forwarding path.  In essence
      the logic is the topmost label is read, looked up, removed, and
      replaced by 0 or more new lables and the sent out the specified
      interface to it's next hop.
      
      Quite a few optional features are not implemented here.  Among them
      are generation of ICMP errors when the TTL is exceeded or the packet
      is larger than the next hop MTU (those conditions are detected and the
      packets are dropped instead of generating an icmp error).  The traffic
      class field is always set to 0.  The implementation focuses on IP over
      MPLS and does not handle egress of other kinds of protocols.
      
      Instead of implementing coordination with the neighbour table and
      sorting out how to input next hops in a different address family (for
      which there is value).  I was lazy and implemented a next hop mac
      address instead.  The code is simpler and there are flavor of MPLS
      such as MPLS-TP where neither an IPv4 nor an IPv6 next hop is
      appropriate so a next hop by mac address would need to be implemented
      at some point.
      
      Two new definitions AF_MPLS and PF_MPLS are exposed to userspace.
      
      Decoding the mpls header must be done by first byeswapping a 32bit bit
      endian word into the local cpu endian and then bit shifting to extract
      the pieces.  There is no C bit-field that can represent a wire format
      mpls header on a little endian machine as the low bits of the 20bit
      label wind up in the wrong half of third byte.  Therefore internally
      everything is deal with in cpu native byte order except when writing
      to and reading from a packet.
      
      For management simplicity if a label is configured to forward out
      an interface that is down the packet is dropped early.  Similarly
      if an network interface is removed rt_dev is updated to NULL
      (so no reference is preserved) and any packets for that label
      are dropped.  Keeping the label entries in the kernel allows
      the kernel label table to function as the definitive source
      of which labels are allocated and which are not.
      Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0189197f