519 * Squeue will poll soft ring when it needs packets.
520 */
521 mutex_enter(&ringp->s_ring_lock);
522 if (!(ringp->s_ring_state & S_RING_PROC)) {
523 ringp->s_ring_state |= S_RING_BLANK;
524 sring_blanked = B_TRUE;
525 }
526 mutex_exit(&ringp->s_ring_lock);
527 return (sring_blanked);
528 }
529
530 /*
531 * mac_soft_ring_poll
532 *
533 * This routine is called by the client to poll for packets from
534 * the soft ring. The function name and cookie corresponding to
535 * the soft ring is exchanged during capability negotiation during
536 * setup.
537 */
538 mblk_t *
539 mac_soft_ring_poll(mac_soft_ring_t *ringp, int bytes_to_pickup)
540 {
541 mblk_t *head, *tail;
542 mblk_t *mp;
543 size_t sz = 0;
544 int cnt = 0;
545 mac_soft_ring_set_t *mac_srs = ringp->s_ring_set;
546
547 ASSERT(mac_srs != NULL);
548
549 mutex_enter(&ringp->s_ring_lock);
550 head = tail = mp = ringp->s_ring_first;
551 if (head == NULL) {
552 mutex_exit(&ringp->s_ring_lock);
553 return (NULL);
554 }
555
556 if (ringp->s_ring_size <= bytes_to_pickup) {
557 head = ringp->s_ring_first;
558 ringp->s_ring_first = NULL;
559 ringp->s_ring_last = NULL;
|
519 * Squeue will poll soft ring when it needs packets.
520 */
521 mutex_enter(&ringp->s_ring_lock);
522 if (!(ringp->s_ring_state & S_RING_PROC)) {
523 ringp->s_ring_state |= S_RING_BLANK;
524 sring_blanked = B_TRUE;
525 }
526 mutex_exit(&ringp->s_ring_lock);
527 return (sring_blanked);
528 }
529
530 /*
531 * mac_soft_ring_poll
532 *
533 * This routine is called by the client to poll for packets from
534 * the soft ring. The function name and cookie corresponding to
535 * the soft ring is exchanged during capability negotiation during
536 * setup.
537 */
538 mblk_t *
539 mac_soft_ring_poll(mac_soft_ring_t *ringp, size_t bytes_to_pickup)
540 {
541 mblk_t *head, *tail;
542 mblk_t *mp;
543 size_t sz = 0;
544 int cnt = 0;
545 mac_soft_ring_set_t *mac_srs = ringp->s_ring_set;
546
547 ASSERT(mac_srs != NULL);
548
549 mutex_enter(&ringp->s_ring_lock);
550 head = tail = mp = ringp->s_ring_first;
551 if (head == NULL) {
552 mutex_exit(&ringp->s_ring_lock);
553 return (NULL);
554 }
555
556 if (ringp->s_ring_size <= bytes_to_pickup) {
557 head = ringp->s_ring_first;
558 ringp->s_ring_first = NULL;
559 ringp->s_ring_last = NULL;
|