From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <keith.wiles@intel.com>
Received: from mga04.intel.com (mga04.intel.com [192.55.52.120])
 by dpdk.org (Postfix) with ESMTP id 3475E1B122;
 Thu,  7 Mar 2019 23:31:36 +0100 (CET)
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from fmsmga005.fm.intel.com ([10.253.24.32])
 by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 07 Mar 2019 14:31:35 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.58,453,1544515200"; d="scan'208";a="326445622"
Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202])
 by fmsmga005.fm.intel.com with ESMTP; 07 Mar 2019 14:31:35 -0800
Received: from fmsmsx152.amr.corp.intel.com (10.18.125.5) by
 fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS)
 id 14.3.408.0; Thu, 7 Mar 2019 14:31:34 -0800
Received: from fmsmsx117.amr.corp.intel.com ([169.254.3.143]) by
 FMSMSX152.amr.corp.intel.com ([169.254.6.9]) with mapi id 14.03.0415.000;
 Thu, 7 Mar 2019 14:31:34 -0800
From: "Wiles, Keith" <keith.wiles@intel.com>
To: olegpoly123 <olegp123@walla.co.il>
CC: Thomas Monjalon <thomas@monjalon.net>, "dev@dpdk.org" <dev@dpdk.org>,
 "stable@dpdk.org" <stable@dpdk.org>, Oeg Polyakov
 <opolyakov@northforgeinc.com>
Thread-Topic: [PATCH] net/tap: fix missing _SC_IOV_MAX
Thread-Index: AQHU1TTGb1R56RWvbECkzx4ElrAOjKYBRruA
Date: Thu, 7 Mar 2019 22:31:34 +0000
Message-ID: <EEA36899-1231-4D2E-A13B-88EFD86D1FA6@intel.com>
References: <20190307222523.24620-1-olegp123@walla.co.il>
In-Reply-To: <20190307222523.24620-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: <962915CFD476FE42822775C28988A6F6@intel.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Subject: Re: [dpdk-dev] [PATCH] 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 <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Thu, 07 Mar 2019 22:31:36 -0000



> On Mar 7, 2019, at 4:25 PM, olegpoly123 <olegp123@walla.co.il> 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: Oeg Polyakov <opolyakov@northforgeinc.com>
> ---
> drivers/net/tap/rte_eth_tap.c | 5 +++++
> 1 file changed, 5 insertions(+)
>=20
> 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 =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 1024 as default\n");
> +		iov_max =3D 1024;

Can I get you to create a define for the 1024 value e.g. #define TAP_IOV_DE=
FAULT_MAX 1024 or something of that type.
Also change the TAP_LOG to use the define.=20
> +	}
> 	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

Regards,
Keith