Bug 1947278

Summary: [RFE] iGB: Add an emulated SR-IOV network card
Product: Red Hat Enterprise Linux 9 Reporter: Gal Hammer <ghammer>
Component: qemu-kvmAssignee: Akihiko Odaki <aodaki>
qemu-kvm sub component: Networking QA Contact: Yanghang Liu <yanghliu>
Status: CLOSED MIGRATED Docs Contact:
Severity: unspecified    
Priority: unspecified CC: aadam, amelnych, chayang, jinzhao, juzhang, leiyang, ngu, qzhang, virt-maint, ybendito, yvugenfi
Version: 9.0Keywords: FutureFeature, MigratedToJIRA, Reopened, RFE, Triaged
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-08-15 15:34:07 UTC Type: Story
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2175513    

Description Gal Hammer 2021-04-08 06:42:26 UTC
Add an emulated SR-IOV network card to allow testing applications' SR-IOV features on a machine without a specific hardware.

Comment 1 John Ferlan 2021-04-16 15:17:28 UTC
Assigned to Ariel for initial triage per bz process and age of bug created or assigned to virt-maint without triage.

Comment 3 John Ferlan 2021-09-08 21:48:25 UTC
Move RHEL-AV bugs to RHEL9. If necessary to resolve in RHEL8, then clone to the current RHEL8 release.

Comment 6 RHEL Program Management 2022-11-01 07:28:55 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.

Comment 7 Yanghang Liu 2022-11-30 02:08:17 UTC
Hi Yuri,

May I ask if we still have the plan to fix this bug in current release ?

If yes, please help re-open this bug

Comment 8 Yanghang Liu 2022-11-30 02:12:18 UTC
Mark qe_test_coverage- first based on QE's workflow.

I will update the qe_test_coverage flag properly after we finally decide to re-open this bug.

Comment 14 Yanghang Liu 2023-03-17 16:39:56 UTC
Hi Yuri,

Could you please help share the test details which QE can run to verify this bug ?

Comment 15 Yvugenfi@redhat.com 2023-03-29 10:53:52 UTC
(In reply to Yanghang Liu from comment #14)
> Hi Yuri,
> 
> Could you please help share the test details which QE can run to verify this
> bug ?

Testing igb
-----------
The basics of igb are no different from the other network devices such as e1000e, and the existing procedure to test other network devices should just work by replacing e.g. e1000e with igb. However, igb implements SR-IOV feature and L2 switching among SR-IOV functions, so these features require extra care.

Test patterns
--------------
igb has one physical function (PF) and can enable 8 virtual functions (VF) at most. Therefore, communications among those functions and the external host needs to be tested. In particular, make sure that the tested combination of peers includes all of the following patterns:
PF - External
PF - VF
VF - External
VF - Another VF


Enabling SR-IOV
----------------
By default, Linux does not start SR-IOV VFs. For the procedure to start VFs, see:
https://docs.kernel.org/PCI/pci-iov-howto.html#sr-iov-api
The device ID used here can be queried with lspci.
The enabled VFs will be recognized as new network devices, and can be found with ip command. A VF is typically suffixed with vN where N is its index.


Avoiding in-kernel loopback
---------------------------
When testing connections among SR-IOV functions, you need to ensure that in-kernel loopback is not performed for them; otherwise the network device will not be used. The below is an example of commands to disable in-kernel loopback between two devices. ADDRESS0 and IFNAME0 represent the IP address and interface name of a peer, and IFNAME1 and ADDRESS1 represent those of the other peer:
ip [-6] rule del priority 0 table local
ip [-6] add priority 1 table local
ip [-6] route add ADDRESS1 dev IFNAME0 src ADDRESS0
ip [-6] route add ADDRESS0 dev IFNAME1 src ADDRESS1

Comment 16 Yvugenfi@redhat.com 2023-03-30 06:53:25 UTC
Additional comment about reusing existing network tests.
To reuse existing network tests, simply replace the name of the device. For example, if the existing QEMU configuration has:
-device e1000e
Then replace e1000e with igb:
-device igb

Comment 17 Yanghang Liu 2023-05-16 10:32:52 UTC
Hi Yan,

It seems to me that a lot of commits about igb has been merged in qemu-kvm 8.0.

like:

[1] commit 3a977deebe6b9a10043182e922f6883924ef21f5
    Intrdocue igb device emulation

[2] commit 65f474bbae9a33b08707084efb95701e187f79e3
    net/eth: Introduce EthL4HdrProto

[3] commit 1a9a4949a55d291b2c5e5aebc9192a3cee04594f
    hw/net: Add more MII definitions

[4] commit fba7c3b788dfcb99a3f9253f7d99cc0d217d6d3c
    igb: respect VMVIR and VMOLR for VLAN

[5] commit 7581baed88a90f7e3d1e78251fd0867573ecf182
    igb: implement VF Tx and Rx stats

[6] commit 3c2e0a68534da9ff9cc79866a20adb8ac78c424f
    igb: respect E1000_VMOLR_RSSE

[7] commit 5f12d7030424e8fc4ee6f123d110073f16ae2b10
    igb: check oversized packets for VMDq

[8] commit 1c1e649761a20e92053cbec81c2947ca82258ef7
    igb: add ICR_RXDW

[9] commit 2e68546a4318228e7dd73f73b471a00f31e64064
    igb: handle PF/VF reset properly

[10] commit 3269ebb3e0fe0e356199c2dcc24c51ad63865aa4
    igb: implement VFRE and VFTE registers

[10] commit f4fdaf009cc85e95a00aba47a6b5b9df920d51c4
   igb: Fix DMA requester specification for Tx packet

[11] commit 212f7b1dac9e4ac344000cc4816097ce2bbe3993
   igb: Save more Tx states

[12] commit 02ef5fdc092bd495d6afd3c0212ff2e45931886d
    hw/net/net_tx_pkt: Implement TCP segmentation


I am not very sure why this bug is still in POST.  Could you please help check for that ?

Comment 18 Yvugenfi@redhat.com 2023-05-16 13:06:14 UTC
(In reply to Yanghang Liu from comment #17)
> Hi Yan,
> 
> It seems to me that a lot of commits about igb has been merged in qemu-kvm
> 8.0.
> 
> like:
> 
> [1] commit 3a977deebe6b9a10043182e922f6883924ef21f5
>     Intrdocue igb device emulation
> 
> [2] commit 65f474bbae9a33b08707084efb95701e187f79e3
>     net/eth: Introduce EthL4HdrProto
> 
> [3] commit 1a9a4949a55d291b2c5e5aebc9192a3cee04594f
>     hw/net: Add more MII definitions
> 
> [4] commit fba7c3b788dfcb99a3f9253f7d99cc0d217d6d3c
>     igb: respect VMVIR and VMOLR for VLAN
> 
> [5] commit 7581baed88a90f7e3d1e78251fd0867573ecf182
>     igb: implement VF Tx and Rx stats
> 
> [6] commit 3c2e0a68534da9ff9cc79866a20adb8ac78c424f
>     igb: respect E1000_VMOLR_RSSE
> 
> [7] commit 5f12d7030424e8fc4ee6f123d110073f16ae2b10
>     igb: check oversized packets for VMDq
> 
> [8] commit 1c1e649761a20e92053cbec81c2947ca82258ef7
>     igb: add ICR_RXDW
> 
> [9] commit 2e68546a4318228e7dd73f73b471a00f31e64064
>     igb: handle PF/VF reset properly
> 
> [10] commit 3269ebb3e0fe0e356199c2dcc24c51ad63865aa4
>     igb: implement VFRE and VFTE registers
> 
> [10] commit f4fdaf009cc85e95a00aba47a6b5b9df920d51c4
>    igb: Fix DMA requester specification for Tx packet
> 
> [11] commit 212f7b1dac9e4ac344000cc4816097ce2bbe3993
>    igb: Save more Tx states
> 
> [12] commit 02ef5fdc092bd495d6afd3c0212ff2e45931886d
>     hw/net/net_tx_pkt: Implement TCP segmentation
> 
> 
> I am not very sure why this bug is still in POST.  Could you please help
> check for that ?

Hi Yanghang,

There are several reasons that the BZ is still in post. Mainly because QEMU8.0 had initial device implementation and additional fixes were added after 8.0.
So it was decided that in downstream we will introduce iGB in RHEL9.4, and as a result iGB compilation in downstream in not enabled (downstream patch should be added on purpose to enable it).

Best regards,
Yan.

Comment 21 RHEL Program Management 2023-08-15 15:25:07 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 22 RHEL Program Management 2023-08-15 15:34:07 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues.