Files
kernel/kernel-modules/intel-i40e/debian/deb_folder/patches/0010-i40e-convert-.adjfreq-to-.adjfine.patch
Jiping Ma ba86fee885 kernel-modules: re-enable the OOT drivers
This commit re-enables ice, i40e, iavf, igb-uio, opae-fpga-driver and
iqvlinux OOT drivers.

In order to deal with a firmware incompatibility or if a problem is
found with the in-tree driver, we will continue to support one
version of each out-of-tree driver. The out-of-tree driver versions
that we plan to keep in StarlingX have been validated in the past.
We will be preserving i40e-2.20.12, iavf-4.5.3.2, and ice-1.9.11
as out-of-tree drivers. For the X700 series of NICs, i40e-2.20.12
is compatible with NVM (non-volatile memory, or firmware) version
9.20, and for the E810 series NICs, ice-1.9.11 is compatible with
NVM version 4.22.

The drivers igb-uio, opae-fpga-driver and iqvlinux are known to only
exist as OOT.

We encountered a few the version compatibility issues after upgrading
the kernel to 6.6.7 version. We adapted drivers' code to the kernel
6.6.7 by referring to the upstream commits.

We also change the driver location folder to "weak-updates" from
"updates" for ice, iavf and i40e so that the default drivers will be
the in-tree drivers.
    ice: 1.9.11
    i40e: 2.20.12
    iavf: 4.5.3.2

ice, i40e, iavf:
* commit b48b89f9c ("net: drop the weight argument from netif_napi_add")
  https://git.yoctoproject.org/linux-yocto/commit/?h=b48b89f9c

