Skip to content

Commit 292ef18

Browse files
committed
Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging
# gpg: Signature made Thu 18 Jun 2020 14:16:22 BST # gpg: using RSA key EF04965B398D6211 # gpg: Good signature from "Jason Wang (Jason Wang on RedHat) <[email protected]>" [marginal] # 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: (33 commits) net: Drop the NetLegacy structure, always use Netdev instead net: Drop the legacy "name" parameter from the -net option hw/net/e1000e: Do not abort() on invalid PSRCTL register value colo-compare: Fix memory leak in packet_enqueue() net/colo-compare.c: Correct ordering in complete and finalize net/colo-compare.c: Check that colo-compare is active net/colo-compare.c: Only hexdump packets if tracing is enabled net/colo-compare.c: Fix deadlock in compare_chr_send chardev/char.c: Use qemu_co_sleep_ns if in coroutine net/colo-compare.c: Create event_bh with the right AioContext net: use peer when purging queue in qemu_flush_or_purge_queue_packets() net: cadence_gem: Fix RX address filtering net: cadence_gem: TX_LAST bit should be set by guest net: cadence_gem: Update the reset value for interrupt mask register net: cadnece_gem: Update irq_read_clear field of designcfg_debug1 reg net: cadence_gem: Add support for jumbo frames net: cadence_gem: Fix up code style net: cadence_gem: Move tx/rx packet buffert to CadenceGEMState net: cadence_gem: Set ISR according to queue in use net: cadence_gem: Define access permission for interrupt registers ... Signed-off-by: Peter Maydell <[email protected]>
2 parents eefe34e + 71830d8 commit 292ef18

File tree

19 files changed

+905
-449
lines changed

19 files changed

+905
-449
lines changed

chardev/char.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#include "qemu/module.h"
3939
#include "qemu/option.h"
4040
#include "qemu/id.h"
41+
#include "qemu/coroutine.h"
4142

4243
#include "chardev/char-mux.h"
4344

