1. 18 3月, 2020 1 次提交
  2. 21 11月, 2019 3 次提交
  3. 05 11月, 2019 1 次提交
    • A
      net: of_get_phy_mode: Change API to solve int/unit warnings · 0c65b2b9
      Andrew Lunn 提交于
      Before this change of_get_phy_mode() returned an enum,
      phy_interface_t. On error, -ENODEV etc, is returned. If the result of
      the function is stored in a variable of type phy_interface_t, and the
      compiler has decided to represent this as an unsigned int, comparision
      with -ENODEV etc, is a signed vs unsigned comparision.
      
      Fix this problem by changing the API. Make the function return an
      error, or 0 on success, and pass a pointer, of type phy_interface_t,
      where the phy mode should be stored.
      
      v2:
      Return with *interface set to PHY_INTERFACE_MODE_NA on error.
      Add error checks to all users of of_get_phy_mode()
      Fixup a few reverse christmas tree errors
      Fixup a few slightly malformed reverse christmas trees
      
      v3:
      Fix 0-day reported errors.
      Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0c65b2b9
  4. 22 8月, 2019 2 次提交
  5. 17 7月, 2019 1 次提交
  6. 09 7月, 2019 1 次提交
    • I
      net: ethernet: ti: cpsw: add XDP support · 9ed4050c
      Ivan Khoronzhuk 提交于
      Add XDP support based on rx page_pool allocator, one frame per page.
      Page pool allocator is used with assumption that only one rx_handler
      is running simultaneously. DMA map/unmap is reused from page pool
      despite there is no need to map whole page.
      
      Due to specific of cpsw, the same TX/RX handler can be used by 2
      network devices, so special fields in buffer are added to identify
      an interface the frame is destined to. Thus XDP works for both
      interfaces, that allows to test xdp redirect between two interfaces
      easily. Also, each rx queue have own page pools, but common for both
      netdevs.
      
      XDP prog is common for all channels till appropriate changes are added
      in XDP infrastructure. Also, once page_pool recycling becomes part of
      skb netstack some simplifications can be added, like removing
      page_pool_release_page() before skb receive.
      
      In order to keep rx_dev while redirect, that can be somehow used in
      future, do flush in rx_handler, that allows to keep rx dev the same
      while redirect. It allows to conform with tracing rx_dev pointed
      by Jesper.
      
      Also, there is probability, that XDP generic code can be extended to
      support multi ndev drivers like this one, using same rx queue for
      several ndevs, based on switchdev for instance or else. In this case,
      driver can be modified like exposed here:
      https://lkml.org/lkml/2019/7/3/243Acked-by: NJesper Dangaard Brouer <brouer@redhat.com>
      Signed-off-by: NIvan Khoronzhuk <ivan.khoronzhuk@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9ed4050c
  7. 29 6月, 2019 1 次提交
  8. 24 6月, 2019 1 次提交
  9. 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
  10. 15 6月, 2019 1 次提交
  11. 30 5月, 2019 1 次提交
  12. 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
  13. 08 5月, 2019 1 次提交
  14. 02 5月, 2019 1 次提交
  15. 28 4月, 2019 13 次提交
  16. 12 12月, 2018 1 次提交
  17. 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
  18. 14 11月, 2018 2 次提交
  19. 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
  20. 23 10月, 2018 1 次提交
  21. 22 10月, 2018 1 次提交
  22. 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