> On 25 Nov 2015, at 18:44, Murali Kandula <[email protected]> wrote: > > Hi Alfredo, > > Thanks for your quick response. I have another question instead of > distributing the packets like round robin basis, if we want to distribute > packets to the threads based on the tuple information; do we need to set " > pfring_set_cluster(thread[id]->pd, 55, cluster_per_flow" ?.
Yes > > Also how to verify if the packets are distributed based on cluster_per_flow? Send some flows and print packets per thread :-) Alfredo > > Thanks > Krish > > On Wed, Nov 25, 2015 at 12:37 PM, Alfredo Cardigliano <[email protected] > <mailto:[email protected]>> wrote: > Hi Krish > correct, as you are doing, you should set the same cluster id for all the > sockets in order to get the traffic load balanced across threads. > > Alfredo > > > On 25 Nov 2015, at 18:32, Murali Kandula <[email protected] > > <mailto:[email protected]>> wrote: > > > > Hello, > > > > I am trying to use the pfring and implement the pf_ring socket cluster. In > > order to achieve this do I need use pfring_open and pfring_set_cluster for > > each thread?. > > > > > > Here is how I am trying to achieve it. > > > > every thread will have it's own pfring pointer and in each thread > > > > if((thread[id]->pd = pfring_open(device, promisc, snaplen, 0)) == NULL) > > { > > printf("pfring_open error\n"); > > return(-1); > > } > > > > int rc = pfring_set_cluster(thread[id]->pd, 55); > > printf("pfring_set_cluster returned %d\n", rc); > > > > pfring_enabkle_ring(thread[id]->pd); > > > > while(1) { > > if(shutdown) { > > break; > > } > > > > if(ret_val = pfring_recv(thread[id]->pd, &pkt_data, 0, &pkt_hdr,0)) > 0 { > > //process packet > > } > > > > } > > > > can you please let me know the above implementation will achieve the > > pf_ring socket cluster mode ?. > > > > Thanks > > Krish > > _______________________________________________ > > Ntop-misc mailing list > > [email protected] <mailto:[email protected]> > > http://listgateway.unipi.it/mailman/listinfo/ntop-misc > > <http://listgateway.unipi.it/mailman/listinfo/ntop-misc> > > _______________________________________________ > Ntop-misc mailing list > [email protected] <mailto:[email protected]> > http://listgateway.unipi.it/mailman/listinfo/ntop-misc > <http://listgateway.unipi.it/mailman/listinfo/ntop-misc> > > _______________________________________________ > Ntop-misc mailing list > [email protected] > http://listgateway.unipi.it/mailman/listinfo/ntop-misc
_______________________________________________ Ntop-misc mailing list [email protected] http://listgateway.unipi.it/mailman/listinfo/ntop-misc
