Commit Graph

634 Commits

Author SHA1 Message Date
Maxim Levitsky d8ae4cb3d6 hv_netvsc: Don't free decrypted memory
JIRA: https://issues.redhat.com/browse/RHEL-54308

commit bbf9ac34677b57506a13682b31a2a718934c0e31
Author: Rick Edgecombe <rick.p.edgecombe@intel.com>
Date:   Mon Mar 11 09:15:56 2024 -0700

    hv_netvsc: Don't free decrypted memory

    In CoCo VMs it is possible for the untrusted host to cause
    set_memory_encrypted() or set_memory_decrypted() to fail such that an
    error is returned and the resulting memory is shared. Callers need to
    take care to handle these errors to avoid returning decrypted (shared)
    memory to the page allocator, which could lead to functional or security
    issues.

    The netvsc driver could free decrypted/shared pages if
    set_memory_decrypted() fails. Check the decrypted field in the gpadl
    to decide whether to free the memory.

    Signed-off-by: Rick Edgecombe <rick.p.edgecombe@intel.com>
    Signed-off-by: Michael Kelley <mhklinux@outlook.com>
    Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
    Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
    Link: https://lore.kernel.org/r/20240311161558.1310-4-mhklinux@outlook.com
    Signed-off-by: Wei Liu <wei.liu@kernel.org>
    Message-ID: <20240311161558.1310-4-mhklinux@outlook.com>

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
2024-08-14 18:27:28 +03:00
Ivan Vecera 24ef7349da net: annotate writes on dev->mtu from ndo_change_mtu()
JIRA: https://issues.redhat.com/browse/RHEL-39583

Conflicts:
- hunks for non-existing files and non-applicable hunks for unsupported
  drivers, batman-adv and DSA were skipped

