13 Jan, 2021

1 commit

  • [ Upstream commit 427c940558560bff2583d07fc119a21094675982 ]

    When aggregating ncsi interfaces and dedicated interfaces to bond
    interfaces, the ncsi response handler will use the wrong net device to
    find ncsi_dev, so that the ncsi interface will not work properly.
    Here, we use the original net device to fix it.

    Fixes: 138635cc27c9 ("net/ncsi: NCSI response packet handler")
    Signed-off-by: John Wang
    Link: https://lore.kernel.org/r/20201223055523.2069-1-wangzhiqiang.bj@bytedance.com
    Signed-off-by: Jakub Kicinski
    Signed-off-by: Greg Kroah-Hartman

    John Wang
     

13 Nov, 2020

1 commit

  • If a user unbinds and re-binds a NC-SI aware driver the kernel will
    attempt to register the netlink interface at runtime. The structure is
    marked __ro_after_init so registration fails spectacularly at this point.

    # echo 1e660000.ethernet > /sys/bus/platform/drivers/ftgmac100/unbind
    # echo 1e660000.ethernet > /sys/bus/platform/drivers/ftgmac100/bind
    ftgmac100 1e660000.ethernet: Read MAC address 52:54:00:12:34:56 from chip
    ftgmac100 1e660000.ethernet: Using NCSI interface
    8] lr : [] psr: 20000153
    sp : 8553bc80 ip : 81406244 fp : 8553bd04
    r10: 8085d12c r9 : 80a8f73c r8 : 85739000
    r7 : 00000017 r6 : 80a8f860 r5 : 80c8ab98 r4 : 80a8f858
    r3 : 00000000 r2 : 00000000 r1 : 81406130 r0 : 00000017
    Flags: nzCv IRQs on FIQs off Mode SVC_32 ISA ARM Segment none
    Control: 00c5387d Table: 85524008 DAC: 00000051
    Process sh (pid: 116, stack limit = 0x1f1988d6)
    ...
    Backtrace:
    [] (genl_register_family) from [] (ncsi_init_netlink+0x20/0x48)
    r10:8085d12c r9:80c8fb0c r8:85739000 r7:00000000 r6:81218000 r5:85739000
    r4:8121c000
    [] (ncsi_init_netlink) from [] (ncsi_register_dev+0x1b0/0x210)
    r5:8121c400 r4:8121c000
    [] (ncsi_register_dev) from [] (ftgmac100_probe+0x6e0/0x778)
    r10:00000004 r9:80950228 r8:8115bc10 r7:8115ab00 r6:9eae2c24 r5:813b6f88
    r4:85739000
    [] (ftgmac100_probe) from [] (platform_drv_probe+0x58/0xa8)
    r9:80c76bb0 r8:00000000 r7:80cd4974 r6:80c76bb0 r5:8115bc10 r4:00000000
    [] (platform_drv_probe) from [] (really_probe+0x204/0x514)
    r7:80cd4974 r6:00000000 r5:80cd4868 r4:8115bc10

    Jakub pointed out that ncsi_register_dev is obviously broken, because
    there is only one family so it would never work if there was more than
    one ncsi netdev.

    Fix the crash by registering the netlink family once on boot, and drop
    the code to unregister it.

    Fixes: 955dc68cb9b2 ("net/ncsi: Add generic netlink family")
    Signed-off-by: Joel Stanley
    Reviewed-by: Samuel Mendoza-Jonas
    Link: https://lore.kernel.org/r/20201112061210.914621-1-joel@jms.id.au
    Signed-off-by: Jakub Kicinski

    Joel Stanley
     

03 Oct, 2020

1 commit


24 Aug, 2020

1 commit

  • Replace the existing /* fall through */ comments and its variants with
    the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
    fall-through markings when it is the case.

    [1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

    Signed-off-by: Gustavo A. R. Silva

    Gustavo A. R. Silva
     

24 Jul, 2020

1 commit


14 Jun, 2020

1 commit

  • Since commit 84af7a6194e4 ("checkpatch: kconfig: prefer 'help' over
    '---help---'"), the number of '---help---' has been gradually
    decreasing, but there are still more than 2400 instances.

    This commit finishes the conversion. While I touched the lines,
    I also fixed the indentation.

    There are a variety of indentation styles found.

    a) 4 spaces + '---help---'
    b) 7 spaces + '---help---'
    c) 8 spaces + '---help---'
    d) 1 space + 1 tab + '---help---'
    e) 1 tab + '---help---' (correct indentation)
    f) 1 tab + 1 space + '---help---'
    g) 1 tab + 2 spaces + '---help---'

    In order to convert all of them to 1 tab + 'help', I ran the
    following commend:

    $ find . -name 'Kconfig*' | xargs sed -i 's/^[[:space:]]*---help---/\thelp/'

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

10 Jan, 2020

1 commit

  • Multi host Mellanox cards require MAC affinity to be set
    before receiving any config commands. All config commands
    should also have unicast address for source address in
    command header.

    Adding GMA and SMAF(Set Mac Affinity) for Mellanox card
    and call these in channel probe state machine if it is
    defined in device tree.

    Signed-off-by: Vijay Khemka
    Signed-off-by: David S. Miller

    Vijay Khemka
     

09 Jan, 2020

1 commit


31 Dec, 2019

1 commit

  • gma_flag was set at the time of GMA command request but it should
    only be set after getting successful response. Movinng this flag
    setting in GMA response handler.

    This flag is used mainly for not repeating GMA command once
    received MAC address.

    Signed-off-by: Vijay Khemka
    Reviewed-by: Samuel Mendoza-Jonas
    Signed-off-by: David S. Miller

    Vijay Khemka
     

20 Sep, 2019

1 commit

  • Disabling multicast filtering from NCSI if it is supported. As it
    should not filter any multicast packets. In current code, multicast
    filter is enabled and with an exception of optional field supported
    by device are disabled filtering.

    Mainly I see if goal is to disable filtering for IPV6 packets then let
    it disabled for every other types as well. As we are seeing issues with
    LLDP not working with this enabled filtering. And there are other issues
    with IPV6.

    By Disabling this multicast completely, it is working for both IPV6 as
    well as LLDP.

    Signed-off-by: Vijay Khemka
    Acked-by: Samuel Mendoza-Jonas
    Signed-off-by: Jakub Kicinski

    Vijay Khemka
     

01 Sep, 2019

1 commit

  • This patch adds handlers for PLDM over NC-SI command response.

    This enables NC-SI driver recognizes the packet type so the responses
    don't get dropped as unknown packet type.

    PLDM over NC-SI are not handled in kernel driver for now, but can be
    passed back to user space via Netlink for further handling.

    Signed-off-by: Ben Wei
    Signed-off-by: David S. Miller

    Ben Wei
     

28 Aug, 2019

1 commit


23 Aug, 2019

2 commits


21 Aug, 2019

1 commit


31 May, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 of the license or at
    your option any later version

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-or-later

    has been chosen to replace the boilerplate/reference in 3029 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190527070032.746973796@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

21 May, 2019

1 commit


28 Apr, 2019

