Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ message NicExpectation {

// Receive queues for this NIC.
repeated RxQueue rx_queues = 3;

// Receive and transmit ring buffer sizes for this NIC.
int32 rx_ring_size = 4;
int32 tx_ring_size = 5;
}

message RxQueue {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,19 @@ func TestCPUSets(t *testing.T) {
})
}
}

func TestRingSizes(t *testing.T) {
c := proto()
for _, config := range c.GetConfigExpectations() {
t.Run(config.GetDescription(), func(t *testing.T) {
for nicIdx, nic := range config.GetNics() {
if nic.HasRxRingSize() && nic.GetRxRingSize() <= 0 {
t.Errorf("NIC %d: non-positive rx_ring_size %d", nicIdx, nic.GetRxRingSize())
}
if nic.HasTxRingSize() && nic.GetTxRingSize() <= 0 {
t.Errorf("NIC %d: non-positive tx_ring_size %d", nicIdx, nic.GetTxRingSize())
}
}
})
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.