[v2,2/2] Define macro for iov_max default value
diff mbox series

Message ID 20190308155547.1695-2-olegp123@walla.co.il
State Superseded, archived
Delegated to: Ferruh Yigit
Headers show
Series
  • [v2,1/2] net/tap: fix missing _SC_IOV_MAX
Related show

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation success Compilation OK

Commit Message

olegpoly123 March 8, 2019, 3:55 p.m. UTC
Cc: stable@dpdk.org

Signed-off-by: Oeg Polyakov <opolyakov@northforgeinc.com>
---
 drivers/net/tap/rte_eth_tap.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Patch
diff mbox series

diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
index cd48b2b2a..e7da73509 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -68,6 +68,8 @@ 
 /* IPC key for queue fds sync */
 #define TAP_MP_KEY "tap_mp_sync_queues"
 
+#define TAP_IOV_DEFAULT_MAX 1024
+
 static int tap_devices_count;
 static struct rte_vdev_driver pmd_tap_drv;
 static struct rte_vdev_driver pmd_tun_drv;
@@ -1328,8 +1330,8 @@  tap_rx_queue_setup(struct rte_eth_dev *dev,
 	long iov_max = sysconf(_SC_IOV_MAX);
 	if (iov_max <= 0) {
 		TAP_LOG(WARNING,
-			"_SC_IOV_MAX is not defined. Using 1024 as default\n");
-		iov_max = 1024;
+			"_SC_IOV_MAX is not defined. Using %d as default\n", TAP_IOV_DEFAULT_MAX);
+		iov_max = TAP_IOV_DEFAULT_MAX;
 	}
 	uint16_t nb_desc = RTE_MIN(nb_rx_desc, iov_max - 1);
 	struct iovec (*iovecs)[nb_desc + 1];