From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com [209.85.212.177]) by dpdk.org (Postfix) with ESMTP id D97558E7C for ; Tue, 20 Oct 2015 14:39:58 +0200 (CEST) Received: by wicfv8 with SMTP id fv8so26659144wic.0 for ; Tue, 20 Oct 2015 05:39:58 -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=3I0auu6DKtAi4DvC80GFaY2HRVXvMRjFVw3wi2fs0xM=; b=IuY6tf/4Zg7wQ844H4R4tdarnx8o62ZrdATZ/xbqOT9wrEnkTlS8Je6RbHkXwhh0/z p4FTqzQIOpgvL7nJHbGlJvdwIA/zJ/s1plsSvafdKfbxL//9OojjmC2wKIdGmO7cBE2/ 0QMk/acznlFDRAw2WbBrx679qg4fi7TDLT+HoxiQ0HGZp6qX21kJCRDUfsNuUx9m2md4 NpjsabiI4Pnuex3D0+jbIkoyCBSGgEhRf7A5fiu31hKo5CHWxpkSWSb7OA/CW8XY/NA2 kq+USzLp1fz7vUMQ6lzE1kRiQl4BNxb99j55nFtQRkIgA9QSKl9Ms2tBo+QAKOY8xSoQ V3fw== X-Gm-Message-State: ALoCoQkZlpDFSWDyibggtruxczOyjhPUvUBV5jgkzUkQzXjYEElovGjyzo/OWEFWKxVMGnOjXaRP X-Received: by 10.180.96.166 with SMTP id dt6mr4462632wib.38.1445344798607; Tue, 20 Oct 2015 05:39:58 -0700 (PDT) Received: from xps13.localnet (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by smtp.gmail.com with ESMTPSA id qh12sm19191129wic.20.2015.10.20.05.39.57 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Oct 2015 05:39:58 -0700 (PDT) From: Thomas Monjalon To: Simon =?ISO-8859-1?Q?K=E5gstr=F6m?= Date: Tue, 20 Oct 2015 14:38:54 +0200 Message-ID: <2727565.cjguxIjPP1@xps13> Organization: 6WIND User-Agent: KMail/4.14.10 (Linux/4.1.6-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: <56263196.9020305@netinsight.net> References: <56263196.9020305@netinsight.net> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" Cc: dev@dpdk.org Subject: Re: [dpdk-dev] Unit for tx_rate in rte_eth_set_queue_rate_limit? 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: Tue, 20 Oct 2015 12:39:59 -0000 2015-10-20 14:20, Simon K=E5gstr=F6m: > Hi! >=20 > What is the unit of the tx_rate parameter to the > rte_eth_set_queue_rate_limit function? It's documented as >=20 > /** > * Set the rate limitation for a queue on an Ethernet device. > * > * @param port_id > * The port identifier of the Ethernet device. > * @param queue_idx > * The queue id. > * @param tx_rate > * The tx rate allocated from the total link speed for this queue. > * @return > * - (0) if successful. > * - (-ENOTSUP) if hardware doesn't support this feature. > * - (-ENODEV) if *port_id* invalid. > * - (-EINVAL) if bad parameter. > */ > int rte_eth_set_queue_rate_limit(uint8_t port_id, uint16_t queue_idx,= > =09=09=09uint16_t tx_rate); >=20 > I parse this as meaning a percentage of total link speed, i.e., on a = 10 > Gbps link, 50 would mean 5Gbps, 10 means 1Gbps etc. Is this correct? It's implemented only in ixgbe: /* Calculate the rate factor values to set */ rf_int =3D (uint32_t)link_speed / (uint32_t)tx_rate; rf_dec =3D (uint32_t)link_speed % (uint32_t)tx_rate; rf_dec =3D (rf_dec << IXGBE_RTTBCNRC_RF_INT_SHIFT) / tx_rate; bcnrc_val =3D IXGBE_RTTBCNRC_RS_ENA; bcnrc_val |=3D ((rf_int << IXGBE_RTTBCNRC_RF_INT_SHIFT) & IXGBE_RTTBCNRC_RF_INT_MASK_M); bcnrc_val |=3D (rf_dec & IXGBE_RTTBCNRC_RF_DEC_MASK); So you just need to check the datasheet and send a patch to make it cle= ar :) Thanks