1. 19 Mar, 2016 10 commits
  2. 18 Mar, 2016 26 commits
    • Zhang Shengju's avatar
      net: fix a comment typo · 93e68cd6
      Zhang Shengju authored
      Fix a comment typo.
      Signed-off-by: default avatarZhang Shengju <zhangshengju@cmss.chinamobile.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      93e68cd6
    • Dan Carpenter's avatar
      ethernet: micrel: fix some error codes · 3af0d554
      Dan Carpenter authored
      There were two issues here:
      1) dma_mapping_error() return true/false but we want to return -ENOMEM
      2) If dmaengine_prep_slave_sg() failed then "err" wasn't set but
         presumably that should be -ENOMEM as well.
      
      I changed the success path to "return 0;" instead of "return ret;" for
      clarity.
      
      Fixes: 94fe8c68 ('ks8842: Support DMA when accessed via timberdale')
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3af0d554
    • David S. Miller's avatar
      Merge branch 'bpf-misc' · 3004932c
      David S. Miller authored
      Daniel Borkmann says:
      
      ====================
      Minor BPF follow-ups
      
      Some minor last follow-ups I still had in my queue. The first one adds
      readability support for __sk_buff's tc_classid member, the remaining
      two are some minor cleanups. For details please see individual patches.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3004932c
    • Daniel Borkmann's avatar
      ip_tunnels, bpf: define IP_TUNNEL_OPTS_MAX and use it · fca5fdf6
      Daniel Borkmann authored
      eBPF defines this as BPF_TUNLEN_MAX and OVS just uses the hard-coded
      value inside struct sw_flow_key. Thus, add and use IP_TUNNEL_OPTS_MAX
      for this, which makes the code a bit more generic and allows to remove
      BPF_TUNLEN_MAX from eBPF code.
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fca5fdf6
    • Daniel Borkmann's avatar
      bpf, dst: add and use dst_tclassid helper · 808c1b69
      Daniel Borkmann authored
      We can just add a small helper dst_tclassid() for retrieving the
      dst->tclassid value. It makes the code a bit better in that we can
      get rid of the ifdef from filter.c by moving this into the header.
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      808c1b69
    • Daniel Borkmann's avatar
      bpf: make skb->tc_classid also readable · 09c37a2c
      Daniel Borkmann authored
      Currently, the tc_classid from eBPF skb context is write-only, but there's
      no good reason for tc programs to limit it to write-only. For example,
      it can be used to transfer its state via tail calls where the resulting
      tc_classid gets filled gradually.
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      09c37a2c
    • Arnd Bergmann's avatar
      net: mvneta: bm: clarify dependencies · 019ded3a
      Arnd Bergmann authored
      MVNETA_BM has a dependency on MVNETA, so we can only select the former
      if the latter is enabled. However, the code dependency is the reverse:
      The mvneta module can call into the mvneta_bm module, so mvneta cannot
      be a built-in if mvneta_bm is a module, or we get a link error:
      
      drivers/net/built-in.o: In function `mvneta_remove':
      drivers/net/ethernet/marvell/mvneta.c:4211: undefined reference to `mvneta_bm_pool_destroy'
      drivers/net/built-in.o: In function `mvneta_bm_update_mtu':
      drivers/net/ethernet/marvell/mvneta.c:1034: undefined reference to `mvneta_bm_bufs_free'
      
      This avoids the problem by further clarifying the dependency so that
      MVNETA_BM is a silent Kconfig option that gets turned on by the
      new MVNETA_BM_ENABLE option. This way both the core HWBM module and
      the MVNETA_BM code are always built-in when needed.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Fixes: dc35a10f ("net: mvneta: bm: add support for hardware buffer management")
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      019ded3a
    • Daniel Borkmann's avatar
      cls_bpf: reset class and reuse major in da · 3a461da1
      Daniel Borkmann authored
      There are two issues with the current code. First one is that we need
      to set res->class to 0 in case we use non-default classid matching.
      
      This is important for the case where cls_bpf was initially set up with
      an optional binding to a default class with tcf_bind_filter(), where
      the underlying qdisc implements bind_tcf() that fills res->class and
      tests for it later on when doing the classification. Convention for
      these cases is that after tc_classify() was called, such qdiscs (atm,
      drr, qfq, cbq, hfsc, htb) first test class, and if 0, then they lookup
      based on classid.
      
      Second, there's a bug with da mode, where res->classid is only assigned
      a 16 bit minor, but it needs to expand to the full 32 bit major/minor
      combination instead, therefore we need to expand with the bound major.
      This is fine as classes belonging to a classful qdisc must share the
      same major.
      
      Fixes: 045efa82 ("cls_bpf: introduce integrated actions")
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3a461da1
    • David S. Miller's avatar
      Merge branch 'ldmvsw' · 70063e94
      David S. Miller authored
      Aaron Young says:
      
      ====================
      ldmvsw: Add ldmvsw driver
      
      This series adds a new Logical Domains vSwitch (ldmvsw) driver.
      
      The ldmvsw driver code will live in the drivers/net/ethernet/sun/
      directory and will operate on Oracle systems running SPARC Linux in a
      Logical Domains environment (typically in the control domain).
      
      The ldmvsw driver is very similar in function to the existing sunvnet
      driver. Ldmvsw creates a network interface for each "vsw-port" node
      found in the Machine Description (MD) of a service domain. These
      nodes correspond to ports on a vswitch created by the logical domains
      manager. The created network interface(s) can be used by bridge/vswitch
      software (such as the Linux bridge or Open vSwitch) to provide
      guest domain(s) with network interconnectivity or connectivity
      to a physical network.
      
      Here is a example diagram of ldmvsw driver usage in a logical
      domain environment to provide a guest domain with network connectivity
      to a physical NIC on the service domain:
      
         +----------------+             +-----------------
         | Service Domain |             |  Guest domain  |
         |                |             |                |
         |  LinuxBridge   |             |                |
         |    |    |      |             |                |
         |   NIC Ldmvsw   |             |    Sunvnet     |
         +----------------+             +----------------+
              |    |           LDC              |
             LAN   ------------------------------
      
      As stated, the sunvnet and ldmvsw drivers are _very_ similar in function.
      They both create network interface(s) to receive/transmit network
      traffic across LDC network channel(s). Since the driver is so similar
      in function to sunvnet, the approach will be as follows to integrate
      the driver and take advantage of common code:
      
      Patch #1: Split sunvnet.c driver into sunvnet.c and sunvnet_common.c
      Patch #2: Modify the sunvnet_common code and data structures to be compatible
                with both the sunvnet and ldmvsw drivers.
      Patch #3: Add the new ldmvsw.c driver code
      Patch #4: Checkpatch cleanup of the sunvnet/sunvnet_common code.
      
      NOTE - Patch#1 renames a file (sunvnet.h -> sunvnet_common.h). When generating
      the patches (using git format-patch), I had to use the --no-renames option
      otherwise patch#1 would NOT apply using 'patch -p1' - which as I
      understand is a requirement for patch acceptance. I wasn't sure if this
      is proper thing to do.  Please advise if not. Thanks.
      
      v2 changes:
        * change all EXPORT_SYMBOL declarations to EXPORT_SYMBOL_GPL
        * remove inline attribute for external function port_is_up_common()
        * Give all exported/global funcs in sunvnet_common.c a 'sunvnet_' prefix
          to avoid kernel global namespace pollution/collisions
        * ldmvsw.c: Order local variable declarations from longest to shortest line
        * ldmvsw.c: register the netdevice after all supporting state is ready/setup.
                    NOTE: The consensus at Oracle is that the following functions
                          must be done AFTER register_netdev() - this is the same
                          ordering currently used in the sunvnet driver:
                          1. sunvnet_port_add_txq_common() - needs registered netdev
                          2. napi_enable() - requires registered netdev
                          3. vio_port_up() - as soon as this function is called
                                             LDC handshake messages will come in
                                             which must be handled by the napi code.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      70063e94
    • Aaron Young's avatar
      ldmvsw: Checkpatch sunvnet.c and sunvnet_common.c · dc153f85
      Aaron Young authored
        Checkpatch updates for sunvnet.c and sunvnet_common.c.
      Signed-off-by: default avatarAaron Young <aaron.young@oracle.com>
      Signed-off-by: default avatarRashmi Narasimhan <rashmi.narasimhan@oracle.com>
      Reviewed-by: default avatarSowmini Varadhan <sowmini.varadhan@oracle.com>
      Reviewed-by: default avatarAlexandre Chartre <Alexandre.Chartre@oracle.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      dc153f85
    • Aaron Young's avatar
      ldmvsw: Add ldmvsw.c driver code · 5d01fa0c
      Aaron Young authored
        Add ldmvsw.c driver
      
        Details:
      
        The ldmvsw driver very closely follows the sunvnet.c code and makes
        use of the sunvnet_common.c code for core functionality.
      
        A significant difference between sunvnet and ldmvsw driver is
        sunvnet creates a network interface for each vnet-port *parent*
        node in the MD while the ldmvsw driver creates a network interface
        for every vsw-port node in the Machine Description (MD).
        Therefore the netdev_priv() for sunvnet is a vnet structure while
        the netdev_priv() for ldmvsw is a vnet_port structure.
      
        Vnet_port structures allocated by ldmvsw have the vsw bit set.
        When finding the net_device associated with a port, the common code keys
        off this bit to use either the net_device found in the vnet_port or the
        net_device in the vnet structure (see the VNET_PORT_TO_NET_DEVICE() macro in
        sunvnet_common.h). This scheme allows the common code to work with
        both drivers with minimal changes.
      
        Similar to Xen, network interfaces created by the ldmvsw driver will always
        have a HW Addr (i.e. mac address) of FE:FF:FF:FF:FF:FF and each will be
        assigned the devname "vif<cfg_handle>.<port_id>" - where <cfg_handle> and
        <port_id> are a unique handle/port pair assigned to the associated
        vsw-port node in the MD.
      Signed-off-by: default avatarAaron Young <aaron.young@oracle.com>
      Signed-off-by: default avatarRashmi Narasimhan <rashmi.narasimhan@oracle.com>
      Reviewed-by: default avatarSowmini Varadhan <sowmini.varadhan@oracle.com>
      Reviewed-by: default avatarAlexandre Chartre <Alexandre.Chartre@oracle.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5d01fa0c
    • Aaron Young's avatar
      ldmvsw: Make sunvnet_common compatible with ldmvsw · 67d0719f
      Aaron Young authored
        Modify sunvnet common code and data structures to be compatible
        with both sunvnet and ldmvsw drivers.
      
        Details:
      
        Sunvnet operates on "vnet-port" nodes which appear in the Machine
        Description (MD) in a guest domain. Ldmvsw operates on "vsw-port"
        nodes which appear in the MD of a service domain.
      
        A difference between the sunvnet driver and the ldmvsw driver is
        the sunvnet driver creates a network interface (i.e. a struct net_device)
        for every vnet-port *parent* "network" node. Several vnet-ports may appear
        under this common parent network node - each corresponding to a common parent
        network interface.  Conversely, since bridge/vswitch software will need
        to interface with every vsw-port in a system, the ldmvsw driver creates
        a network interface (i.e. a struct net_device) for every vsw-port - not
        every parent node as with sunvnet.  This difference required some special
        handling in the common code as explained below.
      
        There are 2 key data structures used by the sunvnet and ldmvsw drivers
        (which are now found in sunvnet_common.h):
      
        1. struct vnet_port
           This structure represents a vnet-port node in sunvnet and a vsw-port
           in the ldmvsw driver.
      
        2. struct vnet
           This structure represents a parent "network" node in sunvnet and a parent
           "virtual-network-switch" node in ldmvsw.
      
        Since the sunvnet driver allocates a net_device for every parent "network"
        node, a net_device member appears in the struct vnet. Since the ldmvsw
        driver allocates a net_device for every port, a net_device member was
        added to the vnet_port. The common code distinguishes which structure
        net_device member to use by checking a 'vsw' bit that was added to the
        vnet_port structure. See the VNET_PORT_TO_NET_DEVICE() marco in
        sunvnet_common.h.
      
        The netdev_priv() in sunvnet is allocated as a vnet. The netdev_priv()
        in ldmvsw is a vnet_port. Therefore, any place in the common code
        where a netdev_priv() call was made, a wrapper function was implemented
        in each driver to first get the vnet and/or vnet_port (in a driver
        specific way) and pass them as newly added parameters to the common
        functions (see wrapper funcs: vnet_set_rx_mode() and vnet_poll_controller()).
        Since these wrapper functions call __tx_port_find(), __tx_port_find() was
        moved from the common code back into sunvnet.c. Note - ldmvsw.c does not
        require this function.
      
        These changes also required that port_is_up() be made
        into a common function and thus it was given a _common suffix and
        exported like the other common functions.
      
        A wrapper function was also added for vnet_start_xmit_common() to pass a
        driver-specific function arg to return the port associated with a given
        struct sk_buff and struct net_device. This was required because
        vnet_start_xmit_common() grabs a lock prior to getting the associated
        port. Using a function pointer arg allowed the code to work unchanged
        without risking changes to the non-trivial locking logic in
        vnet_start_xmit_common().
      Signed-off-by: default avatarAaron Young <aaron.young@oracle.com>
      Signed-off-by: default avatarRashmi Narasimhan <rashmi.narasimhan@oracle.com>
      Reviewed-by: default avatarSowmini Varadhan <sowmini.varadhan@oracle.com>
      Reviewed-by: default avatarAlexandre Chartre <Alexandre.Chartre@oracle.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      67d0719f
    • Aaron Young's avatar
      ldmvsw: Split sunvnet driver into common code · 31762eaa
      Aaron Young authored
        Split sunvnet.c into sunvnet.c and sunvnet_common.c.
      
        Details:
      
        Since the sunvnet and ldmvsw drivers will both use common sunvnet code,
        move the functions (and support functions) anticipated to be common code
        from sunvnet.c to sunvnet_common.c. Similarly, sunvnet.h was renamed to
        sunvnet_common.h. The sunvnet_common.c code will be compiled into the
        kernel and act as a library of functions that are linked by either
        (or both) drivers when loaded.
      
        Function names for external functions in sunvnet_common.c (to be
        called by both the sunvnet and ldmvsw drivers) were tagged with a "_common"
        suffix to clearly designate them as common functions.
      
        No functional changes as of yet... just moved code verbatim to the new
        sunvnet_common.c/h files.
      
        Makefile/Kconfig support added to build sunvnet_common.c file. The code
        is included in the kernel if SUN_LDOMS is defined/selected.
      
        NOTE - per the SubmittingPatches documentation, since the code was just
        moved from one file another, the code was NOT checkpatch'd in this commit
        to aid in review.
      Signed-off-by: default avatarAaron Young <aaron.young@oracle.com>
      Signed-off-by: default avatarRashmi Narasimhan <rashmi.narasimhan@oracle.com>
      Reviewed-by: default avatarSowmini Varadhan <sowmini.varadhan@oracle.com>
      Reviewed-by: default avatarAlexandre Chartre <Alexandre.Chartre@oracle.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      31762eaa
    • Yuval Mintz's avatar
      bnx2x: Prevent false warning for lack of FC NPIV · 1e6bb1a3
      Yuval Mintz authored
      Not all adapters have FC-NPIV configured. If bnx2fc is used with such an
      adapter, driver would read irrelevant data from the the nvram and log
      "FC-NPIV table with bad length..." In system logs.
      
      Simply accept that reading '0' as the feature offset in nvram indicates
      the feature isn't there and return.
      Reported-by: default avatarAndrew Patterson <andrew.patterson@hpe.com>
      Signed-off-by: default avatarYuval Mintz <Yuval.Mintz@qlogic.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1e6bb1a3
    • Yoshihiro Kaneko's avatar
      ravb: fix result value overwrite · 38c848c7
      Yoshihiro Kaneko authored
      The result value is overwritten by a return value of
      ravb_ptp_interrupt().
      Signed-off-by: default avatarYoshihiro Kaneko <ykaneko0929@gmail.com>
      Acked-by: default avatarSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      38c848c7
    • Manish Chopra's avatar
      qlge: Fix receive packets drop. · 2c9a266a
      Manish Chopra authored
      When running small packets [length < 256 bytes] traffic, packets were
      being dropped due to invalid data in those packets which were
      delivered by the driver upto the stack. Using pci_dma_sync_single_for_cpu
      ensures copying latest and updated data into skb from the receive buffer.
      Signed-off-by: default avatarSony Chacko <sony.chacko@qlogic.com>
      Signed-off-by: default avatarManish Chopra <manish.chopra@qlogic.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2c9a266a
    • Phil Reid's avatar
      net: stmmac: Don't search for phys if mdio node is defined. · cc2fa619
      Phil Reid authored
      If a dt mdio entry has been added least assume that we wont
      search for phys attached. The DT and of_mdiobus_register already do
      this. This stops DSA phys being found and phys created for them, as
      this is handled by the DSA driver.
      Signed-off-by: default avatarPhil Reid <preid@electromag.com.au>
      Acked-by: default avatarGiuseppe Cavallaro <peppe.cavallaro@st.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cc2fa619
    • Dan Carpenter's avatar
      mediatek: unlock on error in mtk_tx_map() · 48e77422
      Dan Carpenter authored
      There was a missing unlock on the error path.
      
      Fixes: 656e7052 ('net-next: mediatek: add support for MT7623 ethernet')
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Acked-by: default avatarJohn Crispin <blogic@openwrt.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      48e77422
    • Dan Carpenter's avatar
      mediatek: checking for IS_ERR() instead of NULL · 977bc20c
      Dan Carpenter authored
      of_phy_connect() returns NULL on error, it never returns error pointers.
      
      Fixes: 656e7052 ('net-next: mediatek: add support for MT7623 ethernet')
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Acked-by: default avatarJohn Crispin <blogic@openwrt.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      977bc20c
    • Simon Horman's avatar
      openvswitch: allow output of MPLS packets on tunnel vports · fe3a5f6c
      Simon Horman authored
      Currently output of MPLS packets on tunnel vports is not allowed by Open
      vSwitch. This is because historically encapsulation was done in such a way
      that the inner_protocol field of the skb needed to hold the inner protocol
      for both MPLS and tunnel encapsulation in order for GSO segmentation to be
      performed correctly.
      
      Since b2acd1dc ("openvswitch: Use regular GRE net_device instead of
      vport") Open vSwitch makes use of lwt to output to tunnel netdevs which
      perform encapsulation. As no drivers expose support for MPLS offloads this
      means that GSO packets are segmented in software by validate_xmit_skb(),
      which is called from __dev_queue_xmit(), before tunnel encapsulation occurs.
      This means that the inner protocol of MPLS is no longer needed by the time
      encapsulation occurs and the contention on the inner_protocol field of the
      skb no longer occurs.
      
      Thus it is now safe to output MPLS to tunnel vports.
      Signed-off-by: default avatarSimon Horman <simon.horman@netronome.com>
      Reviewed-by: default avatarJesse Gross <jesse@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fe3a5f6c
    • David Daney's avatar
      netdev: Move octeon/octeon_mgmt driver to cavium directory. · d07a147f
      David Daney authored
      No code changes.  Since OCTEON is a Cavium product, move the driver to
      the vendor directory to unclutter things a bit.
      Signed-off-by: default avatarDavid Daney <david.daney@cavium.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d07a147f
    • Wu Fengguang's avatar
      e014e846
    • Wu Fengguang's avatar
      b73f96fc
    • Schemmel Hans-Christoph's avatar
      qmi_wwan: Added support for Gemalto's Cinterion PHxx WWAN interface · bd9e3350
      Schemmel Hans-Christoph authored
      Added support for Gemalto's Cinterion PHxx WWAN interfaces
      by adding QMI_FIXED_INTF with Cinterion's VID and PID.
      
      PHxx can have:
      2 RmNet Interfaces (PID 0x0082) or
      1 RmNet + 1 USB Audio interface (PID 0x0083).
      Signed-off-by: default avatarHans-Christoph Schemmel <hans-christoph.schemmel@gemalto.com>
      Acked-by: default avatarBjørn Mork <bjorn@mork.no>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bd9e3350
    • Eric Dumazet's avatar
      tcp/dccp: remove obsolete WARN_ON() in icmp handlers · e316ea62
      Eric Dumazet authored
      Now SYN_RECV request sockets are installed in ehash table, an ICMP
      handler can find a request socket while another cpu handles an incoming
      packet transforming this SYN_RECV request socket into an ESTABLISHED
      socket.
      
      We need to remove the now obsolete WARN_ON(req->sk), since req->sk
      is set when a new child is created and added into listener accept queue.
      
      If this race happens, the ICMP will do nothing special.
      
      Fixes: 079096f1 ("tcp/dccp: install syn_recv requests into ehash table")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Reported-by: default avatarBen Lazarus <blazarus@google.com>
      Reported-by: default avatarNeal Cardwell <ncardwell@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e316ea62
    • Eric Dumazet's avatar
      vlan: propagate gso_max_segs · f6773c5e
      Eric Dumazet authored
      vlan drivers lack proper propagation of gso_max_segs from
      lower device.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f6773c5e
  3. 16 Mar, 2016 4 commits