kohler / click

The Click modular router: fast modular packet processing and analysis
Other
735 stars 322 forks source link

Cannot initialize DPDK port 0 with 1 RX and 1 TX queues #444

Open antonywei opened 4 years ago

antonywei commented 4 years ago

Hi, We configured a simple DPDK instance with click(a tunnel), But we came across some issues.It seems that the error only appeared in click with dpdk, but not in fastclick. Does anyone have any idea about what is wrong?

DPDK_NF_simple.click:8: While initializing ‘nicIn0 :: FromDPDKDevice’: Cannot initialize DPDK port 0 with 1 RX and 1 TX queues

define(
        $iface0 0,
        $iface1 1,
        $queueSize 1024,
        $burst 32
)

nicIn0 :: FromDPDKDevice(0000:01:00.2, BURST $burst, PROMISC true);

nicOut0 :: ToDPDKDevice(0000:01:00.2, IQUEUE $queueSize, BURST $burst);

nicIn1 :: FromDPDKDevice(0000:01:00.3, BURST $burst,PROMISC true);
nicOut1 :: ToDPDKDevice(0000:01:00.3, BURST $burst);

nicIn1 -> Print("got packet")->nicOut0;
nicIn0 ->Print("got packet")-> nicOut1;
tbarbette commented 4 years ago

Oops sorry I missed your issue. The implementation of the DPDK elements in mainline Click is much less-featured, which explains a difference between the two.

Which DPDK version? Is that the same error? Which NIC? Some default parameters are probably invalid.

woma1040 commented 4 years ago

Hi, i had the same error using DPDK 19.11.3 (LTS) and NIC: Intel Corporation I210 Gigabit Network Connection (rev 03), with the additional information, that the rss_hs is invalid. Comparing the dpdkdevice.cc of click and fast click, i noticed that fastclick uses an additional calculationstep for rss_hs:

calculation in click:

dev_conf.rx_adv_conf.rss_conf.rss_hf = ETH_RSS_IP | ETH_RSS_UDP | ETH_RSS_TCP; calculation in fastclick: dev_conf.rx_adv_conf.rss_conf.rss_hf = ETH_RSS_IP | ETH_RSS_UDP | ETH_RSS_TCP; dev_conf.rx_adv_conf.rss_conf.rss_hf &= dev_info.flow_type_rss_offloads;

Adding the additional line to click solved the problem for me. Hope this might help

tbarbette commented 4 years ago

Ho @woma1029 can you provide a patch/pull request?

Thanks!