19 Feb, 2020

13 commits

  • Add support for low latency Reed Solomon FEC as LLRS.

    The LL-FEC is defined by the 25G/50G ethernet consortium,
    in the document titled "Low Latency Reed Solomon Forward Error Correction"

    Signed-off-by: Aya Levin
    Reviewed-by: Eran Ben Elisha
    CC: Andrew Lunn
    Signed-off-by: Saeed Mahameed
    Reviewed-by: Andrew Lunn

    Aya Levin
     
  • FEC mode is per link type, not necessary per speed. This patch access
    FEC register by link modes instead of speeds. This patch will allow
    further enhacment of link modes supporting FEC with the same speed
    (different lane type).

    Signed-off-by: Aya Levin
    Signed-off-by: Saeed Mahameed

    Aya Levin
     
  • Ethtool advertise supported link modes on an interface. Per each FEC
    mode, query if there is a link type which supports it. If so, add this
    FEC mode to the supported FEC modes list. Prior to this patch, ethtool
    advertised only the supported FEC modes on the current link type.
    Add an explicit mapping between internal FEC modes and ethtool link mode
    bits. With this change, adding new FEC modes in the downstream patch
    would be easier.

    Signed-off-by: Aya Levin
    Reviewed-by: Eran Ben Elisha
    Signed-off-by: Saeed Mahameed

    Aya Levin
     
  • Ethtool command allow setting of several FEC modes in a single set
    command. The driver can only set a single FEC mode at a time. With this
    patch driver will reply not-supported on setting several FEC modes.

    Signed-off-by: Aya Levin
    Signed-off-by: Saeed Mahameed

    Aya Levin
     
  • When configuring FEC mode, driver tries to set it for all available
    link types. If a link type doesn't support a FEC mode, set this link
    type to auto (FW best effort). Prior to this patch, when a link type
    didn't support a FEC mode is was set to no FEC.

    Signed-off-by: Aya Levin
    Reviewed-by: Eran Ben Elisha
    Signed-off-by: Saeed Mahameed

    Aya Levin
     
  • netdev_err should use newline termination but mlx5_health_report
    is used in a trace output function devlink_health_report where
    no newline should be used.

    Remove the newlines from a couple formats and add a format string
    of "%s\n" to the netdev_err call to not directly output the
    logging string.

    Also use snprintf to avoid any possible output string overrun.

    Signed-off-by: Joe Perches
    Signed-off-by: Saeed Mahameed

    Joe Perches
     
  • Add support for SQ's FW dump on RX reporter's events. Use Resource dump
    API to retrieve the relevant data: RX slice, RQ dump, RX buffer and
    ICOSQ dump (depends on the error). Wrap it in formatted messages and
    store the binary output in devlink core.

    Example:
    $ devlink health dump show pci/0000:00:0b.0 reporter rx
    RX Slice:
    data:
    00 00 00 00 00 00 00 80 00 01 00 00 00 00 ad de
    22 01 00 00 00 00 ad de 00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    ff ff ff ff 01 00 00 00 00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 80 00 01 00 00 00 00 ad de
    22 01 00 00 00 00 ad de 00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    ff ff ff ff 01 00 00 00 00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 80 00 01 00 00 00 00 ad de
    RQs:
    RQ:
    rqn: 1512
    data:
    00 00 00 00 00 00 00 80 00 01 00 00 00 00 ad de
    22 01 00 00 00 00 ad de 00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    ff ff ff ff 01 00 00 00 00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 80 00 01 00 00 00 00 ad de
    22 01 00 00 00 00 ad de 00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    ff ff ff ff 01 00 00 00 00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 80 00 01 00 00 00 00 ad de
    RQ:
    rqn: 1517
    data:
    00 00 00 00 00 00 00 80 00 01 00 00 00 00 ad de
    22 01 00 00 00 00 ad de 00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    ff ff ff ff 01 00 00 00 00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 80 00 01 00 00 00 00 ad de
    22 01 00 00 00 00 ad de 00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    ff ff ff ff 01 00 00 00 00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 80 00 01 00 00 00 00 ad de

    $ devlink health dump show pci/0000:00:0b.0 reporter rx -jp
    {
    "RX Slice": {
    "data":[ 0,0,0,0,0,0,0,128,0,1,0,0,0,0,173,222,34,1,0,0,0,0,173,222,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,1,0,0,0,0,173,222,34,1,0,0,0,0,173,222,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,1,0,0,0,0,173,222,34,1,0,0,0,0,173,222,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,1,0,0,0,0,173,222,34,1,0,0,0,0,173,222,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,1,0,0,0,0,173,222,34,1,0,0,0,0,173,222,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,2,1,0,0,0,0,128,0,1,0,0,0,0,173,222]
    },
    "RQs": [ {
    "RQ": {
    "index": 1512,
    "data": [ 0,0,0,0,0,0,0,128,0,1,0,0,0,0,173,222,34,1,0,0,0,0,173,222,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,1,0,0,0,0,173,222,34,1,0,0,0,0,173,222,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,1,0,0,0,0,173,222,34,1,0,0,0,0,173,222,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,1,0,0,0,0,173,222,34,1,0,0,0,0,173,222,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,1,0,0,0,0,173,222,34,1,0,0,0,0,173,222,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,2,1,0,0,0,0,128,0,1,0,0,0,0,173,222]
    }
    },{
    "RQ": {
    "index": 1517,
    "data": [ 0,0,0,0,0,0,0,128,0,1,0,0,0,0,173,222,34,1,0,0,0,0,173,222,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,1,0,0,0,0,173,222,34,1,0,0,0,0,173,222,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,1,0,0,0,0,173,222,34,1,0,0,0,0,173,222,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,1,0,0,0,0,173,222,34,1,0,0,0,0,173,222,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,1,0,0,0,0,173,222,34,1,0,0,0,0,173,222,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,2,1,0,0,0,0,128,0,1,0,0,0,0,173]
    }
    } ]
    }

    Signed-off-by: Aya Levin
    Reviewed-by: Moshe Shemesh
    Acked-by: Jiri Pirko
    Signed-off-by: Saeed Mahameed

    Aya Levin
     
  • Add support for SQ's FW dump on TX reporter's events. Use Resource dump
    API to retrieve the relevant data: SX slice, SQ dump and SQ buffer. Wrap
    it in formatted messages and store the binary output in devlink core.

    Example:
    $ devlink health dump show pci/0000:00:0b.0 reporter tx
    SX Slice:
    data:
    00 00 00 00 00 00 00 80 00 01 00 00 00 00 ad de
    22 01 00 00 00 00 ad de 00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    ff ff ff ff 01 00 00 00 00 00 00 00 00 00 00 00
    00 02 01 00 00 00 00 80 00 01 00 00 00 00 ad de
    22 01 00 00 00 00 ad de 00 20 40 90 81 88 ff ff
    00 00 00 00 00 00 00 00 15 00 15 00 00 00 00 00
    ff ff ff ff 01 00 00 00 00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 80 81 ae 41 06 00 ea ff ff
    SQs:
    SQ:
    index: 1511
    data:
    00 00 00 00 00 00 00 80 00 01 00 00 00 00 ad de
    22 01 00 00 00 00 ad de 00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    ff ff ff ff 01 00 00 00 00 00 00 00 00 00 00 00
    00 02 01 00 00 00 00 80 00 01 00 00 00 00 ad de
    22 01 00 00 00 00 ad de 00 20 40 90 81 88 ff ff
    00 00 00 00 00 00 00 00 15 00 15 00 00 00 00 00
    ff ff ff ff 01 00 00 00 00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 80 81 ae 41 06 00 ea ff ff
    SQ:
    index: 1516
    data:
    00 00 00 00 00 00 00 80 00 01 00 00 00 00 ad de
    22 01 00 00 00 00 ad de 00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    ff ff ff ff 01 00 00 00 00 00 00 00 00 00 00 00
    00 02 01 00 00 00 00 80 00 01 00 00 00 00 ad de
    22 01 00 00 00 00 ad de 00 20 40 90 81 88 ff ff
    00 00 00 00 00 00 00 00 15 00 15 00 00 00 00 00
    ff ff ff ff 01 00 00 00 00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 80 81 ae 41 06 00 ea ff ff

    $ devlink health dump show pci/0000:00:0b.0 reporter tx -jp
    {
    "SX Slice": {
    "data": [ 0,0,0,0,0,0,0,128,0,1,0,0,0,0,173,222,34,1,0,0,0,0,173,222,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,2,1,0,0,0,0,128,0,1,0,0,0,0,173,222,34,1,0,0,0,0,173,222,0,32,64,144,129,136,255,255,0,0,0,0,0,0,0,0,21,0,21,0,0,0,0,0,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,129,174,65,6,0,234,255,255],
    },
    "SQs": [ {
    "SQ": {
    "index": 1511,
    "data": [ 0,0,0,0,0,0,0,128,0,1,0,0,0,0,173,222,34,1,0,0,0,0,173,222,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,2,1,0,0,0,0,128,0,1,0,0,0,0,173,222,34,1,0,0,0,0,173,222,0,32,64,144,129,136,255,255,0,0,0,0,0,0,0,0,21,0,21,0,0,0,0,0,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,129,174,65,6,0,234,255,255]
    }
    },{
    "SQ": {
    "index": 1516,
    "data": [ 0,0,0,0,0,0,0,128,0,1,0,0,0,0,173,222,34,1,0,0,0,0,173,222,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,2,1,0,0,0,0,128,0,1,0,0,0,0,173,222,34,1,0,0,0,0,173,222,0,32,64,144,129,136,255,255,0,0,0,0,0,0,0,0,21,0,21,0,0,0,0,0,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,129,174,65,6,0,234,255,255]
    }
    } ]
    }

    Signed-off-by: Aya Levin
    Reviewed-by: Moshe Shemesh
    Acked-by: Jiri Pirko
    Signed-off-by: Saeed Mahameed

    Aya Levin
     
  • Assemble all the API's to ease insertion of dump callbacks in the
    following patches in the set.

    Signed-off-by: Aya Levin
    Reviewed-by: Moshe Shemesh
    Acked-by: Jiri Pirko
    Signed-off-by: Saeed Mahameed

    Aya Levin
     
  • On driver load:
    - Initialize resource dump data structure and memory access tools (mkey
    & pd).
    - Read the resource dump's menu which contains the FW segment
    identifier. Each record is identified by the segment name (ASCII).

    During the driver's course of life, users (like reporters) may request
    dumps per segment. The user should create a command providing the
    segment identifier (SW enumeration) and command keys. In return, the
    user receives a command context. In order to receive the dump, the user
    should supply the command context and a memory (aligned to a PAGE) on
    which the dump content will be written. Since the dump may be larger
    than the given memory, the user may resubmit the command until received
    an indication of end-of-dump. It is the user's responsibility to destroy
    the command.

    Signed-off-by: Aya Levin
    Reviewed-by: Moshe Shemesh
    Acked-by: Jiri Pirko
    Signed-off-by: Saeed Mahameed

    Aya Levin
     
  • Add a new API for start/end binary array brackets [] to force array
    around binary data as required from JSON. With this restriction, re-open
    API to set binary fmsg data.

    Signed-off-by: Aya Levin
    Reviewed-by: Jiri Pirko
    Signed-off-by: Saeed Mahameed

    Aya Levin
     
  • Instead of assigning skb = segments before the loop, just pass
    segments directly as the first argument to skb_list_walk_safe().

    Signed-off-by: Edward Cree
    Signed-off-by: David S. Miller

    Edward Cree
     
  • After performing an unbind/bind operation the network is no longer
    functional on i.MX6 (which has a single FEC instance):

    # echo 2188000.ethernet > /sys/bus/platform/drivers/fec/unbind
    # echo 2188000.ethernet > /sys/bus/platform/drivers/fec/bind
    [ 10.756519] pps pps0: new PPS source ptp0
    [ 10.792626] libphy: fec_enet_mii_bus: probed
    [ 10.799330] fec 2188000.ethernet eth0: registered PHC device 1
    # udhcpc -i eth0
    udhcpc: started, v1.31.1
    [ 14.985211] fec 2188000.ethernet eth0: no PHY, assuming direct connection to switch
    [ 14.993140] libphy: PHY fixed-0:00 not found
    [ 14.997643] fec 2188000.ethernet eth0: could not attach to PHY

    On SoCs with two FEC instances there are some cases where one FEC instance
    depends on the other one being present. One such example is i.MX28, which
    has the following FEC dependency as noted in the comments:

    /*
    * The i.MX28 dual fec interfaces are not equal.
    * Here are the differences:
    *
    * - fec0 supports MII & RMII modes while fec1 only supports RMII
    * - fec0 acts as the 1588 time master while fec1 is slave
    * - external phys can only be configured by fec0
    *
    * That is to say fec1 can not work independently. It only works
    * when fec0 is working. The reason behind this design is that the
    * second interface is added primarily for Switch mode.
    *
    * Because of the last point above, both phys are attached on fec0
    * mdio interface in board design, and need to be configured by
    * fec0 mii_bus.
    */

    Prevent the unbind operation to avoid these issues.

    Signed-off-by: Fabio Estevam
    Signed-off-by: David S. Miller

    Fabio Estevam
     

