From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 79ABE2B91; Fri, 8 Mar 2019 20:13:10 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Mar 2019 11:13:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,456,1544515200"; d="scan'208";a="132454501" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga003.jf.intel.com with ESMTP; 08 Mar 2019 11:13:09 -0800 Received: from fmsmsx126.amr.corp.intel.com (10.18.125.43) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.408.0; Fri, 8 Mar 2019 11:13:09 -0800 Received: from fmsmsx117.amr.corp.intel.com ([169.254.3.143]) by FMSMSX126.amr.corp.intel.com ([169.254.1.212]) with mapi id 14.03.0415.000; Fri, 8 Mar 2019 11:13:08 -0800 From: "Wiles, Keith" To: olegpoly123 CC: Thomas Monjalon , "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [PATCH v4] net/tap: fix missing _SC_IOV_MAX Thread-Index: AQHU1eIhuI3STH7/z0m8tqcyI4N6aKYCoESA Date: Fri, 8 Mar 2019 19:13:07 +0000 Message-ID: References: <20190308190658.6313-1-olegp123@walla.co.il> In-Reply-To: <20190308190658.6313-1-olegp123@walla.co.il> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.251.134.203] Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v4] net/tap: fix missing _SC_IOV_MAX X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2019 19:13:11 -0000 > On Mar 8, 2019, at 1:06 PM, olegpoly123 wrote: >=20 > If the value _SC_IOV_MAX is missing, sysconf returns -1. > In this case, iov_max is set to a default value of 1024. >=20 > Cc: stable@dpdk.org >=20 > Signed-off-by: Oleg Polyakov > --- > drivers/net/tap/rte_eth_tap.c | 8 ++++++++ > 1 file changed, 8 insertions(+) >=20 > diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.= c > index 6f5109fca..2a7e6aa00 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" >=20 > +#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; > @@ -1326,6 +1328,12 @@ tap_rx_queue_setup(struct rte_eth_dev *dev, > struct rx_queue *rxq =3D &internals->rxq[rx_queue_id]; > struct rte_mbuf **tmp =3D &rxq->pool; > long iov_max =3D sysconf(_SC_IOV_MAX); > + > + if (iov_max <=3D 0) { > + TAP_LOG(WARNING, > + "_SC_IOV_MAX is not defined. Using %d as default\n", TAP_IOV_DEFAULT_= MAX); > + iov_max =3D TAP_IOV_DEFAULT_MAX; > + } > uint16_t nb_desc =3D RTE_MIN(nb_rx_desc, iov_max - 1); > struct iovec (*iovecs)[nb_desc + 1]; > int data_off =3D RTE_PKTMBUF_HEADROOM; > --=20 > 2.14.1 >=20 Acked-by Keith Wiles Regards, Keith