1. 15 5月, 2014 26 次提交
  2. 14 5月, 2014 14 次提交
    • S
      sh_eth: replace devm_kzalloc() with devm_kmalloc_array() · 86b5d251
      Sergei Shtylyov 提交于
      When I was converting the driver to the managed device API, only devm_kzalloc()
      was available for memory allocation, so I had to use it, despite zeroing out the
      PHY IRQ array right before initializing all  its entries to PHY_POLL was quite
      stupid.   Now that devm_kmalloc_array() has become available, we can avoid the
      needless zeroing out...
      Signed-off-by: NSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      86b5d251
    • D
      Merge branch 'tg3-next' · 1e1c77bf
      David S. Miller 提交于
      Michael Chan says:
      
      ====================
      tg3: TSO related enhancements to prevent memory allocation failure
      
      Michael Chan (3):
        tg3: Don't modify ip header fields when doing GSO
        tg3: Prevent page allocation failure during TSO workaround
        tg3: Update copyright and version to 3.137
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1e1c77bf
    • M
      tg3: Update copyright and version to 3.137 · de750e4c
      Michael Chan 提交于
      Signed-off-by: NMichael Chan <mchan@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      de750e4c
    • M
      tg3: Prevent page allocation failure during TSO workaround · d3f6f3a1
      Michael Chan 提交于
      If any TSO fragment hits hardware bug conditions (e.g. 4G boundary), the
      driver will workaround by calling skb_copy() to copy to a linear SKB.  Users
      have reported page allocation failures as the TSO packet can be up to 64K.
      Copying such a large packet is also very inefficient.  We fix this by using
      existing tg3_tso_bug() to transmit the packet using GSO.
      Signed-off-by: NPrashant Sreedharan <prashant@broadcom.com>
      Signed-off-by: NMichael Chan <mchan@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d3f6f3a1
    • M
      tg3: Don't modify ip header fields when doing GSO · d71c0dc4
      Michael Chan 提交于
      tg3 uses GSO as workaround if the hardware cannot perform TSO on certain
      packets.  We should not modify the ip header fields if we do GSO on the
      packet.  It happens to work by accident because GSO recalculates the IP
      checksum and IP total length.
      
      Also fix the tg3_start_xmit comment to reflect that this is the only
      xmit function for all devices.
      Signed-off-by: NPrashant Sreedharan <prashant@broadcom.com>
      Signed-off-by: NMichael Chan <mchan@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d71c0dc4
    • D
      Merge branch 'inet_fwmark_reflect' · b6bd26c4
      David S. Miller 提交于
      Lorenzo Colitti says:
      
      ====================
      Make mark-based routing work better with multiple separate networks.
      
      Mark-based routing (ip rule fwmark 17 lookup 100) combined with
      either iptables marking (iptables -j MARK --set-mark 17) or
      application-based marking (the SO_MARK setsockopt) are a good
      way to deal with connecting simultaneously to multiple networks.
      
      Each network can be given a routing table, and ip rules can
      be configured to make different fwmarks select different
      networks. Applications can select networks them by setting
      appropriate socket marks, and iptables rules can be used to
      handle non-aware applications, enforce policy, etc.
      
      This patch series improves functionality when mark-based routing
      is used in this way. Current behaviour has the following
      limitations:
      
      1. Kernel-originated replies that are not associated with a
         socket always use a mark of zero. This means that, for
         example, when the kernel sends a ping reply or a TCP reset,
         it does not send it on the network from which it received the
         original packet.
      2. Path MTU discovery, which is triggered by incoming packets,
         does not always work correctly, because the routing lookups it
         uses to clone routes do not take the fwmark into account and
         thus can happen in the wrong routing table.
      3. Application-based marking works well for outbound connections,
         but does not work well for incoming connections. Marking a
         listening socket causes that socket to only accept
         connections from a given network, and sockets that are
         returned by accept() are not marked (and are thus not routed
         correctly).
      
      sysctl. This causes route lookups for kernel-generated replies
      and PMTUD to use the fwmark of the packet that caused them.
      
      which causes TCP sockets returned by accept() to be marked with
      the same mark that sent the intial SYN packet.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b6bd26c4
    • L
      net: support marking accepting TCP sockets · 84f39b08
      Lorenzo Colitti 提交于
      When using mark-based routing, sockets returned from accept()
      may need to be marked differently depending on the incoming
      connection request.
      
      This is the case, for example, if different socket marks identify
      different networks: a listening socket may want to accept
      connections from all networks, but each connection should be
      marked with the network that the request came in on, so that
      subsequent packets are sent on the correct network.
      
      This patch adds a sysctl to mark TCP sockets based on the fwmark
      of the incoming SYN packet. If enabled, and an unmarked socket
      receives a SYN, then the SYN packet's fwmark is written to the
      connection's inet_request_sock, and later written back to the
      accepted socket when the connection is established.  If the
      socket already has a nonzero mark, then the behaviour is the same
      as it is today, i.e., the listening socket's fwmark is used.
      
      Black-box tested using user-mode linux:
      
      - IPv4/IPv6 SYN+ACK, FIN, etc. packets are routed based on the
        mark of the incoming SYN packet.
      - The socket returned by accept() is marked with the mark of the
        incoming SYN packet.
      - Tested with syncookies=1 and syncookies=2.
      Signed-off-by: NLorenzo Colitti <lorenzo@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      84f39b08
    • L
      net: Use fwmark reflection in PMTU discovery. · 1b3c61dc
      Lorenzo Colitti 提交于
      Currently, routing lookups used for Path PMTU Discovery in
      absence of a socket or on unmarked sockets use a mark of 0.
      This causes PMTUD not to work when using routing based on
      netfilter fwmark mangling and fwmark ip rules, such as:
      
        iptables -j MARK --set-mark 17
        ip rule add fwmark 17 lookup 100
      
      This patch causes these route lookups to use the fwmark from the
      received ICMP error when the fwmark_reflect sysctl is enabled.
      This allows the administrator to make PMTUD work by configuring
      appropriate fwmark rules to mark the inbound ICMP packets.
      
      Black-box tested using user-mode linux by pointing different
      fwmarks at routing tables egressing on different interfaces, and
      using iptables mangling to mark packets inbound on each interface
      with the interface's fwmark. ICMPv4 and ICMPv6 PMTU discovery
      work as expected when mark reflection is enabled and fail when
      it is disabled.
      Signed-off-by: NLorenzo Colitti <lorenzo@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1b3c61dc
    • L
      net: add a sysctl to reflect the fwmark on replies · e110861f
      Lorenzo Colitti 提交于
      Kernel-originated IP packets that have no user socket associated
      with them (e.g., ICMP errors and echo replies, TCP RSTs, etc.)
      are emitted with a mark of zero. Add a sysctl to make them have
      the same mark as the packet they are replying to.
      
      This allows an administrator that wishes to do so to use
      mark-based routing, firewalling, etc. for these replies by
      marking the original packets inbound.
      
      Tested using user-mode linux:
       - ICMP/ICMPv6 echo replies and errors.
       - TCP RST packets (IPv4 and IPv6).
      Signed-off-by: NLorenzo Colitti <lorenzo@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e110861f
    • D
      Merge branch 'arc_emac-next' · 87e067cd
      David S. Miller 提交于
      Beniamino Galvani says:
      
      ====================
      arc_emac: promiscuous/multicast mode and netpoll support
      
      These patches add support for promiscuous mode, multicast filtering
      and netpoll to the ARC EMAC driver.
      
      They were both tested on a Radxa Rock board which uses a ARC EMAC IP
      core integrated in the Rockchip RK3188 SoC.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      87e067cd
    • B
      arc_emac: add netpoll support · 5a45e57a
      Beniamino Galvani 提交于
      Signed-off-by: NBeniamino Galvani <b.galvani@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5a45e57a
    • B
      arc_emac: implement promiscuous mode and multicast filtering · 775dd682
      Beniamino Galvani 提交于
      This patch implements the set_rx_mode function to enable/disable
      promiscuous or all-multicast modes and to update the multicast
      filtering list of the device.
      Signed-off-by: NBeniamino Galvani <b.galvani@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      775dd682
    • D
      Merge branch 'tcp-fastopen-ipv6' · ae8b42c6
      David S. Miller 提交于
      Yuchung Cheng says:
      
      ====================
      tcp: IPv6 support for fastopen server
      
      This patch series add IPv6 support for fastopen server. To minimize
      code duplication in IPv4 and IPv6, the current v4 only code is
      refactored and common code is moved into net/ipv4/tcp_fastopen.c.
      
      Also the current code uses a different function from
      tcp_v4_send_synack() to send the first SYN-ACK in fastopen.
      The new code eliminates this separate function by refactoring the
      child-socket and syn-ack creation code.  After these refactoring
      in the first four patches, we can easily add the fastopen code in
      IPv6 by changing corresponding IPv6 functions.
      
      Note Fast Open client already supports IPv6. This patch is for
      the server-side (passive open) IPv6 support only.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ae8b42c6
    • D
      tcp: IPv6 support for fastopen server · 3a19ce0e
      Daniel Lee 提交于
      After all the preparatory works, supporting IPv6 in Fast Open is now easy.
      We pretty much just mirror v4 code. The only difference is how we
      generate the Fast Open cookie for IPv6 sockets. Since Fast Open cookie
      is 128 bits and we use AES 128, we use CBC-MAC to encrypt both the
      source and destination IPv6 addresses since the cookie is a MAC tag.
      Signed-off-by: NDaniel Lee <longinus00@gmail.com>
      Signed-off-by: NYuchung Cheng <ycheng@google.com>
      Signed-off-by: NJerry Chu <hkchu@google.com>
      Acked-by: NNeal Cardwell <ncardwell@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3a19ce0e