1. 27 8月, 2016 5 次提交
    • I
      mlxsw: spectrum: Mirror certain packets to CPU · 1c6c6d22
      Ido Schimmel 提交于
      Instead of trapping certain packets to the CPU and then relying on it to
      flood them we can instead make the device mirror them.
      
      The following packet types are mirrored:
      
      * DHCP: Broadcast packets that should be flooded by the device, but also
      trapped in case CPU is running the DHCP server.
      
      * IGMP query: Multicast packets that need to be forwarded to other
      bridge ports, but also trapped so that receiving netdev will be marked
      as a router port by the bridge driver.
      
      * ARP request: Broadcast packets that should be forwarded to other
      bridge ports, but also trapped in case requested IP is of the local
      machine.
      
      * ARP response: Unicast packets that should be forwarded by the bridge
      but also trapped in case response is directed at us.
      
      Set the trap action of such packets to mirror and mark them using
      'offload_fwd_mark' to prevent the bridge driver from forwarding them
      itself.
      
      Note that OSPF packets are also marked despite their action being trap.
      The reason for this is that the device traps such packets in the
      pipeline after they were already flooded.
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1c6c6d22
    • I
      mlxsw: spectrum: Allow different traps to have different actions · 63a81141
      Ido Schimmel 提交于
      Up until now we only trapped packets to CPU, but we are going to allow
      some packets to be mirrored (trap & forward) to CPU.
      
      Extend the Rx listener with 'action' member.
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      63a81141
    • I
      mlxsw: spectrum: Simplify traps definition · 93393b33
      Ido Schimmel 提交于
      Instead of copying & pasting the same struct initialization for every
      Rx listener, just use a macro.
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      93393b33
    • I
      bridge: switchdev: Add forward mark support for stacked devices · 6bc506b4
      Ido Schimmel 提交于
      switchdev_port_fwd_mark_set() is used to set the 'offload_fwd_mark' of
      port netdevs so that packets being flooded by the device won't be
      flooded twice.
      
      It works by assigning a unique identifier (the ifindex of the first
      bridge port) to bridge ports sharing the same parent ID. This prevents
      packets from being flooded twice by the same switch, but will flood
      packets through bridge ports belonging to a different switch.
      
      This method is problematic when stacked devices are taken into account,
      such as VLANs. In such cases, a physical port netdev can have upper
      devices being members in two different bridges, thus requiring two
      different 'offload_fwd_mark's to be configured on the port netdev, which
      is impossible.
      
      The main problem is that packet and netdev marking is performed at the
      physical netdev level, whereas flooding occurs between bridge ports,
      which are not necessarily port netdevs.
      
      Instead, packet and netdev marking should really be done in the bridge
      driver with the switch driver only telling it which packets it already
      forwarded. The bridge driver will mark such packets using the mark
      assigned to the ingress bridge port and will prevent the packet from
      being forwarded through any bridge port sharing the same mark (i.e.
      having the same parent ID).
      
      Remove the current switchdev 'offload_fwd_mark' implementation and
      instead implement the proposed method. In addition, make rocker - the
      sole user of the mark - use the proposed method.
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6bc506b4
    • X
      veth: sctp: add NETIF_F_SCTP_CRC to device features · c80fafbb
      Xin Long 提交于
      Commit b17c7069 ("loopback: sctp: add NETIF_F_SCTP_CSUM to device
      features") added NETIF_F_SCTP_CRC to device features for lo device to
      improve the performance of sctp over lo.
      
      This patch is to add NETIF_F_SCTP_CRC to device features for veth to
      improve the performance of sctp over veth.
      
      Before this patch:
        ip netns exec cs_client netperf -H 10.167.12.2 -t SCTP_STREAM -- -m 10K
        Recv   Send    Send
        Socket Socket  Message  Elapsed
        Size   Size    Size     Time     Throughput
        bytes  bytes   bytes    secs.    10^6bits/sec
      
        212992 212992  10240    10.00    1117.16
      
      After this patch:
        ip netns exec cs_client netperf -H 10.167.12.2 -t SCTP_STREAM -- -m 10K
        Recv   Send    Send
        Socket Socket  Message  Elapsed
        Size   Size    Size     Time     Throughput
        bytes  bytes   bytes    secs.    10^6bits/sec
      
        212992 212992  10240    10.20    1415.22
      Tested-by: NLi Shuang <tjlishuang@yeah.net>
      Signed-off-by: NXin Long <lucien.xin@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c80fafbb
  2. 26 8月, 2016 4 次提交
  3. 25 8月, 2016 9 次提交
  4. 24 8月, 2016 22 次提交