Public bug reported:

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.

** Affects: linux-intel-iotg (Ubuntu)
     Importance: Undecided
     Assignee: Philip Cox (philcox)
         Status: In Progress

** Affects: linux-intel-iotg (Ubuntu Jammy)
     Importance: Undecided
         Status: In Progress

** Changed in: linux-intel-iotg (Ubuntu)
       Status: New => Confirmed

** Also affects: linux-intel-iotg (Ubuntu Jammy)
   Importance: Undecided
       Status: New

** Changed in: linux-intel-iotg (Ubuntu Jammy)
       Status: New => Confirmed

** Changed in: linux-intel-iotg (Ubuntu Jammy)
       Status: Confirmed => Triaged

** Changed in: linux-intel-iotg (Ubuntu Jammy)
       Status: Triaged => In Progress

** Changed in: linux-intel-iotg (Ubuntu)
       Status: Confirmed => Triaged

** Changed in: linux-intel-iotg (Ubuntu)
       Status: Triaged => In Progress

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux-intel-iotg in Ubuntu.
https://bugs.launchpad.net/bugs/2038349

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

Status in linux-intel-iotg package in Ubuntu:
  In Progress
Status in linux-intel-iotg source package in Jammy:
  In Progress

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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux-intel-iotg/+bug/2038349/+subscriptions


-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to     : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to