Lines Matching refs:pipe

151 static void	transmit_event(struct dn_pipe *pipe, struct mbuf **head,
495 pipe_bp->fs.pipe = (user32_addr_t)0 ;
536 pipe_bp->fs.pipe = USER_ADDR_NULL ;
727 transmit_event(struct dn_pipe *pipe, struct mbuf **head, struct mbuf **tail)
736 while ((m = pipe->head) != NULL) {
741 pipe->head = m->m_nextpkt;
756 /* if there are leftover packets, put the pipe into the heap for next ready event */
757 if ((m = pipe->head) != NULL) {
760 * whole pipe p and hoping in the future we are more successful
762 heap_insert(&extract_heap, schedule_time, pipe);
769 * either a pipe (WF2Q) or a flow_queue (per-flow queueing)
817 struct dn_pipe *p = q->fs->pipe ;
823 printf("dummynet: ready_event pipe is gone\n");
829 * schedule fixed-rate queues linked to this pipe:
895 DPRINTF(("dummynet: pipe %d ready from %s --\n",
1046 struct dn_pipe *pipe = p;
1047 if (pipe->if_name[0] != '\0')
1048 printf("dummynet: bad ready_event_wfq for pipe %s\n",
1049 pipe->if_name);
1496 struct dn_pipe *pipe;
1498 SLIST_FOREACH(pipe, &pipehash[HASH(pipe_nr)], next)
1499 if (pipe->pipe_nr == pipe_nr)
1500 return (pipe);
1508 * dummynet hook for packets. Below 'pipe' is a pipe or a queue
1511 * pipe_nr pipe or queue the packet is destined for.
1530 struct dn_pipe *pipe ;
1537 DPRINTF(("dummynet_io m: 0x%llx pipe: %d dir: %d client: %d\n",
1575 pipe = locate_pipe(pipe_nr);
1576 if (pipe != NULL)
1577 fs = &(pipe->fs);
1583 goto dropit ; /* this queue/pipe does not exist! */
1585 pipe = fs->pipe ;
1586 if (pipe == NULL) { /* must be a queue, try find a matching pipe */
1587 pipe = locate_pipe(fs->parent_nr);
1589 if (pipe != NULL)
1590 fs->pipe = pipe ;
1592 printf("dummynet: no pipe %d for queue %d, drop pkt\n",
1708 if (pipe->bandwidth)
1709 t = SET_TICKS(m, q, pipe);
1718 * set S to the virtual time V for the controlling pipe, and update
1719 * the sum of weights for the pipe; otherwise, remove flow from
1722 * Third, if pipe was idle, update V=max(S, V).
1726 q->S = pipe->V ;
1727 pipe->sum += fs->weight ; /* add weight of new queue */
1729 heap_extract(&(pipe->idle_heap), q);
1730 q->S = MAX64(q->F, pipe->V ) ;
1734 if (pipe->not_eligible_heap.elements == 0 &&
1735 pipe->scheduler_heap.elements == 0)
1736 pipe->V = MAX64 ( q->S, pipe->V );
1741 * scheduled for the same pipe, so the scheduler_heap cannot be
1751 if (DN_KEY_GT(q->S, pipe->V) ) { /* not eligible */
1752 if (pipe->scheduler_heap.elements == 0)
1754 heap_insert(&(pipe->not_eligible_heap), q->S, q);
1756 heap_insert(&(pipe->scheduler_heap), q->F, q);
1757 if (pipe->numbytes >= 0) { /* pipe is idle */
1758 if (pipe->scheduler_heap.elements != 1)
1759 printf("dummynet: OUCH! pipe should have been idle!\n");
1760 DPRINTF(("dummynet: waking up pipe %d at %d\n",
1761 pipe->pipe_nr, (int)(q->F >> MY_M)));
1762 pipe->sched_time = curr_time ;
1763 ready_event_wfq(pipe, &head, &tail);
1841 /* if this fs is not part of a pipe, free it */
1842 if (fs->pipe && fs != &(fs->pipe->fs) )
1848 * Dispose all packets queued on a pipe (not a flow_set).
1849 * Also free all resources associated to a pipe, which is about
1853 purge_pipe(struct dn_pipe *pipe)
1857 purge_flow_set( &(pipe->fs), 1 );
1859 mnext = pipe->head;
1865 heap_free( &(pipe->scheduler_heap) );
1866 heap_free( &(pipe->not_eligible_heap) );
1867 heap_free( &(pipe->idle_heap) );
1877 struct dn_pipe *pipe, *pipe1;
1904 SLIST_FOREACH_SAFE(pipe, &pipehash[i], next, pipe1) {
1905 SLIST_REMOVE(&pipehash[i], pipe, dn_pipe, next);
1906 purge_pipe(pipe);
1907 FREE(pipe, M_DUMMYNET);
2066 * setup pipe or queue parameters.
2083 /* We need either a pipe number or a flow_set number */
2088 if (p->pipe_nr != 0) { /* this is a pipe */
2093 /* locate pipe */
2096 if (b == NULL || b->pipe_nr != p->pipe_nr) { /* new pipe */
2100 printf("dummynet: no memory for new pipe\n");
2104 x->fs.pipe = x ;
2125 if ( x->fs.rq == NULL ) { /* a new pipe */
2144 if (pfs->parent_nr == 0) { /* need link to a pipe */
2162 /* Change parent pipe not allowed; must delete and recreate */
2206 * helper function to remove a pipe from a heap (can be there at most once)
2240 /* remove all references to this pipe from flow_sets */
2259 * Fully delete a pipe or a queue, cleaning up associated info.
2268 if (p->pipe_nr != 0) { /* this is an old-style pipe */
2274 /* locate pipe */
2285 /* remove references to this pipe from the ip_fw rules. */
2289 /* Remove all references to this pipe from flow_sets. */
2292 if (fs->pipe == b) {
2293 printf("dummynet: ++ ref to pipe %d from fs %d\n",
2295 fs->pipe = NULL ;
2300 purge_pipe(b); /* remove all data associated to this pipe */
2326 if (b->pipe != NULL) {
2327 /* Update total weight on parent pipe and cleanup parent heaps */
2328 b->pipe->sum -= b->weight * b->backlogged ;
2329 fs_remove_from_heap(&(b->pipe->not_eligible_heap), b);
2330 fs_remove_from_heap(&(b->pipe->scheduler_heap), b);
2332 fs_remove_from_heap(&(b->pipe->idle_heap), b);
2485 * copy pipe descriptor into *bp, convert delay back to ms,
2502 fs_bp->pipe = USER_ADDR_NULL;
2552 case IP_DUMMYNET_DEL : /* remove a pipe or queue */