18 Feb, 2020

27 commits

  • drivers/net/ethernet/amazon/ena/ena_com.c: In function ena_com_hash_key_allocate:
    drivers/net/ethernet/amazon/ena/ena_com.c:1070:50:
    warning: variable hash_key set but not used [-Wunused-but-set-variable]

    commit 6a4f7dc82d1e ("net: ena: rss: do not allocate key when not supported")
    introduced this, but not used, so remove it.

    Reported-by: Hulk Robot
    Signed-off-by: YueHaibing
    Signed-off-by: David S. Miller

    YueHaibing
     
  • The current codebase makes use of the zero-length array language
    extension to the C90 standard, but the preferred mechanism to declare
    variable-length types such as these ones is a flexible array member[1][2],
    introduced in C99:

    struct foo {
    int stuff;
    struct boo array[];
    };

    By making use of the mechanism above, we will get a compiler warning
    in case the flexible array does not occur last in the structure, which
    will help us prevent some kind of undefined behavior bugs from being
    inadvertently introduced[3] to the codebase from now on.

    Also, notice that, dynamic memory allocations won't be affected by
    this change:

    "Flexible array members have incomplete type, and so the sizeof operator
    may not be applied. As a quirk of the original implementation of
    zero-length arrays, sizeof evaluates to zero."[1]

    This issue was found with the help of Coccinelle.

    [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
    [2] https://github.com/KSPP/linux/issues/21
    [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour")

    Signed-off-by: Gustavo A. R. Silva
    Signed-off-by: David S. Miller

    Gustavo A. R. Silva
     
  • The current codebase makes use of the zero-length array language
    extension to the C90 standard, but the preferred mechanism to declare
    variable-length types such as these ones is a flexible array member[1][2],
    introduced in C99:

    struct foo {
    int stuff;
    struct boo array[];
    };

    By making use of the mechanism above, we will get a compiler warning
    in case the flexible array does not occur last in the structure, which
    will help us prevent some kind of undefined behavior bugs from being
    inadvertently introduced[3] to the codebase from now on.

    Also, notice that, dynamic memory allocations won't be affected by
    this change:

    "Flexible array members have incomplete type, and so the sizeof operator
    may not be applied. As a quirk of the original implementation of
    zero-length arrays, sizeof evaluates to zero."[1]

    This issue was found with the help of Coccinelle.

    [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
    [2] https://github.com/KSPP/linux/issues/21
    [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour")

    Signed-off-by: Gustavo A. R. Silva
    Signed-off-by: David S. Miller

    Gustavo A. R. Silva
     
  • The current codebase makes use of the zero-length array language
    extension to the C90 standard, but the preferred mechanism to declare
    variable-length types such as these ones is a flexible array member[1][2],
    introduced in C99:

    struct foo {
    int stuff;
    struct boo array[];
    };

    By making use of the mechanism above, we will get a compiler warning
    in case the flexible array does not occur last in the structure, which
    will help us prevent some kind of undefined behavior bugs from being
    inadvertently introduced[3] to the codebase from now on.

    Also, notice that, dynamic memory allocations won't be affected by
    this change:

    "Flexible array members have incomplete type, and so the sizeof operator
    may not be applied. As a quirk of the original implementation of
    zero-length arrays, sizeof evaluates to zero."[1]

    This issue was found with the help of Coccinelle.

    [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
    [2] https://github.com/KSPP/linux/issues/21
    [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour")

    Signed-off-by: Gustavo A. R. Silva
    Signed-off-by: David S. Miller

    Gustavo A. R. Silva
     
  • The current codebase makes use of the zero-length array language
    extension to the C90 standard, but the preferred mechanism to declare
    variable-length types such as these ones is a flexible array member[1][2],
    introduced in C99:

    struct foo {
    int stuff;
    struct boo array[];
    };

    By making use of the mechanism above, we will get a compiler warning
    in case the flexible array does not occur last in the structure, which
    will help us prevent some kind of undefined behavior bugs from being
    inadvertently introduced[3] to the codebase from now on.

    Also, notice that, dynamic memory allocations won't be affected by
    this change:

    "Flexible array members have incomplete type, and so the sizeof operator
    may not be applied. As a quirk of the original implementation of
    zero-length arrays, sizeof evaluates to zero."[1]

    This issue was found with the help of Coccinelle.

    [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
    [2] https://github.com/KSPP/linux/issues/21
    [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour")

    Signed-off-by: Gustavo A. R. Silva
    Signed-off-by: David S. Miller

    Gustavo A. R. Silva
     
  • The current codebase makes use of the zero-length array language
    extension to the C90 standard, but the preferred mechanism to declare
    variable-length types such as these ones is a flexible array member[1][2],
    introduced in C99:

    struct foo {
    int stuff;
    struct boo array[];
    };

    By making use of the mechanism above, we will get a compiler warning
    in case the flexible array does not occur last in the structure, which
    will help us prevent some kind of undefined behavior bugs from being
    inadvertently introduced[3] to the codebase from now on.

    Also, notice that, dynamic memory allocations won't be affected by
    this change:

    "Flexible array members have incomplete type, and so the sizeof operator
    may not be applied. As a quirk of the original implementation of
    zero-length arrays, sizeof evaluates to zero."[1]

    This issue was found with the help of Coccinelle.

    [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
    [2] https://github.com/KSPP/linux/issues/21
    [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour")

    Signed-off-by: Gustavo A. R. Silva
    Signed-off-by: David S. Miller

    Gustavo A. R. Silva
     
  • Now that the phylib module loading issue has been resolved, we can
    allow this PHY driver to be built as a module.

    Signed-off-by: Russell King
    Acked-by: Florian Fainelli
    Signed-off-by: David S. Miller

    Russell King
     
  • Ursula Braun says:

    ====================
    net/smc: patches 2020-02-17

    here are patches for SMC making termination tasks more perfect.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • IB event handlers schedule the port event worker for further
    processing of port state changes. This patch reduces the number of
    schedules to avoid duplicate processing of the same port change.

    Reviewed-by: Karsten Graul
    Signed-off-by: Ursula Braun
    Signed-off-by: David S. Miller

    Ursula Braun
     
  • smc_lgr_terminate() and smc_lgr_terminate_sched() both result in soft
    link termination, smc_lgr_terminate_sched() is scheduling a worker for
    this task. Take out complexity by always using the termination worker
    and getting rid of smc_lgr_terminate() completely.

    Signed-off-by: Karsten Graul
    Signed-off-by: Ursula Braun
    Signed-off-by: David S. Miller

    Karsten Graul
     
  • The soft parameter of smc_lgr_terminate() is not used and obsolete.
    Remove it.

    Signed-off-by: Karsten Graul
    Signed-off-by: Ursula Braun
    Signed-off-by: David S. Miller

    Karsten Graul
     
  • When 2 callers call smc_lgr_terminate() at the same time
    for the same lgr, one gets the lgr_lock and deletes the lgr from the
    list and releases the lock. Then the second caller gets the lock and
    tries to delete it again.
    In smc_lgr_terminate() add a check if the link group lgr is already
    deleted from the link group list and prevent to try to delete it a
    second time.
    And add a check if the lgr is marked as freeing, which means that a
    termination is already pending.

    Signed-off-by: Karsten Graul
    Signed-off-by: Ursula Braun
    Signed-off-by: David S. Miller

    Karsten Graul
     
  • smc_tx_rdma_write() is called under the send_lock and should not call
    smc_lgr_terminate() directly. Call smc_lgr_terminate_sched() instead
    which schedules a worker.

    Signed-off-by: Karsten Graul
    Signed-off-by: Ursula Braun
    Signed-off-by: David S. Miller

    Karsten Graul
     
  • smc_lgr_cleanup() is called during termination processing, there is no
    need to send a DELETE_LINK at that time. A DELETE_LINK should have been
    sent before the termination is initiated, if needed.
    And remove the extra call to wake_up(&lnk->wr_reg_wait) because
    smc_llc_link_inactive() already calls the related helper function
    smc_wr_wakeup_reg_wait().

    Signed-off-by: Karsten Graul
    Signed-off-by: Ursula Braun
    Signed-off-by: David S. Miller

    Karsten Graul
     
  • Ido Schimmel says:

    ====================
    mlxsw: Reduce dependency between bridge and router code

    This patch set reduces the dependency between the bridge and the router
    code in preparation for RTNL removal from the route insertion path in
    mlxsw.

    The motivation and solution are explained in detail in patch #3. The
    main idea is that we need to stop special-casing the VXLAN devices with
    regards to the reference counting of the FIDs. Otherwise, we can bump
    into the situation described in patch #3, where the routing code calls
    into the bridge code which calls back into the routing code. After
    adding a mutex to protect router data structures to remove RTNL
    dependency, this can result in an AA deadlock.

    Patches #1 and #2 are preparations. They convert the FIDs to use
    'refcount_t' for reference counting in order to catch over/under flows
    and add extack to the bridge creation function.

    Patches #3-#5 reduce the dependency between the bridge and the router
    code. First, by having the VXLAN device take a reference on the FID in
    patch #3 and then by removing unnecessary code following the change in
    patch #3.

    Patches #6-#10 adjust existing selftests and add new ones to exercise
    the new code paths.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Test that when two VXLAN tunnels with conflicting configurations (i.e.,
    different TTL) are enslaved to the same VLAN-aware bridge, then the
    enslavement of a port to the bridge is denied.

    Signed-off-by: Ido Schimmel
    Acked-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Ido Schimmel
     
  • After recent changes, the VXLAN tunnel will be offloaded regardless if
    any local ports are member in the FID or not. Adjust the test to make
    sure the tunnel is offloaded in this case.

    Signed-off-by: Ido Schimmel
    Acked-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Ido Schimmel
     
  • The driver supports a single VLAN-aware bridge. Test that the
    enslavement of a port to the second VLAN-aware bridge fails with an
    extack.

    Signed-off-by: Ido Schimmel
    Acked-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Ido Schimmel
     
  • Test that creation of a bridge (both VLAN-aware and VLAN-unaware) fails
    with an extack when a VXLAN device with an unsupported configuration is
    already enslaved to it.

    Signed-off-by: Ido Schimmel
    Acked-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Ido Schimmel
     
  • The addition of a VLAN on a bridge slave prompts the driver to have the
    local port in question join the FID corresponding to this VLAN.

    Before recent changes, the operation of joining the FID would also mean
    that the driver would enable VXLAN tunneling if a VXLAN device was also
    member in the VLAN. In case the configuration of the VXLAN tunnel was
    not supported, an extack error would be returned.

    Since the operation of joining the FID no longer means that VXLAN
    tunneling is potentially enabled, the test is no longer relevant. Remove
    it.

    Signed-off-by: Ido Schimmel
    Acked-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Ido Schimmel
     
  • Commit f40be47a3e40 ("mlxsw: spectrum_router: Do not force specific
    configuration order") added a call from the routing code to the bridge
    code in order to handle the case where VNI should be set on a FID
    following the joining of the router port to the FID.

    This is no longer required, as previous patches made VXLAN devices
    explicitly take a reference on the FID and set VNI on it.

    Therefore, remove the unnecessary call and simply have the RIF take a
    reference on the FID without checking if VNI should also be set on it.

    Signed-off-by: Ido Schimmel
    Acked-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Ido Schimmel
     
  • As explained in previous patch, VXLAN devices now take a reference on
    the FID and not only local ports. Therefore, there is no need for local
    ports to check if they need to set a VNI on the FID when they join the
    FID.

    Remove these unnecessary checks.

    Signed-off-by: Ido Schimmel
    Acked-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Ido Schimmel
     
  • Up until now only local ports and the router port (which is also a local
    port) took a reference on the corresponding FID (Filtering Identifier)
    when joining a bridge. For example:

    192.0.2.1/24
    br0
    |
    +------+------+
    | |
    swp1 vxlan0

    In this case the reference count of the FID will be '2'. Since the VXLAN
    device does not take a reference on the FID, whenever a local port joins
    the bridge it needs to check if a VXLAN device is already enslaved. If
    the VXLAN device should be mapped to the FID in question, then the VXLAN
    device's VNI is set on the FID.

    Beside the fact that this scheme special-cases the VXLAN device, it also
    creates an unnecessary dependency between the routing and bridge code:

    1. [R] IP address is added on 'br0', which prompts the creation of a RIF
    and a backing FID
    2. [B] VNI is enabled on backing FID
    3. [R] Host route corresponding to VXLAN device's source address is
    promoted to perform NVE decapsulation

    [R] - Routing code
    [B] - Bridge code

    This back and forth dependency will become problematic when a lock is
    added in the routing code instead of relying on RTNL, as it will result
    in an AA deadlock.

    Instead, have the VXLAN device take a reference on the FID just like all
    the other netdev members of the bridge. In order to correctly handle the
    case where VXLAN devices are already enslaved to the bridge when it is
    offloaded, walk the bridge's slaves and replay the configuration.

    Signed-off-by: Ido Schimmel
    Acked-by: Jiri Pirko
    Reviewed-by: Petr Machata
    Signed-off-by: David S. Miller

    Ido Schimmel
     
  • Propagate extack to bridge creation function so that error messages
    could be passed to user space via netlink instead of printing them to
    kernel log.

    A subsequent patch will pass the new extack argument to more functions.

    Signed-off-by: Ido Schimmel
    Acked-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Ido Schimmel
     
  • 'refcount_t' is very useful for catching over/under flows. Convert the
    FID (Filtering Identifier) objects to use it instead of 'unsigned int'
    for their reference count.

    A subsequent patch in the series will change the way VXLAN devices hold
    / release the FID reference, which is why the conversion is made now.

    Signed-off-by: Ido Schimmel
    Acked-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Ido Schimmel
     
  • This enables ndo_dflt_bridge_getlink() to report a bridge port's
    offload settings for multicast and broadcast flooding.

    CC: Roopa Prabhu
    CC: Nikolay Aleksandrov
    Signed-off-by: Julian Wiedmann
    Signed-off-by: David S. Miller

    Julian Wiedmann
     
  • Edward Cree says:

    ====================
    couple more ARFS tidy-ups

    Tie up some loose ends from the recent ARFS work.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller