~vilhelm-gray/ubuntu/+source/linux/+git/sf277232:sf277232

Last commit made on 2021-01-27
Get this branch:
git clone -b sf277232 https://git.launchpad.net/~vilhelm-gray/ubuntu/+source/linux/+git/sf277232
Only William Breathitt Gray can upload to this branch. If you are William Breathitt Gray please log in for upload directions.

Branch merges

Branch information

Recent commits

c82437d... by Haiyang Zhang

hv_netvsc: Fix XDP refcnt for synthetic and VF NICs

BugLink: https://bugs.launchpad.net/bugs/1877654

The caller of XDP_SETUP_PROG has already incremented refcnt in
__bpf_prog_get(), so drivers should only increment refcnt by
num_queues - 1.

To fix the issue, update netvsc_xdp_set() to add the correct number
to refcnt.

Hold a refcnt in netvsc_xdp_set()’s other caller, netvsc_attach().

And, do the same in netvsc_vf_setxdp(). Otherwise, every time when VF is
removed and added from the host side, the refcnt will be decreased by one,
which may cause page fault when unloading xdp program.

Fixes: 351e1581395f ("hv_netvsc: Add XDP support")
Signed-off-by: Haiyang Zhang <email address hidden>
Signed-off-by: David S. Miller <email address hidden>
(cherry picked from commit 184367dce4f744bde54377203305ccc8889aa79f)
Signed-off-by: William Breathitt Gray <email address hidden>

c4dbaed... by Haiyang Zhang

hv_netvsc: Update document for XDP support

BugLink: https://bugs.launchpad.net/bugs/1877654

Added the new section in the document regarding XDP support
by hv_netvsc driver.

Signed-off-by: Haiyang Zhang <email address hidden>
Signed-off-by: David S. Miller <email address hidden>
(backported from commit 12fa74383ed4d1ffa283f77c1e7fe038e8182405)
[ vilhelmgray: context adjustment ]
Signed-off-by: William Breathitt Gray <email address hidden>

2233461... by Haiyang Zhang

hv_netvsc: Add XDP support

BugLink: https://bugs.launchpad.net/bugs/1877654

This patch adds support of XDP in native mode for hv_netvsc driver, and
transparently sets the XDP program on the associated VF NIC as well.

Setting / unsetting XDP program on synthetic NIC (netvsc) propagates to
VF NIC automatically. Setting / unsetting XDP program on VF NIC directly
is not recommended, also not propagated to synthetic NIC, and may be
overwritten by setting of synthetic NIC.

The Azure/Hyper-V synthetic NIC receive buffer doesn't provide headroom
for XDP. We thought about re-use the RNDIS header space, but it's too
small. So we decided to copy the packets to a page buffer for XDP. And,
most of our VMs on Azure have Accelerated Network (SRIOV) enabled, so
most of the packets run on VF NIC. The synthetic NIC is considered as a
fallback data-path. So the data copy on netvsc won't impact performance
significantly.

XDP program cannot run with LRO (RSC) enabled, so you need to disable LRO
before running XDP:
        ethtool -K eth0 lro off

XDP actions not yet supported:
        XDP_REDIRECT

Signed-off-by: Haiyang Zhang <email address hidden>
Signed-off-by: David S. Miller <email address hidden>
(backported from commit 351e1581395fcc7fb952bbd7dda01238f69968fd)
[ vilhelmgray: context adjustments ]
[ vilhelmgray: drop changes for netvsc_resume() ]
Signed-off-by: William Breathitt Gray <email address hidden>

554f24f... by Haiyang Zhang

hv_netvsc: Refactor assignments of struct netvsc_device_info

BugLink: https://bugs.launchpad.net/bugs/1877654

These assignments occur in multiple places. The patch refactor them
to a function for simplicity. It also puts the struct to heap area
for future expension.

Signed-off-by: Haiyang Zhang <email address hidden>
Reviewed-by: Michael Kelley <email address hidden>
[sl: fix up subject line]
Signed-off-by: Sasha Levin <email address hidden>
(backported from commit 7c9f335a3ff20557a92584199f3d35c7e992bbe5)
[ vilhelmgray: context adjustments and storing ring_size ]
Signed-off-by: William Breathitt Gray <email address hidden>

c7c76ed... by Haiyang Zhang

hv_netvsc: Add support for LRO/RSC in the vSwitch

BugLink: https://bugs.launchpad.net/bugs/1877654

LRO/RSC in the vSwitch is a feature available in Windows Server 2019
hosts and later. It reduces the per packet processing overhead by
coalescing multiple TCP segments when possible. This patch adds netvsc
driver support for this feature.

