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

Function netisr_queue_src

freebsd/net/netisr.c:1054–1093  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1052}
1053
1054int
1055netisr_queue_src(u_int proto, uintptr_t source, struct mbuf *m)
1056{
1057#ifdef NETISR_LOCKING
1058 struct rm_priotracker tracker;
1059#endif
1060 u_int cpuid;
1061 int error;
1062
1063 KASSERT(proto < NETISR_MAXPROT,
1064 ("%s: invalid proto %u", __func__, proto));
1065
1066#ifdef NETISR_LOCKING
1067 NETISR_RLOCK(&tracker);
1068#endif
1069 KASSERT(netisr_proto[proto].np_handler != NULL,
1070 ("%s: invalid proto %u", __func__, proto));
1071
1072#ifdef VIMAGE
1073 if (V_netisr_enable[proto] == 0) {
1074 m_freem(m);
1075 return (ENOPROTOOPT);
1076 }
1077#endif
1078
1079 m = netisr_select_cpuid(&netisr_proto[proto], NETISR_DISPATCH_DEFERRED,
1080 source, m, &cpuid);
1081 if (m != NULL) {
1082 KASSERT(!CPU_ABSENT(cpuid), ("%s: CPU %u absent", __func__,
1083 cpuid));
1084 VNET_ASSERT(m->m_pkthdr.rcvif != NULL,
1085 ("%s:%d rcvif == NULL: m=%p", __func__, __LINE__, m));
1086 error = netisr_queue_internal(proto, m, cpuid);
1087 } else
1088 error = ENOBUFS;
1089#ifdef NETISR_LOCKING
1090 NETISR_RUNLOCK(&tracker);
1091#endif
1092 return (error);
1093}
1094
1095int
1096netisr_queue(u_int proto, struct mbuf *m)

Callers 5

div_output_inboundFunction · 0.85
netisr_queueFunction · 0.85
netisr_dispatch_srcFunction · 0.85
ipsec4_common_input_cbFunction · 0.85
ipsec_input.cFile · 0.85

Calls 3

netisr_select_cpuidFunction · 0.85
netisr_queue_internalFunction · 0.85
m_freemFunction · 0.50

Tested by

no test coverage detected