[PATCH v3 05/26] e1000: Mask registers when writing

2023-01-26 Thread Akihiko Odaki
When a register has effective bits fewer than their width, the old code inconsistently masked when writing or reading. Make the code consistent by always masking when writing, and remove some code duplication. Signed-off-by: Akihiko Odaki --- hw/net/e1000.c | 84

[PATCH v3 01/26] e1000e: Fix the code style

2023-01-26 Thread Akihiko Odaki
igb implementation first starts off by copying e1000e code. Correct the code style before that. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé --- hw/net/e1000.c | 41 hw/net/e1000e.c| 72 ++-- hw/net/e1000e_core.c

[PATCH v3 04/26] e1000: Use hw/net/mii.h

2023-01-26 Thread Akihiko Odaki
hw/net/mii.h provides common definitions for MII. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé --- hw/net/e1000.c | 86 ++-- hw/net/e1000_regs.h| 46 hw/net/e1000e.c| 1 + hw/net/e1000e_core.c | 99

[PATCH v3 14/26] e1000e: Configure ResettableClass

2023-01-26 Thread Akihiko Odaki
This is part of recent efforts of refactoring e1000 and e1000e. DeviceClass's reset member is deprecated so migrate to ResettableClass. There is no behavioral difference. Signed-off-by: Akihiko Odaki Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé --- hw/net/e1000e.c

[PATCH v3 15/26] e1000e: Introduce e1000_rx_desc_union

2023-01-26 Thread Akihiko Odaki
Before this change, e1000e_write_packet_to_guest() allocated the receive descriptor buffer as an array of uint8_t. This does not ensure the buffer is sufficiently aligned. Introduce e1000_rx_desc_union type, a union type of all receive descriptor types to correct this. Signed-off-by: Akihiko

[PATCH v3 06/26] e1000e: Mask registers when writing

2023-01-26 Thread Akihiko Odaki
When a register has effective bits fewer than their width, the old code inconsistently masked when writing or reading. Make the code consistent by always masking when writing, and remove some code duplication. Signed-off-by: Akihiko Odaki --- hw/net/e1000e_core.c | 94

[PATCH v3 02/26] hw/net: Add more MII definitions

2023-01-26 Thread Akihiko Odaki
The definitions will be used by igb. Signed-off-by: Akihiko Odaki --- include/hw/net/mii.h | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/include/hw/net/mii.h b/include/hw/net/mii.h index 4ae4dcce7e..c6a767a49a 100644 --- a/include/hw/net/mii.h +++ b/include

[PATCH v3 11/26] e1000e: Remove pending interrupt flags

2023-01-26 Thread Akihiko Odaki
They are duplicate of running throttling timer flags and incomplete as the flags are not cleared when the interrupts are fired or the device is reset. Signed-off-by: Akihiko Odaki --- hw/net/e1000e.c | 5 ++--- hw/net/e1000e_core.c | 19 +++ hw/net/e1000e_core.h | 2

[PATCH v3 12/26] e1000e: Improve software reset

2023-01-26 Thread Akihiko Odaki
This change makes e1000e reset more things when software reset was triggered. Some registers are exempted from software reset in the datasheet and this change also implements the behavior accordingly. Signed-off-by: Akihiko Odaki --- hw/net/e1000e_core.c | 24 +++- 1 file

[PATCH v3 03/26] fsl_etsec: Use hw/net/mii.h

2023-01-26 Thread Akihiko Odaki
hw/net/mii.h provides common definitions for MII. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé --- hw/net/fsl_etsec/etsec.c | 11 ++- hw/net/fsl_etsec/etsec.h | 17 - hw/net/fsl_etsec/miim.c | 5 +++-- include/hw/net/mii.h | 1 + 4 files

[PATCH v3 13/26] e1000: Configure ResettableClass

2023-01-26 Thread Akihiko Odaki
This is part of recent efforts of refactoring e1000 and e1000e. DeviceClass's reset member is deprecated so migrate to ResettableClass. There is no behavioral difference. Signed-off-by: Akihiko Odaki Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé --- hw/net/e1000.c

[PATCH v3 23/26] e1000e: Perform software segmentation for loopback

2023-01-26 Thread Akihiko Odaki
ation if VIRTIO_NET_HDR_F_DATA_VALID is set. Signed-off-by: Akihiko Odaki --- hw/net/e1000e_core.c | 27 ++-- hw/net/net_rx_pkt.c | 7 hw/net/net_rx_pkt.h | 8 + hw/net/net_tx_pkt.c | 76 +--- hw/net/net_tx_pkt.h | 21 ++

[PATCH v3 08/26] e1000e: Use more constant definitions

2023-01-26 Thread Akihiko Odaki
The definitions of SW Semaphore Register were copied from: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/net/ethernet/intel/e1000e/defines.h?h=v6.0.9#n374 Signed-off-by: Akihiko Odaki --- hw/net/e1000_regs.h | 7 +++ hw/net/e1000e_core.c | 49

[PATCH v3 26/26] MAINTAINERS: Add e1000e test files

2023-01-26 Thread Akihiko Odaki
Signed-off-by: Akihiko Odaki Acked-by: Thomas Huth --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 958915f227..e920d0061e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2218,6 +2218,8 @@ R: Akihiko Odaki S: Maintained F: hw/net/e1000e* F

