30 Sep, 2018

4 commits

  • The function tipc_msg_reverse() is reversing the header of a message
    while reusing the original buffer. We have seen at several occasions
    that this may have unfortunate side effects when the buffer to be
    reversed is a clone.

    In one of the following commits we will again need to reverse cloned
    buffers, so this is the right time to permanently eliminate this
    problem. In this commit we let the said function always consume the
    original buffer and replace it with a new one when applicable.

    Acked-by: Ying Xue
    Signed-off-by: Jon Maloy
    Signed-off-by: David S. Miller

    Jon Maloy
     
  • Previously TCP initial receive buffer is ~87KB by default and
    the initial receive window is ~29KB (20 MSS). This patch changes
    the two numbers to 128KB and ~64KB (rounding down to the multiples
    of MSS) respectively. The patch also simplifies the calculations s.t.
    the two numbers are directly controlled by sysctl tcp_rmem[1]:

    1) Initial receiver buffer budget (sk_rcvbuf): while this should
    be configured via sysctl tcp_rmem[1], previously tcp_fixup_rcvbuf()
    always override and set a larger size when a new connection
    establishes.

    2) Initial receive window in SYN: previously it is set to 20
    packets if MSS
    Signed-off-by: Wei Wang
    Signed-off-by: Neal Cardwell
    Signed-off-by: Eric Dumazet
    Reviewed-by: Soheil Hassas Yeganeh
    Signed-off-by: David S. Miller

    Yuchung Cheng
     
  • drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c: In function ‘hclge_get_sset_count’:
    drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c:496:31: error: ‘HNAE3_REVISION_ID_21’ undeclared (first use in this function); did you mean ‘FADT2_REVISION_ID’?
    if (hdev->pdev->revision >= HNAE3_REVISION_ID_21 ||
    ^~~~~~~~~~~~~~~~~~~~
    FADT2_REVISION_ID

    Signed-off-by: David S. Miller

    David S. Miller
     
  • drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c: In function ‘hns3_self_test’:
    drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c:278:15: error: ‘HNS3_SELF_TEST_TYPE_NUM’ undeclared (first use in this function); did you mean ‘HNS3_SELF_TEST_TPYE_NUM’?
    int st_param[HNS3_SELF_TEST_TYPE_NUM][2];
    ^~~~~~~~~~~~~~~~~~~~~~~
    HNS3_SELF_TEST_TPYE_NUM

    Signed-off-by: David S. Miller

    David S. Miller
     

29 Sep, 2018

32 commits

  • Trivial fix to spelling mistake struct field name, rename it.

    Signed-off-by: Colin Ian King
    Signed-off-by: David S. Miller

    Colin Ian King
     
  • Jeff Kirsher says:

    ====================
    100GbE Intel Wired LAN Driver Updates 2018-09-27

    This series contains fixes to the ice driver only.

    Jake fixes a potential crash due to attempting to access the mutex which
    is already destroyed. Fix this by using rq.count and sq.count to
    determine if the queue was initialized. Fixed the current logic for
    checking the firmware version to properly handle situations when
    firmware major/minor versions differ and when the branch version
    differs.

    Bruce replaces a memcpy() with a direct assignment, which is preferred.
    Also updated the branding strings and device ids supported by the
    driver. Fixed the "ethtool -G" command in the driver, which was always
    returning EINVAL when changing the descriptor ring size.

    Brett update and clarified code comments.

    Anirudh updates the driver to ensure we query the firmware for the
    transmit scheduler node information before adding it to the driver
    database, to ensure we have the current information. Also update the
    "get capabilities" command to get device and function capabilities.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Fixes the following sparse warning:

    net/sched/sch_generic.c:944:6: warning:
    symbol 'qdisc_free_cb' was not declared. Should it be static?

    Fixes: 3a7d0d07a386 ("net: sched: extend Qdisc with rcu")
    Signed-off-by: Wei Yongjun
    Signed-off-by: David S. Miller

    Wei Yongjun
     
  • This test adds an fdb entry with the sticky flag and sends traffic from
    a different port with the same mac as a source address expecting the entry
    to not change ports if the flag is operating correctly.

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

    Nikolay Aleksandrov
     
  • We need to explicitly zero is_sticky when creating a new fdb, otherwise
    we might get a stale value for a new entry.

    Fixes: 435f2e7cc0b7 ("net: bridge: add support for sticky fdb entries")
    Signed-off-by: Nikolay Aleksandrov
    Signed-off-by: David S. Miller

    Nikolay Aleksandrov
     
  • Salil Mehta says:

    ====================
    Cleanups, minor additions & fixes for HNS3 driver

    This patch-set contains cleans-ups, minor changes and fixes to the HNS3 driver.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • The user's coal configuration will be lost after reset, so the tx_coal
    and rx_coal fields are added to the struct hns_nic_priv to save the coal
    configuration and used to restore the user's configuration after the reset
    is complete.

    Fixes: bb6b94a896d4 ("net: hns3: Add reset interface implementation in client")
    Signed-off-by: Huazhong Tan
    Signed-off-by: Yunsheng Lin
    Signed-off-by: Salil Mehta
    Signed-off-by: David S. Miller

    Huazhong Tan
     
  • The current hns3_get_max_available_channels returns the total number
    of queues for the device, which makes ethtool -L set the number of queues
    per channel queues incorrectly, so hns3_get_max_available_channels should
    return the maximum available number of queues per channel, depending on
    the total number of queues allocated and the hardware configurations.

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

    Huazhong Tan
     
  • hclge_tm_schd_info_update should return an error when num_tc is greater
    than alloc_tqps.

    This patch changes the return type of hnae3_register_ae_algo from void
    to int.

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

    Huazhong Tan
     
  • Currently hns3_nic_change_mtu will try to down the netdev before
    setting mtu, and it does not up the netdev when the setting fails,
    which causes netdev not up problem.

    This patch fixes it by not returning when the setting fails.

    Fixes: a8e8b7ff3517 ("net: hns3: Add support to change MTU in HNS3 hardware")
    Signed-off-by: Yunsheng Lin
    Signed-off-by: Peng Li
    Signed-off-by: Salil Mehta
    Signed-off-by: David S. Miller

    Yunsheng Lin
     
  • The hardware expects a unit of 128 bytes when setting
    packet buffer. When calculating the packet buffer size,
    hclge_rx_buffer_calc does not round up the size as a unit
    of 128 byte, which may casue packet lost problem when stress
    testing.

    This patch fixes it by rounding up packet size when calculating.

    Fixes: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support")
    Signed-off-by: Yunsheng Lin
    Signed-off-by: Peng Li
    Signed-off-by: Salil Mehta
    Signed-off-by: David S. Miller

    Yunsheng Lin
     
  • This patch adds serdes parallel inner loopback support for self test.

    Signed-off-by: Fuyun Liang
    Signed-off-by: Peng Li
    Signed-off-by: Salil Mehta
    Signed-off-by: David S. Miller

    Fuyun Liang
     
  • In fact, our implementation of mac loopback is the implementation of app
    loopback now. Current name is wrong. This patch renames mac loopback to
    app loopback.

    Signed-off-by: Fuyun Liang
    Signed-off-by: Peng Li
    Signed-off-by: Salil Mehta
    Signed-off-by: David S. Miller

    Fuyun Liang
     
  • Our loop mode includes mac loop, serdes loop and phy loop. Not all of them
    are related with mac. This patch corrects their names.

    Signed-off-by: Fuyun Liang
    Signed-off-by: Peng Li
    Signed-off-by: Salil Mehta
    Signed-off-by: David S. Miller

    Fuyun Liang
     
  • The extra mac address of pause param is used to do double check
    for pause frame. This patch set it to HW. If we do not do that,
    pfc pause frame will be transferred protocol stack when normal
    flow control mode is enabled.

    Signed-off-by: Fuyun Liang
    Signed-off-by: Peng Li
    Signed-off-by: Salil Mehta
    Signed-off-by: David S. Miller

    Fuyun Liang
     
  • This patch adds support for sctp checksum offload.

    Signed-off-by: Fuyun Liang
    Signed-off-by: Peng Li
    Signed-off-by: Salil Mehta
    Signed-off-by: David S. Miller

    Peng Li
     
  • When B53_SERDES is a loadable module, a built-in srab driver still
    cannot reach it, so the previous fix is incomplete:

    b53_srab.c:(.text+0x3f4): undefined reference to `b53_serdes_init'
    drivers/net/dsa/b53/b53_srab.o:(.rodata+0xe64): undefined reference to `b53_serdes_link_state'
    drivers/net/dsa/b53/b53_srab.o:(.rodata+0xe74): undefined reference to `b53_serdes_link_set'
    drivers/net/dsa/b53/b53_srab.o:(.rodata+0xe88): undefined reference to `b53_serdes_an_restart'
    drivers/net/dsa/b53/b53_srab.o:(.rodata+0xea0): undefined reference to `b53_serdes_phylink_validate'
    drivers/net/dsa/b53/b53_srab.o:(.rodata+0xea4): undefined reference to `b53_serdes_config'

    Add a Kconfig dependency that forces srab to also be a module
    in this case, but allow it to be built-in when serdes is
    disabled or built-in.

    Fixes: 7a8c7f5c30f9 ("net: dsa: b53: Fix build with B53_SRAB enabled and not B53_SERDES")
    Signed-off-by: Arnd Bergmann
    Acked-by: Florian Fainelli
    Signed-off-by: David S. Miller

    Arnd Bergmann
     
  • The newly added runtime-pm support causes a harmless warning
    when CONFIG_PM is disabled:

    drivers/net/phy/mdio-bcm-unimac.c:330:12: error: 'unimac_mdio_resume' defined but not used [-Werror=unused-function]
    static int unimac_mdio_resume(struct device *d)
    drivers/net/phy/mdio-bcm-unimac.c:321:12: error: 'unimac_mdio_suspend' defined but not used [-Werror=unused-function]
    static int unimac_mdio_suspend(struct device *d)

    Marking the functions as __maybe_unused is the easiest workaround
    and avoids adding #ifdef checks.

    Fixes: b78ac6ecd1b6 ("net: phy: mdio-bcm-unimac: Allow configuring MDIO clock divider")
    Signed-off-by: Arnd Bergmann
    Signed-off-by: David S. Miller

    Arnd Bergmann
     
  • gcc points out that the length of the temporary buffer may not be sufficient for
    large numbers of leds:

    drivers/net/phy/mscc.c: In function 'vsc85xx_probe':
    drivers/net/phy/mscc.c:460:45: error: '-mode' directive writing 5 bytes into a region of size between 0 and 9 [-Werror=format-overflow=]
    ret = sprintf(led_dt_prop, "vsc8531,led-%d-mode", i);
    ^~~~~
    drivers/net/phy/mscc.c:460:9: note: 'sprintf' output between 19 and 28 bytes into a destination of size 22
    ret = sprintf(led_dt_prop, "vsc8531,led-%d-mode", i);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    While we can make a reasonable assumption that the number of LEDs is small,
    the cost of making the buffer a little bigger is insignificant as well.

    Fixes: 11bfdabb7ff5 ("net: phy: mscc: factorize code for LEDs mode")
    Signed-off-by: Arnd Bergmann
    Reviewed-by: Alexandre Belloni
    Signed-off-by: David S. Miller

    Arnd Bergmann
     
  • The patch that removed the only users of the oldadv/newadv variables
    accidentally left the now-unused declarations behind:

    drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c: In function 'dpaa_set_pauseparam':
    drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c:185:14: error: unused variable 'oldadv' [-Werror=unused-variable]
    drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c:185:6: error: unused variable 'newadv' [-Werror=unused-variable]

    Fixes: 70814e819c11 ("net: ethernet: Add helper for set_pauseparam for Asym Pause")
    Signed-off-by: Arnd Bergmann
    Signed-off-by: David S. Miller

    Arnd Bergmann
     
  • Fixes the following sparse warning:

    drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c:873:5: warning:
    symbol 'aq_fw1x_set_power' was not declared. Should it be static?

    Fixes: a0da96c08cfa ("net: aquantia: implement WOL support")
    Signed-off-by: Wei Yongjun
    Signed-off-by: David S. Miller

    Wei Yongjun
     
  • Fixes the following sparse warning:

    net/tls/tls_sw.c:655:16: warning:
    symbol 'get_rec' was not declared. Should it be static?

    Fixes: a42055e8d2c3 ("net/tls: Add support for async encryption of records for performance")
    Signed-off-by: Wei Yongjun
    Signed-off-by: David S. Miller

    Wei Yongjun
     
  • Fixes the following sparse warning:

    net/core/gen_stats.c:166:1: warning:
    symbol '___gnet_stats_copy_basic' was not declared. Should it be static?

    Fixes: 5e111210a443 ("net/core: Add new basic hardware counter")
    Signed-off-by: Wei Yongjun
    Acked-by: Eelco Chaudron
    Signed-off-by: David S. Miller

    Wei Yongjun
     
  • The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
    which is a typedef for an enum type, so make sure the implementation in
    this driver has returns 'netdev_tx_t' value, and change the function
    return type to netdev_tx_t.

    Found by coccinelle.

    Signed-off-by: YueHaibing
    Acked-by: Wei Liu
    Signed-off-by: David S. Miller

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

    drivers/net/ethernet/qlogic/qed/qed_ooo.c: In function 'qed_ooo_delete_isles':
    drivers/net/ethernet/qlogic/qed/qed_ooo.c:354:30: warning:
    variable 'p_archipelago' set but not used [-Wunused-but-set-variable]

    drivers/net/ethernet/qlogic/qed/qed_ooo.c: In function 'qed_ooo_join_isles':
    drivers/net/ethernet/qlogic/qed/qed_ooo.c:463:30: warning:
    variable 'p_archipelago' set but not used [-Wunused-but-set-variable]

    Since commit 1eec2437d14c ("qed: Make OOO archipelagos into an array"),
    'p_archipelago' is no longer in use.

    Signed-off-by: YueHaibing
    Signed-off-by: David S. Miller

    YueHaibing
     
  • The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
    which is a typedef for an enum type, so make sure the implementation in
    this driver has returns 'netdev_tx_t' value, and change the function
    return type to netdev_tx_t.

    Found by coccinelle.

    Signed-off-by: YueHaibing
    Signed-off-by: David S. Miller

    YueHaibing
     
  • Johannes Berg says:

    ====================
    netlink: nested policy validation

    This adds nested policy validation, which lets you specify the
    nested attribute type, e.g. NLA_NESTED with sub-policy, or the
    new NLA_NESTED_ARRAY with sub-sub-policy.

    Changes in v2:
    * move setting the bad attr pointer/message into validate_nla()
    * remove the recursion patch since that's no longer needed
    * simply skip the generic bad attr pointer/message setting in
    case of nested nla_validate() failing since that could fail
    only due to validate_nla() failing inside, which already sets
    the extack information

    Changes in v3:
    * fix NLA_REJECT to have an error message if none is in policy
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Sometimes nested netlink attributes are just used as arrays, with
    the nla_type() of each not being used; we have this in nl80211 and
    e.g. NFTA_SET_ELEM_LIST_ELEMENTS.

    Add the ability to validate this type of message directly in the
    policy, by adding the type NLA_NESTED_ARRAY which does exactly
    this: require a first level of nesting but ignore the attribute
    type, and then inside each require a second level of nested and
    validate those attributes against a given policy (if present).

    Note that some nested array types actually require that all of
    the entries have the same index, this is possible to express in
    a nested policy already, apart from the validation that only the
    one allowed type is used.

    Signed-off-by: Johannes Berg
    Signed-off-by: David S. Miller

    Johannes Berg
     
  • Now that we have a validation_data pointer, and the len field in
    the policy is unused for NLA_NESTED, we can allow using them both
    to have nested validation. This can be nice in code, although we
    still have to use nla_parse_nested() or similar which would also
    take a policy; however, it also serves as documentation in the
    policy without requiring a look at the code.

    Signed-off-by: Johannes Berg
    Signed-off-by: David S. Miller

    Johannes Berg
     
  • This unifies the code between nla_parse() which sets the bad
    attribute pointer and an error message, and nla_validate()
    which only sets the bad attribute pointer.

    It also cleans up the code for NLA_REJECT and paves the way
    for nested policy validation, as it will allow us to easily
    skip setting the "generic" message without any extra args
    like the **error_msg now, just passing the extack through is
    now enough.

    While at it, remove the unnecessary label in nla_parse().

    Suggested-by: David Ahern
    Signed-off-by: Johannes Berg
    Signed-off-by: David S. Miller

    Johannes Berg
     
  • The validation data is only used within the policy that
    should usually already be const, and isn't changed in any
    code that uses it. Therefore, make the validation_data
    pointer const.

    While at it, remove the duplicate variable in the bitfield
    validation that I'd otherwise have to change to const.

    Reviewed-by: David Ahern
    Signed-off-by: Johannes Berg
    Signed-off-by: David S. Miller

    Johannes Berg
     
  • This isn't used anywhere, so we might as well get rid of it.

    Reviewed-by: David Ahern
    Signed-off-by: Johannes Berg
    Signed-off-by: David S. Miller

    Johannes Berg
     

27 Sep, 2018

4 commits

  • rx_mini_pending was set to an incorrect value. This was causing EINVAL to
    always be returned to 'ethtool -G'. The driver does not support mini or
    jumbo rings so the respective settings should be zero.

    Also, change the valid range of the number of descriptors in the rings to
    make the code simpler and easier for users to understand (this removes the
    valid settings of 8 and 16). Add a system log message indicating when the
    number is rounded-up from what the user specifies with the 'ethtool -G'
    command (i.e. when it is not a multiple of 32), and update the log message
    when a user-provided value is out of range to also indicate the stride.

    Signed-off-by: Bruce Allan
    Signed-off-by: Anirudh Venkataramanan
    Tested-by: Andrew Bowers
    Signed-off-by: Jeff Kirsher

    Bruce Allan
     
  • This patch makes a couple of changes in the way the driver uses the
    "get capabilities" command.

    1. Get device capabilities in addition to function capabilities

    2. Align to latest spec by using cap_count to determine size of the
    buffer in case of length error.

    Signed-off-by: Anirudh Venkataramanan
    Tested-by: Andrew Bowers
    Signed-off-by: Jeff Kirsher

    Anirudh Venkataramanan
     
  • Query the Tx scheduler tree node information from FW before adding it to
    the driver's software database. This will keep the node information current
    in driver.

    Signed-off-by: Anirudh Venkataramanan
    Tested-by: Andrew Bowers
    Signed-off-by: Jeff Kirsher

    Anirudh Venkataramanan
     
  • Previously the comment stated that VSI lists should be used when a
    second VSI becomes a subscriber to the "VLAN address". VSI lists
    are always used for VLAN membership, so replace "VLAN address" with
    "MAC address". Also note that VLAN(s) always use VSI list rules.

    Signed-off-by: Brett Creeley
    Signed-off-by: Anirudh Venkataramanan
    Tested-by: Andrew Bowers
    Signed-off-by: Jeff Kirsher

    Brett Creeley