Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 2210044

Summary: Better error message for SRIOV failure on `min-rx-rate`
Product: Red Hat Enterprise Linux 9 Reporter: Gris Ge <fge>
Component: nmstateAssignee: Gris Ge <fge>
Status: CLOSED MIGRATED QA Contact: Mingyu Shi <mshi>
Severity: low Docs Contact:
Priority: unspecified    
Version: 9.2CC: ferferna, jiji, jishi, network-qe, sfaye, till
Target Milestone: rcKeywords: MigratedToJIRA, Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-08-17 13:08:58 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Gris Ge 2023-05-25 14:54:39 UTC
Description of problem:

When applying a desire state of nmstate setting SR-IOV `min-rx-rate` on some i40e card, user get failure like:

```
NmstateError: VerificationError: Verification failure: ens1f0.interface.ethernet.sr-iov.total-vfs desire '5', current '0'
```

This give user a wrong impression that nmstate/NetworkManager failure to activate the SR-IOV.

But the actual failure is:

```
kernel: i40e 0000:3b:00.0: Invalid min tx rate (100) (greater than 0) specified for VF 2.
```

When NetworkManager failed to set SR-IOV parameters, NM will disable SRIOV setting which lead to nmstate found SR-IOV been disabled during verification stage.

Version-Release number of selected component (if applicable):
nmstate-2.2.10-3.el9

How reproducible:
100%

Steps to Reproduce:
1. Apply this desire state on i40e card which does not support setting `min-tx-rate`:

```
interfaces:
- name: ens1f0
  type: ethernet
  description: Change QOS on VF0
  state: up
  ethernet:
    sr-iov:
      total-vfs: 5
      vfs:
      - id: 2
        min-tx-rate: 100
        max-tx-rate: 200
```


Actual results:

 VerificationError: Verification failure: ens1f0.interface.ethernet.sr-iov.total-vfs desire '5', current '0'


Expected results:

InvalidArgument: Invalid SR-IOV parameter for interface ens1f0: kernel: i40e 0000:3b:00.0: Invalid min tx rate (100) (greater than 0) specified for VF 2.

Additional info:

Comment 1 Gris Ge 2023-05-25 14:57:55 UTC
Design A: nmstate collect kernel logs

1. On verification error of SR-IOV, nmstate check `NmDeviceStateReason` to
   confirm whether it is a `NM_DEVICE_STATE_REASON_SRIOV_CONFIGURATION_FAILED`.
2. Parse kernel dmesg and collect all warning+ message for failed
   interface(matched PCI address in this case)
3. Show above kernel logs as nmstate log along with `InvalidArgument` error.