{"action":"created","issue":{"url":"https://api.github.com/repos/kohler/click/issues/227","labels_url":"https://api.github.com/repos/kohler/click/issues/227/labels{/name}","comments_url":"https://api.github.com/repos/kohler/click/issues/227/comments","events_url":"https://api.github.com/repos/kohler/click/issues/227/events","html_url":"https://github.com/kohler/click/issues/227","id":124624266,"number":227,"title":"Parallel Implementation with DPDK ","user":{"login":"muradkablan","id":11242924,"avatar_url":"https://avatars.githubusercontent.com/u/11242924?v=3","gravatar_id":"","url":"https://api.github.com/users/muradkablan","html_url":"https://github.com/muradkablan","followers_url":"https://api.github.com/users/muradkablan/followers","following_url":"https://api.github.com/users/muradkablan/following{/other_user}","gists_url":"https://api.github.com/users/muradkablan/gists{/gist_id}","starred_url":"https://api.github.com/users/muradkablan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/muradkablan/subscriptions","organizations_url":"https://api.github.com/users/muradkablan/orgs","repos_url":"https://api.github.com/users/muradkablan/repos","events_url":"https://api.github.com/users/muradkablan/events{/privacy}","received_events_url":"https://api.github.com/users/muradkablan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-03T02:39:51Z","updated_at":"2016-01-04T08:09:40Z","closed_at":null,"body":"Hi, \r\nI am using Click userlevel with DPDK. I created a push element (I call it pushreadblockc) that performs some packet processing. The element is fairly simple and it contains run_task function to check if the processing of the packet is done or not. \r\n\r\nI tried to optimize my router performance by adding a classifier that spread the traffic among running multiple of pushreadblockc elements so they can run in parallel, but the performance became worse and the throughput degraded. \r\n\r\nMy questions are:\r\n1- Is my below configuration proper? \r\n2- Could the run_task function in my pushreadblockc element cause this issue? If so what should I do?\r\n3- I thought of multi-threading, but I don't know how to add -t argument to my running of Click command with all DPDK stuff. And even so, will multi threading help me get a better performance?\r\n\r\nThis is how I run Click with DPDK:\r\n$ build/bin/click -c 2 --pci-whitelist 0000:82:10.0 --file-prefix pg1  conf/test-multi-nonBlock-dpdk.click\r\n\r\nThanks.\r\nMurad\r\n......................................\r\n\r\nfd :: FromDPDKDevice(0);\r\ntd :: ToDPDKDevice(0); //Discard;\r\n\r\nAddressInfo(\r\n  intern        10.15.0.1       10.15.0.0/24    90:e2:ba:84:4e:a6\r\n);\r\n\r\nintern_arp_class :: Classifier(12/0806 20/0001, 12/0806 20/0002, 12/0800, -);\r\n\r\nfd -> intern_arp_class;\r\n\r\nintern_arp_class[0] -> ARPResponder(intern) -> Discard;    // ARP queries\r\nintern_arp_class[1] -> Discard;\r\nintern_arp_class[3] -> Discard;\r\n\r\nintern_arp_class[2] -> Strip(14)\r\n        -> CheckIPHeader\r\n        -> EtherEncap(0x0800, 02:09:c0:b7:a2:de, 90:e2:ba:84:46:20)\r\n        -> port_classifier :: IPClassifier(dst port 1234, dst port 1235, -); \r\n          port_classifier[0] -> Queue(100000) -> Unqueue -> PushReadBlock -> td;\r\n          port_classifier[1] -> Queue(100000) -> Unqueue -> PushReadBlock -> td;\r\n          port_classifier[2] -> Discard;\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/kohler/click/issues/comments/168607224","html_url":"https://github.com/kohler/click/issues/227#issuecomment-168607224","issue_url":"https://api.github.com/repos/kohler/click/issues/227","id":168607224,"user":{"login":"bcronje","id":462097,"avatar_url":"https://avatars.githubusercontent.com/u/462097?v=3","gravatar_id":"","url":"https://api.github.com/users/bcronje","html_url":"https://github.com/bcronje","followers_url":"https://api.github.com/users/bcronje/followers","following_url":"https://api.github.com/users/bcronje/following{/other_user}","gists_url":"https://api.github.com/users/bcronje/gists{/gist_id}","starred_url":"https://api.github.com/users/bcronje/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcronje/subscriptions","organizations_url":"https://api.github.com/users/bcronje/orgs","repos_url":"https://api.github.com/users/bcronje/repos","events_url":"https://api.github.com/users/bcronje/events{/privacy}","received_events_url":"https://api.github.com/users/bcronje/received_events","type":"User","site_admin":false},"created_at":"2016-01-04T08:09:40Z","updated_at":"2016-01-04T08:09:40Z","body":"I dont quite understand what you are trying to accomplish with PushReadBlock. Can you explain this a bit more? Or ideally post your main element code. So far with the limited information supplied is does not sound like a task is what you need.\r\n\r\nI havent experimented with multithreading and FromDPDKDevice yet, but I can tell you to use Click with multithreading you need to either use StaticThreadSched http://read.cs.ucla.edu/click/elements/staticthreadsched or BalancedThreadSched http://read.cs.ucla.edu/click/elements/balancedthreadsched to tell Click which element tasks should be scheduled on which thread.\r\n\r\nAs an example, change to the following:\r\n\r\n    port_classifier[0] -> Queue(100000) -> uq1::Unqueue -> PushReadBlock -> td;\r\n    port_classifier[1] -> Queue(100000) -> uq2::Unqueue -> PushReadBlock -> td;\r\n    StaticThreadSched(fd 0, uq1 1, uq2 2);\r\n\r\nThis will tell Click to schedule fd on thread 0, uq1 on thread 1 and uq2 on thread 2. And start Click with at least 3 threads.\r\n"}}