From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f171.google.com (mail-wi0-f171.google.com [209.85.212.171]) by dpdk.org (Postfix) with ESMTP id 31B8A6A7F for ; Fri, 20 Jun 2014 16:34:22 +0200 (CEST) Received: by mail-wi0-f171.google.com with SMTP id n15so937650wiw.4 for ; Fri, 20 Jun 2014 07:34:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=VNGQaCJCueK2GpA2CrsmiSQJuN28kMtKlWAXmDBX8Kc=; b=XYa9ke+sqDajB9EGR4w3ODkVHM17Ftf1Ji9e+3oFsxzZ3zDMRwUTA0P2q5v+KEbgii 74+TeQhrm+RQQ/YRMEfUswHNhbDKWelKS3zgVNKqVkXe5vR8eDbM7sE7qHyPgYpYT/dT 7wahgjr+QpmyYiTVFTmGg1KHhAEaJyUEd4GXNd/V1J9TcF1+rXbuG/3JDtkvxFyti4bh P2h6HlgsqVMM0b8guOOoFVDr1HsmAGTw+80BbKbRv6JSXfpvrlG2T6sHaMhTE/7pK/fT fKYqlD1hj4l/+ZfhFE32TwwM0cBfsTMrktGrrgIYAiHtc18oWKK9h0s38rPrIPk0zQbI arCA== X-Gm-Message-State: ALoCoQkhacAFoH3D9O3dSoZwfWlaP3RQP+0S/hVtLJfYpp4Rp3V8seJjtaj39Fqr3YDksVeMCfai X-Received: by 10.180.88.131 with SMTP id bg3mr4658586wib.57.1403274879027; Fri, 20 Jun 2014 07:34:39 -0700 (PDT) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by mx.google.com with ESMTPSA id s3sm15973572wje.36.2014.06.20.07.34.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Jun 2014 07:34:38 -0700 (PDT) From: Thomas Monjalon To: Helin Zhang Date: Fri, 20 Jun 2014 16:34:35 +0200 Message-ID: <45267557.BLbedC010Y@xps13> Organization: 6WIND User-Agent: KMail/4.13.1 (Linux/3.14.6-1-ARCH; KDE/4.13.1; x86_64; ; ) In-Reply-To: <1403244889-21358-8-git-send-email-helin.zhang@intel.com> References: <1403244889-21358-1-git-send-email-helin.zhang@intel.com> <1403244889-21358-8-git-send-email-helin.zhang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH 7/7] app/testpmd: rework for displaying different size of RX descriptors X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jun 2014 14:34:22 -0000 2014-06-20 14:14, Helin Zhang: > i40e supports 16 and 32 bytes RX descriptors which can be configured. > It needs to check the driver type and the configuration to determine > if 16 or 32 bytes RX descriptors is being used, for reading and > displaying the different sizes of RX descriptors. [...] > + if (strstr(dev_info.driver_name, "i40e") != NULL) { /* i40e */ > +#ifndef RTE_LIBRTE_I40E_16BYTE_RX_DESC Do we need to handle i40e case if RTE_LIBRTE_I40E_16BYTE_RX_DESC is defined? [simplified diff follows] > #else > + struct igb_ring_desc_16_bytes *ring = > + (struct igb_ring_desc_16_bytes *)ring_mz->addr; > > + ring_rxd_display_dword(rte_le_to_cpu_64(\ > + ring[desc_id].lo_dword)); > + ring_rxd_display_dword(rte_le_to_cpu_64(\ > + ring[desc_id].hi_dword)); > #endif > + } else { /* not i40e */ > + struct igb_ring_desc_16_bytes *ring = > + (struct igb_ring_desc_16_bytes *)ring_mz->addr; > + > + ring_rxd_display_dword(rte_le_to_cpu_64(\ > + ring[desc_id].lo_dword)); > + ring_rxd_display_dword(rte_le_to_cpu_64(\ > + ring[desc_id].hi_dword)); > + } You could factorize these 2 cases. -- Thomas