3 commits

  • Add options to strictly validate messages and dump messages,
    sometimes perhaps validating dump messages non-strictly may
    be required, so add an option for that as well.

    Since none of this can really be applied to existing commands,
    set the options everwhere using the following spatch:

    @@
    identifier ops;
    expression X;
    @@
    struct genl_ops ops[] = {
    ...,
    {
    .cmd = X,
    + .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
    ...
    },
    ...
    };

    For new commands one should just not copy the .validate 'opt-out'
    flags and thus get strict validation.

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

    Johannes Berg
     
  • We currently have two levels of strict validation:

    1) liberal (default)
    - undefined (type >= max) & NLA_UNSPEC attributes accepted
    - attribute length >= expected accepted
    - garbage at end of message accepted
    2) strict (opt-in)
    - NLA_UNSPEC attributes accepted
    - attribute length >= expected accepted

    Split out parsing strictness into four different options:
    * TRAILING - check that there's no trailing data after parsing
    attributes (in message or nested)
    * MAXTYPE - reject attrs > max known type
    * UNSPEC - reject attributes with NLA_UNSPEC policy entries
    * STRICT_ATTRS - strictly validate attribute size

    The default for future things should be *everything*.
    The current *_strict() is a combination of TRAILING and MAXTYPE,
    and is renamed to _deprecated_strict().
    The current regular parsing has none of this, and is renamed to
    *_parse_deprecated().

    Additionally it allows us to selectively set one of the new flags
    even on old policies. Notably, the UNSPEC flag could be useful in
    this case, since it can be arranged (by filling in the policy) to
    not be an incompatible userspace ABI change, but would then going
    forward prevent forgetting attribute entries. Similar can apply
    to the POLICY flag.

    We end up with the following renames:
    * nla_parse -> nla_parse_deprecated
    * nla_parse_strict -> nla_parse_deprecated_strict
    * nlmsg_parse -> nlmsg_parse_deprecated
    * nlmsg_parse_strict -> nlmsg_parse_deprecated_strict
    * nla_parse_nested -> nla_parse_nested_deprecated
    * nla_validate_nested -> nla_validate_nested_deprecated

    Using spatch, of course:
    @@
    expression TB, MAX, HEAD, LEN, POL, EXT;
    @@
    -nla_parse(TB, MAX, HEAD, LEN, POL, EXT)
    +nla_parse_deprecated(TB, MAX, HEAD, LEN, POL, EXT)

    @@
    expression NLH, HDRLEN, TB, MAX, POL, EXT;
    @@
    -nlmsg_parse(NLH, HDRLEN, TB, MAX, POL, EXT)
    +nlmsg_parse_deprecated(NLH, HDRLEN, TB, MAX, POL, EXT)

    @@
    expression NLH, HDRLEN, TB, MAX, POL, EXT;
    @@
    -nlmsg_parse_strict(NLH, HDRLEN, TB, MAX, POL, EXT)
    +nlmsg_parse_deprecated_strict(NLH, HDRLEN, TB, MAX, POL, EXT)

    @@
    expression TB, MAX, NLA, POL, EXT;
    @@
    -nla_parse_nested(TB, MAX, NLA, POL, EXT)
    +nla_parse_nested_deprecated(TB, MAX, NLA, POL, EXT)

    @@
    expression START, MAX, POL, EXT;
    @@
    -nla_validate_nested(START, MAX, POL, EXT)
    +nla_validate_nested_deprecated(START, MAX, POL, EXT)

    @@
    expression NLH, HDRLEN, MAX, POL, EXT;
    @@
    -nlmsg_validate(NLH, HDRLEN, MAX, POL, EXT)
    +nlmsg_validate_deprecated(NLH, HDRLEN, MAX, POL, EXT)

    For this patch, don't actually add the strict, non-renamed versions
    yet so that it breaks compile if I get it wrong.

    Also, while at it, make nla_validate and nla_parse go down to a
    common __nla_validate_parse() function to avoid code duplication.

    Ultimately, this allows us to have very strict validation for every
    new caller of nla_parse()/nlmsg_parse() etc as re-introduced in the
    next patch, while existing things will continue to work as is.

    In effect then, this adds fully strict validation for any new command.

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

    Johannes Berg
     
  • Even if the NLA_F_NESTED flag was introduced more than 11 years ago, most
    netlink based interfaces (including recently added ones) are still not
    setting it in kernel generated messages. Without the flag, message parsers
    not aware of attribute semantics (e.g. wireshark dissector or libmnl's
    mnl_nlmsg_fprintf()) cannot recognize nested attributes and won't display
    the structure of their contents.

    Unfortunately we cannot just add the flag everywhere as there may be
    userspace applications which check nlattr::nla_type directly rather than
    through a helper masking out the flags. Therefore the patch renames
    nla_nest_start() to nla_nest_start_noflag() and introduces nla_nest_start()
    as a wrapper adding NLA_F_NESTED. The calls which add NLA_F_NESTED manually
    are rewritten to use nla_nest_start().

    Except for changes in include/net/netlink.h, the patch was generated using
    this semantic patch:

    @@ expression E1, E2; @@
    -nla_nest_start(E1, E2)
    +nla_nest_start_noflag(E1, E2)

    @@ expression E1, E2; @@
    -nla_nest_start_noflag(E1, E2 | NLA_F_NESTED)
    +nla_nest_start(E1, E2)

    Signed-off-by: Michal Kubecek
    Acked-by: Jiri Pirko
    Acked-by: David Ahern
    Signed-off-by: David S. Miller

    Michal Kubecek
     

