* Helper function used to drop all mbufs in hold queue. * * Returns the number of held packets, if any, that were dropped. */
| 282 | * Returns the number of held packets, if any, that were dropped. |
| 283 | */ |
| 284 | size_t |
| 285 | lltable_drop_entry_queue(struct llentry *lle) |
| 286 | { |
| 287 | size_t pkts_dropped; |
| 288 | struct mbuf *next; |
| 289 | |
| 290 | LLE_WLOCK_ASSERT(lle); |
| 291 | |
| 292 | pkts_dropped = 0; |
| 293 | while ((lle->la_numheld > 0) && (lle->la_hold != NULL)) { |
| 294 | next = lle->la_hold->m_nextpkt; |
| 295 | m_freem(lle->la_hold); |
| 296 | lle->la_hold = next; |
| 297 | lle->la_numheld--; |
| 298 | pkts_dropped++; |
| 299 | } |
| 300 | |
| 301 | KASSERT(lle->la_numheld == 0, |
| 302 | ("%s: la_numheld %d > 0, pkts_droped %zd", __func__, |
| 303 | lle->la_numheld, pkts_dropped)); |
| 304 | |
| 305 | return (pkts_dropped); |
| 306 | } |
| 307 | |
| 308 | void |
| 309 | lltable_set_entry_addr(struct ifnet *ifp, struct llentry *lle, |
no test coverage detected