commit 1eb2cded45b35816085c1f962933c187d970f9dc
Author: Eric Dumazet <edumazet@google.com>
Date:   Mon May 6 10:28:12 2024 +0000

    net: annotate writes on dev->mtu from ndo_change_mtu()

    Simon reported that ndo_change_mtu() methods were never
    updated to use WRITE_ONCE(dev->mtu, new_mtu) as hinted
    in commit 501a90c945 ("inet: protect against too small
    mtu values.")

    We read dev->mtu without holding RTNL in many places,
    with READ_ONCE() annotations.

    It is time to take care of ndo_change_mtu() methods
    to use corresponding WRITE_ONCE()

    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Reported-by: Simon Horman <horms@kernel.org>
    Closes: https://lore.kernel.org/netdev/20240505144608.GB67882@kernel.org/
    Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
    Reviewed-by: Sabrina Dubroca <sd@queasysnail.net>
    Reviewed-by: Simon Horman <horms@kernel.org>
    Acked-by: Shannon Nelson <shannon.nelson@amd.com>
    Link: https://lore.kernel.org/r/20240506102812.3025432-1-edumazet@google.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Ivan Vecera <ivecera@redhat.com>
2024-05-31 21:00:33 +02:00
Lucas Zampieri a2c77db22b Merge: CNB95: ethtool: Support symmetric-xor RSS hash
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/3990

JIRA: https://issues.redhat.com/browse/RHEL-31889  
Tested: Preverified by QA  
Depends: !3939 

Commits:
```
b9335a757232 ("net/mlx5e: Make flow classification filters static")
fb6e30a72539 ("net: ethtool: pass a pointer to parameters to get/set_rxfh ethtool ops")
dcd8dbf9e734 ("net: ethtool: get rid of get/set_rxfh_context functions")
13e59344fb9d ("net: ethtool: add support for symmetric-xor RSS hash")
7c402f77e8cb ("net: ethtool: copy input_xfrm to user-space in ethtool_get_rxfh")
0dd415d15505 ("net: ethtool: add a NO_CHANGE uAPI for new RXFH's input_xfrm")
501869fecfbc ("net: ethtool: Fix symmetric-xor RSS RX flow hash check")
948f97f9d8d2 ("net: ethtool: reject unsupported RSS input xfrm values")
```

Signed-off-by: Ivan Vecera <ivecera@redhat.com>

Approved-by: Michal Schmidt <mschmidt@redhat.com>
Approved-by: Corinna Vinschen <vinschen@redhat.com>
Approved-by: Antoine Tenart <atenart@redhat.com>

Merged-by: Lucas Zampieri <lzampier@redhat.com>
2024-05-16 13:34:27 +00:00
Ivan Vecera 6555e8128e net: ethtool: pass a pointer to parameters to get/set_rxfh ethtool ops
JIRA: https://issues.redhat.com/browse/RHEL-31889

Conflicts:
- drivers/net/ethernet/fungible/funeth/funeth_ethtool.c
  hunk removed as the file does not exist in RHEL

commit fb6e30a72539ce28c1323aef4190d35aac106f6f
Author: Ahmed Zaki <ahmed.zaki@intel.com>
Date:   Tue Dec 12 17:33:14 2023 -0700

    net: ethtool: pass a pointer to parameters to get/set_rxfh ethtool ops

    The get/set_rxfh ethtool ops currently takes the rxfh (RSS) parameters
    as direct function arguments. This will force us to change the API (and
    all drivers' functions) every time some new parameters are added.

    This is part 1/2 of the fix, as suggested in [1]:

    - First simplify the code by always providing a pointer to all params
       (indir, key and func); the fact that some of them may be NULL seems
       like a weird historic thing or a premature optimization.
       It will simplify the drivers if all pointers are always present.

     - Then make the functions take a dev pointer, and a pointer to a
       single struct wrapping all arguments. The set_* should also take
       an extack.

    Link: https://lore.kernel.org/netdev/20231121152906.2dd5f487@kernel.org/ [1]
    Suggested-by: Jakub Kicinski <kuba@kernel.org>
    Suggested-by: Jacob Keller <jacob.e.keller@intel.com>
    Signed-off-by: Ahmed Zaki <ahmed.zaki@intel.com>
    Link: https://lore.kernel.org/r/20231213003321.605376-2-ahmed.zaki@intel.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Ivan Vecera <ivecera@redhat.com>
2024-04-10 09:30:33 +02:00
Ivan Vecera da99183327 net: Convert some ethtool_sprintf() to ethtool_puts()
JIRA: https://issues.redhat.com/browse/RHEL-31886

Conflicts:
- hunks for missing files were skipped
- drivers/net/ethernet/freescale/fec_main.c
  adjusted due to missing commit 6970ef27ff7fd ("net: fec: add xdp and
  page pool statistics")
- drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c
  adjusted due to missing commit 15137daef7b0d ("nfp: add support for
  'ethtool -t DEVNAME' command")

commit e403cffff1a46ab1a95d3bc72e92634445d68328
Author: justinstitt@google.com <justinstitt@google.com>
Date:   Wed Dec 6 23:16:12 2023 +0000

    net: Convert some ethtool_sprintf() to ethtool_puts()

    This patch converts some basic cases of ethtool_sprintf() to
    ethtool_puts().

    The conversions are used in cases where ethtool_sprintf() was being used
    with just two arguments:
    |       ethtool_sprintf(&data, buffer[i].name);
    or when it's used with format string: "%s"
    |       ethtool_sprintf(&data, "%s", buffer[i].name);
    which both now become:
    |       ethtool_puts(&data, buffer[i].name);

    Signed-off-by: Justin Stitt <justinstitt@google.com>
    Reviewed-by: Wei Fang <wei.fang@nxp.com>
    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
    Reviewed-by: Louis Peens <louis.peens@corigine.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

Signed-off-by: Ivan Vecera <ivecera@redhat.com>
2024-04-05 11:27:44 +02:00
Maxim Levitsky 24aa2fbb1b hv_netvsc: Register VF in netvsc_probe if NET_DEVICE_REGISTER missed
JIRA: https://issues.redhat.com/browse/RHEL-26435

commit 9cae43da9867412f8bd09aee5c8a8dc5e8dc3dc2
Author: Shradha Gupta <shradhagupta@linux.microsoft.com>
Date:   Thu Feb 1 20:40:38 2024 -0800

    hv_netvsc: Register VF in netvsc_probe if NET_DEVICE_REGISTER missed

    If hv_netvsc driver is unloaded and reloaded, the NET_DEVICE_REGISTER
    handler cannot perform VF register successfully as the register call
    is received before netvsc_probe is finished. This is because we
    register register_netdevice_notifier() very early( even before
    vmbus_driver_register()).
    To fix this, we try to register each such matching VF( if it is visible
    as a netdevice) at the end of netvsc_probe.

    Cc: stable@vger.kernel.org
    Fixes: 85520856466e ("hv_netvsc: Fix race of register_netdevice_notifier and VF register")
    Suggested-by: Dexuan Cui <decui@microsoft.com>
    Signed-off-by: Shradha Gupta <shradhagupta@linux.microsoft.com>
    Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
    Reviewed-by: Dexuan Cui <decui@microsoft.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
2024-03-15 15:33:51 -04:00
Maxim Levitsky ff400473fc hv_netvsc: Fix race condition between netvsc_probe and netvsc_remove
JIRA: https://issues.redhat.com/browse/RHEL-26435

commit e0526ec5360a48ad3ab2e26e802b0532302a7e11
Author: Souradeep Chakrabarti <schakrabarti@linux.microsoft.com>
Date:   Tue Jan 30 23:35:51 2024 -0800

    hv_netvsc: Fix race condition between netvsc_probe and netvsc_remove

    In commit ac50476717 ("hv_netvsc: Disable NAPI before closing the
    VMBus channel"), napi_disable was getting called for all channels,
    including all subchannels without confirming if they are enabled or not.

    This caused hv_netvsc getting hung at napi_disable, when netvsc_probe()
    has finished running but nvdev->subchan_work has not started yet.
    netvsc_subchan_work() -> rndis_set_subchannel() has not created the
    sub-channels and because of that netvsc_sc_open() is not running.
    netvsc_remove() calls cancel_work_sync(&nvdev->subchan_work), for which
    netvsc_subchan_work did not run.

    netif_napi_add() sets the bit NAPI_STATE_SCHED because it ensures NAPI
    cannot be scheduled. Then netvsc_sc_open() -> napi_enable will clear the
    NAPIF_STATE_SCHED bit, so it can be scheduled. napi_disable() does the
    opposite.

    Now during netvsc_device_remove(), when napi_disable is called for those
    subchannels, napi_disable gets stuck on infinite msleep.

    This fix addresses this problem by ensuring that napi_disable() is not
    getting called for non-enabled NAPI struct.
    But netif_napi_del() is still necessary for these non-enabled NAPI struct
    for cleanup purpose.

    Call trace:
    [  654.559417] task:modprobe        state:D stack:    0 pid: 2321 ppid:  1091 flags:0x00004002
    [  654.568030] Call Trace:
    [  654.571221]  <TASK>
    [  654.573790]  __schedule+0x2d6/0x960
    [  654.577733]  schedule+0x69/0xf0
    [  654.581214]  schedule_timeout+0x87/0x140
    [  654.585463]  ? __bpf_trace_tick_stop+0x20/0x20
    [  654.590291]  msleep+0x2d/0x40
    [  654.593625]  napi_disable+0x2b/0x80
    [  654.597437]  netvsc_device_remove+0x8a/0x1f0 [hv_netvsc]
    [  654.603935]  rndis_filter_device_remove+0x194/0x1c0 [hv_netvsc]
    [  654.611101]  ? do_wait_intr+0xb0/0xb0
    [  654.615753]  netvsc_remove+0x7c/0x120 [hv_netvsc]
    [  654.621675]  vmbus_remove+0x27/0x40 [hv_vmbus]

    Cc: stable@vger.kernel.org
    Fixes: ac50476717 ("hv_netvsc: Disable NAPI before closing the VMBus channel")
    Signed-off-by: Souradeep Chakrabarti <schakrabarti@linux.microsoft.com>
    Reviewed-by: Dexuan Cui <decui@microsoft.com>
    Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
    Reviewed-by: Simon Horman <horms@kernel.org>
    Link: https://lore.kernel.org/r/1706686551-28510-1-git-send-email-schakrabarti@linux.microsoft.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
2024-03-15 15:33:49 -04:00
Maxim Levitsky fe1140ea2c hv_netvsc: Calculate correct ring size when PAGE_SIZE is not 4 Kbytes
JIRA: https://issues.redhat.com/browse/RHEL-23420

commit 6941f67ad37d5465b75b9ffc498fcf6897a3c00e
Author: Michael Kelley <mhklinux@outlook.com>
Date:   Mon Jan 22 08:20:28 2024 -0800

    hv_netvsc: Calculate correct ring size when PAGE_SIZE is not 4 Kbytes

    Current code in netvsc_drv_init() incorrectly assumes that PAGE_SIZE
    is 4 Kbytes, which is wrong on ARM64 with 16K or 64K page size. As a
    result, the default VMBus ring buffer size on ARM64 with 64K page size
    is 8 Mbytes instead of the expected 512 Kbytes. While this doesn't break
    anything, a typical VM with 8 vCPUs and 8 netvsc channels wastes 120
    Mbytes (8 channels * 2 ring buffers/channel * 7.5 Mbytes/ring buffer).

    Unfortunately, the module parameter specifying the ring buffer size
    is in units of 4 Kbyte pages. Ideally, it should be in units that
    are independent of PAGE_SIZE, but backwards compatibility prevents
    changing that now.

    Fix this by having netvsc_drv_init() hardcode 4096 instead of using
    PAGE_SIZE when calculating the ring buffer size in bytes. Also
    use the VMBUS_RING_SIZE macro to ensure proper alignment when running
    with page size larger than 4K.

    Cc: <stable@vger.kernel.org> # 5.15.x
    Fixes: 7aff79e297ee ("Drivers: hv: Enable Hyper-V code to be built on ARM64")
    Signed-off-by: Michael Kelley <mhklinux@outlook.com>
    Link: https://lore.kernel.org/r/20240122162028.348885-1-mhklinux@outlook.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
2024-01-31 21:31:53 -05:00
Maxim Levitsky 7a5a110c9c hv_netvsc: remove duplicated including of slab.h
JIRA: https://issues.redhat.com/browse/RHEL-23420

commit e91db1614abae0cca248040c78b2c25f8dd97872
Author: Wang Jinchao <wangjinchao@xfusion.com>
Date:   Fri Dec 15 18:06:59 2023 +0800

    hv_netvsc: remove duplicated including of slab.h

    rm the second include <linux/slab.h>

    Signed-off-by: Wang Jinchao <wangjinchao@xfusion.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
2024-01-31 21:31:53 -05:00
Maxim Levitsky 4f02fc2cdf hv_netvsc: rndis_filter needs to select NLS
JIRA: https://issues.redhat.com/browse/RHEL-23420

commit 6c89f49964375c904cea33c0247467873f4daf2c
Author: Randy Dunlap <rdunlap@infradead.org>
Date:   Wed Nov 29 21:58:53 2023 -0800

    hv_netvsc: rndis_filter needs to select NLS

    rndis_filter uses utf8s_to_utf16s() which is provided by setting
    NLS, so select NLS to fix the build error:

    ERROR: modpost: "utf8s_to_utf16s" [drivers/net/hyperv/hv_netvsc.ko] undefined!

    Fixes: 1ce09e899d ("hyperv: Add support for setting MAC from within guests")
    Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
    Cc: Haiyang Zhang <haiyangz@microsoft.com>
    Cc: K. Y. Srinivasan <kys@microsoft.com>
    Cc: Wei Liu <wei.liu@kernel.org>
    Cc: Dexuan Cui <decui@microsoft.com>
    Reviewed-by: Simon Horman <horms@kernel.org>
    Tested-by: Simon Horman <horms@kernel.org> # build-tested
    Reviewed-by: Michael Kelley <mikelley@microsoft.com>
    Link: https://lore.kernel.org/r/20231130055853.19069-1-rdunlap@infradead.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
2024-01-31 21:31:53 -05:00
Maxim Levitsky 793c1715f3 hv_netvsc: Mark VF as slave before exposing it to user-mode
JIRA: https://issues.redhat.com/browse/RHEL-23420

commit c807d6cd089d2f4951baa838081ec5ae3e2360f8
Author: Long Li <longli@microsoft.com>
Date:   Sun Nov 19 08:23:43 2023 -0800

    hv_netvsc: Mark VF as slave before exposing it to user-mode

    When a VF is being exposed form the kernel, it should be marked as "slave"
    before exposing to the user-mode. The VF is not usable without netvsc
    running as master. The user-mode should never see a VF without the "slave"
    flag.

    This commit moves the code of setting the slave flag to the time before
    VF is exposed to user-mode.

    Cc: stable@vger.kernel.org
    Fixes: 0c195567a8 ("netvsc: transparent VF management")
    Signed-off-by: Long Li <longli@microsoft.com>
    Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
    Acked-by: Stephen Hemminger <stephen@networkplumber.org>
    Acked-by: Dexuan Cui <decui@microsoft.com>
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
2024-01-31 21:31:53 -05:00
Maxim Levitsky fec02da3b4 hv_netvsc: Fix race of register_netdevice_notifier and VF register
JIRA: https://issues.redhat.com/browse/RHEL-23420

commit 85520856466ed6bc3b1ccb013cddac70ceb437db
Author: Haiyang Zhang <haiyangz@microsoft.com>
Date:   Sun Nov 19 08:23:42 2023 -0800

    hv_netvsc: Fix race of register_netdevice_notifier and VF register

    If VF NIC is registered earlier, NETDEV_REGISTER event is replayed,
    but NETDEV_POST_INIT is not.

    Move register_netdevice_notifier() earlier, so the call back
    function is set before probing.

    Cc: stable@vger.kernel.org
    Fixes: e04e7a7bbd ("hv_netvsc: Fix a deadlock by getting rtnl lock earlier in netvsc_probe()")
    Reported-by: Dexuan Cui <decui@microsoft.com>
    Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
    Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>
    Reviewed-by: Dexuan Cui <decui@microsoft.com>
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
2024-01-31 21:31:53 -05:00
Maxim Levitsky 71f88ef740 hv_netvsc: fix race of netvsc and VF register_netdevice
JIRA: https://issues.redhat.com/browse/RHEL-23420

commit d30fb712e52964f2cf9a9c14cf67078394044837
Author: Haiyang Zhang <haiyangz@microsoft.com>
Date:   Sun Nov 19 08:23:41 2023 -0800

    hv_netvsc: fix race of netvsc and VF register_netdevice

    The rtnl lock also needs to be held before rndis_filter_device_add()
    which advertises nvsp_2_vsc_capability / sriov bit, and triggers
    VF NIC offering and registering. If VF NIC finished register_netdev()
    earlier it may cause name based config failure.

    To fix this issue, move the call to rtnl_lock() before
    rndis_filter_device_add(), so VF will be registered later than netvsc
    / synthetic NIC, and gets a name numbered (ethX) after netvsc.

    Cc: stable@vger.kernel.org
    Fixes: e04e7a7bbd ("hv_netvsc: Fix a deadlock by getting rtnl lock earlier in netvsc_probe()")
    Reported-by: Dexuan Cui <decui@microsoft.com>
    Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
    Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>
    Reviewed-by: Simon Horman <horms@kernel.org>
    Reviewed-by: Dexuan Cui <decui@microsoft.com>
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
2024-01-31 21:31:52 -05:00
Maxim Levitsky 93ea58fa70 hv_netvsc: fix netvsc_send_completion to avoid multiple message length checks
JIRA: https://issues.redhat.com/browse/RHEL-23420

commit 9bae5b05502210f7fb5ac24874ec2e0747401b6b
Author: Sonia Sharma <sonia.sharma@linux.microsoft.com>
Date:   Mon Oct 9 01:00:16 2023 -0700

    hv_netvsc: fix netvsc_send_completion to avoid multiple message length checks

    The switch statement in netvsc_send_completion() is incorrectly validating
    the length of incoming network packets by falling through to the next case.
    Avoid the fallthrough. Instead break after a case match and then process
    the complete() call.
    The current code has not caused any known failures. But nonetheless, the
    code should be corrected as a different ordering of the switch cases might
    cause a length check to fail when it should not.

    Signed-off-by: Sonia Sharma <sonia.sharma@linux.microsoft.com>
    Reviewed-by: Simon Horman <horms@kernel.org>
    Signed-off-by: David S. Miller <davem@davemloft.net>

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
2024-01-31 21:31:52 -05:00
Maxim Levitsky 2809048764 hv_netvsc: Allocate rx indirection table size dynamically
JIRA: https://issues.redhat.com/browse/RHEL-23420

commit 4cab498f33f7adaa01ad15909c0f34a81e5a0b0a
Author: Shradha Gupta <shradhagupta@linux.microsoft.com>
Date:   Mon Jun 5 04:30:06 2023 -0700

    hv_netvsc: Allocate rx indirection table size dynamically

    Allocate the size of rx indirection table dynamically in netvsc
    from the value of size provided by OID_GEN_RECEIVE_SCALE_CAPABILITIES
    query instead of using a constant value of ITAB_NUM.

    Signed-off-by: Shradha Gupta <shradhagupta@linux.microsoft.com>
    Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
    Tested-on: Ubuntu22 (azure VM, SKU size: Standard_F72s_v2)
    Testcases:
    1. ethtool -x eth0 output
    2. LISA testcase:PERF-NETWORK-TCP-THROUGHPUT-MULTICONNECTION-NTTTCP-Synthetic
    3. LISA testcase:PERF-NETWORK-TCP-THROUGHPUT-MULTICONNECTION-NTTTCP-SRIOV
    Reviewed-by: Simon Horman <simon.horman@corigine.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
2024-01-31 21:31:52 -05:00
Vitaly Kuznetsov c7aac07a81 hv_netvsc: Remove second mapping of send and recv buffers
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2222608

commit 25727aaed6514b88f98a18862c6f2d65a0b0ec3b
Author: Michael Kelley <mikelley@microsoft.com>
Date:   Sun Mar 26 06:52:05 2023 -0700

    hv_netvsc: Remove second mapping of send and recv buffers

    With changes to how Hyper-V guest VMs flip memory between private
    (encrypted) and shared (decrypted), creating a second kernel virtual
    mapping for shared memory is no longer necessary.  Everything needed
    for the transition to shared is handled by set_memory_decrypted().

    As such, remove the code to create and manage the second
    mapping for the pre-allocated send and recv buffers.  This mapping
    is the last user of hv_map_memory()/hv_unmap_memory(), so delete
    these functions as well.  Finally, hv_map_memory() is the last
    user of vmap_pfn() in Hyper-V guest code, so remove the Kconfig
    selection of VMAP_PFN.

    Signed-off-by: Michael Kelley <mikelley@microsoft.com>
    Reviewed-by: Tianyu Lan <Tianyu.Lan@microsoft.com>
    Link: https://lore.kernel.org/r/1679838727-87310-11-git-send-email-mikelley@microsoft.com
    Signed-off-by: Wei Liu <wei.liu@kernel.org>

Conflicts:
	drivers/hv/Kconfig (skipping f83705a51275e)

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
2023-07-27 18:36:02 +02:00
Jan Stancek e341c7e709 Merge: bpf, xdp: update to 6.3
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/2583

Rebase bpf and xdp to 6.3.

Bugzilla: https://bugzilla.redhat.com/2178930

Signed-off-by: Viktor Malik <vmalik@redhat.com>

Approved-by: Rafael Aquini <aquini@redhat.com>
Approved-by: Artem Savkov <asavkov@redhat.com>
Approved-by: Jason Wang <jasowang@redhat.com>
Approved-by: Jiri Benc <jbenc@redhat.com>
Approved-by: Jan Stancek <jstancek@redhat.com>
Approved-by: Baoquan He <5820488-baoquan_he@users.noreply.gitlab.com>

Signed-off-by: Jan Stancek <jstancek@redhat.com>
2023-06-28 07:52:45 +02:00
Felix Maurer 91338b6db0 hv_netvsc: add missing NETDEV_XDP_ACT_NDO_XMIT xdp-features flag
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2178930

commit 450bdf5bd6c6b78372620da2c32c5a58ab0f124e
Author: Lorenzo Bianconi <lorenzo@kernel.org>
Date:   Sun Feb 12 10:57:58 2023 +0100

    hv_netvsc: add missing NETDEV_XDP_ACT_NDO_XMIT xdp-features flag

    Add missing ndo_xdp_xmit bit to xdp_features capability flag.

    Fixes: 66c0e13ad236 ("drivers: net: turn on XDP features")
    Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
    Link: https://lore.kernel.org/r/8e3747018f0fd0b5d6e6b9aefe8d9448ca3a3288.1676195726.git.lorenzo@kernel.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Felix Maurer <fmaurer@redhat.com>
2023-06-14 10:44:22 +02:00
Felix Maurer d892a11ed2 drivers: net: turn on XDP features
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2178930
Conflicts:
- drivers/net/ethernet/engleder/tsnep_main.c: We don't have this driver
- drivers/net/ethernet/fungible/funeth/funeth_main.c: We don't have this
  driver
- drivers/net/ethernet/aquantia/atlantic/aq_nic.c: left out because it
  does not have XDP support
- drivers/net/ethernet/mediatek/mtk_eth_soc.c: left out because mtk_eth_soc
  does not have XDP support
- drivers/net/ethernet/freescale/dpaa/dpaa_eth.c: left out because driver
  is not enabled
- drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c: left out because driver
  is not enabled
- drivers/net/ethernet/freescale/enetc/enetc_pf.c: left out because driver
  is not enabled
- drivers/net/ethernet/marvell/mvneta.c: left out because driver is not
  enabled
- drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c: left out because driver
  is not enabled
- drivers/net/ethernet/socionext/netsec.c: left out because driver is not
  enabled
- drivers/net/ethernet/ti/cpsw.c: left out because driver is not enabled
- drivers/net/ethernet/ti/cpsw_new.c: left out because driver is not
  enabled
- drivers/net/ethernet/netronome/nfp/nfp_net_common.c: Context difference
  due to missing 67d2656b48f1 ("nfp: support RX VLAN ctag/stag strip") and
  7de8b691615f ("nfp: enable TSO by default for nfp netdev")
- drivers/net/ethernet/intel/ice/ice_main.c: Merge conflict upstream
  between 5b246e533d01 ("ice: split probe into smaller functions") and this
  commit. Resolved the same way as upstream in de4287336794 (pull-request:
  bpf-next 2023-02-11): only add the XDP features to the existing
  ice_cfg_netdev() function.
- drivers/net/ethernet/intel/i40e/i40e_main.c: Code difference because the
  driver does not have support for frags/multi-buff. The last parameter of
  xdp_features_set_redirect_target indicates if frags are supported for Tx,
  we change the code to set it to false.

Omitted-fix: 1dc55923296d ("net: mvneta: do not set xdp_features for hw
buffer devices")
mvneta is not enabled and hunks in this commit are skipped
Omitted-fix: 481e96fc1307 ("mvpp2: take care of xdp_features when
reconfiguring queues")
mvpp2 is not enabled and hunks in this commit are skipped
Omitted-fix: e4ac7cc6e5a4 ("net: fec: turn on XDP features")
fec does not have XDP support

commit 66c0e13ad236c74ea88c7c1518f3cef7f372e3da
Author: Marek Majtyka <alardam@gmail.com>
Date:   Wed Feb 1 11:24:18 2023 +0100

    drivers: net: turn on XDP features

    A summary of the flags being set for various drivers is given below.
    Note that XDP_F_REDIRECT_TARGET and XDP_F_FRAG_TARGET are features
    that can be turned off and on at runtime. This means that these flags
    may be set and unset under RTNL lock protection by the driver. Hence,
    READ_ONCE must be used by code loading the flag value.

    Also, these flags are not used for synchronization against the availability
    of XDP resources on a device. It is merely a hint, and hence the read
    may race with the actual teardown of XDP resources on the device. This
    may change in the future, e.g. operations taking a reference on the XDP
    resources of the driver, and in turn inhibiting turning off this flag.
    However, for now, it can only be used as a hint to check whether device
    supports becoming a redirection target.

    Turn 'hw-offload' feature flag on for:
     - netronome (nfp)
     - netdevsim.

    Turn 'native' and 'zerocopy' features flags on for:
     - intel (i40e, ice, ixgbe, igc)
     - mellanox (mlx5).
     - stmmac
     - netronome (nfp)

    Turn 'native' features flags on for:
     - amazon (ena)
     - broadcom (bnxt)
     - freescale (dpaa, dpaa2, enetc)
     - funeth
     - intel (igb)
     - marvell (mvneta, mvpp2, octeontx2)
     - mellanox (mlx4)
     - mtk_eth_soc
     - qlogic (qede)
     - sfc
     - socionext (netsec)
     - ti (cpsw)
     - tap
     - tsnep
     - veth
     - xen
     - virtio_net.

    Turn 'basic' (tx, pass, aborted and drop) features flags on for:
     - netronome (nfp)
     - cavium (thunder)
     - hyperv.

    Turn 'redirect_target' feature flag on for:
     - amanzon (ena)
     - broadcom (bnxt)
     - freescale (dpaa, dpaa2)
     - intel (i40e, ice, igb, ixgbe)
     - ti (cpsw)
     - marvell (mvneta, mvpp2)
     - sfc
     - socionext (netsec)
     - qlogic (qede)
     - mellanox (mlx5)
     - tap
     - veth
     - virtio_net
     - xen

    Reviewed-by: Gerhard Engleder <gerhard@engleder-embedded.com>
    Reviewed-by: Simon Horman <simon.horman@corigine.com>
    Acked-by: Stanislav Fomichev <sdf@google.com>
    Acked-by: Jakub Kicinski <kuba@kernel.org>
    Co-developed-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
    Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
    Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
    Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
    Signed-off-by: Marek Majtyka <alardam@gmail.com>
    Link: https://lore.kernel.org/r/3eca9fafb308462f7edb1f58e451d59209aa07eb.1675245258.git.lorenzo@kernel.org
    Signed-off-by: Alexei Starovoitov <ast@kernel.org>

Signed-off-by: Felix Maurer <fmaurer@redhat.com>
2023-06-14 10:33:43 +02:00
Ivan Vecera 59591f9868 net: Remove the obsolte u64_stats_fetch_*_irq() users (drivers).
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2193170

Conflicts:
- small context conflict around required change
- hunks for missing files were skipped
- several hunks for existing files were skipped as they are not
  applicable (missing get_stats callback etc.)
- hunks for aquantia, i40e, iavf, igb were skipped as they are already applied

commit 068c38ad88ccb09e5e966d4db5cedab0e02b3b95
Author: Thomas Gleixner <tglx@linutronix.de>
Date:   Wed Oct 26 15:22:14 2022 +0200

    net: Remove the obsolte u64_stats_fetch_*_irq() users (drivers).

    Now that the 32bit UP oddity is gone and 32bit uses always a sequence
    count, there is no need for the fetch_irq() variants anymore.

    Convert to the regular interface.

    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Ivan Vecera <ivecera@redhat.com>
2023-06-08 13:37:52 +02:00
Jan Stancek 12f19869a5 Merge: CNB: net: move from strlcpy with unused retval to strscpy
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/2125

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2175236
Tested: Just build

Commits:
```
f029c781dd6d ("net: ethernet: move from strlcpy with unused retval to strscpy")
fb3ceec187e8 ("net: move from strlcpy with unused retval to strscpy")
```

Signed-off-by: Ivan Vecera <ivecera@redhat.com>

Approved-by: Mohamed Gamal Morsy <mgamal@redhat.com>
Approved-by: José Ignacio Tornos Martínez <jtornosm@redhat.com>
Approved-by: Petr Oros <poros@redhat.com>
Approved-by: Jiri Benc <jbenc@redhat.com>
Approved-by: John W. Linville <linville@redhat.com>
Approved-by: Íñigo Huguet <ihuguet@redhat.com>
Approved-by: Corinna Vinschen <vinschen@redhat.com>

Signed-off-by: Jan Stancek <jstancek@redhat.com>
2023-03-29 12:09:13 +02:00
Ivan Vecera d1e58e3d4c net: move from strlcpy with unused retval to strscpy
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2175236

Conflicts:
- hunk for vmxnet3 was omitted as it is already applied

commit fb3ceec187e8bca474340e361a18163a2e79c0a2
Author: Wolfram Sang <wsa+renesas@sang-engineering.com>
Date:   Tue Aug 30 22:14:52 2022 +0200

    net: move from strlcpy with unused retval to strscpy

    Follow the advice of the below link and prefer 'strscpy' in this
    subsystem. Conversion is 1:1 because the return value is not used.
    Generated by a coccinelle script.

    Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/
    Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
    Acked-by: Marc Kleine-Budde <mkl@pengutronix.de> # for CAN
    Link: https://lore.kernel.org/r/20220830201457.7984-1-wsa+renesas@sang-engineering.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Ivan Vecera <ivecera@redhat.com>
2023-03-14 14:32:35 +01:00
Mohammed Gamal a70d7d630e hv_netvsc: Check status in SEND_RNDIS_PKT completion message
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2172439

Completion responses to SEND_RNDIS_PKT messages are currently processed
regardless of the status in the response, so that resources associated
with the request are freed.  While this is appropriate, code bugs that
cause sending a malformed message, or errors on the Hyper-V host, go
undetected. Fix this by checking the status and outputting a rate-limited
message if there is an error.

Signed-off-by: Michael Kelley <mikelley@microsoft.com>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
Link: https://lore.kernel.org/r/1676264881-48928-1-git-send-email-mikelley@microsoft.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
(cherry picked from commit dca5161f9bd052e9e73be90716ffd57e8762c697)

Signed-off-by: Mohammed Gamal <mgamal@redhat.com>
2023-03-01 22:54:54 +02:00
Mohammed Gamal a7b0d089e4 hv_netvsc: Allocate memory in netvsc_dma_map() with GFP_ATOMIC
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2172439

Memory allocations in the network transmit path must use GFP_ATOMIC
so they won't sleep.

Reported-by: Paolo Abeni <pabeni@redhat.com>
Link: https://lore.kernel.org/lkml/8a4d08f94d3e6fe8b6da68440eaa89a088ad84f9.camel@redhat.com/
Fixes: 846da38de0e8 ("net: netvsc: Add Isolation VM support for netvsc driver")
Cc: stable@vger.kernel.org
Signed-off-by: Michael Kelley <mikelley@microsoft.com>
Link: https://lore.kernel.org/r/1675714317-48577-1-git-send-email-mikelley@microsoft.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
(cherry picked from commit c6aa9d3b43cd11ac13a8220368a3b0483c6751d4)

Signed-off-by: Mohammed Gamal <mgamal@redhat.com>
2023-03-01 22:54:54 +02:00
Mohammed Gamal 567a5ebf65 hv_netvsc: Fix missed pagebuf entries in netvsc_dma_map/unmap()
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2172439

netvsc_dma_map() and netvsc_dma_unmap() currently check the cp_partial
flag and adjust the page_count so that pagebuf entries for the RNDIS
portion of the message are skipped when it has already been copied into
a send buffer. But this adjustment has already been made by code in
netvsc_send(). The duplicate adjustment causes some pagebuf entries to
not be mapped. In a normal VM, this doesn't break anything because the
mapping doesn’t change the PFN. But in a Confidential VM,
dma_map_single() does bounce buffering and provides a different PFN.
Failing to do the mapping causes the wrong PFN to be passed to Hyper-V,
and various errors ensue.

Fix this by removing the duplicate adjustment in netvsc_dma_map() and
netvsc_dma_unmap().

Fixes: 846da38de0e8 ("net: netvsc: Add Isolation VM support for netvsc driver")
Cc: stable@vger.kernel.org
Signed-off-by: Michael Kelley <mikelley@microsoft.com>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
Link: https://lore.kernel.org/r/1675135986-254490-1-git-send-email-mikelley@microsoft.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
(cherry picked from commit 99f1c46011cc0feb47d4f4f7bee70a0341442d14)

Signed-off-by: Mohammed Gamal <mgamal@redhat.com>
2023-03-01 22:54:54 +02:00
Mohammed Gamal bbeaac3edd Drivers: hv: Make remove callback of hyperv driver void returned
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2172439

Since commit fc7a6209d571 ("bus: Make remove callback return
void") forces bus_type::remove be void-returned, it doesn't
make much sense for any bus based driver implementing remove
callbalk to return non-void to its caller.

As such, change the remove function for Hyper-V VMBus based
drivers to return void.

Signed-off-by: Dawei Li <set_pte_at@outlook.com>
Link: https://lore.kernel.org/r/TYCP286MB2323A93C55526E4DF239D3ACCAFA9@TYCP286MB2323.JPNP286.PROD.OUTLOOK.COM
Signed-off-by: Wei Liu <wei.liu@kernel.org>
(cherry picked from commit 96ec2939620c48a503d9c89865c0c230d6f955e4)

Signed-off-by: Mohammed Gamal <mgamal@redhat.com>
2023-03-01 22:54:54 +02:00
Mohammed Gamal e8ada10098 net: hv_netvsc: Fix a warning triggered by memcpy in rndis_filter
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2172439

memcpy: detected field-spanning write (size 168) of single field "(void *)&request->response_msg + (sizeof(struct rndis_message) - sizeof(union rndis_message_container)) + sizeof(*req_id)" at drivers/net/hyperv/rndis_filter.c:338 (size 40)
RSP: 0018:ffffc90000144de0 EFLAGS: 00010282
RAX: 0000000000000000 RBX: ffff8881766b4000 RCX: 0000000000000000
RDX: 0000000000000102 RSI: 0000000000009ffb RDI: 00000000ffffffff
RBP: ffffc90000144e38 R08: 0000000000000000 R09: 00000000ffffdfff
R10: ffffc90000144c48 R11: ffffffff82f56ac8 R12: ffff8881766b403c
R13: 00000000000000a8 R14: ffff888100b75000 R15: ffff888179301d00
FS:  0000000000000000(0000) GS:ffff8884d6280000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055f8b024c418 CR3: 0000000176548001 CR4: 00000000003706e0
Call Trace:
 <IRQ>
 ? _raw_spin_unlock_irqrestore+0x27/0x50
 netvsc_poll+0x556/0x940 [hv_netvsc]
 __napi_poll+0x2e/0x170
 net_rx_action+0x299/0x2f0
 __do_softirq+0xed/0x2ef
 __irq_exit_rcu+0x9f/0x110
 irq_exit_rcu+0xe/0x20
 sysvec_hyperv_callback+0xb0/0xd0
 </IRQ>
 <TASK>
 asm_sysvec_hyperv_callback+0x1b/0x20
RIP: 0010:native_safe_halt+0xb/0x10

Fixes: A warning triggered when the response message len exceeds
the size of rndis_message. Inside the rndis_request structure
these fields are however followed by a RNDIS_EXT_LEN padding
so it is safe to use unsafe_memcpy.

Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Signed-off-by: Cezar Bulinaru <cbulinaru@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 017e42540639a46fdf7c7f5ee647e0b7806c9013)

Signed-off-by: Mohammed Gamal <mgamal@redhat.com>
2023-03-01 22:54:54 +02:00
Mohammed Gamal 2559c19e1a hv_netvsc: Fix race between VF offering and VF association message from host
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2139466

During vm boot, there might be possibility that vf registration
call comes before the vf association from host to vm.

And this might break netvsc vf path, To prevent the same block
vf registration until vf bind message comes from host.

Cc: stable@vger.kernel.org
Fixes: 00d7ddba11 ("hv_netvsc: pair VF based on serial number")
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Gaurav Kohli <gauravkohli@linux.microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 365e1ececb2905f94cc10a5817c5b644a32a3ae2)

Signed-off-by: Mohammed Gamal <mgamal@redhat.com>
2022-11-17 18:13:39 +01:00
Frantisek Hrbata 27a89b8946 Merge: tcp: BIG TCP implementation
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/1560

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2139501
Depends: https://bugzilla.redhat.com/show_bug.cgi?id=2128180
Tested: Using netperf and veth driver. Results meet the assumptions. See https://bugzilla.redhat.com/show_bug.cgi?id=2139501#c1

The series introduces support for BIG TCP.

- Patch 1-2: Preliminary dependencies
- Patch 3-14: Commits from upstream series 7fa2e481ff2f ("Merge branch 'big-tcp'", 2022-05-16)
- Patch 15-19: Follow-ups

Signed-off-by: Ivan Vecera <ivecera@redhat.com>

Approved-by: Antoine Tenart <atenart@redhat.com>
Approved-by: Florian Westphal <fwestpha@redhat.com>

Signed-off-by: Frantisek Hrbata <fhrbata@redhat.com>
2022-11-15 07:30:55 -05:00
Frantisek Hrbata 6fd36e2149 Merge: CNB: net: drop the weight argument from netif_napi_add
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/1577

Bugzilla: https://bugzilla.redhat.com/2139498
Tested: build, boot

Change netif_napi_add family function's API so `netif_napi_add` and `netif_napi_add_tx` uses by default weight = NAPI_POLL_WEIGHT (as most of drivers were already doing in some or another way), and add `netif_napi_add_weight` and `netif_napi_add_tx_weight` for drivers that want to specify a custom NAPI weight.

Signed-off-by: Íñigo Huguet <ihuguet@redhat.com>

Approved-by: John W. Linville <linville@redhat.com>
Approved-by: Jarod Wilson <jarod@redhat.com>
Approved-by: Torez Smith <torez@redhat.com>
Approved-by: Ivan Vecera <ivecera@redhat.com>
Approved-by: Tony Camuso <tcamuso@redhat.com>

Signed-off-by: Frantisek Hrbata <fhrbata@redhat.com>
2022-11-14 10:28:04 -05:00
Íñigo Huguet 0ee29fbc30 net: drop the weight argument from netif_napi_add
Bugzilla: https://bugzilla.redhat.com/2139498

Conflicts:
 - Removed chunk of unexistent drivers: ctucanfd, sunplus, tsnep, funeth,
   octeon_ep, lan966, sfc/siena
 - Removed chunks of unsupported drivers/devices: alacritech, bcm4908, bgmac,
   brocade bna, cadence, cortina, dpaa2, gianfar, jme, lantiq, skge, sky2,
   mediatek ethernet socs, forcedeth, oki-semi, ravb, sfc/falcon, all from TI,
   toshiba spider, via, xilinx axienet, qlge, wil6210
 - e1000e: context conflict, missing f029c781dd6d ("net: ethernet: move from
   strlcpy with unused retval to strscpy")
 - octeontx2: context conflict, missing many commits
 - sfc: removed chunks due to missing commits:
   c28678162b33 ("eth: sfc: remove remnants of the out-of-tree napi_weight module param")
   08135eecd07f ("sfc: add skeleton ef100 VF representors") and following commits
 - lan78: removed chunk due to lack of napi support due to many missing commits
 - qeth_l3: context conflict, missing ee8b7a1156f3 ("net: make drivers set the
   TSO limit not the GSO limit")

commit b48b89f9c189d24eb5e2b4a0ac067da5a24ee86d
Author: Jakub Kicinski <kuba@kernel.org>
Date:   Tue Sep 27 06:27:53 2022 -0700

    net: drop the weight argument from netif_napi_add
    
    We tell driver developers to always pass NAPI_POLL_WEIGHT
    as the weight to netif_napi_add(). This may be confusing
    to newcomers, drop the weight argument, those who really
    need to tweak the weight can use netif_napi_add_weight().
    
    Acked-by: Marc Kleine-Budde <mkl@pengutronix.de> # for CAN
    Link: https://lore.kernel.org/r/20220927132753.750069-1-kuba@kernel.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Íñigo Huguet <ihuguet@redhat.com>
2022-11-04 16:46:36 +01:00
Ivan Vecera d513603ec1 net: allow gso_max_size to exceed 65536
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2139501

commit 7c4e983c4f3cf94fcd879730c6caa877e0768a4d
Author: Alexander Duyck <alexanderduyck@fb.com>
Date:   Fri May 13 11:33:57 2022 -0700

    net: allow gso_max_size to exceed 65536

    The code for gso_max_size was added originally to allow for debugging and
    workaround of buggy devices that couldn't support TSO with blocks 64K in
    size. The original reason for limiting it to 64K was because that was the
    existing limits of IPv4 and non-jumbogram IPv6 length fields.

    With the addition of Big TCP we can remove this limit and allow the value
    to potentially go up to UINT_MAX and instead be limited by the tso_max_size
    value.

    So in order to support this we need to go through and clean up the
    remaining users of the gso_max_size value so that the values will cap at
    64K for non-TCPv6 flows. In addition we can clean up the GSO_MAX_SIZE value
    so that 64K becomes GSO_LEGACY_MAX_SIZE and UINT_MAX will now be the upper
    limit for GSO_MAX_SIZE.

    v6: (edumazet) fixed a compile error if CONFIG_IPV6=n,
                   in a new sk_trim_gso_size() helper.
                   netif_set_tso_max_size() caps the requested TSO size
                   with GSO_MAX_SIZE.

    Signed-off-by: Alexander Duyck <alexanderduyck@fb.com>
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

Signed-off-by: Ivan Vecera <ivecera@redhat.com>
2022-11-02 18:55:52 +01:00
Ivan Vecera 4ba4dadfe4 net: make drivers set the TSO limit not the GSO limit
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2128180

Conflicts:
* drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
* drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c
  - small context conflicts
* drivers/net/usb/ax88179_178a.c
  - hunk removed, the driver does not call netif_set_gso_max_size()
* drivers/net/usb/lan78xx.c
  - modified due to absence of commits d383216a7efe ("lan78xx: Introduce
    Tx URB processing improvements") and 0dd87266c133 ("lan78xx: Remove
    hardware-specific header update")

commit ee8b7a1156f357613646d6c69d07ac5a087a1071
Author: Jakub Kicinski <kuba@kernel.org>
Date:   Thu May 5 19:51:33 2022 -0700

    net: make drivers set the TSO limit not the GSO limit

    Drivers should call the TSO setting helper, GSO is controllable
    by user space.

    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: David S. Miller <davem@davemloft.net>

Signed-off-by: Ivan Vecera <ivecera@redhat.com>
2022-10-18 10:27:21 +02:00
Patrick Talbert 95ad1a9fa6 Merge: CNB: bpf: Let bpf_warn_invalid_xdp_action() report more info
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/1070

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2073454
Tested: Build, boot.

The commit let bpf_warn_invalid_xdp_action() report more info

Signed-off-by: Ivan Vecera <ivecera@redhat.com>

Approved-by: Corinna Vinschen <vinschen@redhat.com>
Approved-by: Kamal Heib <kheib@redhat.com>
Approved-by: Jarod Wilson <jarod@redhat.com>
Approved-by: Hangbin Liu <haliu@redhat.com>
Approved-by: Artem Savkov <asavkov@redhat.com>
Approved-by: Petr Oros <poros@redhat.com>
Approved-by: José Ignacio Tornos Martínez <jtornosm@redhat.com>
Approved-by: Mohamed Gamal Morsy <mgamal@redhat.com>
Approved-by: Jiri Benc <jbenc@redhat.com>

Signed-off-by: Patrick Talbert <ptalbert@redhat.com>
2022-07-15 09:40:47 +02:00
Ivan Vecera ca7c7d9c0c bpf: Let bpf_warn_invalid_xdp_action() report more info
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2073454

Conflicts:
- N/A hunk for unsupported octeontx2 driver omitted

commit c8064e5b4adac5e1255cf4f3b374e75b5376e7ca
Author: Paolo Abeni <pabeni@redhat.com>
Date:   Tue Nov 30 11:08:07 2021 +0100

    bpf: Let bpf_warn_invalid_xdp_action() report more info

    In non trivial scenarios, the action id alone is not sufficient to
    identify the program causing the warning. Before the previous patch,
    the generated stack-trace pointed out at least the involved device
    driver.

    Let's additionally include the program name and id, and the relevant
    device name.

    If the user needs additional infos, he can fetch them via a kernel
    probe, leveraging the arguments added here.

    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
    Acked-by: Toke Høiland-Jørgensen <toke@redhat.com>
    Link: https://lore.kernel.org/bpf/ddb96bb975cbfddb1546cf5da60e77d5100b533c.1638189075.git.pabeni@redhat.com

Signed-off-by: Ivan Vecera <ivecera@redhat.com>
2022-06-28 16:13:14 +02:00
Mohammed Gamal 0d1835d3d6 hv_netvsc: Fix potential dereference of NULL pointer
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2086626

The return value of netvsc_devinfo_get()
needs to be checked to avoid use of NULL
pointer in case of an allocation failure.

Fixes: 0efeea5fb1 ("hv_netvsc: Add the support of hibernation")
Signed-off-by: Yongzhi Liu <lyz_cs@pku.edu.cn>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
Link: https://lore.kernel.org/r/1652962188-129281-1-git-send-email-lyz_cs@pku.edu.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
(cherry picked from commit eb4c0788964730d12e8dd520bd8f5217ca48321c)

Signed-off-by: Mohammed Gamal <mgamal@redhat.com>
2022-06-21 15:42:48 +02:00
Mohammed Gamal 94a763a72e hv_netvsc: Add support for XDP_REDIRECT
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2086626

Handle XDP_REDIRECT action in netvsc driver.
Also, transparently pass ndo_xdp_xmit to VF when available.

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Link: https://lore.kernel.org/r/1649362894-20077-1-git-send-email-haiyangz@microsoft.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
(cherry picked from commit 1cb9d3b6185b2a4d1d592632a7faf5d8c8e5f9b3)

Signed-off-by: Mohammed Gamal <mgamal@redhat.com>
2022-06-21 15:42:48 +02:00
Mohammed Gamal daaced12c6 hv_netvsc: Print value of invalid ID in netvsc_send_{completion,tx_complete}()
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2086626

That being useful for debugging purposes.

Notice that the packet descriptor is in "private" guest memory, so
that Hyper-V can not tamper with it.

While at it, remove two unnecessary u64-casts.

Signed-off-by: Andrea Parri (Microsoft) <parri.andrea@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
(cherry picked from commit 26894cd971168d14fd8f4c05435aef59188c9514)

Signed-off-by: Mohammed Gamal <mgamal@redhat.com>
2022-06-21 15:42:48 +02:00
Mohammed Gamal ed008654bd net: hyperv: remove use of bpf_op_t
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2086626

Following patch will hide that typedef. There seems to be
no strong reason for hyperv to use it, so let's not.

Acked-by: Wei Liu <wei.liu@kernel.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
(cherry picked from commit e416531f04594de678614f9dc63a84bd12b4ef24)

Signed-off-by: Mohammed Gamal <mgamal@redhat.com>
2022-06-21 15:42:48 +02:00
Mohammed Gamal e1363a2dd5 hv_netvsc: Add check for kvmalloc_array
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2086626

As the potential failure of the kvmalloc_array(),
it should be better to check and restore the 'data'
if fails in order to avoid the dereference of the
NULL pointer.

Fixes: 6ae7467112 ("hv_netvsc: Add per-cpu ethtool stats for netvsc")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Link: https://lore.kernel.org/r/20220314020125.2365084-1-jiasheng@iscas.ac.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
(cherry picked from commit 886e44c9298a6b428ae046e2fa092ca52e822e6a)

Signed-off-by: Mohammed Gamal <mgamal@redhat.com>
2022-06-21 15:42:48 +02:00
Mohammed Gamal 762229c388 net: netvsc: remove break after return
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2086626

In function netvsc_process_raw_pkt for VM_PKT_DATA_USING_XFER_PAGES
case there is already a 'return' statement which results 'break'
as dead code

Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
Link: https://lore.kernel.org/r/1646933534-29493-1-git-send-email-ssengar@linux.microsoft.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
(cherry picked from commit 8cf5ab362dce8acff7d2d28a967cdb2d8e9f7b13)

Signed-off-by: Mohammed Gamal <mgamal@redhat.com>
2022-06-21 15:42:48 +02:00
Mohammed Gamal 3460dc3d1e Netvsc: Call hv_unmap_memory() in the netvsc_device_remove()
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2086626

netvsc_device_remove() calls vunmap() inside which should not be
called in the interrupt context. Current code calls hv_unmap_memory()
in the free_netvsc_device() which is rcu callback and maybe called
in the interrupt context. This will trigger BUG_ON(in_interrupt())
in the vunmap(). Fix it via moving hv_unmap_memory() to netvsc_device_
remove().

Fixes: 846da38de0e8 ("net: netvsc: Add Isolation VM support for netvsc driver")
Signed-off-by: Tianyu Lan <Tianyu.Lan@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit b539324f6fe798bdb186e4e91eafb37dd851db2a)

Signed-off-by: Mohammed Gamal <mgamal@redhat.com>
2022-06-21 15:42:48 +02:00
Mohammed Gamal 2f3dd2c5d3 net: netvsc: Add Isolation VM support for netvsc driver
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2086626

In Isolation VM, all shared memory with host needs to mark visible
to host via hvcall. vmbus_establish_gpadl() has already done it for
netvsc rx/tx ring buffer. The page buffer used by vmbus_sendpacket_
pagebuffer() stills need to be handled. Use DMA API to map/umap
these memory during sending/receiving packet and Hyper-V swiotlb
bounce buffer dma address will be returned. The swiotlb bounce buffer
has been masked to be visible to host during boot up.

rx/tx ring buffer is allocated via vzalloc() and they need to be
mapped into unencrypted address space(above vTOM) before sharing
with host and accessing. Add hv_map/unmap_memory() to map/umap rx
/tx ring buffer.

Signed-off-by: Tianyu Lan <Tianyu.Lan@microsoft.com>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Link: https://lore.kernel.org/r/20211213071407.314309-6-ltykernel@gmail.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
(cherry picked from commit 846da38de0e8224f2f94b885125cf1fd2d7b0d39)

Signed-off-by: Mohammed Gamal <mgamal@redhat.com>

Conflicts:
	drivers/net/hyperv/netvsc.c (Context issue due to previous commit)
	include/asm-generic/mshyperv.h (Out of order commits)
2022-06-21 15:42:42 +02:00
Mohammed Gamal 19a0a687b7 hv_netvsc: Use bitmap_zalloc() when applicable
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2086626

'send_section_map' is a bitmap. So use 'bitmap_zalloc()' to simplify code,
improve the semantic and avoid some open-coded arithmetic in allocator
arguments.

Also change the corresponding 'kfree()' into 'bitmap_free()' to keep
consistency.

While at it, change an '== NULL' test into a '!'.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit e9268a94399899a3ad797d37d611d9e41f65e8e7)

Signed-off-by: Mohammed Gamal <mgamal@redhat.com>
2022-06-21 15:33:01 +02:00
Mohammed Gamal 1478acc588 hv_netvsc: Add comment of netvsc_xdp_xmit()
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2086626

Adding comment to avoid the misusing of netvsc_xdp_xmit().
Otherwise the value of skb->queue_mapping could be 0 and
then the return value of skb_get_rx_queue() could be MAX_U16
cause by overflow.

Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
Link: https://lore.kernel.org/r/1634174786-1810351-1-git-send-email-jiasheng@iscas.ac.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
(cherry picked from commit 78e0a006914b9fc0dd714d68f0bb6e0f50c944f2)

Signed-off-by: Mohammed Gamal <mgamal@redhat.com>
2022-06-21 15:32:54 +02:00
Mohammed Gamal 3f94868b00 hv_netvsc: use netif_is_bond_master() instead of open code
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2086626

Use netif_is_bond_master() function instead of open code, which is
((event_dev->priv_flags & IFF_BONDING) && (event_dev->flags & IFF_MASTER)).
This patch doesn't change logic.

Signed-off-by: Juhee Kang <claudiajkang@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit c60882a4566a0a62dc3a40c85131103aad83dcb3)

Signed-off-by: Mohammed Gamal <mgamal@redhat.com>
2022-06-21 15:32:26 +02:00
Mohammed Gamal 174ee8b7c7 Drivers: hv: vmbus: Mark vmbus ring buffer visible to host in Isolation VM
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2086622

Mark vmbus ring buffer visible with set_memory_decrypted() when
establish gpadl handle.

Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Signed-off-by: Tianyu Lan <Tianyu.Lan@microsoft.com>
Link: https://lore.kernel.org/r/20211025122116.264793-5-ltykernel@gmail.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
(cherry picked from commit d4dccf353db80e209f262e3973c834e6e48ba9a9)

Signed-off-by: Mohammed Gamal <mgamal@redhat.com>
2022-06-14 17:25:22 +02:00
Ivan Vecera 4be382be21 net: use eth_hw_addr_set()
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2081256

commit 2f23e5cef31414156c24b90e56dedc118feb9bf3
Author: Jakub Kicinski <kuba@kernel.org>
Date:   Fri Oct 1 14:32:19 2021 -0700

    net: use eth_hw_addr_set()

    Convert sw drivers from memcpy(... ETH_ADDR) to eth_hw_addr_set():

      @@
      expression dev, np;
      @@
      - memcpy(dev->dev_addr, np, ETH_ALEN)
      + eth_hw_addr_set(dev, np)

    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: David S. Miller <davem@davemloft.net>

Signed-off-by: Ivan Vecera <ivecera@redhat.com>
2022-05-03 13:24:34 +02:00
Ivan Vecera c426c3b533 ethtool: extend ringparam setting/getting API with rx_buf_len
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2047636

commit 7462494408cd3de8b0bc1e79670bf213288501d0
Author: Hao Chen <chenhao288@hisilicon.com>
Date:   Thu Nov 18 20:12:43 2021 +0800

    ethtool: extend ringparam setting/getting API with rx_buf_len

    Add two new parameters kernel_ringparam and extack for
    .get_ringparam and .set_ringparam to extend more ring params
    through netlink.

    Signed-off-by: Hao Chen <chenhao288@hisilicon.com>
    Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

Signed-off-by: Ivan Vecera <ivecera@redhat.com>
2022-01-28 15:55:56 +01:00
Linus Torvalds dbe69e4337 Networking changes for 5.14.
Core:
 
  - BPF:
    - add syscall program type and libbpf support for generating
      instructions and bindings for in-kernel BPF loaders (BPF loaders
      for BPF), this is a stepping stone for signed BPF programs
    - infrastructure to migrate TCP child sockets from one listener
      to another in the same reuseport group/map to improve flexibility
      of service hand-off/restart
    - add broadcast support to XDP redirect
 
  - allow bypass of the lockless qdisc to improving performance
    (for pktgen: +23% with one thread, +44% with 2 threads)
 
  - add a simpler version of "DO_ONCE()" which does not require
    jump labels, intended for slow-path usage
 
  - virtio/vsock: introduce SOCK_SEQPACKET support
 
  - add getsocketopt to retrieve netns cookie
 
  - ip: treat lowest address of a IPv4 subnet as ordinary unicast address
        allowing reclaiming of precious IPv4 addresses
 
  - ipv6: use prandom_u32() for ID generation
 
  - ip: add support for more flexible field selection for hashing
        across multi-path routes (w/ offload to mlxsw)
 
  - icmp: add support for extended RFC 8335 PROBE (ping)
 
  - seg6: add support for SRv6 End.DT46 behavior
 
  - mptcp:
     - DSS checksum support (RFC 8684) to detect middlebox meddling
     - support Connection-time 'C' flag
     - time stamping support
 
  - sctp: packetization Layer Path MTU Discovery (RFC 8899)
 
  - xfrm: speed up state addition with seq set
 
  - WiFi:
     - hidden AP discovery on 6 GHz and other HE 6 GHz improvements
     - aggregation handling improvements for some drivers
     - minstrel improvements for no-ack frames
     - deferred rate control for TXQs to improve reaction times
     - switch from round robin to virtual time-based airtime scheduler
 
  - add trace points:
     - tcp checksum errors
     - openvswitch - action execution, upcalls
     - socket errors via sk_error_report
 
 Device APIs:
 
  - devlink: add rate API for hierarchical control of max egress rate
             of virtual devices (VFs, SFs etc.)
 
  - don't require RCU read lock to be held around BPF hooks
    in NAPI context
 
  - page_pool: generic buffer recycling
 
 New hardware/drivers:
 
  - mobile:
     - iosm: PCIe Driver for Intel M.2 Modem
     - support for Qualcomm MSM8998 (ipa)
 
  - WiFi: Qualcomm QCN9074 and WCN6855 PCI devices
 
  - sparx5: Microchip SparX-5 family of Enterprise Ethernet switches
 
  - Mellanox BlueField Gigabit Ethernet (control NIC of the DPU)
 
  - NXP SJA1110 Automotive Ethernet 10-port switch
 
  - Qualcomm QCA8327 switch support (qca8k)
 
  - Mikrotik 10/25G NIC (atl1c)
 
 Driver changes:
 
  - ACPI support for some MDIO, MAC and PHY devices from Marvell and NXP
    (our first foray into MAC/PHY description via ACPI)
 
  - HW timestamping (PTP) support: bnxt_en, ice, sja1105, hns3, tja11xx
 
  - Mellanox/Nvidia NIC (mlx5)
    - NIC VF offload of L2 bridging
    - support IRQ distribution to Sub-functions
 
  - Marvell (prestera):
     - add flower and match all
     - devlink trap
     - link aggregation
 
  - Netronome (nfp): connection tracking offload
 
  - Intel 1GE (igc): add AF_XDP support
 
  - Marvell DPU (octeontx2): ingress ratelimit offload
 
  - Google vNIC (gve): new ring/descriptor format support
 
  - Qualcomm mobile (rmnet & ipa): inline checksum offload support
 
  - MediaTek WiFi (mt76)
     - mt7915 MSI support
     - mt7915 Tx status reporting
     - mt7915 thermal sensors support
     - mt7921 decapsulation offload
     - mt7921 enable runtime pm and deep sleep
 
  - Realtek WiFi (rtw88)
     - beacon filter support
     - Tx antenna path diversity support
     - firmware crash information via devcoredump
 
  - Qualcomm 60GHz WiFi (wcn36xx)
     - Wake-on-WLAN support with magic packets and GTK rekeying
 
  - Micrel PHY (ksz886x/ksz8081): add cable test support
 
 Signed-off-by: Jakub Kicinski <kuba@kernel.org>
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE6jPA+I1ugmIBA4hXMUZtbf5SIrsFAmDb+fUACgkQMUZtbf5S
 Irs2Jg//aqN0Q8CgIvYCVhPxQw1tY7pTAbgyqgBZ01vwjyvtIOgJiWzSfFEU84mX
 M8fcpFX5eTKrOyJ9S6UFfQ/JG114n3hjAxFFT4Hxk2gC1Tg0vHuFQTDHcUl28bUE
 mTm61e1YpdorILnv2k5JVQ/wu0vs5QKDrjcYcrcPnh+j93wvnPOgAfDBV95nZzjS
 OTt4q2fR8GzLcSYWWsclMbDNkzyTG50RW/0Yd6aGjr5QGvXfrMeXfUJNz533PMf/
 w5lNyjRKv+x9mdTZJzU0+msNUrZgUdRz7W8Ey8lD3hJZRE+D6/uU7FtsE8Mi3+uc
 HWxeZUyzA3YF1MfVl/eesbxyPT7S/OkLzk4O5B35FbqP0YltaP+bOjq1/nM3ce1/
 io9Dx9pIl/2JANUgRCAtLi8Z2dkvRoqTaBxZ/nPudCCljFwDwl6joTMJ7Ow22i5Y
 5aIkcXFmZq4LbJDiHvbTlqT7yiuaEvu2UK/23bSIg/K3nF4eAmkY9Y1EgiMf60OF
 78Ttw0wk2tUegwaS5MZnCniKBKDyl9gM2F6rbZ/IxQRR2LTXFc1B6gC+ynUxgXfh
 Ub8O++6qGYGYZ0XvQH4pzco79p3qQWBTK5beIp2eu6BOAjBVIXq4AibUfoQLACsu
 hX7jMPYd0kc3WFgUnKgQP8EnjFSwbf4XiaE7fIXvWBY8hzCw2h4=
 =LvtX
 -----END PGP SIGNATURE-----

Merge tag 'net-next-5.14' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next

Pull networking updates from Jakub Kicinski:
 "Core:

   - BPF:
      - add syscall program type and libbpf support for generating
        instructions and bindings for in-kernel BPF loaders (BPF loaders
        for BPF), this is a stepping stone for signed BPF programs
      - infrastructure to migrate TCP child sockets from one listener to
        another in the same reuseport group/map to improve flexibility
        of service hand-off/restart
      - add broadcast support to XDP redirect

   - allow bypass of the lockless qdisc to improving performance (for
     pktgen: +23% with one thread, +44% with 2 threads)

   - add a simpler version of "DO_ONCE()" which does not require jump
     labels, intended for slow-path usage

   - virtio/vsock: introduce SOCK_SEQPACKET support

   - add getsocketopt to retrieve netns cookie

   - ip: treat lowest address of a IPv4 subnet as ordinary unicast
     address allowing reclaiming of precious IPv4 addresses

   - ipv6: use prandom_u32() for ID generation

   - ip: add support for more flexible field selection for hashing
     across multi-path routes (w/ offload to mlxsw)

   - icmp: add support for extended RFC 8335 PROBE (ping)

   - seg6: add support for SRv6 End.DT46 behavior

   - mptcp:
      - DSS checksum support (RFC 8684) to detect middlebox meddling
      - support Connection-time 'C' flag
      - time stamping support

   - sctp: packetization Layer Path MTU Discovery (RFC 8899)

   - xfrm: speed up state addition with seq set

   - WiFi:
      - hidden AP discovery on 6 GHz and other HE 6 GHz improvements
      - aggregation handling improvements for some drivers
      - minstrel improvements for no-ack frames
      - deferred rate control for TXQs to improve reaction times
      - switch from round robin to virtual time-based airtime scheduler

   - add trace points:
      - tcp checksum errors
      - openvswitch - action execution, upcalls
      - socket errors via sk_error_report

  Device APIs:

   - devlink: add rate API for hierarchical control of max egress rate
     of virtual devices (VFs, SFs etc.)

   - don't require RCU read lock to be held around BPF hooks in NAPI
     context

   - page_pool: generic buffer recycling

  New hardware/drivers:

   - mobile:
      - iosm: PCIe Driver for Intel M.2 Modem
      - support for Qualcomm MSM8998 (ipa)

   - WiFi: Qualcomm QCN9074 and WCN6855 PCI devices

   - sparx5: Microchip SparX-5 family of Enterprise Ethernet switches

   - Mellanox BlueField Gigabit Ethernet (control NIC of the DPU)

   - NXP SJA1110 Automotive Ethernet 10-port switch

   - Qualcomm QCA8327 switch support (qca8k)

   - Mikrotik 10/25G NIC (atl1c)

  Driver changes:

   - ACPI support for some MDIO, MAC and PHY devices from Marvell and
     NXP (our first foray into MAC/PHY description via ACPI)

   - HW timestamping (PTP) support: bnxt_en, ice, sja1105, hns3, tja11xx

   - Mellanox/Nvidia NIC (mlx5)
      - NIC VF offload of L2 bridging
      - support IRQ distribution to Sub-functions

   - Marvell (prestera):
      - add flower and match all
      - devlink trap
      - link aggregation

   - Netronome (nfp): connection tracking offload

   - Intel 1GE (igc): add AF_XDP support

   - Marvell DPU (octeontx2): ingress ratelimit offload

   - Google vNIC (gve): new ring/descriptor format support

   - Qualcomm mobile (rmnet & ipa): inline checksum offload support

   - MediaTek WiFi (mt76)
      - mt7915 MSI support
      - mt7915 Tx status reporting
      - mt7915 thermal sensors support
      - mt7921 decapsulation offload
      - mt7921 enable runtime pm and deep sleep

   - Realtek WiFi (rtw88)
      - beacon filter support
      - Tx antenna path diversity support
      - firmware crash information via devcoredump

   - Qualcomm WiFi (wcn36xx)
      - Wake-on-WLAN support with magic packets and GTK rekeying

   - Micrel PHY (ksz886x/ksz8081): add cable test support"

* tag 'net-next-5.14' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next: (2168 commits)
  tcp: change ICSK_CA_PRIV_SIZE definition
  tcp_yeah: check struct yeah size at compile time
  gve: DQO: Fix off by one in gve_rx_dqo()
  stmmac: intel: set PCI_D3hot in suspend
  stmmac: intel: Enable PHY WOL option in EHL
  net: stmmac: option to enable PHY WOL with PMT enabled
  net: say "local" instead of "static" addresses in ndo_dflt_fdb_{add,del}
  net: use netdev_info in ndo_dflt_fdb_{add,del}
  ptp: Set lookup cookie when creating a PTP PPS source.
  net: sock: add trace for socket errors
  net: sock: introduce sk_error_report
  net: dsa: replay the local bridge FDB entries pointing to the bridge dev too
  net: dsa: ensure during dsa_fdb_offload_notify that dev_hold and dev_put are on the same dev
  net: dsa: include fdb entries pointing to bridge in the host fdb list
  net: dsa: include bridge addresses which are local in the host fdb list
  net: dsa: sync static FDB entries on foreign interfaces to hardware
  net: dsa: install the host MDB and FDB entries in the master's RX filter
  net: dsa: reference count the FDB addresses at the cross-chip notifier level
  net: dsa: introduce a separate cross-chip notifier type for host FDBs
  net: dsa: reference count the MDB entries at the cross-chip notifier level
  ...
2021-06-30 15:51:09 -07:00