From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH v6] net/tap: fix missing _SC_IOV_MAX Date: Mon, 18 Mar 2019 10:56:36 -0700 Message-ID: <20190318105636.2a96f3ab@shemminger-XPS-13-9360> References: <20190318165523.4086-1-olegp123@walla.co.il> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: keith.wiles@intel.com, thomas@monjalon.net, dev@dpdk.org, stable@dpdk.org To: olegpoly123 Return-path: Received: from mail-pg1-f180.google.com (mail-pg1-f180.google.com [209.85.215.180]) by dpdk.org (Postfix) with ESMTP id 49696378B for ; Mon, 18 Mar 2019 18:56:40 +0100 (CET) Received: by mail-pg1-f180.google.com with SMTP id q206so11917017pgq.4 for ; Mon, 18 Mar 2019 10:56:40 -0700 (PDT) In-Reply-To: <20190318165523.4086-1-olegp123@walla.co.il> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Mon, 18 Mar 2019 12:55:23 -0400 olegpoly123 wrote: > long iov_max = sysconf(_SC_IOV_MAX); > + > + if (iov_max <= 0) { > + TAP_LOG(WARNING, > + "_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); Looking at this a little more carefully. 1. Trivial: TAP_LOG() already adds a newline. 2. TAP device should not be silently reducing the number of receive descriptors. 3. TAP device be using IOV_MAX to set rx_descriptor limit. (in dev_info) The ethdev would rx_queue_setup with any request for too large a value.