[PATCH v3 07/26] e1000: Use more constant definitions

2023-01-26 Thread Akihiko Odaki
, E1000_MC_TBL_SIZE, and E1000_VLAN_FILTER_TBL_SIZE were copied from: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/net/ethernet/intel/e1000/e1000_hw.h?h=v6.0.9#n707 Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé --- hw/net/e1000.c | 50

[PATCH v3 22/26] hw/net/net_rx_pkt: Remove net_rx_pkt_has_virt_hdr

2023-01-26 Thread Akihiko Odaki
NetTxPkt has a valid virtio-net header. Signed-off-by: Akihiko Odaki --- hw/net/e1000e_core.c | 16 hw/net/net_rx_pkt.c | 11 +-- hw/net/net_rx_pkt.h | 12 +--- hw/net/trace-events | 1 - hw/net/virtio-net.c | 2 +- hw/net/vmxnet3.c | 12 ++-- 6

[PATCH v3 17/26] e1000e: Remove extra pointer indirection

2023-01-26 Thread Akihiko Odaki
pointer indirection. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé --- hw/net/e1000e_core.c | 38 +++--- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c index 736708407c..d143f2ae6f

[PATCH v3 25/26] MAINTAINERS: Add Akihiko Odaki as a e1000e reviewer

2023-01-26 Thread Akihiko Odaki
I want to know to be notified when there is a new change for e1000e as e1000e is similar to igb and such a change may also be applicable for igb. Signed-off-by: Akihiko Odaki --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 08ad1e5341

[PATCH v3 10/26] e1000e: Use memcpy to intialize registers

2023-01-26 Thread Akihiko Odaki
Use memcpy instead of memmove to initialize registers. The initial register templates and register table instances will never overlap. Signed-off-by: Akihiko Odaki --- hw/net/e1000e_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/net/e1000e_core.c b/hw/net

[PATCH v3 16/26] e1000e: Set MII_ANER_NWAY

2023-01-26 Thread Akihiko Odaki
mismatch. > ACTION: Configure the link partner for auto-negotiation. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé --- hw/net/e1000e_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c index d8c17baf8f

[PATCH v3 20/26] net: Strip virtio-net header when dumping

2023-01-26 Thread Akihiko Odaki
-off-by: Akihiko Odaki --- include/net/net.h | 6 ++ net/dump.c| 11 +++ net/net.c | 18 ++ net/tap.c | 16 4 files changed, 47 insertions(+), 4 deletions(-) diff --git a/include/net/net.h b/include/net/net.h index dc20b31e9f

[PATCH v3 18/26] net: Check L4 header size

2023-01-26 Thread Akihiko Odaki
net_tx_pkt_build_vheader() inspects TCP header but had no check for the header size, resulting in an undefined behavior. Check the header size and drop the packet if the header is too small. Signed-off-by: Akihiko Odaki --- hw/net/e1000e_core.c | 19 ++- hw/net/net_tx_pkt.c

[PATCH v3 19/26] e1000x: Alter the signature of e1000x_is_vlan_packet

2023-01-26 Thread Akihiko Odaki
e1000x_is_vlan_packet() had a pointer to uint8_t as a parameter, but it does not have to be uint8_t. Change the type to void *. Signed-off-by: Akihiko Odaki --- hw/net/e1000x_common.c | 2 +- hw/net/e1000x_common.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/net

[PATCH v3 21/26] hw/net/net_tx_pkt: Automatically determine if virtio-net header is used

2023-01-26 Thread Akihiko Odaki
The new function qemu_get_using_vnet_hdr() allows to automatically determine if virtio-net header is used. Signed-off-by: Akihiko Odaki --- hw/net/e1000e_core.c | 3 +-- hw/net/net_tx_pkt.c | 19 ++- hw/net/net_tx_pkt.h | 3 +-- hw/net/vmxnet3.c | 6 ++ 4 files

[PATCH v3 24/26] hw/net/net_tx_pkt: Implement TCP segmentation

2023-01-26 Thread Akihiko Odaki
implementation; igb provides loopback feature for VMDq and the feature relies on software segmentation. Implement proper TCP segmentation in net_tx_pkt to fix such a scenario. Signed-off-by: Akihiko Odaki --- hw/net/net_tx_pkt.c | 244 include/net

[PATCH v3 09/26] e1000: Use memcpy to intialize registers

2023-01-26 Thread Akihiko Odaki
Use memcpy instead of memmove to initialize registers. The initial register templates and register table instances will never overlap. Signed-off-by: Akihiko Odaki --- hw/net/e1000.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/net/e1000.c b/hw/net/e1000.c index

[PATCH v4 02/13] pcie: Introduce pcie_sriov_num_vfs

2023-01-26 Thread Akihiko Odaki
igb can use this function to change its behavior depending on the number of virtual functions currently enabled. Signed-off-by: Gal Hammer Signed-off-by: Marcel Apfelbaum Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé --- hw/pci/pcie_sriov.c | 5 + include/hw

[PATCH v4 03/13] e1000: Split header files

