From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com [209.85.212.179]) by dpdk.org (Postfix) with ESMTP id 6325A8D3D for ; Sat, 29 Aug 2015 01:20:27 +0200 (CEST) Received: by wicne3 with SMTP id ne3so30430558wic.0 for ; Fri, 28 Aug 2015 16:20:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=LWOGWFJ4vrltZbxlxqniu/ASHOG8LMYzwLlM+nGbnwc=; b=sFNArHkm08XVPu6tbt4zx/7XEUmJeNtA2/6O5U8ZtIMc/NrBC1IU65eHX3oZsXH3Iu 45winJEIi1QtEz50AAFwOjK+AM0MgkGiVfJ+wIGXJhFLhvEHOt0yxL3jwG7YNUTUOpek vzrlW8T5s94eCP/4dnk+I+XFHT0yRw910dDs2QCAsHwc9wEpAc/68qxUlKwlvH+F41zi sRd58+4MPQckWTuXaCnREuC4mDMcSsKYPAic5BBhhcaB5p4QiBkIORSzKP7bUuGJoEnr bVTCnqfHdW1bbtJWvsm9oSVh3eM6kUOmWKHC/JNtuaAZKSLAy8CYJ/L094whOB2uXKgm HQFA== X-Received: by 10.194.109.228 with SMTP id hv4mr7448395wjb.110.1440804027117; Fri, 28 Aug 2015 16:20:27 -0700 (PDT) Received: from localhost.localdomain (103.Red-83-55-239.dynamicIP.rima-tde.net. [83.55.239.103]) by smtp.gmail.com with ESMTPSA id r8sm5868803wik.16.2015.08.28.16.20.26 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 28 Aug 2015 16:20:26 -0700 (PDT) From: Marc Sune X-Google-Original-From: Marc Sune To: dev@dpdk.org Date: Sat, 29 Aug 2015 01:20:12 +0200 Message-Id: <1440804014-30815-1-git-send-email-marc.sune@bisdn.de> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1432669843-15672-1-git-send-email-marc.sune@bisdn.de> References: <1432669843-15672-1-git-send-email-marc.sune@bisdn.de> Cc: Marc Sune Subject: [dpdk-dev] [PATCH v3 0/2] ethdev: add port speed capability bitmap 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, 28 Aug 2015 23:20:27 -0000 From: Marc Sune The current rte_eth_dev_info abstraction does not provide any mechanism to get the supported speed(s) of an ethdev. For some drivers (e.g. ixgbe), an educated guess can be done based on the driver's name (driver_name in rte_eth_dev_info), see: http://dpdk.org/ml/archives/dev/2013-August/000412.html However, i) doing string comparisons is annoying, and can silently break existing applications if PMDs change their names ii) it does not provide all the supported capabilities of the ethdev iii) for some drivers it is impossible determine correctly the (max) speed by the application (e.g. in i40, distinguish between XL710 and X710). This small patch adds speed_capa bitmap in rte_eth_dev_info, which is filled by the PMDs according to the physical device capabilities. v2: rebase, converted speed_capa into 32 bits bitmap, fixed alignment (checkpatch). v3: rebase to v2.1. unified ETH_LINK_SPEED and ETH_SPEED_CAP into ETH_SPEED. Converted field speed in struct rte_eth_link to speed, to allow a bitmap for defining the announced speeds, as suggested M. Brorup. Fixed spelling issues. Marc Sune (2): Added ETH_SPEED_ bitmap in rte_eth_dev_info Filling speed capability bitmaps in the PMDs app/test-pmd/cmdline.c | 32 +++++++++++------------ app/test/virtual_pmd.c | 2 +- drivers/net/bonding/rte_eth_bond_8023ad.c | 14 +++++------ drivers/net/e1000/em_ethdev.c | 20 +++++++++------ drivers/net/e1000/igb_ethdev.c | 20 +++++++++------ drivers/net/fm10k/fm10k_ethdev.c | 3 +++ drivers/net/i40e/i40e_ethdev.c | 37 ++++++++++++++++----------- drivers/net/i40e/i40e_ethdev_vf.c | 2 +- drivers/net/ixgbe/ixgbe_ethdev.c | 32 +++++++++++++++-------- drivers/net/mlx4/mlx4.c | 6 +++++ drivers/net/vmxnet3/vmxnet3_ethdev.c | 2 +- lib/librte_ether/rte_ethdev.h | 42 ++++++++++++++++++++++--------- 12 files changed, 135 insertions(+), 77 deletions(-) -- 2.1.4