Skip to content

Commit 6786d37

Browse files
authored
Merge pull request #979 from ravens/bump-queue-size
port.h: bump kDefault*QueueSize
2 parents 1c13031 + f315317 commit 6786d37

File tree

3 files changed

+36
-3
lines changed

3 files changed

+36
-3
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,4 @@ Please add your name to the end of this file and include this file to the PR, un
6363
* Alireza Sanaee
6464
* Brent Stephens
6565
* M. Asim Jamshed
66-
66+
* Yan Grunenberger

core/drivers/pmd.cc

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,23 @@ CommandResponse PMDPort::Init(const bess::pb::PMDPortArg &arg) {
258258

259259
eth_rxconf = dev_info.default_rxconf;
260260
eth_rxconf.rx_drop_en = 1;
261+
262+
if (dev_info.rx_desc_lim.nb_min > 0 &&
263+
queue_size[PACKET_DIR_INC] < dev_info.rx_desc_lim.nb_min) {
264+
int old_size_rxq = queue_size[PACKET_DIR_INC];
265+
queue_size[PACKET_DIR_INC] = dev_info.rx_desc_lim.nb_min;
266+
LOG(WARNING) << "resizing RX queue size from " << old_size_rxq << " to "
267+
<< queue_size[PACKET_DIR_INC];
268+
}
269+
270+
if (dev_info.rx_desc_lim.nb_max > 0 &&
271+
queue_size[PACKET_DIR_INC] > dev_info.rx_desc_lim.nb_max) {
272+
int old_size_rxq = queue_size[PACKET_DIR_INC];
273+
queue_size[PACKET_DIR_INC] = dev_info.rx_desc_lim.nb_max;
274+
LOG(WARNING) << "capping RX queue size from " << old_size_rxq << " to "
275+
<< queue_size[PACKET_DIR_INC];
276+
}
277+
261278
for (int i = 0; i < num_rxq; i++) {
262279
ret = rte_eth_rx_queue_setup(ret_port_id, i, queue_size[PACKET_DIR_INC],
263280
sid, &eth_rxconf,
@@ -267,6 +284,22 @@ CommandResponse PMDPort::Init(const bess::pb::PMDPortArg &arg) {
267284
}
268285
}
269286

287+
if (dev_info.tx_desc_lim.nb_min > 0 &&
288+
queue_size[PACKET_DIR_OUT] < dev_info.tx_desc_lim.nb_min) {
289+
int old_size_txq = queue_size[PACKET_DIR_OUT];
290+
queue_size[PACKET_DIR_OUT] = dev_info.tx_desc_lim.nb_min;
291+
LOG(WARNING) << "resizing TX queue size from " << old_size_txq << " to "
292+
<< queue_size[PACKET_DIR_OUT];
293+
}
294+
295+
if (dev_info.tx_desc_lim.nb_max > 0 &&
296+
queue_size[PACKET_DIR_OUT] > dev_info.tx_desc_lim.nb_max) {
297+
int old_size_txq = queue_size[PACKET_DIR_OUT];
298+
queue_size[PACKET_DIR_OUT] = dev_info.tx_desc_lim.nb_max;
299+
LOG(WARNING) << "capping TX queue size from " << old_size_txq << " to "
300+
<< queue_size[PACKET_DIR_OUT];
301+
}
302+
270303
for (int i = 0; i < num_txq; i++) {
271304
ret = rte_eth_tx_queue_setup(ret_port_id, i, queue_size[PACKET_DIR_OUT],
272305
sid, nullptr);

core/port.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,8 @@ class Port {
303303
Conf conf_;
304304

305305
private:
306-
static const size_t kDefaultIncQueueSize = 256;
307-
static const size_t kDefaultOutQueueSize = 256;
306+
static const size_t kDefaultIncQueueSize = 1024;
307+
static const size_t kDefaultOutQueueSize = 1024;
308308

309309
static const uint32_t kDefaultMtu = 1500;
310310

0 commit comments

Comments
 (0)