Skip to content

DPDK link issue #31

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

Closed
leeopop opened this issue Jun 4, 2020 · 5 comments
Closed

DPDK link issue #31

leeopop opened this issue Jun 4, 2020 · 5 comments

Comments

@leeopop
Copy link
Contributor

leeopop commented Jun 4, 2020

그동안 RUSTFLAGS를 써서 큰 문제가 없었습니다만 http://mails.dpdk.org/archives/users/2017-June/002032.html 와 같은 이유로 네트워크 드라이버 뿐만 아니라 pool 드라이버도 골라야 하는 상태입니다.
이와 관련해서 저는 해결책으로

  1. cargo 에 어떻게든 whole-archive 옵션 추가
  2. DPDK를 shared lib으로 만들고 dynamic load 수행 (netbricks 방법)

정도를 생각하고 있습니다..
다른 드라이버처럼 mempool 에 있는 symbol을 명시적으로 링크 하는 방법은 mempool에는 외부 symbol이 하나도 없어서 불가능합니다..

@jeehoonkang
Copy link
Contributor

  • 둘중에 노력이 덜 드는게 뭘지 판단해주시면 감사하겠습니다.
  • mempool 안쓰고 custom memory allocator를 쓰는 방법이 있을지 궁금합니다. 일단 그렇게 해도 되지 않을까 해서요.

@leeopop
Copy link
Contributor Author

leeopop commented Jun 5, 2020

처음 제가 제안드린 2가지 방법 이외에 교수님께서 제안해주신 방법대로 custom memory allocator를 생각해보겠습니다.

일단은 현재 dpdk의 pool 코드를 그대로 복사해서 c binding 코드에 넣는 방안을 생각하고 있습니다.

@leeopop
Copy link
Contributor Author

leeopop commented Jun 8, 2020

코드 복붙해서 해결하는 방안으로 시도중 (static linking 유지)

@leeopop
Copy link
Contributor Author

leeopop commented Jun 10, 2020

여러 시도 결과 정리

  1. mempool driver는 static def 만을 가지고 있기 때문에 외부에서 명시적으로 참조가 불가능
  2. 그렇다면 소스 코드를 자동 생성된 static.c (build.rs 가 만드는거) 에 그대로 복붙을 하는 방법이 가능한데
  3. DPDK 를 설치할 때 빌드된 라이브러리만 복사되고 소스 코드는 설치되지 않음. 따라서 이를 해결하려면 매우 편법적인 방법 (DPDK를 install 하지 못하고 build만 한 채로 소스 코드 그대로 받아야 하는 등) 을 써야만 함.
  4. 따라서 자동으로 소스를 포함시키는 방법은 지금 방법보다 딱히 더 라이브러리를 좋게 만들지 않음.
  5. 또한 Jenkins 에서 sudo 를 가지고 DPDK를 실행하는 방법은 아직 권장되지 않는 듯 함.

@leeopop
Copy link
Contributor Author

leeopop commented May 10, 2023

Resolved by rust-lang/cargo#7586

@leeopop leeopop closed this as completed May 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants