[j:linux-intel-iotg][j:linux-intel-iot-realtime] Cannot set frame preemption

Bug #2038349 reported by Philip Cox
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux-intel-iotg (Ubuntu)
Fix Committed
Undecided
Philip Cox
Jammy
Fix Released
Undecided
Unassigned

Bug Description

This is a public version of https://bugs.launchpad.net/bugs/2034007

[Summary]
System cannot set frame preemption via the ethtool-rt from snap store[1], will got netlink error.

[1] https://snapcraft.io/ethtool-rt

u@u-Alder-Lake-Client-Platform:~$ sudo ethtool-rt.ethtool --set-frame-preemption enp1s0 fp on
netlink error: frame preemption settings update failed
netlink error: Invalid argument
u@u-Alder-Lake-Client-Platform:~$ echo $?
81
u@u-Alder-Lake-Client-Platform:~$ sudo ethtool-rt.ethtool --show-frame-preemption enp1s0
Frame preemption settings for enp1s0:
enabled: not enabled
additional fragment size: 0
verified: 0
verification disabled: 1

[Steps to reproduce]
1. sudo snap install ethtool-ty --devmode --edge
2.sudo ethtool-rt.ethtool --set-frame-preemption {your ethernet interface} fp on
3.sudo ethtool-rt.ethtool --show-frame-preemption {your ethernet interface}

[Expected result]
Set frame preemption successfully.

[Actual result]
Got netlink error.

[Failure rate]
3/3

[Additional information]
CID: 202305-31589
SKU: ADL-S
system-manufacturer: Intel Corporation
system-product-name: Alder Lake Client Platform
bios-version: RPLISFI1.R00.4081.A05.2305241419
CPU: 12th Gen Intel(R) Core(TM) i3-12100E (8x)
GPU: 00:02.0 VGA compatible controller [0300]: Intel Corporation Device [8086:4692] (rev 0c)
kernel-version: 5.15.0-1035-intel-iot-realtime

[Stage]
Issue reported and logs collected right after it happened

----------------------

Philip Cox (philcox) wrote on 2023-09-07:   #4
After going through the code, it looks like this is caused by the variable fpcmd->add_frag_size is set to 0 and in the function igc_ethtool_set_preempt() there is the following check:

if (fpcmd->add_frag_size < 68 || fpcmd->add_frag_size > 260)
 return -EINVAL;

And this is causing the the --set-frame-preemption to fail.

ubuntu@adl-p:~$ sudo ethtool-rt.ethtool --set-frame-preemption enp169s0 fp on ; echo $?
netlink error: frame preemption settings update failed
netlink error: Invalid argument
81
ubuntu@adl-p:~$

I see in igc.h that there is a #define for IGC_I225_MIN_FRAG_SIZE_DEFAULT which is:

#define IGC_I225_MIN_FRAG_SIZE_DEFAULT 68

This is set in igc_tsn_disable_offload()

static int igc_tsn_disable_offload(struct igc_adapter *adapter)
{
...
 adapter->cycle_time = 0;
 adapter->add_frag_size = IGC_I225_MIN_FRAG_SIZE_DEFAULT;
...
}

but igc_tsn_disable_offload is not called, so the value is never set.

---------------------

Lai Jun Ann (laijunann-intel) wrote 12 hours ago: #12
0001-igc-fix-frame-preemption-not-able-to-set.patch Edit (1.3 KiB, text/plain)
The patch is ready and uploaded. Below shows the testing done with the patch:
oot@ubuntu-Alder-Lake-Client-Platform:~# ethtool --show-frame-preemption enp1s0
Frame preemption settings for enp1s0:
        enabled: enabled
        additional fragment size: 68
        verified: 0
        verification disabled: 1
root@ubuntu-Alder-Lake-Client-Platform:~#
root@ubuntu-Alder-Lake-Client-Platform:~# ethtool --set-frame-preemption enp1s0 fp off
root@ubuntu-Alder-Lake-Client-Platform:~# ethtool --show-frame-preemption enp1s0
Frame preemption settings for enp1s0:
        enabled: not enabled
        additional fragment size: 68
        verified: 0
        verification disabled: 1
root@ubuntu-Alder-Lake-Client-Platform:~# ethtool --set-frame-preemption enp1s0 fp on
root@ubuntu-Alder-Lake-Client-Platform:~# ethtool --show-frame-preemption enp1s0
Frame preemption settings for enp1s0:
        enabled: enabled
        additional fragment size: 68
        verified: 0
        verification disabled: 1

--------------

Philip Cox (philcox) wrote 20 minutes ago:   #13
I've tested the patch as well, and it works. Thanks.

Philip Cox (philcox)
Changed in linux-intel-iotg (Ubuntu):
status: New → Confirmed
Changed in linux-intel-iotg (Ubuntu Jammy):
status: New → Confirmed
status: Confirmed → Triaged
status: Triaged → In Progress
Changed in linux-intel-iotg (Ubuntu):
status: Confirmed → Triaged
status: Triaged → In Progress
Philip Cox (philcox)
Changed in linux-intel-iotg (Ubuntu):
status: In Progress → Fix Committed
Changed in linux-intel-iotg (Ubuntu Jammy):
status: In Progress → Fix Committed
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote :

This bug is awaiting verification that the linux-intel-iotg/5.15.0-1044.50 kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-jammy-linux-intel-iotg' to 'verification-done-jammy-linux-intel-iotg'. If the problem still exists, change the tag 'verification-needed-jammy-linux-intel-iotg' to 'verification-failed-jammy-linux-intel-iotg'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: kernel-spammed-jammy-linux-intel-iotg-v2 verification-needed-jammy-linux-intel-iotg
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package linux-intel-iotg - 5.15.0-1045.51

---------------
linux-intel-iotg (5.15.0-1045.51) jammy; urgency=medium

  * jammy/linux-intel-iotg: 5.15.0-1045.51 -proposed tracker (LP: #2041936)

  * Packaging resync (LP: #1786013)
    - [Packaging] resync git-ubuntu-log
    - [Packaging] resync update-dkms-versions helper

  [ Ubuntu: 5.15.0-89.99 ]

  * jammy/linux: 5.15.0-89.99 -proposed tracker (LP: #2041949)
  * CVE-2023-31085
    - ubi: Refuse attaching if mtd's erasesize is 0
  * CVE-2023-45871
    - igb: set max size RX buffer when store bad packet is enabled
  * CVE-2023-25775
    - RDMA/irdma: Remove irdma_uk_mw_bind()
    - RDMA/irdma: Remove irdma_sc_send_lsmm_nostag()
    - RDMA/irdma: Remove irdma_cqp_up_map_cmd()
    - RDMA/irdma: Remove irdma_get_hw_addr()
    - RDMA/irdma: Make irdma_uk_cq_init() return a void
    - RDMA/irdma: optimize rx path by removing unnecessary copy
    - RDMA/irdma: Remove enum irdma_status_code
    - RDMA/irdma: Remove excess error variables
    - RDMA/irdma: Prevent zero-length STAG registration
  * Packaging resync (LP: #1786013)
    - [Packaging] update helper scripts

 -- Philip Cox <email address hidden> Tue, 14 Nov 2023 15:45:39 -0500

Changed in linux-intel-iotg (Ubuntu Jammy):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.