qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 290e6e: net: Remove useless local var pkt


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 290e6e: net: Remove useless local var pkt
Date: Mon, 06 Mar 2017 23:45:10 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 290e6e113b65ae86cfa37f2ff5ca5eb57dbf824c
      
https://github.com/qemu/qemu/commit/290e6e113b65ae86cfa37f2ff5ca5eb57dbf824c
  Author: Fam Zheng <address@hidden>
  Date:   2017-03-06 (Mon, 06 Mar 2017)

  Changed paths:
    M hw/net/net_rx_pkt.c

  Log Message:
  -----------
  net: Remove useless local var pkt

This has been pointless since commit 605d52e62, which was a
search-and-replace, overlooked the redundancy.

Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: Dmitry Fleytman <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: 566342c3125ac2e73abd36c650222318164517ed
      
https://github.com/qemu/qemu/commit/566342c3125ac2e73abd36c650222318164517ed
  Author: Dmitry Fleytman <address@hidden>
  Date:   2017-03-06 (Mon, 06 Mar 2017)

  Changed paths:
    M include/net/eth.h
    M net/eth.c

  Log Message:
  -----------
  eth: Extend vlan stripping functions

Make VLAN stripping functions return number of bytes
copied to given Ethernet header buffer.

This information should be used to re-compose
packet IOV after VLAN stripping.

Cc: address@hidden
Signed-off-by: Dmitry Fleytman <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: df8bf7a7fe75eb5d5caffa55f5cd4292b757aea6
      
https://github.com/qemu/qemu/commit/df8bf7a7fe75eb5d5caffa55f5cd4292b757aea6
  Author: Dmitry Fleytman <address@hidden>
  Date:   2017-03-06 (Mon, 06 Mar 2017)

  Changed paths:
    M hw/net/net_rx_pkt.c

  Log Message:
  -----------
  NetRxPkt: Fix memory corruption on VLAN header stripping

This patch fixed a problem that was introduced in commit eb700029.

When net_rx_pkt_attach_iovec() calls eth_strip_vlan()
this can result in pkt->ehdr_buf being overflowed, because
ehdr_buf is only sizeof(struct eth_header) bytes large
but eth_strip_vlan() can write
sizeof(struct eth_header) + sizeof(struct vlan_header)
bytes into it.

Devices affected by this problem: vmxnet3.

Cc: address@hidden
Reported-by: Peter Maydell <address@hidden>
Signed-off-by: Dmitry Fleytman <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: d5e772146d2bbc92e5126c145eddef3b2843d026
      
https://github.com/qemu/qemu/commit/d5e772146d2bbc92e5126c145eddef3b2843d026
  Author: Dmitry Fleytman <address@hidden>
  Date:   2017-03-06 (Mon, 06 Mar 2017)

  Changed paths:
    M hw/net/net_rx_pkt.c

  Log Message:
  -----------
  NetRxPkt: Do not try to pull more data than present

In case of VLAN stripping, ETH header put into a
separate buffer, therefore amont of data copied
from original IOV should be smaller.

Cc: address@hidden
Signed-off-by: Dmitry Fleytman <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: c5d083c561a4f5297cc2e44a2f3cef3324d77a88
      
https://github.com/qemu/qemu/commit/c5d083c561a4f5297cc2e44a2f3cef3324d77a88
  Author: Dmitry Fleytman <address@hidden>
  Date:   2017-03-06 (Mon, 06 Mar 2017)

  Changed paths:
    M hw/net/net_rx_pkt.c

  Log Message:
  -----------
  NetRxPkt: Account buffer with ETH header in IOV length

In case of VLAN stripping ETH header is stored in a
separate chunk and length of IOV should take this into
account.

This patch fixes checksum validation for RX packets
with VLAN header.

Devices affected by this problem: e1000e and vmxnet3.

Cc: address@hidden
Signed-off-by: Dmitry Fleytman <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: 002d394fd492f837083058832edd7ee97a8c3280
      
https://github.com/qemu/qemu/commit/002d394fd492f837083058832edd7ee97a8c3280
  Author: Dmitry Fleytman <address@hidden>
  Date:   2017-03-06 (Mon, 06 Mar 2017)

  Changed paths:
    M hw/net/net_rx_pkt.c

  Log Message:
  -----------
  NetRxPkt: Remove code duplication in net_rx_pkt_pull_data()

