1. 17 6月, 2019 1 次提交
    • I
      net: ethernet: ti: davinci_cpdma: use idled submit · 871e8465
      Ivan Khoronzhuk 提交于
      While data pass suspend, reuse of rx descriptors can be disabled using
      channel state & lock from cpdma layer. For this, submit to a channel
      has to be disabled using state != "not active" under lock, what is done
      with this patch. The same submit is used to fill rx channel while
      ndo_open, when channel is idled, so add idled submit routine that
      allows to prepare descs for the channel. All this simplifies code and
      helps to avoid dormant mode usage and send packets only to active
      channels, avoiding potential race in later on changes. Also add missed
      sync barrier analogically like in other places after stopping tx
      queues.
      Signed-off-by: NIvan Khoronzhuk <ivan.khoronzhuk@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      871e8465
  2. 15 6月, 2019 1 次提交
  3. 30 5月, 2019 1 次提交
  4. 11 5月, 2019 1 次提交
    • P
      net: ethernet: fix similar warning reported by kbuild test robot · 2d2924af
      Petr Štetiar 提交于
      This patch fixes following (similar) warning reported by kbuild test robot:
      
       In function ‘memcpy’,
        inlined from ‘smsc75xx_init_mac_address’ at drivers/net/usb/smsc75xx.c:778:3,
        inlined from ‘smsc75xx_bind’ at drivers/net/usb/smsc75xx.c:1501:2:
        ./include/linux/string.h:355:9: warning: argument 2 null where non-null expected [-Wnonnull]
        return __builtin_memcpy(p, q, size);
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
        drivers/net/usb/smsc75xx.c: In function ‘smsc75xx_bind’:
        ./include/linux/string.h:355:9: note: in a call to built-in function ‘__builtin_memcpy’
      
      I've replaced the offending memcpy with ether_addr_copy, because I'm
      100% sure, that of_get_mac_address can't return NULL as it returns valid
      pointer or ERR_PTR encoded value, nothing else.
      
      I'm hesitant to just change IS_ERR into IS_ERR_OR_NULL check, as this
      would make the warning disappear also, but it would be confusing to
      check for impossible return value just to make a compiler happy.
      
      I'm now changing all occurencies of memcpy to ether_addr_copy after the
      of_get_mac_address call, as it's very likely, that we're going to get
      similar reports from kbuild test robot in the future.
      
      Fixes: a51645f7 ("net: ethernet: support of_get_mac_address new ERR_PTR error")
      Reported-by: Nkbuild test robot <lkp@intel.com>
      Signed-off-by: NPetr Štetiar <ynezz@true.cz>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2d2924af
  5. 08 5月, 2019 1 次提交
  6. 02 5月, 2019 1 次提交
  7. 28 4月, 2019 13 次提交
  8. 12 12月, 2018 1 次提交
  9. 06 12月, 2018 1 次提交
    • R
      net: Use of_node_name_eq for node name comparisons · bf5849f1
      Rob Herring 提交于
      Convert string compares of DT node names to use of_node_name_eq helper
      instead. This removes direct access to the node name pointer.
      
      For instances using of_node_cmp, this has the side effect of now using
      case sensitive comparisons. This should not matter for any FDT based
      system which all of these are.
      
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Claudiu Manoil <claudiu.manoil@nxp.com>
      Cc: Grygorii Strashko <grygorii.strashko@ti.com>
      Cc: Wingman Kwok <w-kwok2@ti.com>
      Cc: Murali Karicheri <m-karicheri2@ti.com>
      Cc: netdev@vger.kernel.org
      Cc: linux-omap@vger.kernel.org
      Signed-off-by: NRob Herring <robh@kernel.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bf5849f1
  10. 14 11月, 2018 2 次提交
  11. 09 11月, 2018 2 次提交
    • I
      net: ethernet: ti: cpsw: fix vlan configuration while down/up · 00fe4712
      Ivan Khoronzhuk 提交于
      The vlan configuration is not restored after interface donw/up sequence
      (if dual-emac - both interfaces). Tested on am572x EVM.
      
      Steps to check:
      ~# ip link add link eth1 name eth1.100 type vlan id 100
      ~# ifconfig eth0 down
      ~# ifconfig eth1 down
      
      Try to remove vid and observe warning:
      ~# ip link del eth1.100
      [  739.526757] net eth1: removing vlanid 100 from vlan filter
      [  739.533322] failed to kill vid 0081/100 for device eth1
      
      This patch fixes it, restoring only vlan ALE entries and all other
      unicast/multicast entries are restored by system calling rx_mode ndo.
      Reviewed-by: NGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: NIvan Khoronzhuk <ivan.khoronzhuk@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      00fe4712
    • I
      net: ethernet: ti: cpsw: fix vlan mcast · 15180eca
      Ivan Khoronzhuk 提交于
      At this moment, mcast addresses are added for real device only
      (reserved vlans for dual-emac mode), even if a mcast address was added
      for some vlan only, thus ALE doesn't have corresponding vlan mcast
      entries after vlan socket joined multicast group. So ALE drops vlan
      frames with mcast addresses intended for vlans and potentially can
      receive mcast frames for base ndev. That's not correct. So, fix it by
      creating only vlan/mcast entries as requested. Patch doesn't use any
      additional lists and is based on device mc address list and cpsw ALE
      table entries.
      Signed-off-by: NIvan Khoronzhuk <ivan.khoronzhuk@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      15180eca
  12. 23 10月, 2018 1 次提交
  13. 22 10月, 2018 1 次提交
  14. 16 10月, 2018 2 次提交
    • I
      net: ethernet: ti: cpsw: use for mcast entries only host port · 5b3a5a14
      Ivan Khoronzhuk 提交于
      In dual-emac mode the cpsw driver sends directed packets, that means
      that packets go to the directed port, but an ALE lookup is performed
      to determine untagged egress only. It means that on tx side no need
      to add port bit for ALE mcast entry mask, and basically ALE entry
      for port identification is needed only on rx side.
      
      So, add only host port in dual_emac mode as used directed
      transmission, and no need in one more port. For single port boards
      and switch mode all ports used, as usual, so no changes for them.
      Also it simplifies farther changes.
      
      In other words, mcast entries for dual-emac should behave exactly
      like unicast. It also can help avoid leaking packets between ports
      with same vlan on h/w level if ports could became members of same vid.
      
      So now, for instance, if mcast address 33:33:00:00:00:01 is added then
      entries in ALE table:
      
      vid = 1, addr = 33:33:00:00:00:01, port_mask = 0x1
      vid = 2, addr = 33:33:00:00:00:01, port_mask = 0x1
      
      Instead of:
      vid = 1, addr = 33:33:00:00:00:01, port_mask = 0x3
      vid = 2, addr = 33:33:00:00:00:01, port_mask = 0x5
      
      With the same considerations, set only host port for unregistered
      mcast for dual-emac mode in case of IFF_ALLMULTI is set, exactly like
      it's done in cpsw_ale_set_allmulti().
      Signed-off-by: NIvan Khoronzhuk <ivan.khoronzhuk@linaro.org>
      Reviewed-by: NGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5b3a5a14
    • I
      net: ethernet: ti: cpsw: fix lost of mcast packets while rx_mode update · 5da19489
      Ivan Khoronzhuk 提交于
      Whenever kernel or user decides to call rx mode update, it clears
      every multicast entry from forwarding table and in some time adds
      it again. This time can be enough to drop incoming multicast packets.
      
      That's why clear only staled multicast entries and update or add new
      one afterwards.
      Signed-off-by: NIvan Khoronzhuk <ivan.khoronzhuk@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5da19489
  15. 20 9月, 2018 1 次提交
  16. 12 8月, 2018 2 次提交
  17. 02 8月, 2018 1 次提交
  18. 30 7月, 2018 1 次提交
  19. 24 7月, 2018 4 次提交
    • I
      net: ethernet: ti: cpsw: restore shaper configuration while down/up · 4b4255ed
      Ivan Khoronzhuk 提交于
      Need to restore shapers configuration after interface was down/up.
      This is needed as appropriate configuration is still replicated in
      kernel settings. This only shapers context restore, so vlan
      configuration should be restored by user if needed, especially for
      devices with one port where vlan frames are sent via ALE.
      Reviewed-by: NIlias Apalodimas <ilias.apalodimas@linaro.org>
      Reviewed-by: NGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: NIvan Khoronzhuk <ivan.khoronzhuk@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4b4255ed
    • I
      net: ethernet: ti: cpsw: add CBS Qdisc offload · 57d90148
      Ivan Khoronzhuk 提交于
      The cpsw has up to 4 FIFOs per port and upper 3 FIFOs can feed rate
      limited queue with shaping. In order to set and enable shaping for
      those 3 FIFOs queues the network device with CBS qdisc attached is
      needed. The CBS configuration is added for dual-emac/single port mode
      only, but potentially can be used in switch mode also, based on
      switchdev for instance.
      
      Despite the FIFO shapers can work w/o cpdma level shapers the base
      usage must be in combine with cpdma level shapers as described in TRM,
      that are set as maximum rates for interface queues with sysfs.
      
      One of the possible configuration with txq shapers and CBS shapers:
      
                            Configured with echo RATE >
                        /sys/class/net/eth0/queues/tx-0/tx_maxrate
                   /---------------------------------------------------
                  /
                 /            cpdma level shapers
              +----+ +----+ +----+ +----+ +----+ +----+ +----+ +----+
              | c7 | | c6 | | c5 | | c4 | | c3 | | c2 | | c1 | | c0 |
              \    / \    / \    / \    / \    / \    / \    / \    /
               \  /   \  /   \  /   \  /   \  /   \  /   \  /   \  /
                \/     \/     \/     \/     \/     \/     \/     \/
      +---------|------|------|------|-------------------------------------+
      |    +----+      |      |  +---+                                     |
      |    |      +----+      |  |                                         |
      |    v      v           v  v                                         |
      | +----+ +----+ +----+ +----+ p        p+----+ +----+ +----+ +----+  |
      | |    | |    | |    | |    | o        o|    | |    | |    | |    |  |
      | | f3 | | f2 | | f1 | | f0 | r  CPSW  r| f3 | | f2 | | f1 | | f0 |  |
      | |    | |    | |    | |    | t        t|    | |    | |    | |    |  |
      | \    / \    / \    / \    / 0        1\    / \    / \    / \    /  |
      |  \  X   \  /   \  /   \  /             \  /   \  /   \  /   \  /   |
      |   \/ \   \/     \/     \/               \/     \/     \/     \/    |
      +-------\------------------------------------------------------------+
               \
                \ FIFO shaper, set with CBS offload added in this patch,
                 \ FIFO0 cannot be rate limited
                  ------------------------------------------------------
      
      CBS shaper configuration is supposed to be used with root MQPRIO Qdisc
      offload allowing to add sk_prio->tc->txq maps that direct traffic to
      appropriate tx queue and maps L2 priority to FIFO shaper.
      
      The CBS shaper is intended to be used for AVB where L2 priority
      (pcp field) is used to differentiate class of traffic. So additionally
      vlan needs to be created with appropriate egress sk_prio->l2 prio map.
      
      If CBS has several tx queues assigned to it, the sum of their
      bandwidth has not overlap bandwidth set for CBS. It's recomended the
      CBS bandwidth to be a little bit more.
      
      The CBS shaper is configured with CBS qdisc offload interface using tc
      tool from iproute2 packet.
      
      For instance:
      
      $ tc qdisc replace dev eth0 handle 100: parent root mqprio num_tc 3 \
      map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 queues 1@0 1@1 2@2 hw 1
      
      $ tc -g class show dev eth0
      +---(100:ffe2) mqprio
      |    +---(100:3) mqprio
      |    +---(100:4) mqprio
      |    
      +---(100:ffe1) mqprio
      |    +---(100:2) mqprio
      |    
      +---(100:ffe0) mqprio
           +---(100:1) mqprio
      
      $ tc qdisc add dev eth0 parent 100:1 cbs locredit -1440 \
      hicredit 60 sendslope -960000 idleslope 40000 offload 1
      
      $ tc qdisc add dev eth0 parent 100:2 cbs locredit -1470 \
      hicredit 62 sendslope -980000 idleslope 20000 offload 1
      
      The above code set CBS shapers for tc0 and tc1, for that txq0 and
      txq1 is used. Pay attention, the real set bandwidth can differ a bit
      due to discreteness of configuration parameters.
      
      Here parameters like locredit, hicredit and sendslope are ignored
      internally and are supposed to be set with assumption that maximum
      frame size for frame - 1500.
      
      It's supposed that interface speed is not changed while reconnection,
      not always is true, so inform user in case speed of interface was
      changed, as it can impact on dependent shapers configuration.
      
      For more examples see Documentation.
      Reviewed-by: NIlias Apalodimas <ilias.apalodimas@linaro.org>
      Reviewed-by: NGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: NIvan Khoronzhuk <ivan.khoronzhuk@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      57d90148
    • I
      net: ethernet: ti: cpsw: add MQPRIO Qdisc offload · 7929a668
      Ivan Khoronzhuk 提交于
      That's possible to offload vlan to tc priority mapping with
      assumption sk_prio == L2 prio.
      
      Example:
      $ ethtool -L eth0 rx 1 tx 4
      
      $ qdisc replace dev eth0 handle 100: parent root mqprio num_tc 3 \
      map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 queues 1@0 1@1 2@2 hw 1
      
      $ tc -g class show dev eth0
      +---(100:ffe2) mqprio
      |    +---(100:3) mqprio
      |    +---(100:4) mqprio
      |    
      +---(100:ffe1) mqprio
      |    +---(100:2) mqprio
      |    
      +---(100:ffe0) mqprio
           +---(100:1) mqprio
      
      Here, 100:1 is txq0, 100:2 is txq1, 100:3 is txq2, 100:4 is txq3
      txq0 belongs to tc0, txq1 to tc1, txq2 and txq3 to tc2
      The offload part only maps L2 prio to classes of traffic, but not
      to transmit queues, so to direct traffic to traffic class vlan has
      to be created with appropriate egress map.
      Reviewed-by: NIlias Apalodimas <ilias.apalodimas@linaro.org>
      Reviewed-by: NGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: NIvan Khoronzhuk <ivan.khoronzhuk@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7929a668
    • I
      net: ethernet: ti: cpsw: use cpdma channels in backward order for txq · 79b3325d
      Ivan Khoronzhuk 提交于
      The cpdma channel highest priority is from hi to lo number.
      The driver has limited number of descriptors that are shared between
      number of cpdma channels. Number of queues can be tuned with ethtool,
      that allows to not spend descriptors on not needed cpdma channels.
      In AVB usually only 2 tx queues can be enough with rate limitation.
      The rate limitation can be used only for hi priority queues. Thus, to
      use only 2 queues the 8 has to be created. It's wasteful.
      
      So, in order to allow using only needed number of rate limited
      tx queues, save resources, and be able to set rate limitation for
      them, let assign tx cpdma channels in backward order to queues.
      Reviewed-by: NIlias Apalodimas <ilias.apalodimas@linaro.org>
      Reviewed-by: NGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: NIvan Khoronzhuk <ivan.khoronzhuk@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      79b3325d
  20. 07 7月, 2018 2 次提交