MCPcopy Create free account
hub / github.com/F-Stack/f-stack / swi_net

Function swi_net

freebsd/net/netisr.c:937–978  ·  view source on GitHub ↗

* SWI handler for netisr -- processes packets in a set of workstreams that * it owns, woken up by calls to NWS_SIGNAL(). If this workstream is already * being direct dispatched, go back to sleep and wait for the dispatching * thread to wake us up again. */

Source from the content-addressed store, hash-verified

935 * thread to wake us up again.
936 */
937static void
938swi_net(void *arg)
939{
940#ifdef NETISR_LOCKING
941 struct rm_priotracker tracker;
942#endif
943 struct netisr_workstream *nwsp;
944 u_int bits, prot;
945
946 nwsp = arg;
947
948#ifdef DEVICE_POLLING
949 KASSERT(nws_count == 1,
950 ("%s: device_polling but nws_count != 1", __func__));
951 netisr_poll();
952#endif
953#ifdef NETISR_LOCKING
954 NETISR_RLOCK(&tracker);
955#endif
956 NWS_LOCK(nwsp);
957 KASSERT(!(nwsp->nws_flags & NWS_RUNNING), ("swi_net: running"));
958 if (nwsp->nws_flags & NWS_DISPATCHING)
959 goto out;
960 nwsp->nws_flags |= NWS_RUNNING;
961 nwsp->nws_flags &= ~NWS_SCHEDULED;
962 while ((bits = nwsp->nws_pendingbits) != 0) {
963 while ((prot = ffs(bits)) != 0) {
964 prot--;
965 bits &= ~(1 << prot);
966 (void)netisr_process_workstream_proto(nwsp, prot);
967 }
968 }
969 nwsp->nws_flags &= ~NWS_RUNNING;
970out:
971 NWS_UNLOCK(nwsp);
972#ifdef NETISR_LOCKING
973 NETISR_RUNLOCK(&tracker);
974#endif
975#ifdef DEVICE_POLLING
976 netisr_pollmore();
977#endif
978}
979
980void inline
981ff_swi_net_excute(void)

Callers 1

ff_swi_net_excuteFunction · 0.85

Calls 4

netisr_pollFunction · 0.85
netisr_pollmoreFunction · 0.85
ffsFunction · 0.50

Tested by

no test coverage detected