[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 Committed
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
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.