2023-01-26 Thread Akihiko Odaki
Some definitions in the header files are invalid for igb so extract them to new header files to keep igb from referring to them. Signed-off-by: Gal Hammer Signed-off-by: Marcel Apfelbaum Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé --- hw/net/e1000.c | 1 + hw

[PATCH v4 05/13] igb: Rename identifiers

2023-01-26 Thread Akihiko Odaki
Rename identifiers of definitions which will be modified later for igb. This will also allow to build igb along with e1000e. Signed-off-by: Gal Hammer Signed-off-by: Marcel Apfelbaum Signed-off-by: Akihiko Odaki --- hw/net/igb.c| 368 +- hw/net/igb_common.h |6 +- hw/net

[PATCH v4 11/13] tests/qtest/libqos/igb: Transform to igb tests

2023-01-26 Thread Akihiko Odaki
Signed-off-by: Akihiko Odaki --- tests/qtest/fuzz/generic_fuzz_configs.h | 5 + tests/qtest/igb-test.c | 67 ++-- tests/qtest/libqos/igb.c| 139 +--- tests/qtest/libqos/meson.build | 1 + tests/qtest/meson.build

[PATCH v4 04/13] igb: Copy e1000e code

2023-01-26 Thread Akihiko Odaki
Start off igb implementation by copying e1000e code first as igb resembles e1000e. Signed-off-by: Gal Hammer Signed-off-by: Marcel Apfelbaum Signed-off-by: Akihiko Odaki --- MAINTAINERS |5 + hw/net/igb.c| 727 + hw/net/igb_common.h | 102 ++ hw/net/igb_core.c

[PATCH v4 09/13] tests/qtest/libqos/e1000e: Export macreg functions

2023-01-26 Thread Akihiko Odaki
They will be useful for igb testing. Signed-off-by: Akihiko Odaki --- tests/qtest/libqos/e1000e.c | 12 tests/qtest/libqos/e1000e.h | 12 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/qtest/libqos/e1000e.c b/tests/qtest/libqos/e1000e.c index

[PATCH v4 06/13] igb: Build igb

2023-01-26 Thread Akihiko Odaki
Currently igb functions identically with e1000e. Signed-off-by: Gal Hammer Signed-off-by: Marcel Apfelbaum Signed-off-by: Akihiko Odaki --- hw/net/Kconfig | 5 + hw/net/meson.build | 2 ++ 2 files changed, 7 insertions(+) diff --git a/hw/net/Kconfig b/hw/net/Kconfig index 1cc1c5775e

[PATCH v4 08/13] tests/qtest/e1000e-test: Fabricate ethernet header

2023-01-26 Thread Akihiko Odaki
e1000e understands ethernet header so fabricate something convincing. Signed-off-by: Akihiko Odaki --- tests/qtest/e1000e-test.c | 17 +++-- tests/qtest/libqos/e1000e.h | 2 ++ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/tests/qtest/e1000e-test.c b/tests/qtest

[PATCH v4 13/13] docs/system/devices/igb: Add igb documentation

2023-01-26 Thread Akihiko Odaki
Signed-off-by: Akihiko Odaki --- MAINTAINERS | 1 + docs/system/device-emulation.rst | 1 + docs/system/devices/igb.rst | 71 3 files changed, 73 insertions(+) create mode 100644 docs/system/devices/igb.rst diff --git a/MAINTAINERS b

[PATCH v4 01/13] hw/net/net_tx_pkt: Introduce net_tx_pkt_get_eth_hdr

2023-01-26 Thread Akihiko Odaki
Expose the ethernet header so that igb can utilize it to perform the internal routing among its SR-IOV functions. Signed-off-by: Gal Hammer Signed-off-by: Marcel Apfelbaum Signed-off-by: Akihiko Odaki --- hw/net/net_tx_pkt.c | 6 ++ hw/net/net_tx_pkt.h | 8 2 files changed, 14

[PATCH v4 00/13] Introduce igb

2023-01-26 Thread Akihiko Odaki
Noted that igb is tested with Windows HLK. V1 -> V2: - Spun off e1000e general improvements to a distinct series. - Restored vnet_hdr offload as there seems nothing preventing from that. Akihiko Odaki (13): hw/net/net_tx_pkt: Introduce net_tx_pkt_get_eth_hdr pcie: Introduce pcie_sriov_num_vfs

[PATCH v4 12/13] tests/avocado: Add igb test

2023-01-26 Thread Akihiko Odaki
This automates ethtool tests for igb registers, interrupts, etc. Signed-off-by: Akihiko Odaki --- MAINTAINERS | 1 + .../org.centos/stream/8/x86_64/test-avocado | 1 + tests/avocado/igb.py | 38 +++ 3 files changed

[PATCH v4 10/13] tests/qtest/libqos/igb: Copy e1000e code

2023-01-26 Thread Akihiko Odaki
Start off igb test implementation by copying e1000e code first as igb resembles e1000e. Signed-off-by: Akihiko Odaki --- MAINTAINERS | 2 + tests/qtest/igb-test.c | 242 +++ tests/qtest/libqos/igb.c | 226

Re: [PATCH v2 00/13] Introduce igb

2023-01-26 Thread Akihiko Odaki
On 2023/01/26 18:34, Sriram Yagnaraman wrote: -Original Message- From: Sriram Yagnaraman Sent: Tuesday, 24 January 2023 09:54 To: Akihiko Odaki ; Jason Wang Cc: Dmitry Fleytman ; Michael S. Tsirkin ; Marcel Apfelbaum ; Alex Bennée ; Philippe Mathieu-Daudé ; Thomas Huth ; Wainer dos

Re: Display update issue on M1 Macs

2023-01-27 Thread Akihiko Odaki
On 2023/01/23 8:28, BALATON Zoltan wrote: On Thu, 19 Jan 2023, Akihiko Odaki wrote: On 2023/01/15 3:11, BALATON Zoltan wrote: On Sat, 14 Jan 2023, Akihiko Odaki wrote: On 2023/01/13 22:43, BALATON Zoltan wrote: On Thu, 5 Jan 2023, BALATON Zoltan wrote: Hello, I got reports from several

Re: [PATCH 2/9] igb: handle PF/VF reset properly

2023-01-28 Thread Akihiko Odaki
On 2023/01/28 22:46, Sriram Yagnaraman wrote: Use PFRSTD to reset RSTI bit for VFs, and raise VFLRE interrupt when VF is reset. Signed-off-by: Sriram Yagnaraman --- hw/net/e1000x_regs.h | 1 + hw/net/igb_core.c| 33 + hw/net/trace-events | 2 ++ 3 fil

Re: [PATCH 2/9] igb: handle PF/VF reset properly

2023-01-28 Thread Akihiko Odaki
On 2023/01/29 14:58, Akihiko Odaki wrote: On 2023/01/28 22:46, Sriram Yagnaraman wrote: Use PFRSTD to reset RSTI bit for VFs, and raise VFLRE interrupt when VF is reset. Signed-off-by: Sriram Yagnaraman ---   hw/net/e1000x_regs.h |  1 +   hw/net/igb_core.c    | 33

Re: [PATCH 4/9] igb: check oversized packets for VMDq

2023-01-28 Thread Akihiko Odaki
On 2023/01/28 22:46, Sriram Yagnaraman wrote: Signed-off-by: Sriram Yagnaraman --- hw/net/igb_core.c | 74 ++- 1 file changed, 54 insertions(+), 20 deletions(-) diff --git a/hw/net/igb_core.c b/hw/net/igb_core.c index 6bca5459b9..1eb7ba168f 100644

Re: [PATCH 5/9] igb: respect E1000_VMOLR_RSSE

2023-01-28 Thread Akihiko Odaki
On 2023/01/28 22:46, Sriram Yagnaraman wrote: RSS for VFs is only enabled if VMOLR[n].RSSE is set. Signed-off-by: Sriram Yagnaraman --- hw/net/igb_core.c | 18 +- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/hw/net/igb_core.c b/hw/net/igb_core.c index 1eb7ba

Re: [PATCH 9/9] igb: respect VMVIR and VMOLR for VLAN

2023-01-29 Thread Akihiko Odaki
On 2023/01/28 22:46, Sriram Yagnaraman wrote: Add support for stripping/inserting VLAN for VFs. Signed-off-by: Sriram Yagnaraman --- hw/net/igb_core.c | 100 ++ 1 file changed, 65 insertions(+), 35 deletions(-) diff --git a/hw/net/igb_core.c b/hw/

Re: [PATCH 3/9] igb: implement VFRE and VFTE registers

2023-01-29 Thread Akihiko Odaki
On 2023/01/28 22:46, Sriram Yagnaraman wrote: Also add checks for RXDCTL/TXDCTL queue enable bits Signed-off-by: Sriram Yagnaraman --- hw/net/igb_core.c | 42 +++--- hw/net/igb_regs.h | 3 ++- 2 files changed, 33 insertions(+), 12 deletions(-) diff --gi

Re: [PATCH 5/9] igb: respect E1000_VMOLR_RSSE

2023-01-30 Thread Akihiko Odaki
On 2023/01/30 21:07, Sriram Yagnaraman wrote: -Original Message- From: Akihiko Odaki Sent: Sunday, 29 January 2023 08:25 To: Sriram Yagnaraman Cc: qemu-devel@nongnu.org; Jason Wang ; Dmitry Fleytman ; Michael S . Tsirkin ; Marcel Apfelbaum Subject: Re: [PATCH 5/9] igb: respect

Re: [PATCH 3/9] igb: implement VFRE and VFTE registers

2023-01-30 Thread Akihiko Odaki
On 2023/01/30 19:16, Sriram Yagnaraman wrote: -Original Message- From: Akihiko Odaki Sent: Sunday, 29 January 2023 10:16 To: Sriram Yagnaraman Cc: qemu-devel@nongnu.org; Jason Wang ; Dmitry Fleytman ; Michael S . Tsirkin ; Marcel Apfelbaum Subject: Re: [PATCH 3/9] igb: implement

[PATCH v4 01/28] e1000e: Fix the code style

2023-01-30 Thread Akihiko Odaki
igb implementation first starts off by copying e1000e code. Correct the code style before that. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé --- hw/net/e1000.c | 41 hw/net/e1000e.c| 72 ++-- hw/net/e1000e_core.c

[PATCH v4 17/28] e1000e: Remove extra pointer indirection

2023-01-30 Thread Akihiko Odaki
pointer indirection. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé --- hw/net/e1000e_core.c | 38 +++--- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c index 736708407c..d143f2ae6f

[PATCH v4 10/28] e1000e: Use memcpy to intialize registers

2023-01-30 Thread Akihiko Odaki
Use memcpy instead of memmove to initialize registers. The initial register templates and register table instances will never overlap. Signed-off-by: Akihiko Odaki --- hw/net/e1000e_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/net/e1000e_core.c b/hw/net

[PATCH v4 15/28] e1000e: Introduce e1000_rx_desc_union

2023-01-30 Thread Akihiko Odaki
Before this change, e1000e_write_packet_to_guest() allocated the receive descriptor buffer as an array of uint8_t. This does not ensure the buffer is sufficiently aligned. Introduce e1000_rx_desc_union type, a union type of all receive descriptor types to correct this. Signed-off-by: Akihiko

[PATCH v4 28/28] MAINTAINERS: Add e1000e test files

2023-01-30 Thread Akihiko Odaki
Signed-off-by: Akihiko Odaki Acked-by: Thomas Huth --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 958915f227..e920d0061e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2218,6 +2218,8 @@ R: Akihiko Odaki S: Maintained F: hw/net/e1000e* F

[PATCH v4 24/28] hw/net/net_tx_pkt: Implement TCP segmentation

2023-01-30 Thread Akihiko Odaki
implementation; igb provides loopback feature for VMDq and the feature relies on software segmentation. Implement proper TCP segmentation in net_tx_pkt to fix such a scenario. Signed-off-by: Akihiko Odaki --- hw/net/net_tx_pkt.c | 248 include/net

[PATCH v4 19/28] e1000x: Alter the signature of e1000x_is_vlan_packet

2023-01-30 Thread Akihiko Odaki
e1000x_is_vlan_packet() had a pointer to uint8_t as a parameter, but it does not have to be uint8_t. Change the type to void *. Signed-off-by: Akihiko Odaki --- hw/net/e1000x_common.c | 2 +- hw/net/e1000x_common.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/net

[PATCH v4 04/28] e1000: Use hw/net/mii.h

2023-01-30 Thread Akihiko Odaki
hw/net/mii.h provides common definitions for MII. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé --- hw/net/e1000.c | 86 ++-- hw/net/e1000_regs.h| 46 hw/net/e1000e.c| 1 + hw/net/e1000e_core.c | 99

[PATCH v4 02/28] hw/net: Add more MII definitions

2023-01-30 Thread Akihiko Odaki
The definitions will be used by igb. Signed-off-by: Akihiko Odaki --- include/hw/net/mii.h | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/include/hw/net/mii.h b/include/hw/net/mii.h index 4ae4dcce7e..c6a767a49a 100644 --- a/include/hw/net/mii.h +++ b/include

[PATCH v4 22/28] hw/net/net_rx_pkt: Remove net_rx_pkt_has_virt_hdr

2023-01-30 Thread Akihiko Odaki
NetTxPkt has a valid virtio-net header. Signed-off-by: Akihiko Odaki --- hw/net/e1000e_core.c | 16 hw/net/net_rx_pkt.c | 11 +-- hw/net/net_rx_pkt.h | 12 +--- hw/net/trace-events | 1 - hw/net/virtio-net.c | 2 +- hw/net/vmxnet3.c | 12 ++-- 6

[PATCH v4 23/28] e1000e: Perform software segmentation for loopback

2023-01-30 Thread Akihiko Odaki
ation if VIRTIO_NET_HDR_F_DATA_VALID is set. Signed-off-by: Akihiko Odaki --- hw/net/e1000e_core.c | 27 ++-- hw/net/net_rx_pkt.c | 7 hw/net/net_rx_pkt.h | 8 + hw/net/net_tx_pkt.c | 76 +--- hw/net/net_tx_pkt.h | 21 ++

[PATCH v4 27/28] MAINTAINERS: Add Akihiko Odaki as a e1000e reviewer

2023-01-30 Thread Akihiko Odaki
I want to know to be notified when there is a new change for e1000e as e1000e is similar to igb and such a change may also be applicable for igb. Signed-off-by: Akihiko Odaki --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 08ad1e5341

[PATCH v4 12/28] e1000e: Improve software reset

2023-01-30 Thread Akihiko Odaki
This change makes e1000e reset more things when software reset was triggered. Some registers are exempted from software reset in the datasheet and this change also implements the behavior accordingly. Signed-off-by: Akihiko Odaki --- hw/net/e1000e_core.c | 24 +++- 1 file

[PATCH v4 21/28] hw/net/net_tx_pkt: Automatically determine if virtio-net header is used

2023-01-30 Thread Akihiko Odaki
The new function qemu_get_using_vnet_hdr() allows to automatically determine if virtio-net header is used. Signed-off-by: Akihiko Odaki --- hw/net/e1000e_core.c | 3 +-- hw/net/net_tx_pkt.c | 19 ++- hw/net/net_tx_pkt.h | 3 +-- hw/net/vmxnet3.c | 6 ++ 4 files

[PATCH v4 20/28] net: Strip virtio-net header when dumping