Signed-off-by: Haiyang Zhang <email address hidden>
Signed-off-by: David S. Miller <email address hidden>
(backported from commit c8e4eff4675f22ad1110141ed9e62102d4d77e1c)
[ vilhelmgray: context adjustments ]
[ vilhelmgray: remove drop incomplete packet from netvsc_receive() ]
Signed-off-by: William Breathitt Gray <email address hidden>

2d09ff6... by =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= <email address hidden>

xdp: add MEM_TYPE_ZERO_COPY

BugLink: https://bugs.launchpad.net/bugs/1877654

Here, a new type of allocator support is added to the XDP return
API. A zero-copy allocated xdp_buff cannot be converted to an
xdp_frame. Instead is the buff has to be copied. This is not supported
at all in this commit.

Also, an opaque "handle" is added to xdp_buff. This can be used as a
context for the zero-copy allocator implementation.

Signed-off-by: Björn Töpel <email address hidden>
Signed-off-by: Daniel Borkmann <email address hidden>
(cherry picked from commit 02b55e5657c3a569fc681ba851e464cfa6b90d4f)
Signed-off-by: William Breathitt Gray <email address hidden>

db1b4ff... by Jesper Dangaard Brouer

xdp: introduce xdp_return_frame_rx_napi

BugLink: https://bugs.launchpad.net/bugs/1877654

When sending an xdp_frame through xdp_do_redirect call, then error
cases can happen where the xdp_frame needs to be dropped, and
returning an -errno code isn't sufficient/possible any-longer
(e.g. for cpumap case). This is already fully supported, by simply
calling xdp_return_frame.

This patch is an optimization, which provides xdp_return_frame_rx_napi,
which is a faster variant for these error cases. It take advantage of
the protection provided by XDP RX running under NAPI protection.

This change is mostly relevant for drivers using the page_pool
allocator as it can take advantage of this. (Tested with mlx5).

Signed-off-by: Jesper Dangaard Brouer <email address hidden>
Signed-off-by: Alexei Starovoitov <email address hidden>
(backported from commit 389ab7f01af988c2a1ec5617eb0c7e220df1ef1c)
[ vilhelmgray: context adjustment ]
Signed-off-by: William Breathitt Gray <email address hidden>

6f28ca1... by Jesper Dangaard Brouer

bpf: devmap prepare xdp frames for bulking

BugLink: https://bugs.launchpad.net/bugs/1877654

Like cpumap create queue for xdp frames that will be bulked. For now,
this patch simply invoke ndo_xdp_xmit foreach frame. This happens,
either when the map flush operation is envoked, or when the limit
DEV_MAP_BULK_SIZE is reached.

V5: Avoid memleak on error path in dev_map_update_elem()

Signed-off-by: Jesper Dangaard Brouer <email address hidden>
Signed-off-by: Alexei Starovoitov <email address hidden>
(backported from commit 5d053f9da4311a86bc58be8588bb5660fb3f0724)
[ vilhelmgray: context adjustment ]
Signed-off-by: William Breathitt Gray <email address hidden>

0483304... by Jesper Dangaard Brouer

bpf: devmap introduce dev_map_enqueue

BugLink: https://bugs.launchpad.net/bugs/1877654

Functionality is the same, but the ndo_xdp_xmit call is now
simply invoked from inside the devmap.c code.

V2: Fix compile issue reported by kbuild test robot <email address hidden>

V5: Cleanups requested by Daniel
 - Newlines before func definition
 - Use BUILD_BUG_ON checks
 - Remove unnecessary use return value store in dev_map_enqueue

Signed-off-by: Jesper Dangaard Brouer <email address hidden>
Signed-off-by: Alexei Starovoitov <email address hidden>
(backported commit 67f29e07e131ffa13ea158c259a513f474c7df27)
[ vilhelmgray: context adjustments ]
Signed-off-by: William Breathitt Gray <email address hidden>

6641b73... by =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= <email address hidden>

xsk: add Rx receive functions and poll support

BugLink: https://bugs.launchpad.net/bugs/1877654

Here the actual receive functions of AF_XDP are implemented, that in a
later commit, will be called from the XDP layers.

There's one set of functions for the XDP_DRV side and another for
XDP_SKB (generic).

A new XDP API, xdp_return_buff, is also introduced.

Adding xdp_return_buff, which is analogous to xdp_return_frame, but
acts upon an struct xdp_buff. The API will be used by AF_XDP in future
commits.

Support for the poll syscall is also implemented.

v2: xskq_validate_id did not update cons_tail.
    The entries variable was calculated twice in xskq_nb_avail.
    Squashed xdp_return_buff commit.

Signed-off-by: Björn Töpel <email address hidden>
Signed-off-by: Alexei Starovoitov <email address hidden>
(cherry picked from commit c497176cb2e478f0a5713b0e05f242276e3194b5)
Signed-off-by: William Breathitt Gray <email address hidden>