| 1052 | } |
| 1053 | |
| 1054 | int |
| 1055 | netisr_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 | |
| 1095 | int |
| 1096 | netisr_queue(u_int proto, struct mbuf *m) |
no test coverage detected