1. 03 Feb, 2017 39 commits
    • Zhu Yanjun's avatar
      bonding: Remove unnecessary returned value check · 3d67576d
      Zhu Yanjun authored
      The function bond_info_query alwarys returns 0. As such, in the function
      bond_do_ioctl, it is not necessary to check the returned value. So the
      interface type of the function bond_info_query is changed to void. The
      redundant check is removed.
      Signed-off-by: default avatarZhu Yanjun <yanjun.zhu@oracle.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3d67576d
    • Eric Dumazet's avatar
      tcp: clear pfmemalloc on outgoing skb · 38ab52e8
      Eric Dumazet authored
      Josef Bacik diagnosed following problem :
      
         I was seeing random disconnects while testing NBD over loopback.
         This turned out to be because NBD sets pfmemalloc on it's socket,
         however the receiving side is a user space application so does not
         have pfmemalloc set on its socket. This means that
         sk_filter_trim_cap will simply drop this packet, under the
         assumption that the other side will simply retransmit. Well we do
         retransmit, and then the packet is just dropped again for the same
         reason.
      
      It seems the better way to address this problem is to clear pfmemalloc
      in the TCP transmit path. pfmemalloc strict control really makes sense
      on the receive path.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Acked-by: default avatarJosef Bacik <jbacik@fb.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      38ab52e8
    • Eric Dumazet's avatar
      cxgb4: get rid of custom busy poll code · 5226b791
      Eric Dumazet authored
      In linux-4.5, busy polling was implemented in core
      NAPI stack, meaning that all custom implementation can
      be removed from drivers.
      
      Not only we remove lot of code, we also remove one spin_lock()
      from driver fast path.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Ganesh Goudar <ganeshgr@chelsio.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5226b791
    • Eric Dumazet's avatar
      myri10ge: get rid of custom busy poll code · 362108b5
      Eric Dumazet authored
      Compared to custom busy_poll, the generic NAPI one is simpler and
      removes a lot of code. It removes one atomic in the fast path (when
      busy poll is not in action) since we do not have to use an extra
      spinlock.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      362108b5
    • Eric Dumazet's avatar
      be2net: get rid of custom busy poll code · fb6113e6
      Eric Dumazet authored
      Compared to custom busy_poll, the generic NAPI one is better, since
      it allows to use GRO, and it removes a lot of code and extra locked
      operations in fast path.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Sathya Perla <sathya.perla@broadcom.com>
      Cc: Ajit Khaparde <ajit.khaparde@broadcom.com>
      Cc: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fb6113e6
    • David Ahern's avatar
      net: ipv6: Set protocol to kernel for local routes · 94b5e0f9
      David Ahern authored
      IPv6 stack does not set the protocol for local routes, so those routes show
      up with proto "none":
          $ ip -6 ro ls table local
          local ::1 dev lo proto none metric 0  pref medium
          local 2100:3:: dev lo proto none metric 0  pref medium
          local 2100:3::4 dev lo proto none metric 0  pref medium
          local fe80:: dev lo proto none metric 0  pref medium
          ...
      
      Set rt6i_protocol to RTPROT_KERNEL for consistency with IPv4. Now routes
      show up with proto "kernel":
          $ ip -6 ro ls table local
          local ::1 dev lo proto kernel metric 0  pref medium
          local 2100:3:: dev lo proto kernel metric 0  pref medium
          local 2100:3::4 dev lo proto kernel metric 0  pref medium
          local fe80:: dev lo proto kernel metric 0  pref medium
          ...
      Signed-off-by: default avatarDavid Ahern <dsa@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      94b5e0f9
    • Daniel Borkmann's avatar
      trace: rename trace_print_hex_seq arg and add kdoc · 3898fac1
      Daniel Borkmann authored
      Steven suggested to improve trace_print_hex_seq() a bit after commit
      2acae0d5 ("trace: add variant without spacing in trace_print_hex_seq")
      in two ways: i) by adding a kdoc comment for the helper function
      itself and ii) by renaming 'spacing' argument into 'concatenate'
      to better denote that we don't add spaces between each hex bytes.
      Suggested-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3898fac1
    • Jiri Pirko's avatar
      MAINTAINERS: add Ivan as a switchdev maintainer · f38c5ad7
      Jiri Pirko authored
      Ivan will be taking care of switchdev code from now on.
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Acked-by: default avatarIvan Vecera <ivecera@redhat.com>
      Acked-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f38c5ad7
    • David S. Miller's avatar
      Merge branch 'bridge-per-vlan-dst_metadata-support' · 3b19860c
      David S. Miller authored
      Roopa Prabhu says:
      
      ====================
      bridge: per vlan dst_metadata support
      
      High level summary:
      lwt and dst_metadata have enabled vxlan l3 deployments
      to use a single vxlan netdev for multiple vnis eliminating the scalability
      problem with using a single vxlan netdev per vni. This series tries to
      do the same for vxlan netdevs in pure l2 bridged networks.
      Use-case/deployment and details are below.
      
      Deployment scerario details:
      As we know VXLAN is used to build layer 2 virtual networks across the
      underlay layer3 infrastructure. A VXLAN tunnel endpoint (VTEP)
      originates and terminates VXLAN tunnels. And a VTEP can be a TOR switch
      or a vswitch in the hypervisor. This patch series mainly
      focuses on the TOR switch configured as a Vtep. Vxlan segment ID (vni)
      along with vlan id is used to identify layer 2 segments in a vxlan
      overlay network. Vxlan bridging is the function provided by Vteps to terminate
      vxlan tunnels and map the vxlan vni to traditional end host vlan. This is
      covered in the "VXLAN Deployment Scenarios" in sections 6 and 6.1 in RFC 7348.
      To provide vxlan bridging function, a vtep has to map vlan to a vni. The rfc
      says that the ingress VTEP device shall remove the IEEE 802.1Q VLAN tag in
      the original Layer 2 packet if there is one before encapsulating the packet
      into the VXLAN format to transmit it through the underlay network. The remote
      VTEP devices have information about the VLAN in which the packet will be
      placed based on their own VLAN-to-VXLAN VNI mapping configurations.
      
      Existing solution:
      Without this patch series one can deploy such a vtep configuration by
      adding the local ports and vxlan netdevs into a vlan filtering bridge.
      The local ports are configured as trunk ports carrying all vlans.
      A vxlan netdev per vni is added to the bridge. Vlan mapping to vni is
      achieved by configuring the vlan as pvid on the corresponding vxlan netdev.
      The vxlan netdev only receives traffic corresponding to the vlan it is mapped
      to. This configuration maps traffic belonging to a vlan to the corresponding
      vxlan segment.
      
                -----------------------------------
               |              bridge               |
               |                                   |
                -----------------------------------
                  |100,200       |100 (pvid)    |200 (pvid)
                  |              |              |
                 swp1          vxlan1000      vxlan2000
      
      This provides the required vxlan bridging function but poses a
      scalability problem with using a separate vxlan netdev for each vni.
      
      Solution in this patch series:
      The Goal is to use a single vxlan device to carry all vnis similar
      to the vxlan collect metadata mode but additionally allowing the bridge
      and vxlan driver to carry all the forwarding information and also learn.
      This implementation uses the existing dst_metadata infrastructure to map
      vlan to a tunnel id.
      - vxlan driver changes:
          - enable collect metadata mode to be used with learning,
            replication and fdb
          - A single fdb table hashed by (mac, vni)
          - rx path already has the vni
          - tx path expects a vni in the packet with dst_metadata and relies
            on learnt or static forwarding information table to forward the packet
      
      - Bridge driver changes: per vlan dst_metadata support:
          - Our use case is vxlan and 1-1 mapping between vlan and vni, but I have
            kept the api generic for any tunnel info
          - Uapi to configure/unconfigure/dump per vlan tunnel data
          - new bridge port flag to turn this feature on/off. off by default
          - ingress hook:
              - if port is a tunnel port, use tunnel info in
                attached dst_metadata to map it to a local vlan
          - egress hook:
              - if port is a tunnel port, use tunnel info attached to vlan
                to set dst_metadata on the skb
      
      Other approaches tried and vetoed:
      - tc vlan push/pop and tunnel metadata dst:
          - though tc can be used to do part of this, these patches address a deployment
            case where bridge driver vlan filtering and forwarding information
            database along with vxlan driver forwarding information table and learning
            are required.
      - making vxlan driver understand vlan-vni mapping:
          - I had a series almost ready with this one but soon realized
            it duplicated a lot of vlan handling code in the vxlan driver
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3b19860c
    • Roopa Prabhu's avatar
      bridge: vlan dst_metadata hooks in ingress and egress paths · 11538d03
      Roopa Prabhu authored
      - ingress hook:
          - if port is a tunnel port, use tunnel info in
            attached dst_metadata to map it to a local vlan
      - egress hook:
          - if port is a tunnel port, use tunnel info attached to
            vlan to set dst_metadata on the skb
      
      CC: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: default avatarRoopa Prabhu <roopa@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      11538d03
    • Roopa Prabhu's avatar
      bridge: per vlan dst_metadata netlink support · efa5356b
      Roopa Prabhu authored
      This patch adds support to attach per vlan tunnel info dst
      metadata. This enables bridge driver to map vlan to tunnel_info
      at ingress and egress. It uses the kernel dst_metadata infrastructure.
      
      The initial use case is vlan to vni bridging, but the api is generic
      to extend to any tunnel_info in the future:
          - Uapi to configure/unconfigure/dump per vlan tunnel data
          - netlink functions to configure vlan and tunnel_info mapping
          - Introduces bridge port flag BR_LWT_VLAN to enable attach/detach
          dst_metadata to bridged packets on ports. off by default.
          - changes to existing code is mainly refactor some existing vlan
          handling netlink code + hooks for new vlan tunnel code
          - I have kept the vlan tunnel code isolated in separate files.
          - most of the netlink vlan tunnel code is handling of vlan-tunid
          ranges (follows the vlan range handling code). To conserve space
          vlan-tunid by default are always dumped in ranges if applicable.
      
      Use case:
      example use for this is a vxlan bridging gateway or vtep
      which maps vlans to vn-segments (or vnis).
      
      iproute2 example (patched and pruned iproute2 output to just show
      relevant fdb entries):
      example shows same host mac learnt on two vni's and
      vlan 100 maps to vni 1000, vlan 101 maps to vni 1001
      
      before (netdev per vni):
      $bridge fdb show | grep "00:02:00:00:00:03"
      00:02:00:00:00:03 dev vxlan1001 vlan 101 master bridge
      00:02:00:00:00:03 dev vxlan1001 dst 12.0.0.8 self
      00:02:00:00:00:03 dev vxlan1000 vlan 100 master bridge
      00:02:00:00:00:03 dev vxlan1000 dst 12.0.0.8 self
      
      after this patch with collect metdata in bridged mode (single netdev):
      $bridge fdb show | grep "00:02:00:00:00:03"
      00:02:00:00:00:03 dev vxlan0 vlan 101 master bridge
      00:02:00:00:00:03 dev vxlan0 src_vni 1001 dst 12.0.0.8 self
      00:02:00:00:00:03 dev vxlan0 vlan 100 master bridge
      00:02:00:00:00:03 dev vxlan0 src_vni 1000 dst 12.0.0.8 self
      
      CC: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: default avatarRoopa Prabhu <roopa@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      efa5356b
    • Roopa Prabhu's avatar
      bridge: uapi: add per vlan tunnel info · b3c7ef0a
      Roopa Prabhu authored
      New nested netlink attribute to associate tunnel info per vlan.
      This is used by bridge driver to send tunnel metadata to
      bridge ports in vlan tunnel mode. This patch also adds new per
      port flag IFLA_BRPORT_VLAN_TUNNEL to enable vlan tunnel mode.
      off by default.
      
      One example use for this is a vxlan bridging gateway or vtep
      which maps vlans to vn-segments (or vnis). User can configure
      per-vlan tunnel information which the bridge driver can use
      to bridge vlan into the corresponding vn-segment.
      Signed-off-by: default avatarRoopa Prabhu <roopa@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b3c7ef0a
    • Roopa Prabhu's avatar
      vxlan: support fdb and learning in COLLECT_METADATA mode · 3ad7a4b1
      Roopa Prabhu authored
      Vxlan COLLECT_METADATA mode today solves the per-vni netdev
      scalability problem in l3 networks. It expects all forwarding
      information to be present in dst_metadata. This patch series
      enhances collect metadata mode to include the case where only
      vni is present in dst_metadata, and the vxlan driver can then use
      the rest of the forwarding information datbase to make forwarding
      decisions. There is no change to default COLLECT_METADATA
      behaviour. These changes only apply to COLLECT_METADATA when
      used with the bridging use-case with a special dst_metadata
      tunnel info flag (eg: where vxlan device is part of a bridge).
      For all this to work, the vxlan driver will need to now support a
      single fdb table hashed by mac + vni. This series essentially makes
      this happen.
      
      use-case and workflow:
      vxlan collect metadata device participates in bridging vlan
      to vn-segments. Bridge driver above the vxlan device,
      sends the vni corresponding to the vlan in the dst_metadata.
      vxlan driver will lookup forwarding database with (mac + vni)
      for the required remote destination information to forward the
      packet.
      
      Changes introduced by this patch:
          - allow learning and forwarding database state in vxlan netdev in
            COLLECT_METADATA mode. Current behaviour is not changed
            by default. tunnel info flag IP_TUNNEL_INFO_BRIDGE is used
            to support the new bridge friendly mode.
          - A single fdb table hashed by (mac, vni) to allow fdb entries with
            multiple vnis in the same fdb table
          - rx path already has the vni
          - tx path expects a vni in the packet with dst_metadata
          - prior to this series, fdb remote_dsts carried remote vni and
            the vxlan device carrying the fdb table represented the
            source vni. With the vxlan device now representing multiple vnis,
            this patch adds a src vni attribute to the fdb entry. The remote
            vni already uses NDA_VNI attribute. This patch introduces
            NDA_SRC_VNI netlink attribute to represent the src vni in a multi
            vni fdb table.
      
      iproute2 example (patched and pruned iproute2 output to just show
      relevant fdb entries):
      example shows same host mac learnt on two vni's.
      
      before (netdev per vni):
      $bridge fdb show | grep "00:02:00:00:00:03"
      00:02:00:00:00:03 dev vxlan1001 dst 12.0.0.8 self
      00:02:00:00:00:03 dev vxlan1000 dst 12.0.0.8 self
      
      after this patch with collect metadata in bridged mode (single netdev):
      $bridge fdb show | grep "00:02:00:00:00:03"
      00:02:00:00:00:03 dev vxlan0 src_vni 1001 dst 12.0.0.8 self
      00:02:00:00:00:03 dev vxlan0 src_vni 1000 dst 12.0.0.8 self
      Signed-off-by: default avatarRoopa Prabhu <roopa@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3ad7a4b1
    • Roopa Prabhu's avatar
      ip_tunnels: new IP_TUNNEL_INFO_BRIDGE flag for ip_tunnel_info mode · f35581d6
      Roopa Prabhu authored
      New ip_tunnel_info flag to represent bridged tunnel metadata.
      Used by bridge driver later in the series to pass per vlan dst
      metadata to bridge ports.
      Signed-off-by: default avatarRoopa Prabhu <roopa@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f35581d6
    • David S. Miller's avatar
      Merge branch 'ife-to-module' · 5a0fd98b
      David S. Miller authored
      Yotam Gigi says:
      
      ====================
      Extract IFE logic to module
      
      Extract ife logic from the tc_ife action into an independent module, and
      make the tc_ife action use it. This way, the ife encapsulation can be used
      by other modules other than tc_ife action.
      
      v1->v2:
      Fix duplicate symbol error by introducing a new patch that makes the
      original symbol static.
      
      The symbol ife_tlv_meta_extract is exported in act_ife, though not being
      used by any other module. As the symbol is being moved to the new ife
      module, introducing the new module creates duplicate symbol. To fix it,
      add a new patch (1/3) that makes the ife_tlv_meta_extract symbol static in
      act_ife, thus the symbol does not collide.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5a0fd98b
    • Yotam Gigi's avatar
      net/sched: act_ife: Change to use ife module · 295a6e06
      Yotam Gigi authored
      Use the encode/decode functionality from the ife module instead of using
      implementation inside the act_ife.
      Reviewed-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarYotam Gigi <yotamg@mellanox.com>
      Signed-off-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
      Signed-off-by: default avatarRoman Mashak <mrv@mojatatu.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      295a6e06
    • Yotam Gigi's avatar
      net: Introduce ife encapsulation module · 1ce84604
      Yotam Gigi authored
      This module is responsible for the ife encapsulation protocol
      encode/decode logics. That module can:
       - ife_encode: encode skb and reserve space for the ife meta header
       - ife_decode: decode skb and extract the meta header size
       - ife_tlv_meta_encode - encodes one tlv entry into the reserved ife
         header space.
       - ife_tlv_meta_decode - decodes one tlv entry from the packet
       - ife_tlv_meta_next - advance to the next tlv
      Reviewed-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarYotam Gigi <yotamg@mellanox.com>
      Signed-off-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
      Signed-off-by: default avatarRoman Mashak <mrv@mojatatu.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1ce84604
    • Yotam Gigi's avatar
      net/sched: act_ife: Unexport ife_tlv_meta_encode · 1d5e7c85
      Yotam Gigi authored
      As the function ife_tlv_meta_encode is not used by any other module,
      unexport it and make it static for the act_ife module.
      Signed-off-by: default avatarYotam Gigi <yotamg@mellanox.com>
      Signed-off-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
      Signed-off-by: default avatarRoman Mashak <mrv@mojatatu.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1d5e7c85
    • Eric Dumazet's avatar
      tcp: add tcp_mss_clamp() helper · 3541f9e8
      Eric Dumazet authored
      Small cleanup factorizing code doing the TCP_MAXSEG clamping.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3541f9e8
    • Arnd Bergmann's avatar
      hns_enet: use cpumask_var_t for on-stack mask · ff3edc9b
      Arnd Bergmann authored
      On large SMP builds, we can run into a build warning:
      
      drivers/net/ethernet/hisilicon/hns/hns_enet.c: In function 'hns_set_irq_affinity.isra.27':
      drivers/net/ethernet/hisilicon/hns/hns_enet.c:1242:1: warning: the frame size of 1032 bytes is larger than 1024 bytes [-Wframe-larger-than=]
      
      The solution here is to use cpumask_var_t, which can use dynamic
      allocation when CONFIG_CPUMASK_OFFSTACK is enabled.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ff3edc9b
    • Eric Dumazet's avatar
      virtio_net: remove custom busy_poll · ceef438d
      Eric Dumazet authored
      Generic NAPI busy polling allows us to remove custom implementations
      found in drivers.
      
      It is possible further optimization could be done by testing
      napi_complete_done() return value.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Acked-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ceef438d
    • Eric Dumazet's avatar
      atl1e: add GRO support · c45f8e10
      Eric Dumazet authored
      It is time to add GRO support to this driver.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c45f8e10
    • Arjun V's avatar
      cxgb4: Fix uld_send() for ctrl pkts · 0d4b729d
      Arjun V authored
      Without any uld being loaded, uld_txq_info[] will be NULL. uld_send()
      is also used for sending control work requests(for eg: setting filter)
      that dont require any ulds to be loaded. Hence move uld_txq_info[]
      assignment after ctrl_xmit().
      
      Also added a NULL check for uld_txq_info[].
      
      Fixes: 94cdb8bb (cxgb4: Add support for dynamic allocation
             of resources for ULD).
      Signed-off-by: default avatarArjun V <arjun@chelsio.com>
      Signed-off-by: default avatarCasey Leedom <leedom@chelsio.com>
      Signed-off-by: default avatarGanesh Goudar <ganeshgr@chelsio.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0d4b729d
    • Eric Dumazet's avatar
      sfc-falcon: get rid of custom busy polling code · 86bc8b31
      Eric Dumazet authored
      In linux-4.5, busy polling was implemented in core
      NAPI stack, meaning that all custom implementation can
      be removed from drivers.
      
      Not only we remove lot's of tricky code, we also remove
      one lock operation in fast path.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Edward Cree <ecree@solarflare.com>
      Cc: Bert Kenward <bkenward@solarflare.com>
      Acked-by: default avatarBert Kenward <bkenward@solarflare.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      86bc8b31
    • Eric Dumazet's avatar
      sfc: get rid of custom busy polling code · e7fe9491
      Eric Dumazet authored
      In linux-4.5, busy polling was implemented in core
      NAPI stack, meaning that all custom implementation can
      be removed from drivers.
      
      Not only we remove lot's of tricky code, we also remove
      one lock operation in fast path.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Edward Cree <ecree@solarflare.com>
      Cc: Bert Kenward <bkenward@solarflare.com>
      Acked-by: default avatarBert Kenward <bkenward@solarflare.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e7fe9491
    • Eric Dumazet's avatar
      net: add LINUX_MIB_PFMEMALLOCDROP counter · 8fe809a9
      Eric Dumazet authored
      Debugging issues caused by pfmemalloc is often tedious.
      
      Add a new SNMP counter to more easily diagnose these problems.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Josef Bacik <jbacik@fb.com>
      Acked-by: default avatarJosef Bacik <jbacik@fb.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8fe809a9
    • David Ahern's avatar
      net: ipv4: remove fib_lookup.h from devinet.c include list · 66109109
      David Ahern authored
      nothing in devinet.c relies on fib_lookup.h; remove it from the includes
      Signed-off-by: default avatarDavid Ahern <dsa@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      66109109
    • Eric Dumazet's avatar
      net: remove useless pfmemalloc setting · b9ea2a7b
      Eric Dumazet authored
      When __alloc_skb() allocates an skb from fast clone cache,
      setting pfmemalloc on the clone is not needed.
      
      Clone will be properly initialized later at skb_clone() time,
      including pfmemalloc field, as it is included in the
      headers_start/headers_end section which is fully copied.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b9ea2a7b
    • David S. Miller's avatar
      Merge branch 'MV88E6390-fixes' · bdcfa156
      David S. Miller authored
      Andrew Lunn says:
      
      ====================
      MV88E6390 fixes
      
      Two patches, which have been posted before. Fix simple issues in the
      mv88e6390 support. These don't need to go to stable, since the
      mv88e6390 support in stable is insufficient to be usable.
      
      To apply cleanly, these patches rely on "net: dsa: mv88e6xxx:
      Workaround missing PHY".
      
      v2: Added Reviewed-by.
          Removed a redundant "the"
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bdcfa156
    • Andrew Lunn's avatar
      net: dsa: mv88e6xxx: Fix typ0 when configuring 2.5Gbps · 740117a8
      Andrew Lunn authored
      In order to enable 2.5Gbps mode, we need the base speed of 10G, plus
      the Alt bit setting. Fix a typ0 that used 1Gb base speed.
      Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Reviewed-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      740117a8
    • Andrew Lunn's avatar
      net: dsa: mv88e6xxx: Fix ATU age timer for MV88E6390 · b91e055c
      Andrew Lunn authored
      The MV88E6390 family uses a different ATU age timer coefficient.
      Fix the info structures.
      Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Reviewed-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b91e055c
    • Andrew Lunn's avatar
      net: phy: marvell: Add support for 88e1545 PHY · 60f06fde
      Andrew Lunn authored
      The 88e1545 PHYs are discrete Marvell PHYs, found in a quad package on
      the zii-devel-b board. Add support for it to the Marvell PHY driver.
      Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      60f06fde
    • Heiner Kallweit's avatar
      net: stmmac: Fix wrong message in stmmac_probe_config_dt · fd3984e6
      Heiner Kallweit authored
      Most likely a copy & paste error in referenced commit.
      Restore the debug message to what it was before.
      
      Fixes: f573c0b9 ("stmmac: move stmmac_clk, pclk, clk_ptp_ref and stmmac_rst to platform structure")
      Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Acked-By: default avatarJoao Pinto <jpinto@synopsys.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fd3984e6
    • Heiner Kallweit's avatar
      net: stmmac: add separate warning for PTP not being supported by HW · 722eef28
      Heiner Kallweit authored
      Chips like Amlogic S905GXBB are supported by this driver but don't
      have support for PTP. Add a separate warning for missing HW support
      to differentiate it from other actual failures.
      Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      722eef28
    • Heiner Kallweit's avatar
      net: stmmac: don't set tx delay in RGMII_ID and RGMII_TXID mode · d6db61a4
      Heiner Kallweit authored
      As documented in Documentation/devicetree/bindings/net/ethernet.txt,
      in RGMII_ID and RGMII_TXID mode the MAC should not add a tx delay.
      Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d6db61a4
    • Andrey Vagin's avatar
      unix: add ioctl to open a unix socket file with O_PATH · ba94f308
      Andrey Vagin authored
      This ioctl opens a file to which a socket is bound and
      returns a file descriptor. The caller has to have CAP_NET_ADMIN
      in the socket network namespace.
      
      Currently it is impossible to get a path and a mount point
      for a socket file. socket_diag reports address, device ID and inode
      number for unix sockets. An address can contain a relative path or
      a file may be moved somewhere. And these properties say nothing about
      a mount namespace and a mount point of a socket file.
      
      With the introduced ioctl, we can get a path by reading
      /proc/self/fd/X and get mnt_id from /proc/self/fdinfo/X.
      
      In CRIU we are going to use this ioctl to dump and restore unix socket.
      
      Here is an example how it can be used:
      
      $ strace -e socket,bind,ioctl ./test /tmp/test_sock
      socket(AF_UNIX, SOCK_STREAM, 0)         = 3
      bind(3, {sa_family=AF_UNIX, sun_path="test_sock"}, 11) = 0
      ioctl(3, SIOCUNIXFILE, 0)           = 4
      ^Z
      
      $ ss -a | grep test_sock
      u_str  LISTEN     0      1      test_sock 17798                 * 0
      
      $ ls -l /proc/760/fd/{3,4}
      lrwx------ 1 root root 64 Feb  1 09:41 3 -> 'socket:[17798]'
      l--------- 1 root root 64 Feb  1 09:41 4 -> /tmp/test_sock
      
      $ cat /proc/760/fdinfo/4
      pos:	0
      flags:	012000000
      mnt_id:	40
      
      $ cat /proc/self/mountinfo | grep "^40\s"
      40 19 0:37 / /tmp rw shared:23 - tmpfs tmpfs rw
      Signed-off-by: default avatarAndrei Vagin <avagin@openvz.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ba94f308
    • David S. Miller's avatar
      Merge branch 'mv88e6390-missing-phy-ID' · 2a7b6216
      David S. Miller authored
      Andrew Lunn says:
      
      ====================
      Work around missing PHY prodcut ID in mv88e6390
      
      The internal PHYs of the MV88E6390 have a Marvell OUI, but the product
      ID is zero. Work around this by trapping reads to the ID, and if it is
      zero, return the MV88E6390 family ID.
      
      v2: Move the workaround into the central mdio read function.
          Enable the temperature sensor, even though it does not work on the 6390,
          but it does on the 6341, which has the same ID problem.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2a7b6216
    • Andrew Lunn's avatar
      net: phy: Marvell: Add mv88e6390 internal PHY · e4cf8a38
      Andrew Lunn authored
      The mv88e6390 Ethernet switch has internal PHYs. These PHYs don't have
      an model ID in the ID2 register. So the MDIO driver in the switch
      intercepts reads to this register, and returns the switch family ID.
      Extend the Marvell PHY driver by including this ID, and treat the PHY
      as a 88E1540.
      Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e4cf8a38
    • Andrew Lunn's avatar
      net: dsa: mv88e6xxx: Workaround missing PHY ID on mv88e6390 · da9f3301
      Andrew Lunn authored
      The internal PHYs of the mv88e6390 do not have a model ID. Trap any
      calls to the ID register, and if it is zero, return the ID for the
      mv88e6390. The Marvell PHY driver can then bind to this ID.
      Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Reviewed-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      da9f3301
  2. 02 Feb, 2017 1 commit
    • Arnd Bergmann's avatar
      xgene_enet: remove bogus forward declarations · 1f3d6209
      Arnd Bergmann authored
      The device match tables for both the xgene_enet driver and its phy driver
      have forward declarations that declare an array without a length, leading
      to a clang warning when they are not followed by an actual defitinition:
      
      drivers/net/ethernet/apm/xgene/../../../phy/mdio-xgene.h:135:34: warning: tentative array definition assumed to have one element
      drivers/net/ethernet/apm/xgene/xgene_enet_main.c:33:36: warning: tentative array definition assumed to have one element
      
      The declarations for the mdio driver are even in a header file, so they
      cause duplicate definitions of the tables for each file that includes
      them.
      
      This removes all four forward declarations and moves the actual
      definitions up a little, so they are in front of their first user. For
      the OF match tables, this means having to remove the #ifdef around them,
      and passing the actual structure into of_match_device(). This has no
      effect on the generated object code though, as the of_match_device
      function has an empty stub that does not evaluate its argument, and
      the symbol gets dropped either way.
      
      Fixes: 43b3cf66 ("drivers: net: phy: xgene: Add MDIO driver")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1f3d6209