26 Apr, 2019

1 commit


24 Apr, 2019

1 commit

  • Previously BMC's MAC address is calculated by simply adding 1 to the
    last byte of network controller's MAC address, and it produces incorrect
    result when network controller's MAC address ends with 0xFF.

    The problem can be fixed by calling eth_addr_inc() function to increment
    MAC address; besides, the MAC address is also validated before assigning
    to BMC.

    Fixes: cb10c7c0dfd9 ("net/ncsi: Add NCSI Broadcom OEM command")
    Signed-off-by: Tao Ren
    Acked-by: Jakub Kicinski
    Acked-by: Samuel Mendoza-Jonas
    Signed-off-by: David S. Miller

    Tao Ren
     

22 Mar, 2019

1 commit

  • Since maxattr is common, the policy can't really differ sanely,
    so make it common as well.

    The only user that did in fact manage to make a non-common policy
    is taskstats, which has to be really careful about it (since it's
    still using a common maxattr!). This is no longer supported, but
    we can fake it using pre_doit.

    This reduces the size of e.g. nl80211.o (which has lots of commands):

    text data bss dec hex filename
    398745 14323 2240 415308 6564c net/wireless/nl80211.o (before)
    397913 14331 2240 414484 65314 net/wireless/nl80211.o (after)
    --------------------------------
    -832 +8 0 -824

    Which is obviously just 8 bytes for each command, and an added 8
    bytes for the new policy pointer. I'm not sure why the ops list is
    counted as .text though.

    Most of the code transformations were done using the following spatch:
    @ops@
    identifier OPS;
    expression POLICY;
    @@
    struct genl_ops OPS[] = {
    ...,
    {
    - .policy = POLICY,
    },
    ...
    };

    @@
    identifier ops.OPS;
    expression ops.POLICY;
    identifier fam;
    expression M;
    @@
    struct genl_family fam = {
    .ops = OPS,
    .maxattr = M,
    + .policy = POLICY,
    ...
    };

    This also gets rid of devlink_nl_cmd_region_read_dumpit() accessing
    the cb->data as ops, which we want to change in a later genl patch.

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

    Johannes Berg
     

17 Mar, 2019

1 commit


28 Nov, 2018

1 commit

  • This patch adds OEM Mellanox commands and response handling. It also
    defines OEM Get MAC Address handler to get and configure the device.

    ncsi_oem_gma_handler_mlx: This handler send NCSI mellanox command for
    getting mac address.
    ncsi_rsp_handler_oem_mlx: This handles response received for all
    mellanox OEM commands.
    ncsi_rsp_handler_oem_mlx_gma: This handles get mac address response and
    set it to device.

    Signed-off-by: Vijay Khemka
    Signed-off-by: David S. Miller

    Vijay Khemka
     

18 Nov, 2018

