- Jul 10, 2023
-
-
Hawkins Jiawei authored
We can access the CVQ header through `struct virtio_net_ctrl_hdr`, instead of accessing it through a `uint8_t` pointer, which improves the code's readability and maintainability. Signed-off-by:
Hawkins Jiawei <yin31149@gmail.com> Message-Id: <cd522e06a4371e9d6b8a1c1a86f90a92401d56e8.1688743107.git.yin31149@gmail.com> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
Hawkins Jiawei authored
This patch introduces vhost_vdpa_net_load_rx_mode() and vhost_vdpa_net_load_rx() to restore the packet receive filtering state in relation to VIRTIO_NET_F_CTRL_RX feature at device's startup. Signed-off-by:
Hawkins Jiawei <yin31149@gmail.com> Message-Id: <804cedac93e19ba3b810d52b274ca5ec11469f09.1688743107.git.yin31149@gmail.com> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
Hawkins Jiawei authored
This patch refactors vhost_vdpa_net_load_mac() to restore the MAC address filtering state at device's startup. Signed-off-by:
Hawkins Jiawei <yin31149@gmail.com> Message-Id: <4b9550c14bc8c98c8f48e04dbf3d3ac41489d3fd.1688743107.git.yin31149@gmail.com> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
Hawkins Jiawei authored
According to VirtIO standard, "The driver MUST follow the VIRTIO_NET_CTRL_MAC_TABLE_SET command by a le32 number, followed by that number of non-multicast MAC addresses, followed by another le32 number, followed by that number of multicast addresses." Considering that these data is not stored in contiguous memory, this patch refactors vhost_vdpa_net_load_cmd() to accept scattered data, eliminating the need for an addtional data copy or packing the data into s->cvq_cmd_out_buffer outside of vhost_vdpa_net_load_cmd(). Signed-off-by:
Hawkins Jiawei <yin31149@gmail.com> Message-Id: <3482cc50eebd13db4140b8b5dec9d0cc25b20b1b.1688743107.git.yin31149@gmail.com> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
Hawkins Jiawei authored
QEMU uses vhost_handle_guest_kick() to forward guest's available buffers to the vdpa device in SVQ avail ring. In vhost_handle_guest_kick(), a `g_autofree` `elem` is used to iterate through the available VirtQueueElements. This `elem` is then passed to `svq->ops->avail_handler`, specifically to the vhost_vdpa_net_handle_ctrl_avail(). If this handler fails to process the CVQ command, vhost_handle_guest_kick() regains ownership of the `elem`, and either frees it or requeues it. Yet the problem is that, vhost_vdpa_net_handle_ctrl_avail() mistakenly frees the `elem`, even if it fails to forward the CVQ command to vdpa device. This can result in a use-after-free for the `elem` in vhost_handle_guest_kick(). This patch solves this problem by refactoring vhost_vdpa_net_handle_ctrl_avail() to only freeing the `elem` if it owns it. Fixes: bd907ae4 ("vdpa: manual forward CVQ buffers") Signed-off-by:
Hawkins Jiawei <yin31149@gmail.com> Message-Id: <e3f2d7db477734afe5c6a5ab3fa8b8317514ea34.1688746840.git.yin31149@gmail.com> Reviewed-by:
Eugenio Pérez <eperezma@redhat.com> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
Hawkins Jiawei authored
According to VirtIO standard, "The class, command and command-specific-data are set by the driver, and the device sets the ack byte. There is little it can do except issue a diagnostic if ack is not VIRTIO_NET_OK." Therefore, QEMU should stop sending the queued SVQ commands and cancel the device startup if the device's ack is not VIRTIO_NET_OK. Yet the problem is that, vhost_vdpa_net_load_offloads() returns 1 based on `*s->status != VIRTIO_NET_OK` when the device's ack is VIRTIO_NET_ERR. As a result, net->nc->info->load() also returns 1, this makes vhost_net_start_one() incorrectly assume the device state is successfully loaded by vhost_vdpa_net_load() and return 0, instead of goto `fail` label to cancel the device startup, as vhost_net_start_one() only cancels the device startup when net->nc->info->load() returns a negative value. This patch fixes this problem by returning -EIO when the device's ack is not VIRTIO_NET_OK. Fixes: 0b58d368 ("vdpa: Add vhost_vdpa_net_load_offloads()") Signed-off-by:
Hawkins Jiawei <yin31149@gmail.com> Acked-by:
Jason Wang <jasowang@redhat.com> Acked-by:
Eugenio Pérez <eperezma@redhat.com> Message-Id: <b0396b80e96322b86f1a0b10c098fc1edd947d72.1688438055.git.yin31149@gmail.com> Tested-by:
Lei Yang <leiyang@redhat.com> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
Hawkins Jiawei authored
According to VirtIO standard, "The class, command and command-specific-data are set by the driver, and the device sets the ack byte. There is little it can do except issue a diagnostic if ack is not VIRTIO_NET_OK." Therefore, QEMU should stop sending the queued SVQ commands and cancel the device startup if the device's ack is not VIRTIO_NET_OK. Yet the problem is that, vhost_vdpa_net_load_mq() returns 1 based on `*s->status != VIRTIO_NET_OK` when the device's ack is VIRTIO_NET_ERR. As a result, net->nc->info->load() also returns 1, this makes vhost_net_start_one() incorrectly assume the device state is successfully loaded by vhost_vdpa_net_load() and return 0, instead of goto `fail` label to cancel the device startup, as vhost_net_start_one() only cancels the device startup when net->nc->info->load() returns a negative value. This patch fixes this problem by returning -EIO when the device's ack is not VIRTIO_NET_OK. Fixes: f64c7cda ("vdpa: Add vhost_vdpa_net_load_mq") Signed-off-by:
Hawkins Jiawei <yin31149@gmail.com> Acked-by:
Jason Wang <jasowang@redhat.com> Acked-by:
Eugenio Pérez <eperezma@redhat.com> Message-Id: <ec515ebb0b4f56368751b9e318e245a5d994fa72.1688438055.git.yin31149@gmail.com> Tested-by:
Lei Yang <leiyang@redhat.com> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
Hawkins Jiawei authored
According to VirtIO standard, "The class, command and command-specific-data are set by the driver, and the device sets the ack byte. There is little it can do except issue a diagnostic if ack is not VIRTIO_NET_OK." Therefore, QEMU should stop sending the queued SVQ commands and cancel the device startup if the device's ack is not VIRTIO_NET_OK. Yet the problem is that, vhost_vdpa_net_load_mac() returns 1 based on `*s->status != VIRTIO_NET_OK` when the device's ack is VIRTIO_NET_ERR. As a result, net->nc->info->load() also returns 1, this makes vhost_net_start_one() incorrectly assume the device state is successfully loaded by vhost_vdpa_net_load() and return 0, instead of goto `fail` label to cancel the device startup, as vhost_net_start_one() only cancels the device startup when net->nc->info->load() returns a negative value. This patch fixes this problem by returning -EIO when the device's ack is not VIRTIO_NET_OK. Fixes: f73c0c43 ("vdpa: extract vhost_vdpa_net_load_mac from vhost_vdpa_net_load") Signed-off-by:
Hawkins Jiawei <yin31149@gmail.com> Acked-by:
Jason Wang <jasowang@redhat.com> Acked-by:
Eugenio Pérez <eperezma@redhat.com> Message-Id: <a21731518644abbd0c495c5b7960527c5911f80d.1688438055.git.yin31149@gmail.com> Tested-by:
Lei Yang <leiyang@redhat.com> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
- Jul 08, 2023
-
-
Hawkins Jiawei authored
This patch sorts the vdpa_feature_bits array alphabetically in ascending order to avoid future duplicates. Signed-off-by:
Hawkins Jiawei <yin31149@gmail.com> Signed-off-by:
Michael Tokarev <mjt@tls.msk.ru>
-
Hawkins Jiawei authored
This entry was duplicated on referenced commit. Removing it. Fixes: 40237840 ("vhost-vdpa: multiqueue support") Signed-off-by:
Hawkins Jiawei <yin31149@gmail.com> Reviewed-by:
Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by:
Michael Tokarev <mjt@tls.msk.ru>
-
- Jul 07, 2023
-
-
Laurent Vivier authored
Move the file descriptor type checking before doing anything with it. If it's not usable, don't close it as it could be in use by another part of QEMU, only fail and report an error. Reviewed-by:
David Gibson <david@gibson.dropbear.id.au> Signed-off-by:
Laurent Vivier <lvivier@redhat.com> Signed-off-by:
Jason Wang <jasowang@redhat.com>
-
Laurent Vivier authored
Reviewed-by:
David Gibson <david@gibson.dropbear.id.au> Signed-off-by:
Laurent Vivier <lvivier@redhat.com> Signed-off-by:
Jason Wang <jasowang@redhat.com>
-
Laurent Vivier authored
Use directly net_socket_fd_init_stream() and net_socket_fd_init_dgram() when the socket type is already known. Reviewed-by:
David Gibson <david@gibson.dropbear.id.au> Signed-off-by:
Laurent Vivier <lvivier@redhat.com> Signed-off-by:
Jason Wang <jasowang@redhat.com>
-
- Jun 26, 2023
-
-
Ani Sinha authored
When a peer nic is still attached to the vdpa backend, it is too early to free up the vhost-net and vdpa structures. If these structures are freed here, then QEMU crashes when the guest is being shut down. The following call chain would result in an assertion failure since the pointer returned from vhost_vdpa_get_vhost_net() would be NULL: do_vm_stop() -> vm_state_notify() -> virtio_set_status() -> virtio_net_vhost_status() -> get_vhost_net(). Therefore, we defer freeing up the structures until at guest shutdown time when qemu_cleanup() calls net_cleanup() which then calls qemu_del_net_client() which would eventually call vhost_vdpa_cleanup() again to free up the structures. This time, the loop in net_cleanup() ensures that vhost_vdpa_cleanup() will be called one last time when all the peer nics are detached and freed. All unit tests pass with this change. CC: imammedo@redhat.com CC: jusual@redhat.com CC: mst@redhat.com Fixes: CVE-2023-3301 Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2128929 Signed-off-by:
Ani Sinha <anisinha@redhat.com> Message-Id: <20230619065209.442185-1-anisinha@redhat.com> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
Eugenio Pérez authored
Bug introducing when refactoring. Otherway, the guest never received the used buffer. Fixes: be4278b6 ("vdpa: extract vhost_vdpa_net_cvq_add from vhost_vdpa_net_handle_ctrl_avail") Signed-off-by:
Eugenio Pérez <eperezma@redhat.com> Message-Id: <20230602173451.1917999-1-eperezma@redhat.com> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com> Acked-by:
Jason Wang <jasowang@redhat.com> Tested-by:
Lei Yang <leiyang@redhat.com>
-
Eugenio Pérez authored
QEMU does not emulate it so it must be disabled as long as the backend does not support it. Signed-off-by:
Eugenio Pérez <eperezma@redhat.com> Message-Id: <20230602173328.1917385-1-eperezma@redhat.com> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com> Acked-by:
Jason Wang <jasowang@redhat.com> Tested-by:
Lei Yang <leiyang@redhat.com>
-
Hawkins Jiawei authored
Enable SVQ with VIRTIO_NET_F_CTRL_GUEST_OFFLOADS feature. Signed-off-by:
Hawkins Jiawei <yin31149@gmail.com> Acked-by:
Jason Wang <jasowang@redhat.com> Message-Id: <778d642ecae6deed8a218b0e6232e4d7bb96b439.1685704856.git.yin31149@gmail.com> Tested-by:
Lei Yang <leiyang@redhat.com> Reviewed-by:
Eugenio Pérez <eperezma@redhat.com> Tested-by:
Eugenio Pérez <eperezma@redhat.com> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
Hawkins Jiawei authored
This patch introduces vhost_vdpa_net_load_offloads() to restore offloads state at device's startup. Signed-off-by:
Hawkins Jiawei <yin31149@gmail.com> Message-Id: <7e2b5cad9c48c917df53d80dec27dbfeb513e1a3.1685704856.git.yin31149@gmail.com> Tested-by:
Lei Yang <leiyang@redhat.com> Reviewed-by:
Eugenio Pérez <eperezma@redhat.com> Tested-by:
Eugenio Pérez <eperezma@redhat.com> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
Hawkins Jiawei authored
We can use virtio_vdev_has_feature() instead of manually accessing the features. Signed-off-by:
Hawkins Jiawei <yin31149@gmail.com> Acked-by:
Eugenio Pérez <eperezma@redhat.com> Message-Id: <ff838d30206209fd865511b16ffb34cc0d5e8d8f.1685704856.git.yin31149@gmail.com> Tested-by:
Lei Yang <leiyang@redhat.com> Reviewed-by:
Eugenio Pérez <eperezma@redhat.com> Tested-by:
Eugenio Pérez <eperezma@redhat.com> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
Eugenio Pérez authored
The vdpa devices that use va addresses neeeds these maps shared. Otherwise, vhost_vdpa checks will refuse to accept the maps. The mmap call will always return a page aligned address, so removing the qemu_memalign call. Keeping the ROUND_UP for the size as we still need to DMA-map them in full. Not applying fixes tag as it never worked with va devices. Signed-off-by:
Eugenio Pérez <eperezma@redhat.com> Message-Id: <20230602143854.1879091-4-eperezma@redhat.com> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
Eugenio Pérez authored
We need to call it from resource cleanup context, as munmap needs the size of the mappings. Signed-off-by:
Eugenio Pérez <eperezma@redhat.com> Reviewed-by:
Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230602143854.1879091-3-eperezma@redhat.com> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
Eugenio Pérez authored
It was a mistake to forbid in all cases, as SVQ is already able to send all the CVQ messages before start forwarding data vqs. It actually caused a regression, making impossible to migrate device previously migratable. Fixes: 36e46472 ("vdpa: add vhost_vdpa_net_valid_svq_features") Signed-off-by:
Eugenio Pérez <eperezma@redhat.com> Message-Id: <20230602143854.1879091-2-eperezma@redhat.com> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com> Tested-by:
Lei Yang <leiyang@redhat.com>
-
- Jun 23, 2023
-
-
Eugenio Pérez authored
Evaluating it at start time instead of initialization time may make the guest capable of dynamically adding or removing migration blockers. Also, moving to initialization reduces the number of ioctls in the migration, reducing failure possibilities. As a drawback we need to check for CVQ isolation twice: one time with no MQ negotiated and another one acking it, as long as the device supports it. This is because Vring ASID / group management is based on vq indexes, but we don't know the index of CVQ before negotiating MQ. Signed-off-by:
Eugenio Pérez <eperezma@redhat.com> Message-Id: <20230526153143.470745-3-eperezma@redhat.com> Tested-by:
Lei Yang <leiyang@redhat.com> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com> Acked-by:
Jason Wang <jasowang@redhat.com>
-
Eugenio Pérez authored
We need to tell in the caller, as some errors are expected in a normal workflow. In particular, parent drivers in recent kernels with VHOST_BACKEND_F_IOTLB_ASID may not support vring groups. In that case, -ENOTSUP is returned. This is the case of vp_vdpa in Linux 6.2. Next patches in this series will use that information to know if it must abort or not. Also, next patches return properly an errp instead of printing with error_report. Reviewed-by:
Stefano Garzarella <sgarzare@redhat.com> Acked-by:
Jason Wang <jasowang@redhat.com> Signed-off-by:
Eugenio Pérez <eperezma@redhat.com> Message-Id: <20230526153143.470745-2-eperezma@redhat.com> Tested-by:
Lei Yang <leiyang@redhat.com> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
- Jun 20, 2023
-
-
Philippe Mathieu-Daudé authored
We use the user_ss[] array to hold the user emulation sources, and the softmmu_ss[] array to hold the system emulation ones. Hold the latter in the 'system_ss[]' array for parity with user emulation. Mechanical change doing: $ sed -i -e s/softmmu_ss/system_ss/g $(git grep -l softmmu_ss) Signed-off-by:
Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Message-Id: <20230613133347.82210-10-philmd@linaro.org> Signed-off-by:
Richard Henderson <richard.henderson@linaro.org>
-
- Jun 13, 2023
-
-
Philippe Mathieu-Daudé authored
Fix the following Cocoa trivial warnings: C compiler for the host machine: cc (clang 14.0.0 "Apple clang version 14.0.0 (clang-1400.0.29.202)") Objective-C compiler for the host machine: clang (clang 14.0.0) [100/334] Compiling Objective-C object libcommon.fa.p/net_vmnet-bridged.m.o net/vmnet-bridged.m:40:31: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] static char* get_valid_ifnames() ^ void [742/1436] Compiling Objective-C object libcommon.fa.p/ui_cocoa.m.o ui/cocoa.m:1937:22: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] static int cocoa_main() ^ void Signed-off-by:
Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by:
Akihiko Odaki <akihiko.odaki@daynix.com> Message-Id: <20230425192820.34063-1-philmd@linaro.org>
-
- May 23, 2023
-
-
Akihiko Odaki authored
Signed-off-by:
Akihiko Odaki <akihiko.odaki@daynix.com> Signed-off-by:
Jason Wang <jasowang@redhat.com>
-
Akihiko Odaki authored
Signed-off-by:
Akihiko Odaki <akihiko.odaki@daynix.com> Reviewed-by:
Sriram Yagnaraman <sriram.yagnaraman@est.tech> Signed-off-by:
Jason Wang <jasowang@redhat.com>
-
Akihiko Odaki authored
It is possible to have another VLAN tag even if the packet is already tagged. Signed-off-by:
Akihiko Odaki <akihiko.odaki@daynix.com> Signed-off-by:
Jason Wang <jasowang@redhat.com>
-
Akihiko Odaki authored
The uses of uint8_t pointers were misleading as they are never accessed as an array of octets and it even require more strict alignment to access as struct eth_header. Signed-off-by:
Akihiko Odaki <akihiko.odaki@daynix.com> Reviewed-by:
Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by:
Jason Wang <jasowang@redhat.com>
-
Akihiko Odaki authored
The old eth_setup_vlan_headers has no user so remove it and rename eth_setup_vlan_headers_ex. Signed-off-by:
Akihiko Odaki <akihiko.odaki@daynix.com> Reviewed-by:
Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by:
Jason Wang <jasowang@redhat.com>
-
Akihiko Odaki authored
igb does not properly ensure the buffer passed to net_rx_pkt_set_protocols() is contiguous for the entire L2/L3/L4 header. Allow it to pass scattered data to net_rx_pkt_set_protocols(). Fixes: 3a977dee ("Intrdocue igb device emulation") Signed-off-by:
Akihiko Odaki <akihiko.odaki@daynix.com> Reviewed-by:
Sriram Yagnaraman <sriram.yagnaraman@est.tech> Signed-off-by:
Jason Wang <jasowang@redhat.com>
-
- May 18, 2023
-
-
Vladimir Sementsov-Ogievskiy authored
Add option to not build filter-rewriter and colo-compare when they are not needed. Signed-off-by:
Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> Reviewed-by:
Juan Quintela <quintela@redhat.com> Reviewed-by:
Zhang Chen <chen.zhang@intel.com> Message-Id: <20230515130640.46035-2-vsementsov@yandex-team.ru> Signed-off-by:
Juan Quintela <quintela@redhat.com>
-
- Apr 21, 2023
-
-
Eugenio Pérez authored
There is no reason to block it as it has nothing to do with the vrings. All the support of the feature comes via config space. Signed-off-by:
Eugenio Pérez <eperezma@redhat.com> Suggested-by:
Alvaro Karsz <alvaro.karsz@solid-run.com> Message-Id: <20230307170018.260557-1-eperezma@redhat.com> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
- Mar 13, 2023
-
-
Marc-André Lureau authored
Use a close() wrapper instead, so that we don't need to worry about closesocket() vs close() anymore, let's hope. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Stefan Berger <stefanb@linux.ibm.com> Message-Id: <20230221124802.4103554-17-marcandre.lureau@redhat.com>
-
Marc-André Lureau authored
We are about to make the QEMU socket API use file-descriptor space only, but libslirp gives us SOCKET as fd, still. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Stefan Berger <stefanb@linux.ibm.com> Message-Id: <20230221124802.4103554-14-marcandre.lureau@redhat.com>
-
Marc-André Lureau authored
Presumably, this is what should happen when the SOCKET is to be removed. (it probably worked until now because closesocket() does it implicitly, but we never now how the slirp library could use the SOCKET later) Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Stefan Berger <stefanb@linux.ibm.com> Message-Id: <20230221124802.4103554-13-marcandre.lureau@redhat.com>
-
Marc-André Lureau authored
Open-code the socket registration where it's needed, to avoid artificially used or unclear generic interface. Furthermore, the following patches are going to make socket handling use FD-only inside QEMU, but we need to handle win32 SOCKET from libslirp. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Stefan Berger <stefanb@linux.ibm.com> Message-Id: <20230221124802.4103554-12-marcandre.lureau@redhat.com>
-
- Mar 10, 2023
-
-
Akihiko Odaki authored
igb, a new network device emulation, will need SCTP checksum offloading. Currently eth_get_protocols() has a bool parameter for each protocol currently it supports, but there will be a bit too many parameters if we add yet another protocol. Introduce an enum type, EthL4HdrProto to represent all L4 protocols eth_get_protocols() support with one parameter. Signed-off-by:
Akihiko Odaki <akihiko.odaki@daynix.com> Signed-off-by:
Jason Wang <jasowang@redhat.com>
-
Akihiko Odaki authored
The values returned by eth_get_protocols() are used to perform RSS, checksumming and segmentation. Even when a packet signals the use of the protocols which these operations can be applied to, the headers for them may not be present because of too short packet or fragmentation, for example. In such a case, the operations cannot be applied safely. Report the presence of headers instead of whether the use of the protocols are indicated with eth_get_protocols(). This also makes corresponding changes to the callers of eth_get_protocols() to match with its new signature and to remove redundant checks for fragmentation. Fixes: 75020a70 ("Common definitions for VMWARE devices") Signed-off-by:
Akihiko Odaki <akihiko.odaki@daynix.com> Signed-off-by:
Jason Wang <jasowang@redhat.com>
-