mirror of
https://github.com/tnodir/fort
synced 2024-11-15 07:06:08 +00:00
Driver: fortpkt: Simplify fort_shaper_flush()
This commit is contained in:
parent
036f5391b8
commit
3a78e1fece
@ -667,16 +667,10 @@ static void NTAPI fort_shaper_timer_process(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void fort_shaper_flush(PFORT_SHAPER shaper, UINT32 group_io_bits, BOOL drop)
|
||||
inline static PFORT_PACKET fort_shaper_flush_queues(PFORT_SHAPER shaper, UINT32 group_io_bits)
|
||||
{
|
||||
if (group_io_bits == 0)
|
||||
return;
|
||||
|
||||
/* Collect packets from Queues */
|
||||
PFORT_PACKET pkt_chain = NULL;
|
||||
|
||||
group_io_bits &= fort_shaper_io_bits_set(&shaper->active_io_bits, group_io_bits, FALSE);
|
||||
|
||||
for (int i = 0; group_io_bits != 0; ++i) {
|
||||
const BOOL queue_exists = (group_io_bits & 1) != 0;
|
||||
group_io_bits >>= 1;
|
||||
@ -691,6 +685,19 @@ static void fort_shaper_flush(PFORT_SHAPER shaper, UINT32 group_io_bits, BOOL dr
|
||||
pkt_chain = fort_shaper_queue_get_packets(queue, pkt_chain);
|
||||
}
|
||||
|
||||
return pkt_chain;
|
||||
}
|
||||
|
||||
static void fort_shaper_flush(PFORT_SHAPER shaper, UINT32 group_io_bits, BOOL drop)
|
||||
{
|
||||
if (group_io_bits == 0)
|
||||
return;
|
||||
|
||||
group_io_bits &= fort_shaper_io_bits_set(&shaper->active_io_bits, group_io_bits, FALSE);
|
||||
|
||||
/* Collect packets from Queues */
|
||||
PFORT_PACKET pkt_chain = fort_shaper_flush_queues(shaper, group_io_bits);
|
||||
|
||||
/* Process the packets */
|
||||
if (pkt_chain != NULL) {
|
||||
fort_shaper_packet_foreach(
|
||||
|
Loading…
Reference in New Issue
Block a user