DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] Unit for tx_rate in rte_eth_set_queue_rate_limit?
@ 2015-10-20 12:20 Simon Kågström
  2015-10-20 12:38 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: Simon Kågström @ 2015-10-20 12:20 UTC (permalink / raw)
  To: thomas.monjalon; +Cc: dev

Hi!

What is the unit of the tx_rate parameter to the
rte_eth_set_queue_rate_limit function? It's documented as

/**
 * 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,
			uint16_t tx_rate);

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?

// Simon

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] Unit for tx_rate in rte_eth_set_queue_rate_limit?
  2015-10-20 12:20 [dpdk-dev] Unit for tx_rate in rte_eth_set_queue_rate_limit? Simon Kågström
@ 2015-10-20 12:38 ` Thomas Monjalon
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Monjalon @ 2015-10-20 12:38 UTC (permalink / raw)
  To: Simon Kågström; +Cc: dev

2015-10-20 14:20, Simon Kågström:
> Hi!
> 
> What is the unit of the tx_rate parameter to the
> rte_eth_set_queue_rate_limit function? It's documented as
> 
> /**
>  * 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,
> 			uint16_t tx_rate);
> 
> 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 = (uint32_t)link_speed / (uint32_t)tx_rate;
        rf_dec = (uint32_t)link_speed % (uint32_t)tx_rate;
        rf_dec = (rf_dec << IXGBE_RTTBCNRC_RF_INT_SHIFT) / tx_rate;

        bcnrc_val = IXGBE_RTTBCNRC_RS_ENA;
        bcnrc_val |= ((rf_int << IXGBE_RTTBCNRC_RF_INT_SHIFT) &
                IXGBE_RTTBCNRC_RF_INT_MASK_M);
        bcnrc_val |= (rf_dec & IXGBE_RTTBCNRC_RF_DEC_MASK);

So you just need to check the datasheet and send a patch to make it clear :)
Thanks

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-10-20 12:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-20 12:20 [dpdk-dev] Unit for tx_rate in rte_eth_set_queue_rate_limit? Simon Kågström
2015-10-20 12:38 ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).