14 Dec, 2020

1 commit

  • Update txq0's trans_start in order to prevent the netdev watchdog from
    triggering too quickly. Since we set the LLTX flag, the stack won't update
    the jiffies for other tx queues. Prevent the watchdog from checking the
    other tx queues by adding the NETIF_HW_ACCEL_MQ flag.

    Signed-off-by: Camelia Groza

    Split core changes.

    Signed-off-by: Madalin Bucur

    Camelia Groza
     

11 Sep, 2020

1 commit


01 May, 2020

1 commit


27 Mar, 2020

1 commit

  • This patch introduce a new netdev feature, which will be used by drivers
    to state they can perform MACsec transformations in hardware.

    The patchset was gathered by Mark, macsec functinality itself
    was implemented by Dmitry, Mark and Pavel Belous.

    Signed-off-by: Antoine Tenart
    Signed-off-by: Mark Starovoytov
    Signed-off-by: Igor Russkikh
    Signed-off-by: David S. Miller

    Antoine Tenart
     

27 Jan, 2020

2 commits


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
     

17 Feb, 2019

1 commit


16 Feb, 2019

1 commit

  • The features attribute is of type u64 and stored in the native endianes on
    the system. The for_each_set_bit() macro takes a pointer to a 32 bit array
    and goes over the bits in this area. On little Endian systems this also
    works with an u64 as the most significant bit is on the highest address,
    but on big endian the words are swapped. When we expect bit 15 here we get
    bit 47 (15 + 32).

    This patch converts it more or less to its own for_each_set_bit()
    implementation which works on 64 bit integers directly. This is then
    completely in host endianness and should work like expected.

    Fixes: fd867d51f ("net/core: generic support for disabling netdev features down stack")
    Signed-off-by: Hauke Mehrtens
    Signed-off-by: David S. Miller

    Hauke Mehrtens
     

16 Jul, 2018

1 commit


24 May, 2018

1 commit

  • Until the udp receive stack supports large packets (UDP GRO), GSO
    packets must not loop from the egress to the ingress path.

    Revert the change that added NETIF_F_GSO_UDP_L4 to various virtual
    devices through NETIF_F_GSO_ENCAP_ALL as this included devices that
    may loop packets, such as veth and macvlan.

    Instead add it to specific devices that forward to another device's
    egress path, bonding and team.

    Fixes: 83aa025f535f ("udp: add gso support to virtual devices")
    CC: Alexander Duyck
    Signed-off-by: Willem de Bruijn
    Signed-off-by: David S. Miller

    Willem de Bruijn
     

01 May, 2018

1 commit


27 Apr, 2018

1 commit


01 Apr, 2018

1 commit

  • Ethtool option enables TLS record offload on HW, user
    configures the feature for netdev capable of Inline TLS.
    This allows user to define custom sk_prot for Inline TLS sock

    Signed-off-by: Atul Gupta
    Signed-off-by: David S. Miller

    Atul Gupta
     

19 Dec, 2017

1 commit

  • Introduce NETIF_F_GRO_HW feature flag for NICs that support hardware
    GRO. With this flag, we can now independently turn on or off hardware
    GRO when GRO is on. Previously, drivers were using NETIF_F_GRO to
    control hardware GRO and so it cannot be independently turned on or
    off without affecting GRO.

    Hardware GRO (just like GRO) guarantees that packets can be re-segmented
    by TSO/GSO to reconstruct the original packet stream. Logically,
    GRO_HW should depend on GRO since it a subset, but we will let
    individual drivers enforce this dependency as they see fit.

    Since NETIF_F_GRO is not propagated between upper and lower devices,
    NETIF_F_GRO_HW should follow suit since it is a subset of GRO. In other
    words, a lower device can independent have GRO/GRO_HW enabled or disabled
    and no feature propagation is required. This will preserve the current
    GRO behavior. This can be changed later if we decide to propagate GRO/
    GRO_HW/RXCSUM from upper to lower devices.

    Cc: Ariel Elior
    Cc: everest-linux-l2@cavium.com
    Signed-off-by: Michael Chan
    Acked-by: Alexander Duyck
    Signed-off-by: David S. Miller

    Michael Chan
     

