05 Apr, 2019

40 commits

  • Now that phylib uses genphy_read_abilities() as fallback, we don't have
    to set callback get_features any longer.

    Signed-off-by: Heiner Kallweit
    Reviewed-by: Andrew Lunn
    Signed-off-by: David S. Miller

    Heiner Kallweit
     
  • Meanwhile we have generic functions for reading the abilities of
    Clause 22 / 45 PHY's. This allows to use them as fallback in case
    callback get_features isn't set. Benefit is the reduction of
    boilerplate code in PHY drivers.

    v2:
    - adjust the comment in phy_driver_register to match the code

    Signed-off-by: Heiner Kallweit
    Reviewed-by: Andrew Lunn
    Signed-off-by: David S. Miller

    Heiner Kallweit
     
  • Since the mcast conversion to rhashtable this function has been unused, so
    remove it.

    Signed-off-by: Nikolay Aleksandrov
    Signed-off-by: David S. Miller

    Nikolay Aleksandrov
     
  • This reverts commit 6578229d4efb7ea6287861bfc2bd306140458e07.
    netif_receive_skb_list() doesn't support GRO, therefore we may have
    scenarios with decreased performance. See discussion here [0].

    [0] https://marc.info/?t=155403847400001&r=1&w=2

    Signed-off-by: Heiner Kallweit
    Signed-off-by: David S. Miller

    Heiner Kallweit
     
  • Linux currently disable ECN for incoming connections when the SYN
    requests ECN and the IP header has ECT(0)/ECT(1) set, as some
    networks were reportedly mangling the ToS byte, hence could later
    trigger false congestion notifications.

    RFC8311 §4.3 relaxes RFC3168's requirements such that ECT can be set
    one TCP control packets (including SYNs). The main benefit of this
    is the decreased probability of losing a SYN in a congested
    ECN-capable network (i.e., it avoids the initial 1s timeout).
    Additionally, this allows the development of newer TCP extensions,
    such as AccECN.

    This patch relaxes the previous check, by enabling ECN on incoming
    connections using SYN+ECT if at least one bit of the reserved flags
    of the TCP header is set. Such bit would indicate that the sender of
    the SYN is using a newer TCP feature than what the host implements,
    such as AccECN, and is thus implementing RFC8311. This enables
    end-hosts not supporting such extensions to still negociate ECN, and
    to have some of the benefits of using ECN on control packets.

    Signed-off-by: Olivier Tilmans
    Suggested-by: Bob Briscoe
    Cc: Koen De Schepper
    Signed-off-by: Eric Dumazet
    Acked-by: Neal Cardwell
    Acked-by: Yuchung Cheng
    Signed-off-by: David S. Miller

    Tilmans, Olivier (Nokia - BE/Antwerp)
     
  • Jiri Pirko says:

    ====================
    net: extend devlink port attrs with switch ID

    Extend devlink port attrs to contain switch ID and change drivers that
    register devlink ports to use that.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Currently if the driver registers devlink port instance, he should set
    the devlink port attributes as well. Then the devlink core is able to
    obtain switch id itself, no need for driver to implement the ndo.
    Once all drivers will implement devlink port registration, this ndo
    should be removed. This warning guides new drivers to do things as
    they should be done.

    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Jiri Pirko
     
  • Pass the switch ID down the to devlink through devlink_port_attrs_set()
    so it can be used by devlink_compat_switch_id_get(). Leave
    ndo_get_port_parent_id implementation only for legacy.

    Signed-off-by: Jiri Pirko
    Reviewed-by: Florian Fainelli
    Signed-off-by: David S. Miller

    Jiri Pirko
     
  • Obtain HW id and pass it down to mlxsw_core_port_init() as it would be
    used as switch_id in devlink and exposed to user.

    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Jiri Pirko
     
  • Remove implementation of get_port_parent_id ndo and rely on core calling
    into devlink for the information directly.

    Signed-off-by: Jiri Pirko
    Reviewed-by: Jakub Kicinski
    Signed-off-by: David S. Miller

    Jiri Pirko
     
  • Pass the switch ID down the to devlink through devlink_port_attrs_set()
    so it can be used by devlink_compat_switch_id_get().

    Signed-off-by: Jiri Pirko
    Reviewed-by: Jakub Kicinski
    Signed-off-by: David S. Miller

    Jiri Pirko
     
  • Remove implementation of get_port_parent_id ndo and rely on core calling
    into devlink for the information directly.

    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Jiri Pirko
     
  • Pass the switch ID down the to devlink through devlink_port_attrs_set()
    so it can be used by devlink_compat_switch_id_get().

    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Jiri Pirko
     
  • Currently the switch_id is being only initialized when switching eswitch
    mode from "legacy" to "switchdev". However, nothing prevents the id to
    be initialized from the very beginning. Physical ports can show it even
    in "legacy" mode.

    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Jiri Pirko
     
  • Remove implementation of get_port_parent_id ndo and rely on core calling
    into devlink for the information directly.

    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Jiri Pirko
     
  • Pass the switch ID down the to devlink through devlink_port_attrs_set()
    so it can be used by devlink_compat_switch_id_get().

    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Jiri Pirko
     
  • Introduce devlink_compat_switch_id_get() helper which fills up switch_id
    according to passed netdev pointer. Call it directly from
    dev_get_port_parent_id() as a fallback when ndo_get_port_parent_id
    is not defined for given netdev.

    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Jiri Pirko
     
  • Extend devlink_port_attrs_set() to pass switch ID for ports which are
    part of switch and store it in port attrs. For other ports, this is
    NULL.

    Note that this allows the driver to group devlink ports into one or more
    switches according to the actual topology.

    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Jiri Pirko
     
  • In order to save space in the struct, convert bools to bits.

    Signed-off-by: Jiri Pirko
    Reviewed-by: Florian Fainelli
    Reviewed-by: Jakub Kicinski
    Signed-off-by: David S. Miller

    Jiri Pirko
     
  • We can optimize the fdb convergence when a backup_port is present by not
    immediately flushing the entries of the stopped port since traffic for
    those entries will flow towards the backup_port.

    There are 2 cases specifically that benefit most:
    - when the stopped port comes up before the entries expire by themselves
    - when there's an external entry refresh and they're kept while the
    backup_port is operating (e.g. mlag)

    Signed-off-by: Nikolay Aleksandrov
    Signed-off-by: David S. Miller

    Nikolay Aleksandrov
     
  • This header is not in use - remove it.

    Signed-off-by: Yuval Shaia
    Signed-off-by: David S. Miller

    Yuval Shaia
     
  • Fixes gcc '-Wunused-but-set-variable' warning:

    drivers/net/ethernet/ibm/ibmvnic.c: In function '__ibmvnic_reset':
    drivers/net/ethernet/ibm/ibmvnic.c:1971:21: warning: variable 'netdev' set but not used [-Wunused-but-set-variable]

    It's never used since introduction in
    commit ed651a10875f ("ibmvnic: Updated reset handling")

    Signed-off-by: YueHaibing
    Reviewed-by: Mukesh Ojha
    Signed-off-by: David S. Miller

    YueHaibing
     
  • Fixes gcc '-Wunused-but-set-variable' warning:

    drivers/net/ethernet/ibm/ehea/ehea_qmr.c: In function 'ehea_create_cq':
    drivers/net/ethernet/ibm/ehea/ehea_qmr.c:127:7: warning: variable 'cq_handle_ref' set but not used [-Wunused-but-set-variable]
    drivers/net/ethernet/ibm/ehea/ehea_qmr.c:126:15: warning: variable 'epa' set but not used [-Wunused-but-set-variable]

    They are never used since commit
    7a291083225a ("[PATCH] ehea: IBM eHEA Ethernet Device Driver")

    Signed-off-by: YueHaibing
    Reviewed-by: Mukesh Ojha
    Signed-off-by: David S. Miller

    YueHaibing
     
  • Fixes gcc '-Wunused-but-set-variable' warning:

    drivers/net/ethernet/pasemi/pasemi_mac.c: In function 'pasemi_mac_queue_csdesc':
    drivers/net/ethernet/pasemi/pasemi_mac.c:1358:29: warning: variable 'cpyhdr' set but not used [-Wunused-but-set-variable]

    It's never used since commit 8d636d8bc5ff ("pasemi_mac: jumbo
    frame support") and can be removed.

    Signed-off-by: YueHaibing
    Reviewed-by: Mukesh Ojha
    Signed-off-by: David S. Miller

    YueHaibing
     
  • pr->tx_bytes should be assigned to tx_bytes other than
    rx_bytes.

    Reported-by: Hulk Robot
    Fixes: ce45b873028f ("ehea: Fixing statistics")
    Signed-off-by: YueHaibing
    Reviewed-by: Mukesh Ojha
    Signed-off-by: David S. Miller

    YueHaibing
     
  • syzbot reports:
    BUG: using __this_cpu_read() in preemptible code:
    caller is dev_recursion_level include/linux/netdevice.h:3052 [inline]
    __this_cpu_preempt_check+0x246/0x270 lib/smp_processor_id.c:47
    dev_recursion_level include/linux/netdevice.h:3052 [inline]
    ip6_skb_dst_mtu include/net/ip6_route.h:245 [inline]

    I erronously downgraded a this_cpu_read to __this_cpu_read when
    moving dev_recursion_level() around.

    Reported-by: syzbot+51471b4aae195285a4a3@syzkaller.appspotmail.com
    Fixes: 97cdcf37b57e ("net: place xmit recursion in softnet data")
    Signed-off-by: Florian Westphal
    Reviewed-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Florian Westphal
     
  • skb somehow dequeued out of inputq before processing, it causes to
    NULL pointer and kernel crashed.

    Add checking skb valid before using.

    Fixes: c55c8edafa9 ("tipc: smooth change between replicast and broadcast")
    Reported-by: Tuong Lien Tong
    Acked-by: Ying Xue
    Signed-off-by: Hoang Le
    Acked-by: Jon Maloy
    Signed-off-by: David S. Miller

    Hoang Le
     
  • Recent changes to TC flower remove the requirement for rtnl lock when
    accessing and modifying filters. Refcounts now ensure access and deletion
    do not happen concurrently. However, the reoffload function which cycles
    through all filters and replays them to registered hw drivers is not
    protected.

    Use the fl_get_next_filter() function to cycle the filters for reoffload
    and ensure the ref taken by this function is put when done with each
    filter.

    Signed-off-by: John Hurley
    Reviewed-by: Jakub Kicinski
    Reviewed-by: Vlad Buslov
    Signed-off-by: David S. Miller

    John Hurley
     
  • Simplify this code by updating bridge multicast stats from
    maybe_deliver().

    Note that commit 6db6f0eae605 ("bridge: multicast to unicast"), in case
    the port flag BR_MULTICAST_TO_UNICAST is set, never updates the previous
    port pointer, therefore it is always going to be different from the
    existing port in this deduplicated list iteration.

    Signed-off-by: Pablo Neira Ayuso
    Acked-by: Nikolay Aleksandrov
    Signed-off-by: David S. Miller

    Pablo Neira Ayuso
     
  • Just like 46cfd725c377 ("net: use kfree_skb_list() helper in more places").

    Signed-off-by: Pablo Neira Ayuso
    Acked-by: Florian Westphal
    Signed-off-by: David S. Miller

    Pablo Neira Ayuso
     
  • Huazhong Tan says:

    ====================
    code optimizations & bugfixes for HNS3 driver

    This patchset includes bugfixes and code optimizations for
    the HNS3 ethernet controller driver.

    Change log:
    V1->V2: fixes comments from Sergei Shtylyov
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • The function hnae3_match_n_instantiate() was called both by
    initializing or uninitializing client. For uninitializing, the
    return value was never used.

    To make it more clear, this patch splits it to two functions,
    hnae3_init_client_instance() and hnae3_uninit_client_instance().

    Signed-off-by: Jian Shen
    Signed-off-by: Peng Li
    Signed-off-by: Huazhong Tan
    Signed-off-by: David S. Miller

    Jian Shen
     
  • In the hns3_reset_notify_uninit_enet() HNS3_NIC_STATE_INITED flag
    should be checked and cleared firstly.

    Signed-off-by: Huazhong Tan
    Signed-off-by: Peng Li
    Signed-off-by: David S. Miller

    Huazhong Tan
     
  • When resetting, the changing of MTU is not allowed, so this patch
    adds checking reset status in hns3_nic_change_mtu() to do that.

    Signed-off-by: Huazhong Tan
    Signed-off-by: Peng Li
    Signed-off-by: David S. Miller

    Huazhong Tan
     
  • hns3_get_stats() should check the resetting status firstly,
    since the device will be reinitialized when resetting. If the
    reset has not completed, the hns3_get_stats() may access
    invalid memory.

    Signed-off-by: Huazhong Tan
    Signed-off-by: Peng Li
    Signed-off-by: David S. Miller

    Huazhong Tan
     
  • It used netdev->uc and netdev->mc list in function
    hns3_recover_hw_addr() and hns3_remove_hw_addr().
    We should add protect for them.

    Fixes: f05e21097121 ("net: hns3: Clear mac vlan table entries when unload driver or function reset")
    Signed-off-by: Jian Shen
    Signed-off-by: Peng Li
    Signed-off-by: Huazhong Tan
    Signed-off-by: David S. Miller

    Jian Shen
     
  • csq is used as a ring buffer, the value of the desc will be replaced
    in next use. This patch removes the unnecessary memset, and just
    updates the next_to_clean.

    Signed-off-by: Huazhong Tan
    Signed-off-by: Peng Li
    Signed-off-by: David S. Miller

    Huazhong Tan
     
  • This patch adds a likely case for hns3_fill_desc and
    limits the local variables' scope as much as possible,
    also avoid div operation when the tqp_vector->num_tqps
    is one.

    Signed-off-by: Yunsheng Lin
    Signed-off-by: Peng Li
    Signed-off-by: Huazhong Tan
    Signed-off-by: David S. Miller

    Yunsheng Lin
     
  • This patch optimizes the ring_space by calculating the
    ring space without calling ring_dist.

    Also ring_dist is only used by ring_space, so this patch
    removes it when it is no longer used.

    Signed-off-by: Yunsheng Lin
    Signed-off-by: Peng Li
    Signed-off-by: Huazhong Tan
    Signed-off-by: David S. Miller

    Yunsheng Lin
     
  • When set 2 same MAC to different function of one port, IMP
    will return error as the later one may modify the origin one.
    This will cause bond fail for 2 VFs of one port.

    Driver just print warning and return 0 with this patch, so
    if set same MAC address, it will return 0 but do not really
    configure HW.

    Signed-off-by: Peng Li
    Signed-off-by: Huazhong Tan
    Signed-off-by: David S. Miller

    Peng Li