This is a refactoring commit that does not change behavior.

Signed-off-by: Dmitry Fleytman <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: 66d2a2423ef3f2a3b066d7e9e3301e4fd42f51b3
      
https://github.com/qemu/qemu/commit/66d2a2423ef3f2a3b066d7e9e3301e4fd42f51b3
  Author: zhanghailiang <address@hidden>
  Date:   2017-03-06 (Mon, 06 Mar 2017)

  Changed paths:
    M net/colo-compare.c

  Log Message:
  -----------
  colo-compare: use g_timeout_source_new() to process the stale packets

Instead of using qemu timer to process the stale packets,
We re-use the colo compare thread to process these packets
by creating a new timeout coroutine.

Besides, since we process all the same vNIC's net connection/packets
in one thread, it is safe to remove the timer_check_lock.

Signed-off-by: zhanghailiang <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: dfd917a9c2bed578c31043126c9f558190bf21e4
      
https://github.com/qemu/qemu/commit/dfd917a9c2bed578c31043126c9f558190bf21e4
  Author: zhanghailiang <address@hidden>
  Date:   2017-03-06 (Mon, 06 Mar 2017)

  Changed paths:
    M net/colo-compare.c

  Log Message:
  -----------
  colo-compare: kick compare thread to exit after some cleanup in finalization

We should call g_main_loop_quit() to notify colo compare thread to
exit, Or it will run in g_main_loop_run() forever.

Besides, the finalizing process can't happen in context of colo thread,
it is reasonable to remove the 'if (qemu_thread_is_self(&s->thread))'
branch.

Before compare thead exits, some cleanup works need to be
done,  All unhandled packets need to be released and connection_track_table
needs to be freed, or there will be memory leak.

Signed-off-by: zhanghailiang <address@hidden>
Reviewed-by: Zhang Chen <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: 8487ce45f890cab208541f01e79579d7b25e1615
      
https://github.com/qemu/qemu/commit/8487ce45f890cab208541f01e79579d7b25e1615
  Author: zhanghailiang <address@hidden>
  Date:   2017-03-06 (Mon, 06 Mar 2017)

  Changed paths:
    M chardev/char-fd.c
    M chardev/char-io.c
    M chardev/char-io.h
    M chardev/char-pty.c
    M chardev/char-socket.c
    M chardev/char-udp.c
    M chardev/char.c

  Log Message:
  -----------
  char: remove the right fd been watched in qemu_chr_fe_set_handlers()

We can call qemu_chr_fe_set_handlers() to add/remove fd been watched
in 'context' which can be either default main context or other explicit
context. But the original logic is not correct, we didn't remove
the right fd because we call g_main_context_find_source_by_id(NULL, tag)
which always try to find the Gsource from default context.

Fix it by passing the right context to g_main_context_find_source_by_id().

Cc: Paolo Bonzini <address@hidden>
Cc: Marc-André Lureau <address@hidden>
Signed-off-by: zhanghailiang <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: b43decb015a6efeb9e3cdbdb80f6547ad7248a4c
      
https://github.com/qemu/qemu/commit/b43decb015a6efeb9e3cdbdb80f6547ad7248a4c
  Author: zhanghailiang <address@hidden>
  Date:   2017-03-06 (Mon, 06 Mar 2017)

  Changed paths:
    M net/colo-compare.c

  Log Message:
  -----------
  colo-compare: Fix removing fds been watched incorrectly in finalization

We will catch the bellow error report while try to delete compare object
by qmp command:
chardev/char-io.c:91: io_watch_poll_finalize: Assertion `iwp->src == ((void 
*)0)' failed.

This is caused by failing to remove the right fd been watched while
call qemu_chr_fe_set_handlers();

Fix it by pass the worker_context parameter to qemu_chr_fe_set_handlers().

Signed-off-by: zhanghailiang <address@hidden>
Reviewed-by: Zhang Chen <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: 727c2d764fef0c9492a2e220ba8a6d0979836d36
      
https://github.com/qemu/qemu/commit/727c2d764fef0c9492a2e220ba8a6d0979836d36
  Author: Zhang Chen <address@hidden>
  Date:   2017-03-06 (Mon, 06 Mar 2017)

  Changed paths:
    M net/colo-compare.c

  Log Message:
  -----------
  net/colo-compare: Fix memory free error

We use g_queue_init() to init s->conn_list, so we should use g_queue_clear()
to instead of g_queue_free().

Signed-off-by: Zhang Chen <address@hidden>
Reviewed-by: zhanghailiang <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: 5504bba1fbc987bb3d1d47e169f53b2fe999716c
      
https://github.com/qemu/qemu/commit/5504bba1fbc987bb3d1d47e169f53b2fe999716c
  Author: Dr. David Alan Gilbert <address@hidden>
  Date:   2017-03-06 (Mon, 06 Mar 2017)

  Changed paths:
    M hw/net/vmxnet3.c

  Log Message:
  -----------
  vmxnet3: Convert ring values to uint32_t's

The index's in the Vmxnet3Ring were migrated as 32bit ints
yet are declared as size_t's.  They appear to be derived
from 32bit values loaded from guest memory, so actually
store them as that.

Signed-off-by: Dr. David Alan Gilbert <address@hidden>
Acked-by: Dmitry Fleytman <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: a11f5cb005f9854f0d78da97fc23adf5bc8c83f3
      
https://github.com/qemu/qemu/commit/a11f5cb005f9854f0d78da97fc23adf5bc8c83f3
  Author: Dr. David Alan Gilbert <address@hidden>
  Date:   2017-03-06 (Mon, 06 Mar 2017)

  Changed paths:
    M hw/net/vmxnet3.c

  Log Message:
  -----------
  vmxnet3: VMStatify rx/tx q_descr and int_state

Fairly simple mechanical conversion of all fields.

TODO!!!!
The problem is vmxnet3-ring size/cell_size/next are declared as size_t
but written as 32bit.

Signed-off-by: Dr. David Alan Gilbert <address@hidden>
Acked-by: Dmitry Fleytman <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: 0e79668e1ffcfabb259bea6c2a2bae00a6b27252
      
https://github.com/qemu/qemu/commit/0e79668e1ffcfabb259bea6c2a2bae00a6b27252
  Author: zhanghailiang <address@hidden>
  Date:   2017-03-06 (Mon, 06 Mar 2017)

  Changed paths:
    M net/colo.c

  Log Message:
  -----------
  net/colo: fix memory double free error

The 'primary_list' and 'secondary_list' members of struct Connection
is not allocated through dynamically g_queue_new(), but we free it by using
g_queue_free(), which will lead to a double-free bug.

Reviewed-by: Zhang Chen <address@hidden>
Signed-off-by: zhanghailiang <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: db0a762e4be965b8976abe9df82c6d47c57336fc
      
https://github.com/qemu/qemu/commit/db0a762e4be965b8976abe9df82c6d47c57336fc
  Author: zhanghailiang <address@hidden>
  Date:   2017-03-06 (Mon, 06 Mar 2017)

  Changed paths:
    M net/filter-rewriter.c

  Log Message:
  -----------
  filter-rewriter: skip net_checksum_calculate() while offset = 0

While the offset of packets's sequence for primary side and
secondary side is zero, it is unnecessary to call net_checksum_calculate()
to recalculate the checksume value of packets.

Signed-off-by: zhanghailiang <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: 2ad7ca4c81733cba5c5c464078a643aba61044f8
      
https://github.com/qemu/qemu/commit/2ad7ca4c81733cba5c5c464078a643aba61044f8
  Author: Zhang Chen <address@hidden>
  Date:   2017-03-06 (Mon, 06 Mar 2017)

  Changed paths:
    M net/colo-compare.c

  Log Message:
  -----------
  COLO-compare: Rename compare function and remove duplicate codes

Rename colo_packet_compare() to colo_packet_compare_common() that
make tcp_compare udp_compare icmp_compare reuse this function.
Remove minimum packet size check in icmp_compare, because we have
check this in parse_packet_early().

Signed-off-by: Zhang Chen <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: 6efeb3286dd80c8c943f50fbb5f611d525cd6f8a
      
https://github.com/qemu/qemu/commit/6efeb3286dd80c8c943f50fbb5f611d525cd6f8a
  Author: Zhang Chen <address@hidden>
  Date:   2017-03-06 (Mon, 06 Mar 2017)

  Changed paths:
    M net/colo-compare.c

  Log Message:
  -----------
  COLO-compare: Optimize compare_common and compare_tcp

Add offset args for colo_packet_compare_common, optimize
colo_packet_compare_icmp() and colo_packet_compare_udp()
just compare the IP payload. Before compare all tcp packet,
we compare tcp checksum firstly, this function can get
better performance.

Signed-off-by: Zhang Chen <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: 1723a7f7cfdee92c5479aa497a6c36dec3d0ebd5
      
https://github.com/qemu/qemu/commit/1723a7f7cfdee92c5479aa497a6c36dec3d0ebd5
  Author: Zhang Chen <address@hidden>
  Date:   2017-03-06 (Mon, 06 Mar 2017)

  Changed paths:
    M net/colo-compare.c

  Log Message:
  -----------
  COLO-compare: Fix icmp and udp compare different packet always dump bug

Signed-off-by: Zhang Chen <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: f0aabd5c4ae11fde704d138e8f06c69e5c902a16
      
https://github.com/qemu/qemu/commit/f0aabd5c4ae11fde704d138e8f06c69e5c902a16
  Author: Zhang Chen <address@hidden>
  Date:   2017-03-06 (Mon, 06 Mar 2017)

  Changed paths:
    M net/filter-mirror.c

  Log Message:
  -----------
  net/filter-mirror: Follow CODING_STYLE

Signed-off-by: Zhang Chen <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: eba44e9339fc13c36e24c8c59e2b73ea231b46a1
      
https://github.com/qemu/qemu/commit/eba44e9339fc13c36e24c8c59e2b73ea231b46a1
  Author: Peter Maydell <address@hidden>
  Date:   2017-03-06 (Mon, 06 Mar 2017)

  Changed paths:
    M chardev/char-fd.c
    M chardev/char-io.c
    M chardev/char-io.h
    M chardev/char-pty.c
    M chardev/char-socket.c
    M chardev/char-udp.c
    M chardev/char.c
    M hw/net/net_rx_pkt.c
    M hw/net/vmxnet3.c
    M include/net/eth.h
    M net/colo-compare.c
    M net/colo.c
    M net/eth.c
    M net/filter-mirror.c
    M net/filter-rewriter.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into 
staging

# gpg: Signature made Mon 06 Mar 2017 04:15:17 GMT
# gpg:                using RSA key 0xEF04965B398D6211
# gpg: Good signature from "Jason Wang (Jason Wang on RedHat) <address@hidden>"
# gpg: WARNING: This key is not certified with sufficiently trusted signatures!
# gpg:          It is not certain that the signature belongs to the owner.
# Primary key fingerprint: 215D 46F4 8246 689E C77F  3562 EF04 965B 398D 6211

* remotes/jasowang/tags/net-pull-request:
  net/filter-mirror: Follow CODING_STYLE
  COLO-compare: Fix icmp and udp compare different packet always dump bug
  COLO-compare: Optimize compare_common and compare_tcp
  COLO-compare: Rename compare function and remove duplicate codes
  filter-rewriter: skip net_checksum_calculate() while offset = 0
  net/colo: fix memory double free error
  vmxnet3: VMStatify rx/tx q_descr and int_state
  vmxnet3: Convert ring values to uint32_t's
  net/colo-compare: Fix memory free error
  colo-compare: Fix removing fds been watched incorrectly in finalization
  char: remove the right fd been watched in qemu_chr_fe_set_handlers()
  colo-compare: kick compare thread to exit after some cleanup in finalization
  colo-compare: use g_timeout_source_new() to process the stale packets
  NetRxPkt: Remove code duplication in net_rx_pkt_pull_data()
  NetRxPkt: Account buffer with ETH header in IOV length
  NetRxPkt: Do not try to pull more data than present
  NetRxPkt: Fix memory corruption on VLAN header stripping
  eth: Extend vlan stripping functions
  net: Remove useless local var pkt

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/56b51708e9e2...eba44e9339fc

reply via email to

[Prev in Thread] Current Thread [Next in Thread]