6 commits

  • This patch extends the ncsi-netlink interface with two new commands and
    three new attributes to configure multiple packages and/or channels at
    once, and configure specific failover modes.

    NCSI_CMD_SET_PACKAGE mask and NCSI_CMD_SET_CHANNEL_MASK set a whitelist
    of packages or channels allowed to be configured with the
    NCSI_ATTR_PACKAGE_MASK and NCSI_ATTR_CHANNEL_MASK attributes
    respectively. If one of these whitelists is set only packages or
    channels matching the whitelist are considered for the channel queue in
    ncsi_choose_active_channel().

    These commands may also use the NCSI_ATTR_MULTI_FLAG to signal that
    multiple packages or channels may be configured simultaneously. NCSI
    hardware arbitration (HWA) must be available in order to enable
    multi-package mode. Multi-channel mode is always available.

    If the NCSI_ATTR_CHANNEL_ID attribute is present in the
    NCSI_CMD_SET_CHANNEL_MASK command the it sets the preferred channel as
    with the NCSI_CMD_SET_INTERFACE command. The combination of preferred
    channel and channel whitelist defines a primary channel and the allowed
    failover channels.
    If the NCSI_ATTR_MULTI_FLAG attribute is also present then the preferred
    channel is configured for Tx/Rx and the other channels are enabled only
    for Rx.

    Signed-off-by: Samuel Mendoza-Jonas
    Signed-off-by: David S. Miller

    Samuel Mendoza-Jonas
     
  • When the NCSI driver is stopped with ncsi_stop_dev() the channel
    monitors are stopped and the state set to "inactive". However the
    channels are still configured and active from the perspective of the
    network controller. We should suspend each active channel but in the
    context of ncsi_stop_dev() the transmit queue has been or is about to be
    stopped so we won't have time to do so.

    Instead when ncsi_start_dev() is called if the NCSI topology has already
    been probed then call ncsi_reset_dev() to suspend any channels that were
    previously active. This resets the network controller to a known state,
    provides an up to date view of channel link state, and makes sure that
    mode flags such as NCSI_MODE_TX_ENABLE are properly reset.

    In addition to ncsi_start_dev() use ncsi_reset_dev() in ncsi-netlink.c
    to update the channel configuration more cleanly.

    Signed-off-by: Samuel Mendoza-Jonas
    Signed-off-by: David S. Miller

    Samuel Mendoza-Jonas
     
  • The concepts of a channel being 'active' and it having link are slightly
    muddled in the NCSI driver. Tweak this slightly so that
    NCSI_CHANNEL_ACTIVE represents a channel that has been configured and
    enabled, and NCSI_CHANNEL_INACTIVE represents a de-configured channel.
    This distinction is important because a channel can be 'active' but have
    its link down; in this case the channel may still need to be configured
    so that it may receive AEN link-state-change packets.

    Signed-off-by: Samuel Mendoza-Jonas
    Signed-off-by: David S. Miller

    Samuel Mendoza-Jonas
     
  • When a package is deselected all channels of that package cease
    communication. If there are other channels active on the package of the
    suspended channel this will disable them as well, so only send a
    deselect-package command if no other channels are active.

    Signed-off-by: Samuel Mendoza-Jonas
    Signed-off-by: David S. Miller

    Samuel Mendoza-Jonas
     
  • Currently the NCSI driver sends a select-package command to all possible
    packages simultaneously to discover what packages are available. However
    at this stage in the probe process the driver does not know if
    hardware arbitration is available: if it isn't then this process could
    cause collisions on the RMII bus when packages try to respond.

    Update the probe loop to probe each package one by one, and once
    complete check if HWA is universally supported.

    Signed-off-by: Samuel Mendoza-Jonas
    Signed-off-by: David S. Miller

    Samuel Mendoza-Jonas
     
  • NCSI hardware arbitration allows multiple packages to be enabled at once
    and share the same wiring. If the NCSI driver recognises that HWA is
    available it unconditionally enables all packages and channels; but that
    is a configuration decision rather than something required by HWA.
    Additionally the current implementation will not failover on link events
    which can cause connectivity to be lost unless the interface is manually
    bounced.

    Retain basic HWA support but remove the separate configuration path to
    enable all channels, leaving this to be handled by a later
    implementation.

    Signed-off-by: Samuel Mendoza-Jonas
    Signed-off-by: David S. Miller

    Samuel Mendoza-Jonas
     

18 Oct, 2018

1 commit

  • This patch adds OEM Broadcom commands and response handling. It also
    defines OEM Get MAC Address handler to get and configure the device.

    ncsi_oem_gma_handler_bcm: This handler send NCSI broadcom command for
    getting mac address.
    ncsi_rsp_handler_oem_bcm: This handles response received for all
    broadcom OEM commands.
    ncsi_rsp_handler_oem_bcm_gma: This handles get mac address response and
    set it to device.

    Signed-off-by: Vijay Khemka
    Reviewed-by: Samuel Mendoza-Jonas
    Signed-off-by: David S. Miller

    Vijay Khemka
     

16 Oct, 2018

