govpp icon indicating copy to clipboard operation
govpp copied to clipboard

Memif connect fails on arm setup

Open nikhil-agarwal-git opened this issue 10 months ago • 5 comments

Description Memif fails to initialize when testing on Arm arch setup.

How to reproduce Bringup setup on Arm platform

Expected Behavior

Screenshots/Logs "errors.errorString=initializeRegions: memfdCreate: memfd_create: function not implemented"

Environment (please complete the following information)

Info Example Value
OS/arch linux/arm64
VPP version v24.02-release
GoVPP version v0.9.0

RCA: while creating memfd (memfdCreate()), syscall is called with trap 319 which is not valid when called from arm arch. 279 is a valid value to be used for arm setup. To have a generic solution for all platforms, following call is more suitable which internally calls platform specific values instead of existing memfdCreate().

Proposed Fix:

  • r.fd, err = unix.MemfdCreate("memif_region_0", mfd_allow_sealing)

nikhil-agarwal-git avatar Apr 03 '25 08:04 nikhil-agarwal-git

Is this reproducible with the latest VPP and goVPP releases? Of note:

  • VPP 24.02 is no longer supported by the VPP community
  • goVPP 0.12.0 is in process and should be released in the next few days

dwallacelf avatar Apr 03 '25 14:04 dwallacelf

Hi,

Yes, issue is with latest govpp as well. I havn't tested with latest vpp + govpp versions, but I believe issue would be there as well since issue is local to govpp.

Attached is the proposed fix.

memif_fix.patch

nikhil-agarwal-git avatar Apr 07 '25 06:04 nikhil-agarwal-git

Hi @nikhil-agarwal-git Thanks for spotting the issue and suggesting a fix. I am not sure if anyone has tried it on the ARM platform before. Does everything work correctly on your end after applying the fix?

mohsinkazmi avatar Apr 17 '25 16:04 mohsinkazmi

Hi @mohsinkazmi , after this memif connection is successful. There is another issue because of which rx/tx is not happening. Issue seems to be at vpp memif plugin side since it is considering 128bit cacheline size for all memif data structures for arm platforms. With the fix of both these issues, memif works fine. I am attaching patch of vpp memif-plugin as well here for reference.

vpp-memif-plugin-fix.patch .patch

nikhil-agarwal-git avatar Apr 23 '25 06:04 nikhil-agarwal-git

@nikhil-agarwal-git Thanks for reporting the second issue. The gomemif is computing the wrong cache-line size for memif on ARM based platforms. I will devise the fix which looks like something following: https://github.com/FDio/vpp/blob/2c4a000e36a58276c62e63aa6a4147e4e43875cc/extras/libmemif/CMakeLists.txt#L68

mohsinkazmi avatar Apr 24 '25 15:04 mohsinkazmi