From: olegpoly123 <olegp123@walla.co.il>
To: keith.wiles@intel.com, thomas@monjalon.net
Cc: dev@dpdk.org, olegpoly123 <olegp123@walla.co.il>,
stable@dpdk.org, Oeg Polyakov <opolyakov@northforgeinc.com>
Subject: [dpdk-dev] [PATCH] net/tap: fix missing _SC_IOV_MAX
Date: Thu, 7 Mar 2019 17:25:23 -0500 [thread overview]
Message-ID: <20190307222523.24620-1-olegp123@walla.co.il> (raw)
If the value _SC_IOV_MAX is missing, sysconf returns -1.
In this case, iov_max is set to a default value of 1024.
Cc: stable@dpdk.org
Signed-off-by: Oeg Polyakov <opolyakov@northforgeinc.com>
---
drivers/net/tap/rte_eth_tap.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
index 6f5109fca..cd48b2b2a 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -1326,6 +1326,11 @@ tap_rx_queue_setup(struct rte_eth_dev *dev,
struct rx_queue *rxq = &internals->rxq[rx_queue_id];
struct rte_mbuf **tmp = &rxq->pool;
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;
+ }
uint16_t nb_desc = RTE_MIN(nb_rx_desc, iov_max - 1);
struct iovec (*iovecs)[nb_desc + 1];
int data_off = RTE_PKTMBUF_HEADROOM;
--
2.14.1
next reply other threads:[~2019-03-07 22:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-07 22:25 olegpoly123 [this message]
2019-03-07 22:31 ` Wiles, Keith
2019-03-08 18:00 olegpoly123
2019-03-08 18:06 ` Wiles, Keith
2019-03-08 18:54 ` Thomas Monjalon
2019-03-09 3:02 ` Stephen Hemminger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190307222523.24620-1-olegp123@walla.co.il \
--to=olegp123@walla.co.il \
--cc=dev@dpdk.org \
--cc=keith.wiles@intel.com \
--cc=opolyakov@northforgeinc.com \
--cc=stable@dpdk.org \
--cc=thomas@monjalon.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).