Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: EFA is incompatible with Mellanox rdma #308

Open
3 tasks done
vmarkovtsev opened this issue Jul 5, 2024 · 1 comment
Open
3 tasks done

[Bug]: EFA is incompatible with Mellanox rdma #308

vmarkovtsev opened this issue Jul 5, 2024 · 1 comment
Labels
bug Report errors or unexpected behavior Linux EFA driver triage Determine the priority and severity

Comments

@vmarkovtsev
Copy link

Preliminary Actions

Driver Type

Linux kernel driver for Elastic Fabric Adapter (EFA)

Driver Tag/Commit

efa_2.6.0-1.amzn1_amd64

Custom Code

No

OS Platform and Distribution

5.15.0-2000-aws #2000 SMP Thu May 23 13:16:55 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

Stock Ubuntu kernel 5.15.0-1006 with nvme moved from builtins to external modules.

Bug description

When built with rdma pointing at Mellanox distribution (i.e., /usr/src/ofa_kernel/x86_64/5.15.0-2000-aws/include/rdma belonging to https://network.nvidia.com/products/infiniband-drivers/linux/mlnx_ofed/), insmod efa fails with

[68998.526165] Elastic Fabric Adapter (EFA) v2.6.0g
[68998.526276] efa 0000:4f:00.0: enabling device (0000 -> 0002)
[68998.638853] efa 0000:4f:00.0: Setup irq:1861 name:efa-mgmnt@pci:0000:4f:00.0
[68998.667638] ------------[ cut here ]------------
[68998.667640] WARNING: CPU: 0 PID: 2150 at /var/lib/dkms/mlnx-ofed-kernel/24.04.OFED.24.04.0.6.6.1/build/drivers/infiniband/core/device.c:835 alloc_port_data.part.0+0xe7/0x100 [ib_core]
[68998.667657] Modules linked in: efa(OE+) nvidia_fs(OE) sunrpc rdma_ucm(OE) ib_ipoib(OE) ib_umad(OE) mlx5_ib(OE) mlx5_core(OE) pci_hyperv_intf mlxdevm(OE) tls mlxfw(OE) psample sch_fq_codel nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 ppdev nvme_rdma(OE) binfmt_misc rdma_cm(OE) nls_iso8859_1 iw_cm(OE) input_leds ib_cm(OE) serio_raw parport_pc parport nvidia_uvm(OE) nvme_fabrics(OE) ib_uverbs(OE) ib_core(OE) dm_multipath scsi_dh_rdac scsi_dh_emc scsi_dh_alua efi_pstore ip_tables x_tables autofs4 btrfs blake2b_generic zstd_compress raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx xor raid6_pq libcrc32c raid1 raid0 multipath linear nvidia_drm(OE) nvidia_modeset(OE) nvidia(OE) drm_kms_helper syscopyarea crct10dif_pclmul sysfillrect crc32_pclmul sysimgblt ghash_clmulni_intel aesni_intel crypto_simd cryptd fb_sys_fops nvme(OE) cec psmouse rc_core nvme_core(OE) drm ena mlx_compat(OE)
[68998.667701] CPU: 0 PID: 2150 Comm: kworker/0:6 Tainted: G           OE     5.15.0-2000-aws #2000
[68998.667703] Hardware name: Amazon EC2 p5.48xlarge/, BIOS 1.0 10/16/2017
[68998.667704] Workqueue: events work_for_cpu_fn
[68998.667709] RIP: 0010:alloc_port_data.part.0+0xe7/0x100 [ib_core]
[68998.667719] Code: 8b 8b c0 08 00 00 39 ca 76 a1 31 c0 48 8b 5d f8 c9 c3 83 c0 01 48 8d 14 80 48 8d 3c 50 48 c1 e7 04 48 83 c7 10 e9 4f ff ff ff <0f> 0b b8 ea ff ff ff c3 0f 0b b8 ea ff ff ff c3 b8 f4 ff ff ff eb
[68998.667720] RSP: 0018:ffffb217afff3ce8 EFLAGS: 00010246
[68998.667721] RAX: 0000000000000000 RBX: 0000000000000007 RCX: 0000000000000004
[68998.667722] RDX: 0000000000000001 RSI: 0000000000000007 RDI: ffff9db5ce1d4000
[68998.667723] RBP: ffffb217afff3da0 R08: 0000000000000cc0 R09: 0000000000000001
[68998.667724] R10: 0000000000000000 R11: 0000000000000000 R12: ffff9db5ce1d4000
[68998.667724] R13: ffff9db5ce1d4008 R14: ffff9daf916180d0 R15: 0000000000000000
[68998.667727] FS:  0000000000000000(0000) GS:ffff9eaffa600000(0000) knlGS:0000000000000000
[68998.667728] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[68998.667729] CR2: 00007f99a01e0ae0 CR3: 000000014658e005 CR4: 00000000003706f0
[68998.667732] Call Trace:
[68998.667733]  <TASK>
[68998.667734]  ? ib_register_device+0x477/0x5d0 [ib_core]
[68998.667745]  efa_probe+0x815/0x8b0 [efa]
[68998.667752]  ? _raw_spin_unlock_irqrestore+0xe/0x30
[68998.667757]  local_pci_probe+0x4b/0x90
[68998.667760]  work_for_cpu_fn+0x1a/0x30
[68998.667761]  process_one_work+0x22b/0x3d0
[68998.667763]  worker_thread+0x223/0x410
[68998.667765]  ? process_one_work+0x3d0/0x3d0
[68998.667767]  kthread+0x12a/0x150
[68998.667768]  ? set_kthread_struct+0x50/0x50
[68998.667770]  ret_from_fork+0x22/0x30
[68998.667773]  </TASK>
[68998.667774] ---[ end trace d74f9cbc22243b8b ]---
[68998.667775] infiniband efa_0: Couldn't create per-port data
[68998.684245] ------------[ cut here ]------------
[68998.684247] WARNING: CPU: 0 PID: 2150 at /var/lib/dkms/mlnx-ofed-kernel/24.04.OFED.24.04.0.6.6.1/build/drivers/infiniband/core/device.c:716 ib_dealloc_device+0xa1/0xc0 [ib_core]
[68998.684259] Modules linked in: efa(OE+) nvidia_fs(OE) sunrpc rdma_ucm(OE) ib_ipoib(OE) ib_umad(OE) mlx5_ib(OE) mlx5_core(OE) pci_hyperv_intf mlxdevm(OE) tls mlxfw(OE) psample sch_fq_codel nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 ppdev nvme_rdma(OE) binfmt_misc rdma_cm(OE) nls_iso8859_1 iw_cm(OE) input_leds ib_cm(OE) serio_raw parport_pc parport nvidia_uvm(OE) nvme_fabrics(OE) ib_uverbs(OE) ib_core(OE) dm_multipath scsi_dh_rdac scsi_dh_emc scsi_dh_alua efi_pstore ip_tables x_tables autofs4 btrfs blake2b_generic zstd_compress raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx xor raid6_pq libcrc32c raid1 raid0 multipath linear nvidia_drm(OE) nvidia_modeset(OE) nvidia(OE) drm_kms_helper syscopyarea crct10dif_pclmul sysfillrect crc32_pclmul sysimgblt ghash_clmulni_intel aesni_intel crypto_simd cryptd fb_sys_fops nvme(OE) cec psmouse rc_core nvme_core(OE) drm ena mlx_compat(OE)
[68998.684284] CPU: 0 PID: 2150 Comm: kworker/0:6 Tainted: G        W  OE     5.15.0-2000-aws #2000
[68998.684285] Hardware name: Amazon EC2 p5.48xlarge/, BIOS 1.0 10/16/2017
[68998.684286] Workqueue: events work_for_cpu_fn
[68998.684289] RIP: 0010:ib_dealloc_device+0xa1/0xc0 [ib_core]
[68998.684297] Code: 05 db 01 00 48 8d bb 38 05 00 00 e8 19 2e e4 d6 48 8b 5d f8 c9 c3 8b b3 68 0a 00 00 48 c7 c7 70 58 62 c0 e8 e1 4e c8 d6 eb a0 <0f> 0b 48 83 bb f0 04 00 00 00 74 bc 0f 0b 8b 83 b0 0a 00 00 85 c0
[68998.684298] RSP: 0018:ffffb217afff3d70 EFLAGS: 00010206
[68998.684300] RAX: 0000000000000001 RBX: ffff9db5ce1d4000 RCX: ffffb217afff3d18
[68998.684301] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff9db5ce1d4000
[68998.684302] RBP: ffffb217afff3d78 R08: ffff9db5ce1d4000 R09: 0000000000000001
[68998.684303] R10: 0000000000000000 R11: 0000000000000200 R12: ffff9db5ce1d4000
[68998.684303] R13: ffff9daf91618000 R14: ffff9daf91618000 R15: 00000000ffffffea
[68998.684306] FS:  0000000000000000(0000) GS:ffff9eaffa600000(0000) knlGS:0000000000000000
[68998.684307] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[68998.684308] CR2: 00007f99a01e0ae0 CR3: 000000014658e005 CR4: 00000000003706f0
[68998.684311] Call Trace:
[68998.684311]  <TASK>
[68998.684313]  efa_remove_device+0xb5/0xd0 [efa]
[68998.684318]  efa_probe+0x536/0x8b0 [efa]
[68998.684322]  ? _raw_spin_unlock_irqrestore+0xe/0x30
[68998.684324]  local_pci_probe+0x4b/0x90
[68998.684326]  work_for_cpu_fn+0x1a/0x30
[68998.684328]  process_one_work+0x22b/0x3d0
[68998.684329]  worker_thread+0x223/0x410
[68998.684331]  ? process_one_work+0x3d0/0x3d0
[68998.684333]  kthread+0x12a/0x150
[68998.684334]  ? set_kthread_struct+0x50/0x50
[68998.684336]  ret_from_fork+0x22/0x30
[68998.684338]  </TASK>
[68998.684338] ---[ end trace d74f9cbc22243b8c ]---
[68998.684341] ================================================================================
[68998.686988] UBSAN: array-index-out-of-bounds in /home/ubuntu/linux/linux-aws-5.15.0/kernel/locking/qspinlock.c:130:9
[68998.690165] index 9793 is out of range for type 'long unsigned int [8192]'
[68998.692259] CPU: 0 PID: 2150 Comm: kworker/0:6 Tainted: G        W  OE     5.15.0-2000-aws #2000
[68998.692261] Hardware name: Amazon EC2 p5.48xlarge/, BIOS 1.0 10/16/2017
[68998.692261] Workqueue: events work_for_cpu_fn
[68998.692263] Call Trace:
[68998.692264]  <TASK>
[68998.692265]  show_stack+0x52/0x58
[68998.692268]  dump_stack_lvl+0x4a/0x5f
[68998.692270]  dump_stack+0x10/0x12
[68998.692271]  ubsan_epilogue+0x9/0x45
[68998.692273]  __ubsan_handle_out_of_bounds.cold+0x44/0x49
[68998.692275]  __pv_queued_spin_lock_slowpath+0x2d3/0x2e0
[68998.692278]  _raw_spin_lock_irqsave+0x39/0x50
[68998.692279]  xa_destroy+0x53/0x120
[68998.692282]  ib_device_release+0x75/0xa0 [ib_core]
[68998.692293]  device_release+0x3b/0xa0
[68998.692295]  kobject_cleanup+0x41/0x140
[68998.692297]  kobject_put+0x53/0x70
[68998.692298]  put_device+0x13/0x20
[68998.692299]  ib_dealloc_device+0x87/0xc0 [ib_core]
[68998.692309]  efa_remove_device+0xb5/0xd0 [efa]
[68998.692312]  efa_probe+0x536/0x8b0 [efa]
[68998.692316]  ? _raw_spin_unlock_irqrestore+0xe/0x30
[68998.692318]  local_pci_probe+0x4b/0x90
[68998.692319]  work_for_cpu_fn+0x1a/0x30
[68998.692321]  process_one_work+0x22b/0x3d0
[68998.692323]  worker_thread+0x223/0x410
[68998.692324]  ? process_one_work+0x3d0/0x3d0
[68998.692326]  kthread+0x12a/0x150
[68998.692327]  ? set_kthread_struct+0x50/0x50
[68998.692329]  ret_from_fork+0x22/0x30
[68998.692331]  </TASK>
[68998.692331] ================================================================================
[68998.694864] BUG: unable to handle page fault for address: 0000000000031be0
[68998.696945] #PF: supervisor write access in kernel mode
[68998.698576] #PF: error_code(0x0002) - not-present page
[68998.700168] PGD 14eb3c067 P4D 14eb3c067 PUD 146a63067 PMD 0 
[68998.701905] Oops: 0002 [#1] SMP NOPTI
[68998.703086] CPU: 0 PID: 2150 Comm: kworker/0:6 Tainted: G        W  OE     5.15.0-2000-aws #2000
[68998.705760] Hardware name: Amazon EC2 p5.48xlarge/, BIOS 1.0 10/16/2017
[68998.707778] Workqueue: events work_for_cpu_fn
[68998.709129] RIP: 0010:__pv_queued_spin_lock_slowpath+0x1bd/0x2e0
[68998.710990] Code: 05 4d 63 f6 49 81 c5 c0 1b 03 00 49 81 fe ff 1f 00 00 0f 87 19 01 00 00 4e 03 2c f5 c0 6a 2e 98 41 bf 01 00 00 00 4c 8d 73 14 <49> 89 5d 00 b8 00 80 00 00 eb 14 84 c0 75 09 41 0f b6 55 14 84 d2
[68998.720187] RSP: 0018:ffffb217afff3c10 EFLAGS: 00010002
[68998.722996] RAX: ffff9dafc0153100 RBX: ffff9eaffa631bc0 RCX: 0000000000000027
[68998.726388] RDX: 0000000000000000 RSI: 0000000000000001 RDI: ffff9eaffa620980
[68998.729785] RBP: ffffb217afff3c48 R08: 0000000000000003 R09: 000000000000000e
[68998.733207] R10: 000000000000000a R11: 3d3d3d3d3d3d3d3d R12: ffff9db5ce1d4b28
[68998.736627] R13: 0000000000031be0 R14: ffff9eaffa631bd4 R15: 0000000000000001
[68998.740031] FS:  0000000000000000(0000) GS:ffff9eaffa600000(0000) knlGS:0000000000000000
[68998.744939] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[68998.747940] CR2: 0000000000031be0 CR3: 000000014658e005 CR4: 00000000003706f0
[68998.751328] Call Trace:
[68998.753353]  <TASK>
[68998.755307]  _raw_spin_lock_irqsave+0x39/0x50
[68998.757911]  xa_destroy+0x53/0x120
[68998.760245]  ib_device_release+0x75/0xa0 [ib_core]
[68998.762961]  device_release+0x3b/0xa0
[68998.765360]  kobject_cleanup+0x41/0x140
[68998.767799]  kobject_put+0x53/0x70
[68998.770104]  put_device+0x13/0x20
[68998.772389]  ib_dealloc_device+0x87/0xc0 [ib_core]
[68998.775113]  efa_remove_device+0xb5/0xd0 [efa]
[68998.777724]  efa_probe+0x536/0x8b0 [efa]
[68998.780216]  ? _raw_spin_unlock_irqrestore+0xe/0x30
[68998.782950]  local_pci_probe+0x4b/0x90
[68998.785387]  work_for_cpu_fn+0x1a/0x30
[68998.787816]  process_one_work+0x22b/0x3d0
[68998.790303]  worker_thread+0x223/0x410
[68998.792741]  ? process_one_work+0x3d0/0x3d0
[68998.795279]  kthread+0x12a/0x150
[68998.797584]  ? set_kthread_struct+0x50/0x50
[68998.800133]  ret_from_fork+0x22/0x30
[68998.802487]  </TASK>
[68998.804477] Modules linked in: efa(OE+) nvidia_fs(OE) sunrpc rdma_ucm(OE) ib_ipoib(OE) ib_umad(OE) mlx5_ib(OE) mlx5_core(OE) pci_hyperv_intf mlxdevm(OE) tls mlxfw(OE) psample sch_fq_codel nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 ppdev nvme_rdma(OE) binfmt_misc rdma_cm(OE) nls_iso8859_1 iw_cm(OE) input_leds ib_cm(OE) serio_raw parport_pc parport nvidia_uvm(OE) nvme_fabrics(OE) ib_uverbs(OE) ib_core(OE) dm_multipath scsi_dh_rdac scsi_dh_emc scsi_dh_alua efi_pstore ip_tables x_tables autofs4 btrfs blake2b_generic zstd_compress raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx xor raid6_pq libcrc32c raid1 raid0 multipath linear nvidia_drm(OE) nvidia_modeset(OE) nvidia(OE) drm_kms_helper syscopyarea crct10dif_pclmul sysfillrect crc32_pclmul sysimgblt ghash_clmulni_intel aesni_intel crypto_simd cryptd fb_sys_fops nvme(OE) cec psmouse rc_core nvme_core(OE) drm ena mlx_compat(OE)
[68998.842535] CR2: 0000000000031be0
[68998.844833] ---[ end trace d74f9cbc22243b8d ]---
[68998.847507] RIP: 0010:__pv_queued_spin_lock_slowpath+0x1bd/0x2e0
[68998.850584] Code: 05 4d 63 f6 49 81 c5 c0 1b 03 00 49 81 fe ff 1f 00 00 0f 87 19 01 00 00 4e 03 2c f5 c0 6a 2e 98 41 bf 01 00 00 00 4c 8d 73 14 <49> 89 5d 00 b8 00 80 00 00 eb 14 84 c0 75 09 41 0f b6 55 14 84 d2
[68998.859835] RSP: 0018:ffffb217afff3c10 EFLAGS: 00010002
[68998.862663] RAX: ffff9dafc0153100 RBX: ffff9eaffa631bc0 RCX: 0000000000000027
[68998.866083] RDX: 0000000000000000 RSI: 0000000000000001 RDI: ffff9eaffa620980
[68998.869494] RBP: ffffb217afff3c48 R08: 0000000000000003 R09: 000000000000000e
[68998.872914] R10: 000000000000000a R11: 3d3d3d3d3d3d3d3d R12: ffff9db5ce1d4b28
[68998.876320] R13: 0000000000031be0 R14: ffff9eaffa631bd4 R15: 0000000000000001
[68998.879703] FS:  0000000000000000(0000) GS:ffff9eaffa600000(0000) knlGS:0000000000000000
[68998.884629] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[68998.887633] CR2: 0000000000031be0 CR3: 000000014658e005 CR4: 00000000003706f0

The reason why we are doing these weird culprits is because we want GPUDirect in nvme working together with EFA. Right now, we have to choose one of the two because of the described crash.

Reproduction steps

1. Install MLNX OFED dkms
2. Insert `KBUILD_EXTRA_SYMBOLS := /usr/src/ofa_kernel/x86_64/5.15.0-*-aws/Module.symvers` into `/usr/src/efa-2.6.0/src/Kbuild.in`
3. Install EFA dkms
4. `insmod efa`

Expected Behavior

efa inserts along with existing ib_core, ib_uverbs, etc. from Mellanox.

Actual Behavior

insmod hangs.

Additional Data

1. Region = us-east-2
2. Instance type = p5.48xlarge

Relevant log output

No response

Contact Details

[email protected]

@vmarkovtsev vmarkovtsev added bug Report errors or unexpected behavior triage Determine the priority and severity labels Jul 5, 2024
@vmarkovtsev
Copy link
Author

vmarkovtsev commented Jul 5, 2024

I made it work with the following changes in EFA dkms. Please let me know how I can contribute these changes.

diff -ruN efa-2.6.0/config/efa.cmake efa-2.6.0/config/efa.cmake
--- efa-2.6.0/config/efa.cmake	2024-07-05 21:41:00.045808694 +0200
+++ efa-2.6.0/config/efa.cmake	2024-07-05 21:31:20.625037540 +0200
@@ -11,13 +11,15 @@
   set(tmp_dir ${tmp_dir} PARENT_SCOPE)
   configure_file(${CMAKE_SOURCE_DIR}/config/main.c.in ${tmp_dir}/main.c @ONLY)
   configure_file(${CMAKE_SOURCE_DIR}/config/Makefile ${tmp_dir} COPYONLY)
+  configure_file(${CMAKE_SOURCE_DIR}/config/kbuild.mk ${tmp_dir} COPYONLY)
 endfunction()
 
 function(try_compile_prog_test)
   set_conf_tmp_dir("" "")
   execute_process(COMMAND make -C ${tmp_dir} KERNEL_DIR=${KERNEL_DIR}
     WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-    OUTPUT_QUIET ERROR_QUIET
+    #OUTPUT_QUIET
+    #ERROR_QUIET
     RESULT_VARIABLE res)
   if(res)
     message(FATAL_ERROR "Conftest failure, kernel headers missing?")
diff -ruN efa-2.6.0/config/kbuild.mk efa-2.6.0/config/kbuild.mk
--- efa-2.6.0/config/kbuild.mk	1970-01-01 01:00:00.000000000 +0100
+++ efa-2.6.0/config/kbuild.mk	2024-07-05 21:31:20.005066674 +0200
@@ -0,0 +1,27 @@
+KVER ?= $(shell uname -r)
+MLNX_ARCH = $(shell uname -m)
+OFA_DIR ?= /usr/src/ofa_kernel/$(MLNX_ARCH)
+OFA := $(shell ( test -d $(OFA_DIR)/$(KVER) && echo $(OFA_DIR)/$(KVER) ) || ( test -d /var/lib/dkms/mlnx-ofed-kernel/ && ls -d /var/lib/dkms/mlnx-ofed-kernel/*/build ) || ( echo $(OFA_DIR) ))
+K_BUILD ?= /lib/modules/$(KVER)/build
+KERNEL_DIR ?= /lib/modules/$(KVER)/build
+KBUILD_EXTRA_SYMBOLS := $(OFA)/Module.symvers
+autoconf_h=$(shell /bin/ls -1 $(K_BUILD)/include/*/autoconf.h 2> /dev/null | head -1)
+kconfig_h=$(shell /bin/ls -1 $(K_BUILD)/include/*/kconfig.h 2> /dev/null | head -1)
+
+LINUXINCLUDE := \
+-include $(kconfig_h) \
+-include $(OFA)/include/linux/compat-2.6.h \
+-I$(PWD) \
+-I$(OFA)/include \
+-I$(OFA)/include/uapi \
+-I$$(srctree)/arch/$$(SRCARCH)/include \
+-Iarch/$$(SRCARCH)/include/generated \
+-Iinclude \
+-I$$(srctree)/arch/$$(SRCARCH)/include/uapi \
+-Iarch/$$(SRCARCH)/include/generated/uapi \
+-I$$(srctree)/include \
+-I$$(srctree)/include/uapi \
+-Iinclude/generated/uapi \
+$$(if $$(KBUILD_SRC),-Iinclude2 -I$$(srctree)/include) \
+-I$$(srctree)/arch/$$(SRCARCH)/include \
+-Iarch/$$(SRCARCH)/include/generated
diff -ruN efa-2.6.0/config/Makefile efa-2.6.0/config/Makefile
--- efa-2.6.0/config/Makefile	2024-07-05 21:40:59.769821663 +0200
+++ efa-2.6.0/config/Makefile	2024-07-05 21:31:20.321051825 +0200
@@ -7,7 +7,8 @@
 obj-m += $(DRIVER_NAME).o
 $(DRIVER_NAME)-objs := main.o
 
-KERNEL_DIR ?= /lib/modules/$(shell uname -r)/build
+obj ?= .
+include $(obj)/kbuild.mk
 
 modules:
-	$(MAKE) -C $(KERNEL_DIR) M=$(CURDIR) modules
+	$(MAKE) -C $(KERNEL_DIR) M=$(CURDIR) V=1 LINUXINCLUDE='$(LINUXINCLUDE)' modules
diff -ruN efa-2.6.0/dkms.conf efa-2.6.0/dkms.conf
--- efa-2.6.0/dkms.conf	2024-07-05 21:41:10.201331451 +0200
+++ efa-2.6.0/dkms.conf	2024-07-05 21:31:31.188541134 +0200
@@ -3,7 +3,7 @@
 CLEAN="cd build; make modules_clean; make clean"
 PRE_BUILD="./configure-dkms.sh $kernelver $source_tree"
 # Quoted 'make' to suppress DKMS append of KERNELRELEASE
-MAKE="cd build; 'make'"
+MAKE="cd build; make VERBOSE=1"
 BUILT_MODULE_NAME[0]="efa"
 BUILT_MODULE_LOCATION="build/src/"
 DEST_MODULE_LOCATION="/extra"
diff -ruN efa-2.6.0/src/build.mk efa-2.6.0/src/build.mk
--- efa-2.6.0/src/build.mk	1970-01-01 01:00:00.000000000 +0100
+++ efa-2.6.0/src/build.mk	2024-07-05 21:31:23.816887549 +0200
@@ -0,0 +1,4 @@
+include $(M)/kbuild.mk
+
+modules:
+	$(MAKE) -C $(KERNEL_DIR) M=$(M) V=1 LINUXINCLUDE='$(LINUXINCLUDE)' modules
diff -ruN efa-2.6.0/src/CMakeLists.txt efa-2.6.0/src/CMakeLists.txt
--- efa-2.6.0/src/CMakeLists.txt	2024-07-05 21:41:04.721588963 +0200
+++ efa-2.6.0/src/CMakeLists.txt	2024-07-05 21:31:25.680799959 +0200
@@ -13,6 +13,8 @@
 
 string(REPLACE ";" " " efa_sources_string "${efa_sources}")
 configure_file(Kbuild.in Kbuild @ONLY)
+configure_file(build.mk build.mk COPYONLY)
+configure_file(../config/kbuild.mk kbuild.mk COPYONLY)
 
 foreach(src ${efa_sources})
   configure_file(${src} ${src} COPYONLY)
@@ -25,14 +27,14 @@
   message("-- Peer-to-peer memory enabled")
 endif()
 
-set(module_cmd make -C ${KERNEL_DIR} M=${CMAKE_CURRENT_BINARY_DIR})
+set(module_cmd make -C ${CMAKE_CURRENT_BINARY_DIR} -f build.mk M=${CMAKE_CURRENT_BINARY_DIR})
 if(GCOV_PROFILE)
   set(module_cmd ${module_cmd} GCOV_PROFILE=y)
 endif()
 add_custom_command(OUTPUT efa.ko
   COMMAND ${module_cmd} modules
   WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-  DEPENDS ${efa_sources} ${CMAKE_CURRENT_BINARY_DIR}/Kbuild ${CMAKE_CURRENT_BINARY_DIR}/config.h
+  DEPENDS ${efa_sources} ${CMAKE_CURRENT_BINARY_DIR}/Kbuild build.mk ${CMAKE_CURRENT_BINARY_DIR}/config.h ../config/kbuild.mk
   VERBATIM)
 
 add_custom_target(modules ALL DEPENDS efa.ko)
diff -ruN efa-2.6.0/src/Kbuild.in efa-2.6.0/src/Kbuild.in
--- efa-2.6.0/src/Kbuild.in	2024-07-05 21:41:01.813725613 +0200
+++ efa-2.6.0/src/Kbuild.in	2024-07-05 21:31:22.364955777 +0200
@@ -1,2 +1,4 @@
+include $(obj)/kbuild.mk
+KBUILD_EXTRA_SYMBOLS := $(OFA)/Module.symvers
 obj-m := efa.o
 efa-y := $(patsubst %.c,%.o, $(filter %.c, @efa_sources_string@))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Report errors or unexpected behavior Linux EFA driver triage Determine the priority and severity
Projects
None yet
Development

No branches or pull requests

2 participants