e9d635ea | 13-Jan-2021 |
Eric Blake <eblake@redhat.com> |
net: Clarify early exit condition
On first glance, the loop in qmp_query_rx_filter() has early return paths that could leak any allocation of filter_list from a previous iteration. But on closer in
net: Clarify early exit condition
On first glance, the loop in qmp_query_rx_filter() has early return paths that could leak any allocation of filter_list from a previous iteration. But on closer inspection, it is obvious that all of the early exits are guarded by has_name, and that the bulk of the loop body can be executed at most once if the user is filtering by name, thus, any early exit coincides with an empty list. Add asserts to make this obvious.
Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20210113221013.390592-2-eblake@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
show more ...
|
f5746335 | 11-Dec-2020 |
Bin Meng <bin.meng@windriver.com> |
net: checksum: Introduce fine control over checksum type
At present net_checksum_calculate() blindly calculates all types of checksums (IP, TCP, UDP). Some NICs may have a per type setting in their
net: checksum: Introduce fine control over checksum type
At present net_checksum_calculate() blindly calculates all types of checksums (IP, TCP, UDP). Some NICs may have a per type setting in their BDs to control what checksum should be offloaded. To support such hardware behavior, introduce a 'csum_flag' parameter to the net_checksum_calculate() API to allow fine control over what type checksum is calculated.
Existing users of this API are updated accordingly.
Signed-off-by: Bin Meng <bin.meng@windriver.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
show more ...
|
d97f1159 | 11-Dec-2020 |
Guishan Qin <guishan.qin@windriver.com> |
net: checksum: Add IP header checksum calculation
At present net_checksum_calculate() only calculates TCP/UDP checksum in an IP packet, but assumes the IP header checksum to be provided by the softw
net: checksum: Add IP header checksum calculation
At present net_checksum_calculate() only calculates TCP/UDP checksum in an IP packet, but assumes the IP header checksum to be provided by the software, e.g.: Linux kernel always calculates the IP header checksum. However this might not always be the case, e.g.: for an IP checksum offload enabled stack like VxWorks, the IP header checksum can be zero.
This adds the checksum calculation of the IP header.
Signed-off-by: Guishan Qin <guishan.qin@windriver.com> Signed-off-by: Yabing Liu <yabing.liu@windriver.com> Signed-off-by: Bin Meng <bin.meng@windriver.com> Reviewed-by: Cédric Le Goater <clg@kaod.org> Signed-off-by: Jason Wang <jasowang@redhat.com>
show more ...
|
0dcf0c0a | 11-Dec-2020 |
Markus Carlstedt <markus.carlstedt@windriver.com> |
net: checksum: Skip fragmented IP packets
To calculate the TCP/UDP checksum we need the whole datagram. Unless the hardware has some logic to collect all fragments before sending the whole datagram
net: checksum: Skip fragmented IP packets
To calculate the TCP/UDP checksum we need the whole datagram. Unless the hardware has some logic to collect all fragments before sending the whole datagram first, it can only be done by the network stack, which is normally the case for the NICs we have seen so far.
Skip these fragmented IP packets to avoid checksum corruption.
Signed-off-by: Markus Carlstedt <markus.carlstedt@windriver.com> Signed-off-by: Bin Meng <bin.meng@windriver.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
show more ...
|
831734cc | 25-Nov-2020 |
Markus Armbruster <armbru@redhat.com> |
net: Fix handling of id in netdev_add and netdev_del
CLI -netdev accumulates in option group "netdev".
Before commit 08712fcb85 "net: Track netdevs in NetClientState rather than QemuOpt", netdev_ad
net: Fix handling of id in netdev_add and netdev_del
CLI -netdev accumulates in option group "netdev".
Before commit 08712fcb85 "net: Track netdevs in NetClientState rather than QemuOpt", netdev_add added to the option group, and netdev_del removed from it, both HMP and QMP. Thus, every netdev had a corresponding QemuOpts in this option group.
Commit 08712fcb85 dropped this for QMP netdev_add and both netdev_del. Now a netdev has a corresponding QemuOpts only when it was created with CLI or HMP. Two issues:
* QMP and HMP netdev_del can leave QemuOpts behind, breaking HMP netdev_add. Reproducer:
$ qemu-system-x86_64 -S -display none -nodefaults -monitor stdio QEMU 5.1.92 monitor - type 'help' for more information (qemu) netdev_add user,id=net0 (qemu) info network net0: index=0,type=user,net=10.0.2.0,restrict=off (qemu) netdev_del net0 (qemu) info network (qemu) netdev_add user,id=net0 upstream-qemu: Duplicate ID 'net0' for netdev Try "help netdev_add" for more information
Fix by restoring the QemuOpts deletion in qmp_netdev_del(), but with a guard, because the QemuOpts need not exist.
* QMP netdev_add loses its "no duplicate ID" check. Reproducer:
$ qemu-system-x86_64 -S -display none -qmp stdio {"QMP": {"version": {"qemu": {"micro": 92, "minor": 1, "major": 5}, "package": "v5.2.0-rc2-1-g02c1f0142c"}, "capabilities": ["oob"]}} {"execute": "qmp_capabilities"} {"return": {}} {"execute": "netdev_add", "arguments": {"type": "user", "id":"net0"}} {"return": {}} {"execute": "netdev_add", "arguments": {"type": "user", "id":"net0"}} {"return": {}}
Fix by adding a duplicate ID check to net_client_init1() to replace the lost one. The check is redundant for callers where QemuOpts still checks, i.e. for CLI and HMP.
Reported-by: Andrew Melnichenko <andrew@daynix.com> Fixes: 08712fcb851034228b61f75bd922863a984a4f60 Cc: qemu-stable@nongnu.org Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
show more ...
|
729cc683 | 15-Dec-2020 |
Peter Maydell <peter.maydell@linaro.org> |
Remove superfluous timer_del() calls
This commit is the result of running the timer-del-timer-free.cocci script on the whole source tree.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Ack
Remove superfluous timer_del() calls
This commit is the result of running the timer-del-timer-free.cocci script on the whole source tree.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Corey Minyard <cminyard@mvista.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20201215154107.3255-4-peter.maydell@linaro.org
show more ...
|
f0e34a06 | 11-Nov-2020 |
Eduardo Habkost <ehabkost@redhat.com> |
netfilter: Use class properties
Instance properties make introspection hard and are not shown by "-object ...,help". Convert them to class properties.
Signed-off-by: Eduardo Habkost <ehabkost@redh
netfilter: Use class properties
Instance properties make introspection hard and are not shown by "-object ...,help". Convert them to class properties.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Message-Id: <20201111183823.283752-12-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
show more ...
|
6d11ea6d | 11-Nov-2020 |
Eduardo Habkost <ehabkost@redhat.com> |
netfilter: Reorder functions
Trivial code reordering in some filter backends, to make the next changes easier to review.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Message-Id: <2020111118
netfilter: Reorder functions
Trivial code reordering in some filter backends, to make the next changes easier to review.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Message-Id: <20201111183823.283752-11-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
show more ...
|
70b75667 | 11-Nov-2020 |
Eduardo Habkost <ehabkost@redhat.com> |
can_host: Use class properties
Instance properties make introspection hard and are not shown by "-object ...,help". Convert them to class properties.
Signed-off-by: Eduardo Habkost <ehabkost@redha
can_host: Use class properties
Instance properties make introspection hard and are not shown by "-object ...,help". Convert them to class properties.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Tested-by: Pavel Pisa <pisa@cmp.felk.cvut.cz> Message-Id: <20201111183823.283752-9-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
show more ...
|
7cc25f6c | 30-Nov-2020 |
Kevin Wolf <kwolf@redhat.com> |
can-host: Fix crash when 'canbus' property is not set
Providing the 'if' property, but not 'canbus' segfaults like this:
#0 0x0000555555b0f14d in can_bus_insert_client (bus=0x0, client=0x555556aa
can-host: Fix crash when 'canbus' property is not set
Providing the 'if' property, but not 'canbus' segfaults like this:
#0 0x0000555555b0f14d in can_bus_insert_client (bus=0x0, client=0x555556aa9af0) at ../net/can/can_core.c:88 #1 0x00005555559c3803 in can_host_connect (ch=0x555556aa9ac0, errp=0x7fffffffd568) at ../net/can/can_host.c:62 #2 0x00005555559c386a in can_host_complete (uc=0x555556aa9ac0, errp=0x7fffffffd568) at ../net/can/can_host.c:72 #3 0x0000555555d52de9 in user_creatable_complete (uc=0x555556aa9ac0, errp=0x7fffffffd5c8) at ../qom/object_interfaces.c:23
Add the missing NULL check.
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Message-Id: <20201130105615.21799-5-kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
show more ...
|
f820af87 | 13-Nov-2020 |
Markus Armbruster <armbru@redhat.com> |
qerror: Eliminate QERR_ macros used in just one place
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20201113082626.2725812-3-armbru@redhat.com> |
9925990d | 23-Nov-2020 |
Keqian Zhu <zhukeqian1@huawei.com> |
net: Use correct default-path macro for downscript
Fixes: 63c4db4c2e6d (net: relocate paths to helpers and scripts) Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com> Signed-off-by: Jason Wang <jasow
net: Use correct default-path macro for downscript
Fixes: 63c4db4c2e6d (net: relocate paths to helpers and scripts) Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
show more ...
|
f012bec8 | 19-Nov-2020 |
yuanjungong <ruc_gongyuanjun@163.com> |
tap: fix a memory leak
Close fd before returning.
Buglink: https://bugs.launchpad.net/qemu/+bug/1904486
Signed-off-by: yuanjungong <ruc_gongyuanjun@163.com> Reviewed-by: Peter Maydell <peter.mayde
tap: fix a memory leak
Close fd before returning.
Buglink: https://bugs.launchpad.net/qemu/+bug/1904486
Signed-off-by: yuanjungong <ruc_gongyuanjun@163.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Jason Wang <jasowang@redhat.com>
show more ...
|
d2abc563 | 12-Nov-2020 |
Yuri Benditovich <yuri.benditovich@daynix.com> |
net: purge queued rx packets on queue deletion
https://bugzilla.redhat.com/show_bug.cgi?id=1829272 When deleting queue pair, purge pending RX packets if any. Example of problematic flow: 1. Bring up
net: purge queued rx packets on queue deletion
https://bugzilla.redhat.com/show_bug.cgi?id=1829272 When deleting queue pair, purge pending RX packets if any. Example of problematic flow: 1. Bring up q35 VM with tap (vhost off) and virtio-net or e1000e 2. Run ping flood to the VM NIC ( 1 ms interval) 3. Hot unplug the NIC device (device_del) During unplug process one or more packets come, the NIC can't receive, tap disables read_poll 4. Hot plug the device (device_add) with the same netdev The tap stays with read_poll disabled and does not receive any packets anymore (tap_send never triggered)
Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
show more ...
|
ad6f932f | 11-Nov-2020 |
Paolo Bonzini <pbonzini@redhat.com> |
net: do not exit on "netdev_add help" monitor command
"netdev_add help" is causing QEMU to exit because the code that invokes show_netdevs is shared between CLI and HMP processing. Move the check to
net: do not exit on "netdev_add help" monitor command
"netdev_add help" is causing QEMU to exit because the code that invokes show_netdevs is shared between CLI and HMP processing. Move the check to the callers so that exit(0) remains only in the CLI flow.
"netdev_add help" is not fixed by this patch; that is left for later work.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
show more ...
|
d949fe64 | 29-Oct-2020 |
AlexChen <alex.chen@huawei.com> |
net/l2tpv3: Remove redundant check in net_init_l2tpv3()
The result has been checked to be NULL before, it cannot be NULL here, so the check is redundant. Remove it.
Reported-by: Euler Robot <euler.
net/l2tpv3: Remove redundant check in net_init_l2tpv3()
The result has been checked to be NULL before, it cannot be NULL here, so the check is redundant. Remove it.
Reported-by: Euler Robot <euler.robot@huawei.com> Signed-off-by: AlexChen <alex.chen@huawei.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
show more ...
|
7564bf77 | 21-Oct-2020 |
Prasad J Pandit <pjp@fedoraproject.org> |
net: remove an assert call in eth_get_gso_type
eth_get_gso_type() routine returns segmentation offload type based on L3 protocol type. It calls g_assert_not_reached if L3 protocol is unknown, making
net: remove an assert call in eth_get_gso_type
eth_get_gso_type() routine returns segmentation offload type based on L3 protocol type. It calls g_assert_not_reached if L3 protocol is unknown, making the following return statement unreachable. Remove the g_assert call, it maybe triggered by a guest user.
Reported-by: Gaoning Pan <pgn@zju.edu.cn> Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org> Signed-off-by: Jason Wang <jasowang@redhat.com>
show more ...
|
2f2fcff3 | 16-Oct-2020 |
Zhang Chen <chen.zhang@intel.com> |
net/colo-compare.c: Increase default queued packet scan frequency
In my test, use this default parameter looks better.
Signed-off-by: Zhang Chen <chen.zhang@intel.com> Signed-off-by: Jason Wang <ja
net/colo-compare.c: Increase default queued packet scan frequency
In my test, use this default parameter looks better.
Signed-off-by: Zhang Chen <chen.zhang@intel.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
show more ...
|
17475df2 | 16-Oct-2020 |
Zhang Chen <chen.zhang@intel.com> |
net/colo-compare.c: Add secondary old packet detection
Detect queued secondary packet to sync VM state in time.
Signed-off-by: Zhang Chen <chen.zhang@intel.com> Reviewed-by: Li Zhijian <lizhijian@c
net/colo-compare.c: Add secondary old packet detection
Detect queued secondary packet to sync VM state in time.
Signed-off-by: Zhang Chen <chen.zhang@intel.com> Reviewed-by: Li Zhijian <lizhijian@cn.fujitsu.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
show more ...
|
ec081984 | 16-Oct-2020 |
Zhang Chen <chen.zhang@intel.com> |
net/colo-compare.c: Change the timer clock type
The virtual clock only runs during the emulation. It stops when the virtual machine is stopped. The host clock should be used for device models that e
net/colo-compare.c: Change the timer clock type
The virtual clock only runs during the emulation. It stops when the virtual machine is stopped. The host clock should be used for device models that emulate accurate real time sources. It will continue to run when the virtual machine is suspended. COLO need to know the host time here.
Fixes: dd321ecfc2e ("colo-compare: Use IOThread to Check old packet regularly and Process packets of the primary")
Reported-by: Derek Su <dereksu@qnap.com> Signed-off-by: Zhang Chen <chen.zhang@intel.com> Reviewed-by: Li Zhijian <lizhijian@cn.fujitsu.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
show more ...
|
0c4266ef | 16-Oct-2020 |
Zhang Chen <chen.zhang@intel.com> |
net/colo-compare.c: Fix compare_timeout format issue
This parameter need compare with the return of qemu_clock_get_ms(), it is uint64_t. So we need fix this issue here.
Fixes: 9cc43c94b31 ("net/col
net/colo-compare.c: Fix compare_timeout format issue
This parameter need compare with the return of qemu_clock_get_ms(), it is uint64_t. So we need fix this issue here.
Fixes: 9cc43c94b31 ("net/colo-compare.c: Expose "compare_timeout" to users")
Reported-by: Derek Su <dereksu@qnap.com> Signed-off-by: Zhang Chen <chen.zhang@intel.com> Reviewed-by: Li Zhijian <lizhijian@cn.fujitsu.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
show more ...
|
45b9e8c3 | 16-Oct-2020 |
Li Zhijian <lizhijian@cn.fujitsu.com> |
colo-compare: check mark in mutual exclusion
Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com> Signed-off-by: Zhang Chen <chen.zhang@intel.com> Reviewed-by: Zhang Chen <chen.zhang@intel.com> Sign
colo-compare: check mark in mutual exclusion
Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com> Signed-off-by: Zhang Chen <chen.zhang@intel.com> Reviewed-by: Zhang Chen <chen.zhang@intel.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
show more ...
|
862ee1e0 | 16-Oct-2020 |
Li Zhijian <lizhijian@cn.fujitsu.com> |
colo-compare: fix missing compare_seq initialization
Fixes: f449c9e549c ("colo: compare the packet based on the tcp sequence number")
Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com> Signed-off
colo-compare: fix missing compare_seq initialization
Fixes: f449c9e549c ("colo: compare the packet based on the tcp sequence number")
Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com> Signed-off-by: Zhang Chen <chen.zhang@intel.com> Reviewed-by: Zhang Chen <chen.zhang@intel.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
show more ...
|
33609e95 | 16-Oct-2020 |
Rao, Lei <lei.rao@intel.com> |
Optimize seq_sorter function for colo-compare
The seq of tcp has been filled in fill_pkt_tcp_info, it can be used directly here.
Signed-off-by: Lei Rao <lei.rao@intel.com> Signed-off-by: Zhang Chen
Optimize seq_sorter function for colo-compare
The seq of tcp has been filled in fill_pkt_tcp_info, it can be used directly here.
Signed-off-by: Lei Rao <lei.rao@intel.com> Signed-off-by: Zhang Chen <chen.zhang@intel.com> Reviewed-by: Li Zhijian <lizhijian@cn.fujitsu.com> Reviewed-by: Zhang Chen <chen.zhang@intel.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
show more ...
|
b492a4b8 | 16-Oct-2020 |
Pan Nengyuan <pannengyuan@huawei.com> |
net/filter-rewriter: destroy g_hash_table in colo_rewriter_cleanup
s->connection_track_table forgot to destroy in colo_rewriter_cleanup. Fix it.
Reported-by: Euler Robot <euler.robot@huawei.com> Si
net/filter-rewriter: destroy g_hash_table in colo_rewriter_cleanup
s->connection_track_table forgot to destroy in colo_rewriter_cleanup. Fix it.
Reported-by: Euler Robot <euler.robot@huawei.com> Signed-off-by: Pan Nengyuan <pannengyuan@huawei.com> Signed-off-by: Zhang Chen <chen.zhang@intel.com> Reviewed-by: Zhang Chen <chen.zhang@intel.com> Reviewed-by: Li Qiang <liq3ea@gmail.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
show more ...
|