1. 18 Mar, 2016 19 commits
    • 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
  2. 16 Mar, 2016 19 commits
  3. 15 Mar, 2016 2 commits
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next · 1cdba550
      David S. Miller authored
      Pablo Neira Ayuso says:
      
      ====================
      Netfilter/IPVS/OVS updates for net-next
      
      The following patchset contains Netfilter/IPVS fixes and OVS NAT
      support, more specifically this batch is composed of:
      
      1) Fix a crash in ipset when performing a parallel flush/dump with
         set:list type, from Jozsef Kadlecsik.
      
      2) Make sure NFACCT_FILTER_* netlink attributes are in place before
         accessing them, from Phil Turnbull.
      
      3) Check return error code from ip_vs_fill_iph_skb_off() in IPVS SIP
         helper, from Arnd Bergmann.
      
      4) Add workaround to IPVS to reschedule existing connections to new
         destination server by dropping the packet and wait for retransmission
         of TCP syn packet, from Julian Anastasov.
      
      5) Allow connection rescheduling in IPVS when in CLOSE state, also
         from Julian.
      
      6) Fix wrong offset of SIP Call-ID in IPVS helper, from Marco Angaroni.
      
      7) Validate IPSET_ATTR_ETHER netlink attribute length, from Jozsef.
      
      8) Check match/targetinfo netlink attribute size in nft_compat,
         patch from Florian Westphal.
      
      9) Check for integer overflow on 32-bit systems in x_tables, from
         Florian Westphal.
      
      Several patches from Jarno Rajahalme to prepare the introduction of
      NAT support to OVS based on the Netfilter infrastructure:
      
      10) Schedule IP_CT_NEW_REPLY definition for removal in
          nf_conntrack_common.h.
      
      11) Simplify checksumming recalculation in nf_nat.
      
      12) Add comments to the openvswitch conntrack code, from Jarno.
      
      13) Update the CT state key only after successful nf_conntrack_in()
          invocation.
      
      14) Find existing conntrack entry after upcall.
      
      15) Handle NF_REPEAT case due to templates in nf_conntrack_in().
      
      16) Call the conntrack helper functions once the conntrack has been
          confirmed.
      
      17) And finally, add the NAT interface to OVS.
      
      The batch closes with:
      
      18) Cleanup to use spin_unlock_wait() instead of
          spin_lock()/spin_unlock(), from Nicholas Mc Guire.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1cdba550
    • Nicholas Mc Guire's avatar
      netfilter: nf_conntrack: consolidate lock/unlock into unlock_wait · e39365be
      Nicholas Mc Guire authored
      The spin_lock()/spin_unlock() is synchronizing on the
      nf_conntrack_locks_all_lock which is equivalent to
      spin_unlock_wait() but the later should be more efficient.
      Signed-off-by: default avatarNicholas Mc Guire <hofrat@osadl.org>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      e39365be