Daniel Borkmann says: ==================== netkit: Support for io_uring zero-copy and AF_XDP Containers use virtual netdevs to route traffic from a physical netdev in the host namespace. They do not have access to the physical netdev in the host and thus can't use memory providers or AF_XDP that require reconfiguring/restarting queues in the physical netdev. This patchset adds the concept of queue leasing to virtual netdevs that allow containers to use memory providers and AF_XDP at native speed. Leased queues are bound to a real queue in a physical netdev and act as a proxy. Memory providers and AF_XDP operations take an ifindex and queue id, so containers would pass in an ifindex for a virtual netdev and a queue id of a leased queue, which then gets proxied to the underlying real queue. We have implemented support for this concept in netkit and tested the latter against Nvidia ConnectX-6 (mlx5) as well as Broadcom BCM957504 (bnxt_en) 100G NICs. For more details see the individual patches. ====================
Showing the changes to include/uapi (2 of 26 files). Show all
Unified · Split
| @@ -1296,6 +1296,11 @@ enum netkit_mode { · 1295 unmodified lines | |||
| 1296 | NETKIT_L3, | 1296 | NETKIT_L3, |
| 1297 | }; | 1297 | }; |
| 1298 | 1298 | ||
| 1299 | enum netkit_pairing { | ||
| 1300 | NETKIT_DEVICE_PAIR, | ||
| 1301 | NETKIT_DEVICE_SINGLE, | ||
| 1302 | }; | ||
| 1303 | |||
| 1299 | /* NETKIT_SCRUB_NONE leaves clearing skb->{mark,priority} up to | 1304 | /* NETKIT_SCRUB_NONE leaves clearing skb->{mark,priority} up to |
| 1300 | * the BPF program if attached. This also means the latter can | 1305 | * the BPF program if attached. This also means the latter can |
| 1301 | * consume the two fields if they were populated earlier. | 1306 | * consume the two fields if they were populated earlier. |
| @@ -1320,6 +1325,7 @@ enum { · 18 unmodified lines | |||
| 1320 | IFLA_NETKIT_PEER_SCRUB, | 1325 | IFLA_NETKIT_PEER_SCRUB, |
| 1321 | IFLA_NETKIT_HEADROOM, | 1326 | IFLA_NETKIT_HEADROOM, |
| 1322 | IFLA_NETKIT_TAILROOM, | 1327 | IFLA_NETKIT_TAILROOM, |
| 1328 | IFLA_NETKIT_PAIRING, | ||
| 1323 | __IFLA_NETKIT_MAX, | 1329 | __IFLA_NETKIT_MAX, |
| 1324 | }; | 1330 | }; |
| 1325 | #define IFLA_NETKIT_MAX (__IFLA_NETKIT_MAX - 1) | 1331 | #define IFLA_NETKIT_MAX (__IFLA_NETKIT_MAX - 1) |
| @@ -160,6 +160,7 @@ enum { · 159 unmodified lines | |||
| 160 | NETDEV_A_QUEUE_DMABUF, | 160 | NETDEV_A_QUEUE_DMABUF, |
| 161 | NETDEV_A_QUEUE_IO_URING, | 161 | NETDEV_A_QUEUE_IO_URING, |
| 162 | NETDEV_A_QUEUE_XSK, | 162 | NETDEV_A_QUEUE_XSK, |
| 163 | NETDEV_A_QUEUE_LEASE, | ||
| 163 | 164 | ||
| 164 | __NETDEV_A_QUEUE_MAX, | 165 | __NETDEV_A_QUEUE_MAX, |
| 165 | NETDEV_A_QUEUE_MAX = (__NETDEV_A_QUEUE_MAX - 1) | 166 | NETDEV_A_QUEUE_MAX = (__NETDEV_A_QUEUE_MAX - 1) |
| @@ -202,6 +203,15 @@ enum { · 36 unmodified lines | |||
| 202 | NETDEV_A_QSTATS_MAX = (__NETDEV_A_QSTATS_MAX - 1) | 203 | NETDEV_A_QSTATS_MAX = (__NETDEV_A_QSTATS_MAX - 1) |
| 203 | }; | 204 | }; |
| 204 | 205 | ||
| 206 | enum { | ||
| 207 | NETDEV_A_LEASE_IFINDEX = 1, | ||
| 208 | NETDEV_A_LEASE_QUEUE, | ||
| 209 | NETDEV_A_LEASE_NETNS_ID, | ||
| 210 | |||
| 211 | __NETDEV_A_LEASE_MAX, | ||
| 212 | NETDEV_A_LEASE_MAX = (__NETDEV_A_LEASE_MAX - 1) | ||
| 213 | }; | ||
| 214 | |||
| 205 | enum { | 215 | enum { |
| 206 | NETDEV_A_DMABUF_IFINDEX = 1, | 216 | NETDEV_A_DMABUF_IFINDEX = 1, |
| 207 | NETDEV_A_DMABUF_QUEUES, | 217 | NETDEV_A_DMABUF_QUEUES, |
| @@ -228,6 +238,7 @@ enum { · 20 unmodified lines | |||
| 228 | NETDEV_CMD_BIND_RX, | 238 | NETDEV_CMD_BIND_RX, |
| 229 | NETDEV_CMD_NAPI_SET, | 239 | NETDEV_CMD_NAPI_SET, |
| 230 | NETDEV_CMD_BIND_TX, | 240 | NETDEV_CMD_BIND_TX, |
| 241 | NETDEV_CMD_QUEUE_CREATE, | ||
| 231 | 242 | ||
| 232 | __NETDEV_CMD_MAX, | 243 | __NETDEV_CMD_MAX, |
| 233 | NETDEV_CMD_MAX = (__NETDEV_CMD_MAX - 1) | 244 | NETDEV_CMD_MAX = (__NETDEV_CMD_MAX - 1) |