MCPcopy Create free account
hub / github.com/NetSys/bess / sn_set_default_queue_mapping

Function sn_set_default_queue_mapping

core/kmod/sn_netdev.c:715–743  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

713}
714
715static void sn_set_default_queue_mapping(struct sn_device *dev)
716{
717 int cpu;
718 int rxq;
719
720 for_each_possible_cpu(cpu) {
721 dev->cpu_to_txq[cpu] = 0;
722 dev->cpu_to_rxqs[cpu][0] = -1;
723 }
724
725 for_each_online_cpu(cpu) {
726 dev->cpu_to_txq[cpu] = cpu % dev->num_txq;
727 }
728
729 for (rxq = 0; rxq < dev->num_rxq; rxq++) {
730 for_each_online_cpu(cpu) {
731 int cnt;
732 for (cnt = 0; dev->cpu_to_rxqs[cpu][cnt] != -1; cnt++)
733 /* do nothing */ ;
734
735 dev->cpu_to_rxqs[cpu][cnt] = rxq;
736 dev->cpu_to_rxqs[cpu][cnt + 1] = -1;
737
738 rxq++;
739 if (rxq >= dev->num_rxq)
740 break;
741 }
742 }
743}
744
745/* unregister_netdev(ice) will eventually trigger this function */
746static void sn_netdev_destructor(struct net_device *netdev)

Callers 1

sn_create_netdevFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected