/*
- * Copyright (c) 2011-2013 Apple Inc. All rights reserved.
+ * Copyright (c) 2011-2015 Apple Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
VERIFY(IFCQ_IS_EMPTY(ifq));
ifq->ifcq_ifp = ifp;
IFCQ_LEN(ifq) = 0;
+ IFCQ_BYTES(ifq) = 0;
bzero(&ifq->ifcq_xmitcnt, sizeof (ifq->ifcq_xmitcnt));
bzero(&ifq->ifcq_dropcnt, sizeof (ifq->ifcq_dropcnt));
VERIFY(ifq->ifcq_dequeue_sc == NULL);
VERIFY(ifq->ifcq_request == NULL);
IFCQ_LEN(ifq) = 0;
+ IFCQ_BYTES(ifq) = 0;
IFCQ_MAXLEN(ifq) = 0;
bzero(&ifq->ifcq_xmitcnt, sizeof (ifq->ifcq_xmitcnt));
bzero(&ifq->ifcq_dropcnt, sizeof (ifq->ifcq_dropcnt));
IFCQ_LOCK_SPIN(ifq);
while (i < limit) {
- u_int64_t pktlen;
#if PF_ALTQ
u_int32_t qlen;
last = *head;
l += (*head)->m_pkthdr.len;
- pktlen = (*head)->m_pkthdr.len;
#if MEASURE_BW
(*head)->m_pkthdr.pkt_bwseq =
- atomic_add_64_ov(&(ifp->if_bw.cur_seq), pktlen);
+ atomic_add_64_ov(&(ifp->if_bw.cur_seq), m_pktlen(*head));
#endif /* MEASURE_BW */
-
+ if (IFNET_IS_CELLULAR(ifp)) {
+ (*head)->m_pkthdr.pkt_flags |= PKTF_VALID_UNSENT_DATA;
+ (*head)->m_pkthdr.pkt_unsent_databytes =
+ (total_snd_byte_count << MSIZESHIFT) +
+ ifq->ifcq_bytes;
+ }
head = &(*head)->m_nextpkt;
i++;
}