24 Nov, 2017

1 commit

  • Tuntap and similar devices can inject GSO packets. Accept type
    VIRTIO_NET_HDR_GSO_UDP, even though not generating UFO natively.

    Processes are expected to use feature negotiation such as TUNSETOFFLOAD
    to detect supported offload types and refrain from injecting other
    packets. This process breaks down with live migration: guest kernels
    do not renegotiate flags, so destination hosts need to expose all
    features that the source host does.

    Partially revert the UFO removal from 182e0b6b5846~1..d9d30adf5677.
    This patch introduces nearly(*) no new code to simplify verification.
    It brings back verbatim tuntap UFO negotiation, VIRTIO_NET_HDR_GSO_UDP
    insertion and software UFO segmentation.

    It does not reinstate protocol stack support, hardware offload
    (NETIF_F_UFO), SKB_GSO_UDP tunneling in SKB_GSO_SOFTWARE or reception
    of VIRTIO_NET_HDR_GSO_UDP packets in tuntap.

    To support SKB_GSO_UDP reappearing in the stack, also reinstate
    logic in act_csum and openvswitch. Achieve equivalence with v4.13 HEAD
    by squashing in commit 939912216fa8 ("net: skb_needs_check() removes
    CHECKSUM_UNNECESSARY check for tx.") and reverting commit 8d63bee643f1
    ("net: avoid skb_warn_bad_offload false positives on UFO").

    (*) To avoid having to bring back skb_shinfo(skb)->ip6_frag_id,
    ipv6_proxy_select_ident is changed to return a __be32 and this is
    assigned directly to the frag_hdr. Also, SKB_GSO_UDP is inserted
    at the end of the enum to minimize code churn.

    Tested
    Booted a v4.13 guest kernel with QEMU. On a host kernel before this
    patch `ethtool -k eth0` shows UFO disabled. After the patch, it is
    enabled, same as on a v4.13 host kernel.

    A UFO packet sent from the guest appears on the tap device:
    host:
    nc -l -p -u 8000 &
    tcpdump -n -i tap0

    guest:
    dd if=/dev/zero of=payload.txt bs=1 count=2000
    nc -u 192.16.1.1 8000 < payload.txt

    Direct tap to tap transmission of VIRTIO_NET_HDR_GSO_UDP succeeds,
    packets arriving fragmented:

    ./with_tap_pair.sh ./tap_send_ufo tap0 tap1
    (from https://github.com/wdebruij/kerneltools/tree/master/tests)

    Changes
    v1 -> v2
    - simplified set_offload change (review comment)
    - documented test procedure

    Link: http://lkml.kernel.org/r/
    Fixes: fb652fdfe837 ("macvlan/macvtap: Remove NETIF_F_UFO advertisement.")
    Reported-by: Michal Kubecek
    Signed-off-by: Willem de Bruijn
    Acked-by: Jason Wang
    Signed-off-by: David S. Miller

    Willem de Bruijn
     

25 Jul, 2017

1 commit


18 Jul, 2017

1 commit


14 Apr, 2017

1 commit


04 Feb, 2017

1 commit

  • We added generic support for busy polling in NAPI layer in linux-4.5

    No network driver uses ndo_busy_poll() anymore, we can get rid
    of the pointer in struct net_device_ops, and its use in sk_busy_loop()

    Saves NETIF_F_BUSY_POLL features bit.

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     

04 Jun, 2016

1 commit

  • SCTP has this pecualiarity that its packets cannot be just segmented to
    (P)MTU. Its chunks must be contained in IP segments, padding respected.
    So we can't just generate a big skb, set gso_size to the fragmentation
    point and deliver it to IP layer.

    This patch takes a different approach. SCTP will now build a skb as it
    would be if it was received using GRO. That is, there will be a cover
    skb with protocol headers and children ones containing the actual
    segments, already segmented to a way that respects SCTP RFCs.

    With that, we can tell skb_segment() to just split based on frag_list,
    trusting its sizes are already in accordance.

    This way SCTP can benefit from GSO and instead of passing several
    packets through the stack, it can pass a single large packet.

    v2:
    - Added support for receiving GSO frames, as requested by Dave Miller.
    - Clear skb->cb if packet is GSO (otherwise it's not used by SCTP)
    - Added heuristics similar to what we have in TCP for not generating
    single GSO packets that fills cwnd.
    v3:
    - consider sctphdr size in skb_gso_transport_seglen()
    - rebased due to 5c7cdf339af5 ("gso: Remove arbitrary checks for
    unsupported GSO")

    Signed-off-by: Marcelo Ricardo Leitner
    Tested-by: Xin Long
    Signed-off-by: David S. Miller

    Marcelo Ricardo Leitner
     

21 May, 2016

1 commit

  • This patch defines two new GSO definitions SKB_GSO_IPXIP4 and
    SKB_GSO_IPXIP6 along with corresponding NETIF_F_GSO_IPXIP4 and
    NETIF_F_GSO_IPXIP6. These are used to described IP in IP
    tunnel and what the outer protocol is. The inner protocol
    can be deduced from other GSO types (e.g. SKB_GSO_TCPV4 and
    SKB_GSO_TCPV6). The GSO types of SKB_GSO_IPIP and SKB_GSO_SIT
    are removed (these are both instances of SKB_GSO_IPXIP4).
    SKB_GSO_IPXIP6 will be used when support for GSO with IP
    encapsulation over IPv6 is added.

    Signed-off-by: Tom Herbert
    Acked-by: Jeff Kirsher
    Signed-off-by: David S. Miller

    Tom Herbert
     

22 Apr, 2016

1 commit


17 Apr, 2016

1 commit

  • I realized that when I added NETIF_F_TSO_MANGLEID as a TSO type I forgot to
    add it to NETIF_F_ALL_TSO. This patch corrects that so the flag will be
    included correctly.

    The result should be minor as it was only used by a few drivers and in a
    few specific cases such as when NETIF_F_SG was not supported on a device so
    the TSO flags were cleared.

    Signed-off-by: Alexander Duyck
    Signed-off-by: David S. Miller

    Alexander Duyck
     

15 Apr, 2016

2 commits

  • This patch adds support for something I am referring to as GSO partial.
    The basic idea is that we can support a broader range of devices for
    segmentation if we use fixed outer headers and have the hardware only
    really deal with segmenting the inner header. The idea behind the naming
    is due to the fact that everything before csum_start will be fixed headers,
    and everything after will be the region that is handled by hardware.

    With the current implementation it allows us to add support for the
    following GSO types with an inner TSO_MANGLEID or TSO6 offload:
    NETIF_F_GSO_GRE
    NETIF_F_GSO_GRE_CSUM
    NETIF_F_GSO_IPIP
    NETIF_F_GSO_SIT
    NETIF_F_UDP_TUNNEL
    NETIF_F_UDP_TUNNEL_CSUM

    In the case of hardware that already supports tunneling we may be able to
    extend this further to support TSO_TCPV4 without TSO_MANGLEID if the
    hardware can support updating inner IPv4 headers.

    Signed-off-by: Alexander Duyck
    Signed-off-by: David S. Miller

    Alexander Duyck
     
  • This patch adds support for TSO using IPv4 headers with a fixed IP ID
    field. This is meant to allow us to do a lossless GRO in the case of TCP
    flows that use a fixed IP ID such as those that convert IPv6 header to IPv4
    headers.

    In addition I am adding a feature that for now I am referring to TSO with
    IP ID mangling. Basically when this flag is enabled the device has the
    option to either output the flow with incrementing IP IDs or with a fixed
    IP ID regardless of what the original IP ID ordering was. This is useful
    in cases where the DF bit is set and we do not care if the original IP ID
    value is maintained.

    Signed-off-by: Alexander Duyck
    Signed-off-by: David S. Miller

    Alexander Duyck
     

17 Feb, 2016

1 commit

  • Its useful to turn off the qdisc offload feature at a per device
    level. This gives us a big hammer to enable/disable offloading.
    More fine grained control (i.e. per rule) may be supported later.

    Signed-off-by: John Fastabend
    Acked-by: Jiri Pirko
    Acked-by: Jamal Hadi Salim
    Signed-off-by: David S. Miller

    John Fastabend
     

16 Dec, 2015

3 commits

  • These netif flags are unnecessary convolutions. It is more
    straightforward to just use NETIF_F_HW_CSUM, NETIF_F_IP_CSUM,
    and NETIF_F_IPV6_CSUM directly.

    This patch also:
    - Cleans up can_checksum_protocol
    - Simplifies netdev_intersect_features

    Signed-off-by: Tom Herbert
    Signed-off-by: David S. Miller

    Tom Herbert
     
  • The name NETIF_F_ALL_CSUM is a misnomer. This does not correspond to the
    set of features for offloading all checksums. This is a mask of the
    checksum offload related features bits. It is incorrect to set both
    NETIF_F_HW_CSUM and NETIF_F_IP_CSUM or NETIF_F_IPV6 at the same time for
    features of a device.

    This patch:
    - Changes instances of NETIF_F_ALL_CSUM to NETIF_F_CSUM_MASK (where
    NETIF_F_ALL_CSUM is being used as a mask).
    - Changes bonding, sfc/efx, ipvlan, macvlan, vlan, and team drivers to
    use NEITF_F_HW_CSUM in features list instead of NETIF_F_ALL_CSUM.

    Signed-off-by: Tom Herbert
    Signed-off-by: David S. Miller

    Tom Herbert
     
  • The SCTP checksum is really a CRC and is very different from the
    standards 1's complement checksum that serves as the checksum
    for IP protocols. This offload interface is also very different.
    Rename NETIF_F_SCTP_CSUM to NETIF_F_SCTP_CRC to highlight these
    differences. The term CSUM should be reserved in the stack to refer
    to the standard 1's complement IP checksum.

    Signed-off-by: Tom Herbert
    Signed-off-by: David S. Miller

    Tom Herbert
     

04 Nov, 2015

1 commit

  • As pointed out by Nikolay and further explained by Geert, the initial
    for_each_netdev_feature macro was broken, as feature would get set outside
    of the block of code it was intended to run in, thus only ever working for
    the first feature bit in the mask. While less pretty this way, this is
    tested and confirmed functional with multiple feature bits set in
    NETIF_F_UPPER_DISABLES.

    [root@dell-per730-01 ~]# ethtool -K bond0 lro off
    ...
    [ 242.761394] bond0: Disabling feature 0x0000000000008000 on lower dev p5p2.
    [ 243.552178] bnx2x 0000:06:00.1 p5p2: using MSI-X IRQs: sp 74 fp[0] 76 ... fp[7] 83
    [ 244.353978] bond0: Disabling feature 0x0000000000008000 on lower dev p5p1.
    [ 245.147420] bnx2x 0000:06:00.0 p5p1: using MSI-X IRQs: sp 62 fp[0] 64 ... fp[7] 71

    [root@dell-per730-01 ~]# ethtool -K bond0 gro off
    ...
    [ 251.925645] bond0: Disabling feature 0x0000000000004000 on lower dev p5p2.
    [ 252.713693] bnx2x 0000:06:00.1 p5p2: using MSI-X IRQs: sp 74 fp[0] 76 ... fp[7] 83
    [ 253.499085] bond0: Disabling feature 0x0000000000004000 on lower dev p5p1.
    [ 254.290922] bnx2x 0000:06:00.0 p5p1: using MSI-X IRQs: sp 62 fp[0] 64 ... fp[7] 71

    Fixes: fd867d51f ("net/core: generic support for disabling netdev features down stack")
    CC: "David S. Miller"
    CC: Eric Dumazet
    CC: Jay Vosburgh
    CC: Veaceslav Falico
    CC: Andy Gospodarek
    CC: Jiri Pirko
    CC: Nikolay Aleksandrov
    CC: Michal Kubecek
    CC: Alexander Duyck
    CC: Geert Uytterhoeven
    CC: netdev@vger.kernel.org
    Signed-off-by: Jarod Wilson
    Acked-by: Nikolay Aleksandrov
    Signed-off-by: David S. Miller

    Jarod Wilson
     

03 Nov, 2015

1 commit

  • There are some netdev features, which when disabled on an upper device,
    such as a bonding master or a bridge, must be disabled and cannot be
    re-enabled on underlying devices.

    This is a rework of an earlier more heavy-handed appraoch, which simply
    disables and prevents re-enabling of netdev features listed in a new
    define in include/net/netdev_features.h, NETIF_F_UPPER_DISABLES. Any upper
    device that disables a flag in that feature mask, the disabling will
    propagate down the stack, and any lower device that has any upper device
    with one of those flags disabled should not be able to enable said flag.

    Initially, only LRO is included for proof of concept, and because this
    code effectively does the same thing as dev_disable_lro(), though it will
    also activate from the ethtool path, which was one of the goals here.

    [root@dell-per730-01 ~]# ethtool -k bond0 |grep large
    large-receive-offload: on
    [root@dell-per730-01 ~]# ethtool -k p5p1 |grep large
    large-receive-offload: on
    [root@dell-per730-01 ~]# ethtool -K bond0 lro off
    [root@dell-per730-01 ~]# ethtool -k bond0 |grep large
    large-receive-offload: off
    [root@dell-per730-01 ~]# ethtool -k p5p1 |grep large
    large-receive-offload: off

    dmesg dump:

    [ 1033.277986] bond0: Disabling feature 0x0000000000008000 on lower dev p5p2.
    [ 1034.067949] bnx2x 0000:06:00.1 p5p2: using MSI-X IRQs: sp 74 fp[0] 76 ... fp[7] 83
    [ 1034.753612] bond0: Disabling feature 0x0000000000008000 on lower dev p5p1.
    [ 1035.591019] bnx2x 0000:06:00.0 p5p1: using MSI-X IRQs: sp 62 fp[0] 64 ... fp[7] 71

    This has been successfully tested with bnx2x, qlcnic and netxen network
    cards as slaves in a bond interface. Turning LRO on or off on the master
    also turns it on or off on each of the slaves, new slaves are added with
    LRO in the same state as the master, and LRO can't be toggled on the
    slaves.

    Also, this should largely remove the need for dev_disable_lro(), and most,
    if not all, of its call sites can be replaced by simply making sure
    NETIF_F_LRO isn't included in the relevant device's feature flags.

    Note that this patch is driven by bug reports from users saying it was
    confusing that bonds and slaves had different settings for the same
    features, and while it won't be 100% in sync if a lower device doesn't
    support a feature like LRO, I think this is a good step in the right
    direction.

    CC: "David S. Miller"
    CC: Eric Dumazet
    CC: Jay Vosburgh
    CC: Veaceslav Falico
    CC: Andy Gospodarek
    CC: Jiri Pirko
    CC: Nikolay Aleksandrov
    CC: Michal Kubecek
    CC: Alexander Duyck
    CC: netdev@vger.kernel.org
    Signed-off-by: Jarod Wilson
    Signed-off-by: David S. Miller

    Jarod Wilson
     

13 May, 2015

1 commit


02 Feb, 2015

1 commit


06 Nov, 2014

2 commits


24 Jul, 2014

1 commit


15 Jun, 2014

1 commit

  • Joseph Gasparakis reported that VXLAN GSO offload stopped working with
    i40e device after recent UDP changes. The problem is that the
    SKB_GSO_* bits are out of sync with the corresponding NETIF flags. This
    patch fixes that. Also, we add BUILD_BUG_ONs in net_gso_ok for several
    GSO constants that were missing to avoid the problem in the future.

    Reported-by: Joseph Gasparakis
    Signed-off-by: Tom Herbert
    Signed-off-by: David S. Miller

    Tom Herbert
     

05 Jun, 2014

2 commits

  • Call gso_make_checksum. This should have the benefit of using a
    checksum that may have been previously computed for the packet.

    This also adds NETIF_F_GSO_GRE_CSUM to differentiate devices that
    offload GRE GSO with and without the GRE checksum offloaed.

    Signed-off-by: Tom Herbert
    Signed-off-by: David S. Miller

    Tom Herbert
     
  • Added a new netif feature for GSO_UDP_TUNNEL_CSUM. This indicates
    that a device is capable of computing the UDP checksum in the
    encapsulating header of a UDP tunnel.

    Signed-off-by: Tom Herbert
    Signed-off-by: David S. Miller

    Tom Herbert