1 commit

  • The new command (NCSI_CMD_SEND_CMD) is added to allow user space application
    to send NC-SI command to the network card.
    Also, add a new attribute (NCSI_ATTR_DATA) for transferring request and response.

    The work flow is as below.

    Request:
    User space application
    -> Netlink interface (msg)
    -> new Netlink handler - ncsi_send_cmd_nl()
    -> ncsi_xmit_cmd()

    Response:
    Response received - ncsi_rcv_rsp()
    -> internal response handler - ncsi_rsp_handler_xxx()
    -> ncsi_rsp_handler_netlink()
    -> ncsi_send_netlink_rsp ()
    -> Netlink interface (msg)
    -> user space application

    Command timeout - ncsi_request_timeout()
    -> ncsi_send_netlink_timeout ()
    -> Netlink interface (msg with zero data length)
    -> user space application

    Error:
    Error detected
    -> ncsi_send_netlink_err ()
    -> Netlink interface (err msg)
    -> user space application

    Signed-off-by: Justin Lee
    Reviewed-by: Samuel Mendoza-Jonas
    Signed-off-by: David S. Miller

    Justin.Lee1@Dell.com
     

06 Oct, 2018

1 commit

  • This patch adds OEM commands and response handling. It also defines OEM
    command and response structure as per NCSI specification along with its
    handlers.

    ncsi_cmd_handler_oem: This is a generic command request handler for OEM
    commands
    ncsi_rsp_handler_oem: This is a generic response handler for OEM commands

    Signed-off-by: Vijay Khemka
    Reviewed-by: Justin Lee
    Reviewed-by: Samuel Mendoza-Jonas
    Signed-off-by: David S. Miller

    Vijay Khemka
     

30 Aug, 2018

1 commit


23 Aug, 2018

1 commit


20 Jun, 2018

3 commits

  • This moves all of the netdev_printk(KERN_DEBUG, ...) messages over to
    netdev_dbg.

    As Joe explains:

    > netdev_dbg is not included in object code unless
    > DEBUG is defined or CONFIG_DYNAMIC_DEBUG is set.
    > And then, it is not emitted into the log unless
    > DEBUG is set or this specific netdev_dbg is enabled
    > via the dynamic debug control file.

    Which is what we're after in this case.

    Acked-by: Samuel Mendoza-Jonas
    Signed-off-by: Joel Stanley
    Signed-off-by: David S. Miller

    Joel Stanley
     
  • This does not provide useful information. As the ncsi maintainer said:

    > either we get a channel or broadcom has gone out to lunch

    Acked-by: Samuel Mendoza-Jonas
    Signed-off-by: Joel Stanley
    Signed-off-by: David S. Miller

    Joel Stanley
     
  • In normal operation we see this series of messages as the host drives
    the network device:

    ftgmac100 1e660000.ethernet eth0: NCSI: LSC AEN - channel 0 state down
    ftgmac100 1e660000.ethernet eth0: NCSI: suspending channel 0
    ftgmac100 1e660000.ethernet eth0: NCSI: configuring channel 0
    ftgmac100 1e660000.ethernet eth0: NCSI: channel 0 link down after config
    ftgmac100 1e660000.ethernet eth0: NCSI interface down
    ftgmac100 1e660000.ethernet eth0: NCSI: LSC AEN - channel 0 state up
    ftgmac100 1e660000.ethernet eth0: NCSI: configuring channel 0
    ftgmac100 1e660000.ethernet eth0: NCSI interface up
    ftgmac100 1e660000.ethernet eth0: NCSI: LSC AEN - channel 0 state down
    ftgmac100 1e660000.ethernet eth0: NCSI: suspending channel 0
    ftgmac100 1e660000.ethernet eth0: NCSI: configuring channel 0
    ftgmac100 1e660000.ethernet eth0: NCSI: channel 0 link down after config
    ftgmac100 1e660000.ethernet eth0: NCSI interface down
    ftgmac100 1e660000.ethernet eth0: NCSI: LSC AEN - channel 0 state up
    ftgmac100 1e660000.ethernet eth0: NCSI: configuring channel 0
    ftgmac100 1e660000.ethernet eth0: NCSI interface up

    This makes all of these messages netdev_dbg. They are still useful to
    debug eg. misbehaving network device firmware, but we do not need them
    filling up the kernel logs in normal operation.

    Acked-by: Samuel Mendoza-Jonas
    Signed-off-by: Joel Stanley
    Signed-off-by: David S. Miller

    Joel Stanley
     