* commit 068c38ad ("net: Remove the obsolte u64_stats_fetch_*_irq()
  users (drivers).")
  https://git.yoctoproject.org/linux-yocto/commit/?h=068c38ad

* commit ba153552c ("ice: Remove redundant
  pci_enable_pcie_error_reporting()")
  https://git.yoctoproject.org/linux-yocto/commit/?h=ba153552c

* commit 680ee0456a ("net: invert the netdevice.h vs xdp.h dependency")
  https://git.yoctoproject.org/linux-yocto/commit/?h=680ee0456a

ice:
* commit ac73d4bf2 ("net: make drivers to use SET_NETDEV_DEVLINK_PORT
  to set devlink_port")
  https://git.yoctoproject.org/linux-yocto/commit/?h=ac73d4bf2

* commit 226bf98055 ("net: devlink: let the core report the driver name
  instead of the drivers")
  https://git.yoctoproject.org/linux-yocto/commit/?h=226bf98055

* commit fb8421a9 ("devlink: remove devlink features")
  https://git.yoctoproject.org/linux-yocto/commit/?h=fb8421a9

i40e:
* commit 3626a690b ("i40e: use mul_u64_u64_div_u64 for PTP frequency
  calculation")
  https://git.yoctoproject.org/linux-yocto/commit/?h=3626a690b

* commit ccd3bf985 ("i40e: convert .adjfreq to .adjfine")
  https://git.yoctoproject.org/linux-yocto/commit/?h=ccd3bf985

igb_uio:
Cherry pick upstream commit to fix the build error.
* commit 29b1c1e4 ("linux/igb_uio: fix build with kernel 5.18+")
  http://git.dpdk.org/dpdk-kmods/commit/?id=29b1c1e4

intel-opae-fpga:
* commit 1aaba11da9 ("driver core: class: remove module * from
  class_create()")
  https://git.yoctoproject.org/linux-yocto/commit/?h=1aaba11da9

iqvlinux:
* commit 79687789 ("PCI: Remove the deprecated "pci-dma-compat.h" API")
  https://git.yoctoproject.org/linux-yocto/commit/?h=79687789

Verification:
* ice, i40e, iavf:
  - installs from iso succeed on servers with ice(ntel E810-2C-QDA2
    Chapman beach) and i40e hw(Intel Ethernet Controller X710) for
    rt and std.
  - interfaces are up and pass packets for rt and std.
  - create vfs, ensure that they are picked up by the new iavf
    driver and that the interface can come up and pass packets
    on rt and std system.
  - Check dmesg to see DDP package is loaded successfully and
    the version is 1.3.30.0 for rt and std.
* Switch drivers between the OOT and in-tree drivers.
  - switch to the OOT drivers
    1. Add cmdline parameter multi-drivers-switch=cvl-4.0.1
    2. reboot
    can switch to the OOT drivers.
  - switch to the in-tree drivers
    1. Remove cmdline parameter multi-drivers-switch=cvl-4.0.1
    2. reboot
    can switch to the in-tree drivers.
* igb_uio, intel-opae-fpga, iqvlinux
    Did not do the tests, it looks need docker image to do the test.
    So need the test team help to do the full tests.

Story: 2011056
Task: 49672

Change-Id: I2c05dee6f35ed431e8a53d2680a3c7558f08abef
Signed-off-by: Jiping Ma <jiping.ma2@windirver.com>
(cherry picked from commit d4f8973274)
Signed-off-by: Jiping Ma <jiping.ma2@windriver.com>
2024-07-10 23:17:25 +00:00

87 lines
3.2 KiB
Diff

From 262c2d5e13edac5b7da4518e72a7696f28331465 Mon Sep 17 00:00:00 2001
From: Jacob Keller <jacob.e.keller@intel.com>
Date: Thu, 21 Jul 2022 14:29:59 -0700
Subject: [PATCH 10/10] i40e: convert .adjfreq to .adjfine
The i40e driver currently implements the .adjfreq handler for frequency
adjustments. This takes the adjustment parameter in parts per billion. The
PTP core supports .adjfine which provides an adjustment in scaled parts per
million. This has a higher resolution and can result in more precise
adjustments for small corrections.
Convert the existing .adjfreq implementation to the newer .adjfine
implementation. This is trivial since it just requires changing the divisor
from 1000000000ULL to (1000000ULL << 16) in the mul_u64_u64_div_u64 call.
This improves the precision of the adjustments and gets us one driver
closer to removing the old .adjfreq support from the kernel.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Gurucharan <gurucharanx.g@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
(cherry picked from commit ccd3bf98592117f59be2daa0f2ca00f352d7abbc)
[jma: This commit was cherry-picked from
https://git.yoctoproject.org/linux-yocto/commit/?h=ccd3bf985 ]
Signed-off-by: Jiping Ma <jiping.ma2@windriver.com>
---
src/i40e_ptp.c | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)
diff --git a/src/i40e_ptp.c b/src/i40e_ptp.c
index 956b0eb..92af9f7 100644
--- a/src/i40e_ptp.c
+++ b/src/i40e_ptp.c
@@ -349,29 +349,31 @@ static void i40e_ptp_convert_to_hwtstamp(struct skb_shared_hwtstamps *hwtstamps,
}
/**
- * i40e_ptp_adjfreq - Adjust the PHC frequency
+ * i40e_ptp_adjfine - Adjust the PHC frequency
* @ptp: The PTP clock structure
- * @ppb: Parts per billion adjustment from the base
+ * @scaled_ppm: Scaled parts per million adjustment from base
*
- * Adjust the frequency of the PHC by the indicated parts per billion from the
- * base frequency.
+ * Adjust the frequency of the PHC by the indicated delta from the base
+ * frequency.
+ *
+ * Scaled parts per million is ppm with a 16 bit binary fractional field.
**/
-static int i40e_ptp_adjfreq(struct ptp_clock_info *ptp, s32 ppb)
+static int i40e_ptp_adjfine(struct ptp_clock_info *ptp, long scaled_ppm)
{
struct i40e_pf *pf = container_of(ptp, struct i40e_pf, ptp_caps);
struct i40e_hw *hw = &pf->hw;
u64 adj, freq, diff;
int neg_adj = 0;
- if (ppb < 0) {
+ if (scaled_ppm < 0) {
neg_adj = 1;
- ppb = -ppb;
+ scaled_ppm = -scaled_ppm;
}
smp_mb(); /* Force any pending update before accessing. */
freq = I40E_PTP_40GB_INCVAL * READ_ONCE(pf->ptp_adj_mult);
- diff = mul_u64_u64_div_u64(freq, (u64)ppb,
- 1000000000ULL);
+ diff = mul_u64_u64_div_u64(freq, (u64)scaled_ppm,
+ 1000000ULL << 16);
if (neg_adj)
adj = I40E_PTP_40GB_INCVAL - diff;
@@ -1549,7 +1551,7 @@ static long i40e_ptp_create_clock(struct i40e_pf *pf)
sizeof(pf->ptp_caps.name) - 1);
pf->ptp_caps.owner = THIS_MODULE;
pf->ptp_caps.max_adj = 999999999;
- pf->ptp_caps.adjfreq = i40e_ptp_adjfreq;
+ pf->ptp_caps.adjfine = i40e_ptp_adjfine;
pf->ptp_caps.adjtime = i40e_ptp_adjtime;
#ifdef HAVE_PTP_CLOCK_INFO_GETTIME64
pf->ptp_caps.gettime64 = i40e_ptp_gettime;
--
2.42.0