1. 14 Mar, 2016 2 commits
  2. 13 Mar, 2016 6 commits
  3. 11 Mar, 2016 17 commits
  4. 10 Mar, 2016 15 commits
    • David S. Miller's avatar
      Merge branch 'flower-offload' · e8ab563f
      David S. Miller authored
      Amir Vadai says:
      
      ====================
      cls_flower hardware offload support
      
      Please see changes from V2 at the bottom.
      
      This patchset introduces cls_flower hardware offload support over ConnectX-4
      driver, more hardware vendors are welcome to use it too.
      
      This patchset is based on John's infrastructure for tc offloading [2] to add
      hardware offload support to the flower filter. It also extends the support to
      an additional tc action - skbedit mark operation.
      NIC driver that was used is ConnectX-4. Feature is off by default and could be
      turned on using ethtool.
      
      Some commands to use this code:
      
      export TC=../iproute2/tc/tc
      export ETH=ens9
      
      ethtool  -K ens9 hw-tc-offload on
      
      $TC qdisc add dev $ETH ingress
      
      $TC filter add dev $ETH protocol ip prio 20 parent ffff: \
      	flower ip_proto 1 \
      	dst_mac 7c:fe:90:69:81:62 \
      	src_mac 7c:fe:90:69:81:56 \
      	dst_ip 11.11.11.11 \
      	src_ip 11.11.11.12 \
      	indev $ETH \
      	action drop
      
      $TC filter add dev $ETH protocol ip prio 30 parent ffff: \
      	flower ip_proto 6 \
      	indev $ETH \
      	action skbedit mark 0x1234
      
      $TC filter add dev $ETH protocol ip prio 10 parent ffff: \
      	handle 0x1234 fw action pass
      
      The code was tested and applied on top of commit 3ebeac1d ("Merge branch
      'cxgb4-next'")
      
      Changes from V2:
      - patch 1/10 ("net/flower: Introduce hardware offload support")
        - Remove unused variable [Dave]
        - Don't fail command when HW can't offload filter [John]
      - patch 3/10 ("net/sched: Macro instead of CONFIG_NET_CLS_ACT ifdef")
        - Mention in changelog that struct tc_action is now exposed out of the ifdef.
      - patch 4/10 ("net/act_skbedit: Utility functions for mark action")
        - Document clearly that is_tcf_skbedit_mark() is returning true if and only
          if the only action is mark [Dave]
      - patch 8/10 ("net/mlx5e: Introduce tc offload support")
        - make mlx5e_tc_add_flow() static
      
      Changes from V1:
      - patch 3/10 ("net/sched: Macro instead of CONFIG_NET_CLS_ACT ifdef")
        - fixed return value of tc_no_actions
      
      Changes from V0:
      - Use tc_no_actions and tc_for_each_action instead of ifdef CONFIG_NET_CLS_ACT
      - Replace ENOTSUPP (and some EINVAL) with EOPNOTSUPP
      - Name the flower command enum
      - fl_hw_destroy_filter() to return void - nobody uses the return value
      - mlx5e_tc_init() and mlx5e_tc_cleanup() to be called from the right places.
      - When adding HW rule fails - fail the command
      - Rules are added to be processed both by HW and SW unless SKIP_HW is given
      - Adding patch 6/10 ("net/mlx5e: Relax ndo_setup_tc handle restriction")
      
      Main changes from the RFC [1]:
      - API
        - Using ndo_setup_tc() instead of switchdev
      - act_skbedit, act_gact
        - Actions are not serialized to NIC driver, instead using access functions.
      - cls_flower
        - prevent double classification by software by not adding
          successfuly offloaded filters to the hashtable
        - Fixed some bugs in original RFC with rule delete
      - mlx5
        - Adding flow table to kernel namespace instead of a new namespace
        - s/offload/tc/ in many places
        - no need for a special kconfig since switchdev is not used
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e8ab563f
    • Amir Vadai's avatar
      net/mlx5e: Support offload cls_flower with skbedit mark action · 12185a9f
      Amir Vadai authored
      Introduce offloading of skbedit mark action.
      
      For example, to mark with 0x1234, all TCP (ip_proto 6) packets arriving
      to interface ens9:
      
       # tc qdisc add dev ens9 ingress
       # tc filter add dev ens9 protocol ip parent ffff: \
           flower ip_proto 6 \
           indev ens9 \
           action skbedit mark 0x1234
      Signed-off-by: default avatarAmir Vadai <amir@vadai.me>
      Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      12185a9f
    • Amir Vadai's avatar
      net/mlx5e: Support offload cls_flower with drop action · e3a2b7ed
      Amir Vadai authored
      Parse tc_cls_flower_offload into device specific commands and program
      the hardware to classify and act accordingly.
      
      For example, to drop ICMP (ip_proto 1) packets from specific smac, dmac,
      src_ip, src_ip, arriving to interface ens9:
      
       # tc qdisc add dev ens9 ingress
      
       # tc filter add dev ens9 protocol ip parent ffff: \
           flower ip_proto 1 \
           dst_mac 7c:fe:90:69:81:62 src_mac 7c:fe:90:69:81:56 \
           dst_ip 11.11.11.11 src_ip 11.11.11.12 indev ens9 \
           action drop
      Signed-off-by: default avatarAmir Vadai <amir@vadai.me>
      Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e3a2b7ed
    • Amir Vadai's avatar
      net/mlx5e: Introduce tc offload support · e8f887ac
      Amir Vadai authored
      Extend ndo_setup_tc() to support ingress tc offloading. Will be used by
      later patches to offload tc flower filter.
      
      Feature is off by default and could be enabled by issuing:
       # ethtool  -K eth0 hw-tc-offload on
      
      Offloads flow table is dynamically created when first filter is
      added.
      Rules are saved in a hash table that is maintained by the consumer (for
      example - the flower offload in the next patch).
      When last filter is removed and no filters exist in the hash table, the
      offload flow table is destroyed.
      Signed-off-by: default avatarAmir Vadai <amir@vadai.me>
      Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e8f887ac
    • Amir Vadai's avatar
      net/mlx5e: Add a new priority for kernel flow tables · b6172aac
      Amir Vadai authored
      Move the vlan and main flow tables to use priority 1. This will allow
      the upcoming TC offload logic to use a higher priority (0) for the
      offload steering table.
      Signed-off-by: default avatarAmir Vadai <amir@vadai.me>
      Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b6172aac
    • Amir Vadai's avatar
      net/mlx5e: Relax ndo_setup_tc handle restriction · 67ba422e
      Amir Vadai authored
      Restricting handle to TC_H_ROOT breaks the old instantiation of mqprio
      to setup a hardware qdisc. This patch relaxes the test, to only check the
      type.
      
      Fixes: 08fb1dac ("net/mlx5e: Support DCBNL IEEE ETS")
      Signed-off-by: default avatarAmir Vadai <amir@vadai.me>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      67ba422e
    • Amir Vadai's avatar
      net/mlx5_core: Set flow steering dest only for forward rules · 60ab4584
      Amir Vadai authored
      We need to handle flow table entry destinations only if the action
      associated with the rule is forwarding (MLX5_FLOW_CONTEXT_ACTION_FWD_DEST).
      
      Fixes: 26a81453 ('net/mlx5_core: Introduce flow steering firmware commands')
      Signed-off-by: default avatarAmir Vadai <amir@vadai.me>
      Signed-off-by: default avatarMaor Gottlieb <maorg@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      60ab4584
    • Amir Vadai's avatar
      net/act_skbedit: Utility functions for mark action · 519afb18
      Amir Vadai authored
      Enable device drivers to query the action, if and only if is a mark
      action and what value to use for marking.
      Acked-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarAmir Vadai <amir@vadai.me>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      519afb18
    • Amir Vadai's avatar
      net/sched: Macro instead of CONFIG_NET_CLS_ACT ifdef · 00175aec
      Amir Vadai authored
      Introduce the macros tc_no_actions and tc_for_each_action to make code
      clearer.
      Extracted struct tc_action out of the ifdef to make calls to
      is_tcf_gact_shot() and similar functions valid, even when it is a nop.
      Acked-by: default avatarJiri Pirko <jiri@mellanox.com>
      Acked-by: default avatarJohn Fastabend <john.r.fastabend@intel.com>
      Suggested-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarAmir Vadai <amir@vadai.me>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      00175aec
    • Amir Vadai's avatar
      net/flow_dissector: Make dissector_uses_key() and skb_flow_dissector_target() public · 8de2d793
      Amir Vadai authored
      Will be used in a following patch to query if a key is being used, and
      what it's value in the target object.
      Acked-by: default avatarJohn Fastabend <john.r.fastabend@intel.com>
      Acked-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarAmir Vadai <amir@vadai.me>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8de2d793
    • Amir Vadai's avatar
      net/flower: Introduce hardware offload support · 5b33f488
      Amir Vadai authored
      This patch is based on a patch made by John Fastabend.
      It adds support for offloading cls_flower.
      when NETIF_F_HW_TC is on:
        flags = 0       => Rule will be processed twice - by hardware, and if
                           still relevant, by software.
        flags = SKIP_HW => Rull will be processed by software only
      
      If hardware fail/not capabale to apply the rule, operation will NOT
      fail. Filter will be processed by SW only.
      Acked-by: default avatarJiri Pirko <jiri@mellanox.com>
      Suggested-by: default avatarJohn Fastabend <john.r.fastabend@intel.com>
      Signed-off-by: default avatarAmir Vadai <amir@vadai.me>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5b33f488
    • David S. Miller's avatar
      Merge branch 'mediatek-eth' · 10f79037
      David S. Miller authored
      John Crispin says:
      
      ====================
      net-next: mediatek: add ethernet driver
      
      This series adds support for the Mediatek ethernet core found on current ARM
      based SoCs. The driver works on MT2701 and MT7623 SoCs
      
      Instead of trying to upstream everything at once I decided to concentrate on
      the important parts required to make current generation silicon work. The V3
      series only includes the code required to make dual MAC setups work and only
      supports the newer QDMA engine.
      
      Changes in V5
      * reduce the mdio timeut to HZ
      * add a call to usleep_range() which schedules in the background.
      
      Changes in V4
      * remove ugly _FE macro, use offsetof() instead
      
      Changes in V3
      * only include code for MT2701/7623 support
      * drop support for PDMA and older MIPS based SoCs
      * drop switch support
      
      Changes in V2
      * change the namespace of the functions from fe_* to mtk_*
      * add support for the latest generation of ARM SoCs
      * add dual MAC support
      * remove the swconfig specific bits
      * remove most of the magic values and replace them with defines
      * add verbose descriptions to the patches
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      10f79037
    • John Crispin's avatar
      net-next: mediatek: add an entry to MAINTAINERS · 0c272fc9
      John Crispin authored
      Add myself and Felix as the Maintainers for the MediaTek ethernet driver.
      Signed-off-by: default avatarFelix Fietkau <nbd@openwrt.org>
      Signed-off-by: default avatarJohn Crispin <blogic@openwrt.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0c272fc9
    • John Crispin's avatar
      net-next: mediatek: add Kconfig and Makefile · 009fb097
      John Crispin authored
      This patch adds the Makefile and Kconfig required to make the driver build.
      Signed-off-by: default avatarJohn Crispin <blogic@openwrt.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      009fb097
    • John Crispin's avatar
      net-next: mediatek: add support for MT7623 ethernet · 656e7052
      John Crispin authored
      Add ethernet support for MediaTek SoCs from the MT7623 family. These have
      dual GMAC. Depending on the exact version, there might be a built-in
      Gigabit switch (MT7530). The core does not have the typical DMA ring setup.
      Instead there is a linked list that we add descriptors to. There is only
      one linked list that both MACs use together. There is a special field
      inside the TX descriptors called the VQID. This allows us to assign packets
      to different internal queues. By using a separate id for each MAC we are
      able to get deterministic results for BQL. Additionally we need to
      provide the core with a block of scratch memory that is the same size as
      the RX ring and data buffer. This is really needed to make the HW datapath
      work. Although the driver does not support this yet, we still need to
      assign the memory and tell the core about it for RX to work.
      Signed-off-by: default avatarFelix Fietkau <nbd@openwrt.org>
      Signed-off-by: default avatarMichael Lee <igvtee@gmail.com>
      Signed-off-by: default avatarJohn Crispin <blogic@openwrt.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      656e7052