03 Jun, 2018

1 commit

  • ncsi_rsp_handler_gc() allocates the filter arrays using GFP_KERNEL in
    softirq context, causing the below backtrace. This allocation is only a
    few dozen bytes during probing so allocate with GFP_ATOMIC instead.

    [ 42.813372] BUG: sleeping function called from invalid context at mm/slab.h:416
    [ 42.820900] in_atomic(): 1, irqs_disabled(): 0, pid: 213, name: kworker/0:1
    [ 42.827893] INFO: lockdep is turned off.
    [ 42.832023] CPU: 0 PID: 213 Comm: kworker/0:1 Tainted: G W 4.13.16-01441-gad99b38 #65
    [ 42.841007] Hardware name: Generic DT based system
    [ 42.845966] Workqueue: events ncsi_dev_work
    [ 42.850251] [] (unwind_backtrace) from [] (show_stack+0x20/0x24)
    [ 42.858046] [] (show_stack) from [] (dump_stack+0x20/0x28)
    [ 42.865309] [] (dump_stack) from [] (___might_sleep+0x230/0x2b0)
    [ 42.873241] [] (___might_sleep) from [] (__might_sleep+0x6c/0xac)
    [ 42.881129] [] (__might_sleep) from [] (__kmalloc+0x210/0x2fc)
    [ 42.888737] [] (__kmalloc) from [] (ncsi_rsp_handler_gc+0xd0/0x170)
    [ 42.896770] [] (ncsi_rsp_handler_gc) from [] (ncsi_rcv_rsp+0x16c/0x1d4)
    [ 42.905314] [] (ncsi_rcv_rsp) from [] (__netif_receive_skb_core+0x3c8/0xb50)
    [ 42.914158] [] (__netif_receive_skb_core) from [] (__netif_receive_skb+0x20/0x7c)
    [ 42.923420] [] (__netif_receive_skb) from [] (netif_receive_skb_internal+0x78/0x6a4)
    [ 42.932931] [] (netif_receive_skb_internal) from [] (netif_receive_skb+0x78/0x158)
    [ 42.942292] [] (netif_receive_skb) from [] (ftgmac100_poll+0x43c/0x4e8)
    [ 42.950855] [] (ftgmac100_poll) from [] (net_rx_action+0x278/0x4c4)
    [ 42.958918] [] (net_rx_action) from [] (__do_softirq+0xe0/0x4c4)
    [ 42.966716] [] (__do_softirq) from [] (do_softirq.part.4+0x50/0x78)
    [ 42.974756] [] (do_softirq.part.4) from [] (__local_bh_enable_ip+0xf8/0x11c)
    [ 42.983579] [] (__local_bh_enable_ip) from [] (__dev_queue_xmit+0x260/0x890)
    [ 42.992392] [] (__dev_queue_xmit) from [] (dev_queue_xmit+0x1c/0x20)
    [ 43.000689] [] (dev_queue_xmit) from [] (ncsi_xmit_cmd+0x1c0/0x244)
    [ 43.008763] [] (ncsi_xmit_cmd) from [] (ncsi_dev_work+0x2e0/0x4c8)
    [ 43.016725] [] (ncsi_dev_work) from [] (process_one_work+0x214/0x6f8)
    [ 43.024940] [] (process_one_work) from [] (worker_thread+0x48/0x558)
    [ 43.033070] [] (worker_thread) from [] (kthread+0x130/0x174)
    [ 43.040506] [] (kthread) from [] (ret_from_fork+0x14/0x24)

    Fixes: 062b3e1b6d4f ("net/ncsi: Refactor MAC, VLAN filters")
    Signed-off-by: Samuel Mendoza-Jonas
    Signed-off-by: David S. Miller

    Samuel Mendoza-Jonas