@@ -119,7 +120,11 @@ static int qemu_chr_write_buffer(Chardev *s,
119120
retry:
120121
res = cc->chr_write(s, buf + *offset, len - *offset);
121122
if (res < 0 && errno == EAGAIN && write_all) {
122-
g_usleep(100);
123+
if (qemu_in_coroutine()) {
124+
qemu_co_sleep_ns(QEMU_CLOCK_REALTIME, 100000);
125+
} else {
126+
g_usleep(100);
127+
}
123128
goto retry;
124129
}
125130

docs/system/deprecated.rst

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,6 @@ The 'file' driver for drives is no longer appropriate for character or host
4747
devices and will only accept regular files (S_IFREG). The correct driver
4848
for these file types is 'host_cdrom' or 'host_device' as appropriate.
4949

50-
``-net ...,name=``\ *name* (since 3.1)
51-
''''''''''''''''''''''''''''''''''''''
52-
53-
The ``name`` parameter of the ``-net`` option is a synonym
54-
for the ``id`` parameter, which should now be used instead.
55-
5650
``-smp`` (invalid topologies) (since 3.1)
5751
'''''''''''''''''''''''''''''''''''''''''
5852

@@ -441,6 +435,15 @@ What follows is a record of recently removed, formerly deprecated
441435
features that serves as a record for users who have encountered
442436
trouble after a recent upgrade.
443437

438+
System emulator command line arguments
439+
--------------------------------------
440+
441+
``-net ...,name=``\ *name* (removed in 5.1)
442+
'''''''''''''''''''''''''''''''''''''''''''
443+
444+
The ``name`` parameter of the ``-net`` option was a synonym
445+
for the ``id`` parameter, which should now be used instead.
446+
444447
QEMU Machine Protocol (QMP) commands
445448
------------------------------------
446449

hw/net/Makefile.objs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ obj-$(CONFIG_MILKYMIST) += milkymist-minimac2.o
4141
obj-$(CONFIG_PSERIES) += spapr_llan.o
4242
obj-$(CONFIG_XILINX_ETHLITE) += xilinx_ethlite.o
4343

44+
common-obj-$(CONFIG_VIRTIO_NET) += net_rx_pkt.o
4445
obj-$(CONFIG_VIRTIO_NET) += virtio-net.o
4546
common-obj-$(call land,$(CONFIG_VIRTIO_NET),$(CONFIG_VHOST_NET)) += vhost_net.o
4647
common-obj-$(call lnot,$(call land,$(CONFIG_VIRTIO_NET),$(CONFIG_VHOST_NET))) += vhost_net-stub.o

hw/net/cadence_gem.c

Lines changed: 259 additions & 199 deletions
Large diffs are not rendered by default.

hw/net/e1000e_core.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@
3434
*/
3535

3636
#include "qemu/osdep.h"
37+
#include "qemu/log.h"
3738
#include "net/net.h"
3839
#include "net/tap.h"
39-
#include "hw/hw.h"
4040
#include "hw/pci/msi.h"
4141
#include "hw/pci/msix.h"
4242
#include "sysemu/runstate.h"
@@ -2816,11 +2816,15 @@ e1000e_set_psrctl(E1000ECore *core, int index, uint32_t val)
28162816
if (core->mac[RCTL] & E1000_RCTL_DTYP_MASK) {
28172817

28182818
if ((val & E1000_PSRCTL_BSIZE0_MASK) == 0) {
2819-
hw_error("e1000e: PSRCTL.BSIZE0 cannot be zero");
2819+
qemu_log_mask(LOG_GUEST_ERROR,
2820+
"e1000e: PSRCTL.BSIZE0 cannot be zero");
2821+
return;
28202822
}
28212823

28222824
if ((val & E1000_PSRCTL_BSIZE1_MASK) == 0) {
2823-
hw_error("e1000e: PSRCTL.BSIZE1 cannot be zero");
2825+
qemu_log_mask(LOG_GUEST_ERROR,
2826+
"e1000e: PSRCTL.BSIZE1 cannot be zero");
2827+
return;
28242828
}
28252829
}
28262830

hw/net/trace-events

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,9 @@ virtio_net_announce_notify(void) ""
381381
virtio_net_announce_timer(int round) "%d"
382382
virtio_net_handle_announce(int round) "%d"
383383
virtio_net_post_load_device(void)
384+
virtio_net_rss_disable(void)
385+
virtio_net_rss_error(const char *msg, uint32_t value) "%s, value 0x%08x"
386+
virtio_net_rss_enable(uint32_t p1, uint16_t p2, uint8_t p3) "hashes 0x%x, table of %d, key of %d"
384387

385388
# tulip.c
386389
tulip_reg_write(uint64_t addr, const char *name, int size, uint64_t val) "addr 0x%02"PRIx64" (%s) size %d value 0x%08"PRIx64

hw/net/tulip.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,6 @@ static void tulip_copy_rx_bytes(TULIPState *s, struct tulip_descriptor *desc)
171171
len = s->rx_frame_len;
172172
}
173173

174-
if (s->rx_frame_len + len > sizeof(s->rx_frame)) {
175-
return;
176-
}
177174
pci_dma_write(&s->dev, desc->buf_addr1, s->rx_frame +
178175
(s->rx_frame_size - s->rx_frame_len), len);
179176
s->rx_frame_len -= len;
@@ -186,9 +183,6 @@ static void tulip_copy_rx_bytes(TULIPState *s, struct tulip_descriptor *desc)
186183
len = s->rx_frame_len;
187184
}
188185

189-
if (s->rx_frame_len + len > sizeof(s->rx_frame)) {
190-
return;
191-
}
192186
pci_dma_write(&s->dev, desc->buf_addr2, s->rx_frame +
193187
(s->rx_frame_size - s->rx_frame_len), len);
194188
s->rx_frame_len -= len;
@@ -584,6 +578,9 @@ static int tulip_copy_tx_buffers(TULIPState *s, struct tulip_descriptor *desc)
584578
int len2 = (desc->control >> TDES1_BUF2_SIZE_SHIFT) & TDES1_BUF2_SIZE_MASK;
585579

586580
if (s->tx_frame_len + len1 > sizeof(s->tx_frame)) {
581+
qemu_log_mask(LOG_GUEST_ERROR,
582+
"%s: descriptor overflow (ofs: %u, len:%d, size:%zu)\n",
583+
__func__, s->tx_frame_len, len1, sizeof(s->tx_frame));
587584
return -1;
588585
}
589586
if (len1) {
@@ -593,6 +590,9 @@ static int tulip_copy_tx_buffers(TULIPState *s, struct tulip_descriptor *desc)
593590
}
594591

595592
if (s->tx_frame_len + len2 > sizeof(s->tx_frame)) {
593+
qemu_log_mask(LOG_GUEST_ERROR,
594+
"%s: descriptor overflow (ofs: %u, len:%d, size:%zu)\n",
595+
__func__, s->tx_frame_len, len2, sizeof(s->tx_frame));
596596
return -1;
597597
}
598598
if (len2) {

hw/net/tulip.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@
211211
#define RDES0_RF BIT(11)
212212
#define RDES0_DT_SHIFT 12
213213
#define RDES0_DT_MASK 3
214-
#define RDES0_LE BIT(14)
214+
#define RDES0_DE BIT(14)
215215
#define RDES0_ES BIT(15)
216216
#define RDES0_FL_SHIFT 16
217217
#define RDES0_FL_MASK 0x3fff

0 commit comments

Comments
 (0)