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

Can here provide the API of rte_ring_lookup ? #665

Open
ChenYahui2019 opened this issue Nov 14, 2019 · 14 comments
Open

Can here provide the API of rte_ring_lookup ? #665

ChenYahui2019 opened this issue Nov 14, 2019 · 14 comments

Comments

@ChenYahui2019
Copy link

Currently, rte_ring_create has been provided. But what our project need is rte_ring_lookup getting existed ring.

@aregm
Copy link
Owner

aregm commented Nov 14, 2019

@ChenYahui2019 If you mean, that you already have DPDK process that set up the rings and now you want to reuse those rings within the NFF-Go process, then currently such functionality is unavailable. Can you please elaborate on the use-case why do you need to reuse instead of doing it inside NFF-Go app?

@ChenYahui2019
Copy link
Author

ChenYahui2019 commented Nov 15, 2019

@aregm Thx. This is my scenario:
I add a dpdkring port in ovs-dpdk using cmd
ovs-vsctl add-port dpdk-br0 dpdkr0 -- set interface dpdkr0 typ=dpdkr and configure a mirror policy mirroring all the ovs-dpdk traffic to dpkr0.
Then I launch another pmd with parameter --proc-type=secondary to capture packet from dpdkr0 which will lookup dpdkr0 ring.

@ChenYahui2019
Copy link
Author

I have wrote this API, but I can not make PR for step 5 below fail with "remote: Repository not found".

  1. Open a terminal
  2. mkdir -p ~/go-fork/src/github.com/intel-go (replacing go-fork with your preferred location)
  3. export GOPATH=~/go-fork
  4. cd $GOPATH/src/github.com/intel-go/nff-go
  5. git clone https://github.com/GITHUB-USERNAME/nff-go.git (replace GITHUB-USERNAME with your username)
  6. cd nff-go
  7. go install ./...

@leoluk
Copy link

leoluk commented Nov 21, 2019

@ChenYahui2019 Did you fork the nff-go repository?

@ChenYahui2019
Copy link
Author

@leoluk How to fork? Git do not have sub-commad fork.

@leoluk
Copy link

leoluk commented Nov 28, 2019

It's a feature specific to GitHub

@ChenYahui2019
Copy link
Author

@leoluk Thx a lot. I made a PR successfully just now.

@ChenYahui2019
Copy link
Author

ChenYahui2019 commented Dec 6, 2019

@leoluk Thx a lot. I made a PR successfully just now.
#672

@ChenYahui2019
Copy link
Author

ChenYahui2019 commented Dec 11, 2019

May I ask when will this commit to master?

@gshimansky
Copy link
Contributor

Hello @ChenYahui2019
I merged all develop changes into master and published new release 0.9.2 with them.

@ChenYahui2019
Copy link
Author

@gshimansky Thank for your response. I have another question, for my scenario I just want to use DPDK's API with golang version such as DequeueBurst EnqueueBurst, could we change file directory internal/low to low or using linkname to export internal API? If this ok, I would make a PR.

@gshimansky
Copy link
Contributor

Low used to be on the upper level but was moved into internal in #592. I don't think that we need to expose low level functions because they aren't meant to be used by user programs. Can you explain how you intend to use them? You can always write your own package inside of nff-go framework or modify for your needs existing code which uses low API.

@ChenYahui2019
Copy link
Author

Here my scene below:
#665 (comment)

@aregm
Copy link
Owner

aregm commented Dec 13, 2019

@ChenYahui2019 the idea of NFF-Go was to hide all the complexity with dealing with low-level hardware and provide abstractions, where you can focus on the packet processing logic itself. Exposing all that as an API is going against that concept. Feel free to expose them in your project from internals. We do not expose rings directly as they are controlled by the scheduler, and interfering with it from the lower level will break the logic.

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

4 participants