2023-01-30 Thread Akihiko Odaki
-off-by: Akihiko Odaki --- include/net/net.h | 6 ++ net/dump.c| 11 +++ net/net.c | 18 ++ net/tap.c | 16 4 files changed, 47 insertions(+), 4 deletions(-) diff --git a/include/net/net.h b/include/net/net.h index dc20b31e9f

[PATCH v4 16/28] e1000e: Set MII_ANER_NWAY

2023-01-30 Thread Akihiko Odaki
mismatch. > ACTION: Configure the link partner for auto-negotiation. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé --- hw/net/e1000e_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c index d8c17baf8f

[PATCH v4 11/28] e1000e: Remove pending interrupt flags

2023-01-30 Thread Akihiko Odaki
They are duplicate of running throttling timer flags and incomplete as the flags are not cleared when the interrupts are fired or the device is reset. Signed-off-by: Akihiko Odaki --- hw/net/e1000e.c | 5 ++--- hw/net/e1000e_core.c | 19 +++ hw/net/e1000e_core.h | 2

[PATCH v4 05/28] e1000: Mask registers when writing

2023-01-30 Thread Akihiko Odaki
When a register has effective bits fewer than their width, the old code inconsistently masked when writing or reading. Make the code consistent by always masking when writing, and remove some code duplication. Signed-off-by: Akihiko Odaki --- hw/net/e1000.c | 84

[PATCH v4 09/28] e1000: Use memcpy to intialize registers

2023-01-30 Thread Akihiko Odaki
Use memcpy instead of memmove to initialize registers. The initial register templates and register table instances will never overlap. Signed-off-by: Akihiko Odaki --- hw/net/e1000.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/net/e1000.c b/hw/net/e1000.c index

[PATCH v4 13/28] e1000: Configure ResettableClass

2023-01-30 Thread Akihiko Odaki
This is part of recent efforts of refactoring e1000 and e1000e. DeviceClass's reset member is deprecated so migrate to ResettableClass. There is no behavioral difference. Signed-off-by: Akihiko Odaki Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé --- hw/net/e1000.c

[PATCH] softmmu: Use memmove in flatview_write_continue

2023-01-30 Thread Akihiko Odaki
/crash_47dfe62d9f911bf523ff48cd441b61c0013ed805 Signed-off-by: Akihiko Odaki --- softmmu/physmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/softmmu/physmem.c b/softmmu/physmem.c index cb998cdf23..3cd27b1c9d 100644 --- a/softmmu/physmem.c +++ b/softmmu/physmem.c @@ -2828,7 +2828,7 @@ static MemTxResult

[PATCH v4 00/28] e1000x cleanups (preliminary for IGB)

2023-01-30 Thread Akihiko Odaki
er is used". - Added "hw/net/net_rx_pkt: Remove net_rx_pkt_has_virt_hdr". - Added "e1000e: Perform software segmentation for loopback". - Added "hw/net/net_tx_pkt: Implement TCP segmentation" - Added "MAINTAINERS: Add Akihiko Odaki as a e1000e reviewer&quo

[PATCH v4 07/28] e1000: Use more constant definitions

2023-01-30 Thread Akihiko Odaki
, E1000_MC_TBL_SIZE, and E1000_VLAN_FILTER_TBL_SIZE were copied from: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/net/ethernet/intel/e1000/e1000_hw.h?h=v6.0.9#n707 Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé --- hw/net/e1000.c | 50

[PATCH v4 18/28] net: Check L4 header size

2023-01-30 Thread Akihiko Odaki
net_tx_pkt_build_vheader() inspects TCP header but had no check for the header size, resulting in an undefined behavior. Check the header size and drop the packet if the header is too small. Signed-off-by: Akihiko Odaki --- hw/net/e1000e_core.c | 19 ++- hw/net/net_tx_pkt.c

[PATCH v4 26/28] e1000e: Do not assert when MSI-X is disabled later

2023-01-30 Thread Akihiko Odaki
ot;) Signed-off-by: Akihiko Odaki --- hw/net/e1000e_core.c | 4 1 file changed, 4 deletions(-) diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c index ff93547f88..76c7814cb8 100644 --- a/hw/net/e1000e_core.c +++ b/hw/net/e1000e_core.c @@ -162,8 +162,6 @@ e1000e_intrmgr_on_thrott

[PATCH v4 08/28] e1000e: Use more constant definitions

2023-01-30 Thread Akihiko Odaki
The definitions of SW Semaphore Register were copied from: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/net/ethernet/intel/e1000e/defines.h?h=v6.0.9#n374 Signed-off-by: Akihiko Odaki --- hw/net/e1000_regs.h | 7 +++ hw/net/e1000e_core.c | 49

[PATCH] hw/timer/hpet: Fix expiration time overflow

2023-01-30 Thread Akihiko Odaki
...@bu.edu/ The fixed test case is: fuzz/crash_2d7036941dcda1ad4380bb8a9174ed0c949bcefd Fixes: 16b29ae180 ("Add HPET emulation to qemu (Beth Kon)") Signed-off-by: Akihiko Odaki --- hw/timer/hpet.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) diff --git

[PATCH v4 14/28] e1000e: Configure ResettableClass

