From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 1B8EE2B87; Fri, 8 Mar 2019 19:06:44 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Mar 2019 10:06:44 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,456,1544515200"; d="scan'208";a="149898379" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga002.fm.intel.com with ESMTP; 08 Mar 2019 10:06:43 -0800 Received: from fmsmsx153.amr.corp.intel.com (10.18.125.6) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.408.0; Fri, 8 Mar 2019 10:06:42 -0800 Received: from fmsmsx117.amr.corp.intel.com ([169.254.3.143]) by FMSMSX153.amr.corp.intel.com ([169.254.9.137]) with mapi id 14.03.0415.000; Fri, 8 Mar 2019 10:06:42 -0800 From: "Wiles, Keith" To: olegpoly123 CC: Thomas Monjalon , dpdk-dev , "stable@dpdk.org" Thread-Topic: [PATCH] net/tap: fix missing _SC_IOV_MAX Thread-Index: AQHU1dje/plQ3RH3u0C8Z6940TCSl6YCjceA Date: Fri, 8 Mar 2019 18:06:41 +0000 Message-ID: References: <20190308180016.5522-1-olegp123@walla.co.il> In-Reply-To: <20190308180016.5522-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-stable] [PATCH] net/tap: fix missing _SC_IOV_MAX X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2019 18:06:45 -0000 > On Mar 8, 2019, at 12:00 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: olegpoly123 > --- > 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 Sorry the email subject does not list [PATCH v3], but maybe someone can fix= it when it is applied or should another patch be submitted with [PATCH v3]= ? In any case I approve the patch. Acked-by: Keith Wiles Regards, Keith