kohler / click

The Click modular router: fast modular packet processing and analysis
Other
743 stars 321 forks source link

Run multiple instanse of click with same DPDK #491

Closed ali64mohammad closed 3 years ago

ali64mohammad commented 3 years ago

Hi I want to run multiple click instances with dpdk, But the problem is when i run first click with --dpdk it will start a dpdk and if i start second click instance this error shows up because it can't run two dpdk, that is correct.

EAL: Detected 4 lcore(s)
EAL: Detected 1 NUMA nodes
EAL: Cannot create lock on '/var/run/dpdk/rte/config'. Is another primary process running?
EAL: FATAL: Cannot init config
EAL: Cannot init config
EAL: Error - exiting with code: 1
  Cause: Click was built with Intel DPDK support but there was an
          error parsing the EAL arguments.

is there any way to start multiple clicks with same dpdk? also when i run dpdk by my self and run clicks without --dpdk, when i use fromDPDK these error shows up: ./test2.click:7: While configuring ‘enb :: FromDPDKDevice’: 0 : Unknown or invalid PORT ./test2.click:9: While configuring ‘outenb :: ToDPDKDevice’: 0 : Unknown or invalid PORT

any idea how to separate dpdk and still use dpdk elements? thanks a lot.

tbarbette commented 3 years ago

Hi!

This is normal and related to DPDK, please see https://doc.dpdk.org/guides/prog_guide/multi_proc_support.html .

I'm not sure (this repository) mainline Click is compatible with secondary process, as opposed to FastClick that supports also DPDK rings. But you can have independent Click running with the file prefix.

If you run Click without --dpdk, you won't be able to use DPDK so the second part of error messages is expected.

Cheers, Tom

ali64mohammad commented 3 years ago

I don't want to Run several DPDK. I want to run one Dpdk Process with several click processes. I think multi_proc_support is for two dpdk processes. (?) I want to run one DPDK and for example, run 10 click process based on it. fast click can support it?

tbarbette commented 3 years ago

DPDK is a library, there are no such things as "DPDK processes", there are DPDK applications, like Click and FastClick that uses DPDK.

You can run 10 instances of Click that all use DPDK. If they're independent (with --file-prefix), you must use different devices in all application. It makes sense with virtual functions/virtualisation for instance. If they're part of the same logic, then you can run one as primary, and all the others as secondary. Then communicate between the processes with DPDK rings. FastClick supports that (not Click).