2023-01-30 Thread Akihiko Odaki
This is part of recent efforts of refactoring e1000 and e1000e. DeviceClass's reset member is deprecated so migrate to ResettableClass. There is no behavioral difference. Signed-off-by: Akihiko Odaki Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé --- hw/net/e1000e.c

[PATCH v4 25/28] hw/net/net_tx_pkt: Check the payload length

2023-01-30 Thread Akihiko Odaki
/crash_6aeaa33e7211ecd603726c53e834df4c6d1e08bc Fixes: e263cd49c7 ("Packet abstraction for VMWARE network devices") Signed-off-by: Akihiko Odaki --- hw/net/net_tx_pkt.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/hw/net/net_tx_pkt.c b/hw/net/net_tx_pkt.c index 4a35e8429d..986a3adfe9 100644 --- a/hw/net/net_tx_p

[PATCH v4 06/28] e1000e: Mask registers when writing

2023-01-30 Thread Akihiko Odaki
When a register has effective bits fewer than their width, the old code inconsistently masked when writing or reading. Make the code consistent by always masking when writing, and remove some code duplication. Signed-off-by: Akihiko Odaki --- hw/net/e1000e_core.c | 94

[PATCH v4 03/28] fsl_etsec: Use hw/net/mii.h

2023-01-30 Thread Akihiko Odaki
hw/net/mii.h provides common definitions for MII. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé --- hw/net/fsl_etsec/etsec.c | 11 ++- hw/net/fsl_etsec/etsec.h | 17 - hw/net/fsl_etsec/miim.c | 5 +++-- include/hw/net/mii.h | 1 + 4 files

[PATCH] vhost-user-fs: Back up vqs before cleaning up vhost_dev

2023-01-30 Thread Akihiko Odaki
vhost_dev_cleanup() clears vhost_dev so back up its vqs member to free the memory pointed by the member. Fixes: 98fc1ada4c ("virtio: add vhost-user-fs base device") Signed-off-by: Akihiko Odaki --- hw/virtio/vhost-user-fs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) di

[PATCH] vhost-user-gpio: Configure vhost_dev when connecting

2023-01-30 Thread Akihiko Odaki
vhost_dev_cleanup(). Fixes: 27ba7b027f ("hw/virtio: add boilerplate for vhost-user-gpio device") Signed-off-by: Akihiko Odaki --- hw/virtio/vhost-user-gpio.c | 10 ++ include/hw/virtio/vhost-user-gpio.h | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff

[PATCH] vhost-user-i2c: Back up vqs before cleaning up vhost_dev

2023-01-30 Thread Akihiko Odaki
vhost_dev_cleanup() clears vhost_dev so back up its vqs member to free the memory pointed by the member. Fixes: 7221d3b634 ("hw/virtio: add boilerplate for vhost-user-i2c device") Signed-off-by: Akihiko Odaki --- hw/virtio/vhost-user-i2c.c | 5 +++-- 1 file changed, 3 insertions(+), 2

[PATCH] vhost-user-rng: Back up vqs before cleaning up vhost_dev

2023-01-30 Thread Akihiko Odaki
vhost_dev_cleanup() clears vhost_dev so back up its vqs member to free the memory pointed by the member. Fixes: 821d28b88f ("vhost-user-rng: Add vhost-user-rng implementation") Signed-off-by: Akihiko Odaki --- hw/virtio/vhost-user-rng.c | 5 +++-- 1 file changed, 3 insertions(+), 2

[PATCH v5 5/9] tests/qtest/e1000e-test: Fabricate ethernet header

2023-01-30 Thread Akihiko Odaki
e1000e understands ethernet header so fabricate something convincing. Signed-off-by: Akihiko Odaki --- tests/qtest/e1000e-test.c | 17 +++-- tests/qtest/libqos/e1000e.h | 2 ++ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/tests/qtest/e1000e-test.c b/tests/qtest

[PATCH v5 9/9] docs/system/devices/igb: Add igb documentation

2023-01-30 Thread Akihiko Odaki
Signed-off-by: Akihiko Odaki --- MAINTAINERS | 1 + docs/system/device-emulation.rst | 1 + docs/system/devices/igb.rst | 71 3 files changed, 73 insertions(+) create mode 100644 docs/system/devices/igb.rst diff --git a/MAINTAINERS b

[PATCH v5 6/9] tests/qtest/libqos/e1000e: Export macreg functions

2023-01-30 Thread Akihiko Odaki
They will be useful for igb testing. Signed-off-by: Akihiko Odaki --- tests/qtest/libqos/e1000e.c | 12 tests/qtest/libqos/e1000e.h | 12 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/qtest/libqos/e1000e.c b/tests/qtest/libqos/e1000e.c index

[PATCH v5 2/9] pcie: Introduce pcie_sriov_num_vfs

2023-01-30 Thread Akihiko Odaki
igb can use this function to change its behavior depending on the number of virtual functions currently enabled. Signed-off-by: Gal Hammer Signed-off-by: Marcel Apfelbaum Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé --- hw/pci/pcie_sriov.c | 5 + include/hw

[PATCH v5 1/9] hw/net/net_tx_pkt: Introduce net_tx_pkt_get_eth_hdr

2023-01-30 Thread Akihiko Odaki
Expose the ethernet header so that igb can utilize it to perform the internal routing among its SR-IOV functions. Signed-off-by: Gal Hammer Signed-off-by: Marcel Apfelbaum Signed-off-by: Akihiko Odaki --- hw/net/net_tx_pkt.c | 6 ++ hw/net/net_tx_pkt.h | 8 2 files changed, 14

[PATCH v5 8/9] tests/avocado: Add igb test

2023-01-30 Thread Akihiko Odaki
This automates ethtool tests for igb registers, interrupts, etc. Signed-off-by: Akihiko Odaki --- MAINTAINERS | 1 + .../org.centos/stream/8/x86_64/test-avocado | 1 + tests/avocado/igb.py | 38 +++ 3 files changed

[PATCH v5 0/9] Introduce igb

2023-01-30 Thread Akihiko Odaki
Spun off e1000e general improvements to a distinct series. - Restored vnet_hdr offload as there seems nothing preventing from that. Akihiko Odaki (9): hw/net/net_tx_pkt: Introduce net_tx_pkt_get_eth_hdr pcie: Introduce pcie_sriov_num_vfs e1000: Split header files Intrdocue igb device emulati

[PATCH v5 7/9] igb: Introduce qtest for igb device

2023-01-30 Thread Akihiko Odaki
This change is derived from qtest for e1000e device. Signed-off-by: Akihiko Odaki --- MAINTAINERS | 2 + tests/qtest/fuzz/generic_fuzz_configs.h | 5 + tests/qtest/igb-test.c | 243 tests/qtest/libqos/igb.c

[PATCH v5 3/9] e1000: Split header files

2023-01-30 Thread Akihiko Odaki
Some definitions in the header files are invalid for igb so extract them to new header files to keep igb from referring to them. Signed-off-by: Gal Hammer Signed-off-by: Marcel Apfelbaum Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé --- hw/net/e1000.c | 1 + hw

Re: [PATCH v2 2/9] igb: handle PF/VF reset properly

2023-01-30 Thread Akihiko Odaki
On 2023/01/30 22:22, Sriram Yagnaraman wrote: Use PFRSTD to reset RSTI bit for VFs, and raise VFLRE interrupt when VF is reset. Signed-off-by: Sriram Yagnaraman --- hw/net/e1000x_regs.h | 1 + hw/net/igb_core.c| 33 + hw/net/trace-events | 2 ++ 3 fil

Re: [PATCH v2 3/9] igb: implement VFRE and VFTE registers

2023-01-30 Thread Akihiko Odaki
On 2023/01/30 22:22, Sriram Yagnaraman wrote: Also add checks for RXDCTL/TXDCTL queue enable bits Signed-off-by: Sriram Yagnaraman --- hw/net/igb_core.c | 41 ++--- hw/net/igb_regs.h | 4 +++- 2 files changed, 33 insertions(+), 12 deletions(-) diff --gi

Re: [PATCH v2 3/9] igb: implement VFRE and VFTE registers

2023-01-30 Thread Akihiko Odaki
On 2023/01/30 23:19, Akihiko Odaki wrote: On 2023/01/30 22:22, Sriram Yagnaraman wrote: Also add checks for RXDCTL/TXDCTL queue enable bits Signed-off-by: Sriram Yagnaraman ---   hw/net/igb_core.c | 41 ++---   hw/net/igb_regs.h |  4 +++-   2 files changed

Re: [PATCH v2 5/9] igb: check oversized packets for VMDq

2023-01-30 Thread Akihiko Odaki
On 2023/01/30 22:23, Sriram Yagnaraman wrote: Signed-off-by: Sriram Yagnaraman --- hw/net/igb_core.c | 48 +++ 1 file changed, 40 insertions(+), 8 deletions(-) diff --git a/hw/net/igb_core.c b/hw/net/igb_core.c index cea7c036f0..89650fcfd4 100644 -

Re: [PATCH v2 00/13] Introduce igb

2023-01-30 Thread Akihiko Odaki
On 2023/01/29 5:57, Sriram Yagnaraman wrote: -Original Message- From: Akihiko Odaki Sent: Thursday, 26 January 2023 12:32 To: Sriram Yagnaraman ; Jason Wang Cc: Dmitry Fleytman ; Michael S. Tsirkin ; Marcel Apfelbaum ; Alex Bennée ; Philippe Mathieu-Daudé ; Thomas Huth ; Wainer dos

Re: [PATCH] fuzz: add igb testcases

2023-01-30 Thread Akihiko Odaki
://gitlab.freedesktop.org/slirp/libslirp/-/merge_requests/131 Regards, Akihiko Odaki

Re: [PATCH v4 20/28] net: Strip virtio-net header when dumping

2023-01-30 Thread Akihiko Odaki
On 2023/01/31 0:12, Michael S. Tsirkin wrote: On Mon, Jan 30, 2023 at 10:47:07PM +0900, Akihiko Odaki wrote: filter-dump specifiees Ethernet as PCAP LinkType, which does not expect virtio-net header. Having virtio-net header in such PCAP file breaks PCAP unconsumable. Unfortunately currently

<    3   4   5   6   7   8   9   10   11   12   >