While the first trial of Editing Mellanox OFED seemed to go right, it turned out that editing certain files such as en_main.c
caused a problem when trying to install the package using dpkg -i
.
To simply see the solution, move to 3.Solution
On the README
file, I found an answer that they suggest for 1.compilation 2.add a new feature/fix, and 3. add backport patches:
For simple Compilation, they tell us to:
HOWTO add a new feature/fix:
----------------------------
Compilation procedure:
# cd mlnx_rdma
# git checkout master
# ./configure <params>
E.g.: ./configure --with-core-mod --with-user_mad-mod --with-user_access-mod --with-addr_trans-mod --with-mlx4-mod --with-mlx4_en-mod --with-mlx5-mod --with-ipoib-mod --with-srp-mod --with-rds-mod --with-iser-mod
Note: If "backports_applied" file exist then backport patches will not be applied.
# make distclean
# make
# make install
Then, when it comes to adding a new feature, or fixing it, which is what we want to do, it tells us to:
HOWTO add a new feature/fix:
----------------------------
Start with updated branch (equal to “master”).
Add the new code.
Check compilation on the latest kernel base.
# ./configure <params> --without-backport-patches
Note: Provide path to kernel sources if needed: --kernel-version <version> --kernel-sources <path to sources>
# make distclean
# make
# make install
Now, this seemed to solve the problem, yet when I tried to fix the en_main.c
file and configure with the --without-backport-patches
it showed the following error:
So, I needed to first understand what "Backporting" is, and what is happening.
The root cause of this problem was due "Backporting".
So, from the investigation, we knew that:
1. All backport patches are being patched with the with-backport-patch
option.
2. Thus with this option, we cannot cannot directly change the source code as patches need to be done later.
3. With without-backport-patch
option, patches are not applied, yet because of that, dependency problem occurs between the files.
4. We cannot directly change the patch file due its change-Id value.
Thus with all this, I have come up with a solution of finding all the backport patches on the desired file (in our case, en_main.c
), manually apply those patches on the source code, then fix the code.
Then, with the with-backport-patch
option, it will patch all other files to cause no dependency problem too.
Here's How it works:
find the backport.patch file that patches the desired file.
ex) for en_main.c
:
0270-BACKPORT-drivers-net-ethernet-mellanox-mlx5-core-en_.patch
, there may be various patches for a file)
Apply Patches:
patch -p1 < /home/brian11hwang/SR-IOV/OFED_TEST/mlnx-ofed-kernel-5.8/backports/0270-BACKPORT-drivers-net-ethernet-mellanox-mlx5-core-en_.patch
Here, we can see that the file has change due patch applied.
rm -f 0270-BACKPORT-drivers-net-ethernet-mellanox-mlx5-core-en_.patch
--without-backport-patch
option:./configure --with-core-mod --with-user_mad-mod --with-user_access-mod --with-addr_trans-mod --with-mlx4-mod --with-mlx4_en-mod --with-mlx5-mod --with-srp-mod --with-rds-mod --with-iser-mod --kernel-version 5.15.0-76-generic
make -j 16
sudo make install
sudo /etc/init.d/openibd restart
저도 개발자인데 같이 교류 많이 해봐요 ㅎㅎ! 서로 화이팅합시다!