From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <arybchenko@solarflare.com>
Received: from nbfkord-smmo02.seg.att.com (nbfkord-smmo02.seg.att.com
 [209.65.160.78]) by dpdk.org (Postfix) with ESMTP id 8F1A2952
 for <dev@dpdk.org>; Thu,  2 Mar 2017 14:06:08 +0100 (CET)
Received: from unknown [12.187.104.26] (EHLO webmail.solarflare.com)
 by nbfkord-smmo02.seg.att.com(mxl_mta-7.2.4-7) with ESMTP id
 0c818b85.2ae03ee6a940.1009370.00-2476.2789342.nbfkord-smmo02.seg.att.com
 (envelope-from <arybchenko@solarflare.com>); 
 Thu, 02 Mar 2017 13:06:08 +0000 (UTC)
X-MXL-Hash: 58b818c06edfce63-d433211bdf8797e9ecfff8f9155258e81ec5119d
Received: from unknown [12.187.104.26] (EHLO webmail.solarflare.com)
 by nbfkord-smmo02.seg.att.com(mxl_mta-7.2.4-7) over TLS secured channel
 with ESMTP id fb818b85.0.1009368.00-2285.2789338.nbfkord-smmo02.seg.att.com
 (envelope-from <arybchenko@solarflare.com>); 
 Thu, 02 Mar 2017 13:06:07 +0000 (UTC)
X-MXL-Hash: 58b818bf11497a39-4fb9764487023e9645f0034d504ee0ffa32b2cc6
Received: from ocex03.SolarFlarecom.com (10.20.40.36) by
 ocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server (TLS) id
 15.0.1044.25; Thu, 2 Mar 2017 05:06:04 -0800
Received: from opal.uk.solarflarecom.com (10.17.10.1) by
 ocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server (TLS) id
 15.0.1044.25 via Frontend Transport; Thu, 2 Mar 2017 05:06:04 -0800
Received: from uklogin.uk.solarflarecom.com (uklogin.uk.solarflarecom.com
 [10.17.10.10])
 by opal.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id v22D63aD016841;
 Thu, 2 Mar 2017 13:06:03 GMT
Received: from uklogin.uk.solarflarecom.com (localhost.localdomain [127.0.0.1])
 by uklogin.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id v22D62sA013382; 
 Thu, 2 Mar 2017 13:06:02 GMT
From: Andrew Rybchenko <arybchenko@solarflare.com>
To: <dev@dpdk.org>
CC: Thomas Monjalon <thomas.monjalon@6wind.com>
Date: Thu, 2 Mar 2017 13:05:33 +0000
Message-ID: <1488459935-13273-1-git-send-email-arybchenko@solarflare.com>
X-Mailer: git-send-email 1.8.2.3
MIME-Version: 1.0
Content-Type: text/plain
X-AnalysisOut: [v=2.1 cv=T6yKOq+Q c=1 sm=1 tr=0 a=8BlWFWvVlq5taO8ncb8nKg==]
X-AnalysisOut: [:17 a=6Iz7jQTuP9IA:10 a=iOQleRFoHLcccZPZDu0A:9 a=QSMD8Dbp3]
X-AnalysisOut: [Ef29KkV:21 a=UM3Bw_DqLLt6NpJE:21]
X-Spam: [F=0.2000000000; CM=0.500; S=0.200(2015072901)]
X-MAIL-FROM: <arybchenko@solarflare.com>
X-SOURCE-IP: [12.187.104.26]
Subject: [dpdk-dev] [RFC PATCH 0/2] Helper function to ajdust Rx/Tx
	descriptor numbers
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Thu, 02 Mar 2017 13:06:09 -0000

Example applications have hardcoded numbers for Rx/Tx descriptors.
If PMD does not support these values, example application simply fails.
PMD provides the information about supported number of Rx/Tx descriptors
in dev_info and applications have everything required.

I think it would be good if example applications work in more cases.

Possible solutions are:
 1. duplicate adjustment code in all example applications
 2. add helper function and use it in all example applications (I think
    it might be useful for many DPDK applications)

The patch series suggests to go the second way, but updates only one
example application only. If it is accepted, we'll update all related
example applications to use the helper function.

Roman Zhukov (2):
  ethdev: add function to adjust number of descriptors
  examples/l3fwd: add check of Rx and Tx descriptors number

 examples/l3fwd/main.c                  | 11 ++++++++--
 lib/librte_ether/rte_ethdev.c          | 37 ++++++++++++++++++++++++++++++++++
 lib/librte_ether/rte_ethdev.h          | 20 ++++++++++++++++++
 lib/librte_ether/rte_ether_version.map |  7 +++++++
 4 files changed, 73 insertions(+), 2 deletions(-)

-- 
2.9.3