From: Andrew Rybchenko <arybchenko@solarflare.com>
To: Thomas Monjalon <thomas@monjalon.net>, <dev@dpdk.org>,
Roman Zhukov <Roman.Zhukov@oktetlabs.ru>
Subject: Re: [dpdk-dev] [RFC PATCH 1/2] ethdev: add function to adjust number of descriptors
Date: Tue, 25 Apr 2017 10:39:54 +0300 [thread overview]
Message-ID: <c82d3a61-b3ba-fc42-87cb-e892ccdd20f0@solarflare.com> (raw)
In-Reply-To: <2685953.rHhyh0R7Aq@xps>
Hi,
On 04/24/2017 06:13 PM, Thomas Monjalon wrote:
> Hi,
>
> 02/03/2017 14:05, Andrew Rybchenko:
>> From: Roman Zhukov <Roman.Zhukov@oktetlabs.ru>
>>
>> Check that numbers of Rx and Tx descriptors satisfy descriptors limits
>> from the Ethernet device information, otherwise adjust them to boundaries.
>>
>> Signed-off-by: Roman Zhukov <Roman.Zhukov@oktetlabs.ru>
>> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
> I think this helper is OK.
> We could add it in 17.08.
Thanks, we'll prepare patch series which updates alll example
applications to use the helper.
Andrew.
> Is there any comment from PMD maintainers?
>
> [...]
>> +static void
>> +rte_eth_dev_adjust_nb_desc(uint16_t *nb_desc,
>> + const struct rte_eth_desc_lim *desc_lim)
>> +{
>> + if (desc_lim->nb_align != 0)
>> + *nb_desc = RTE_ALIGN_CEIL(*nb_desc, desc_lim->nb_align);
>> +
>> + if (desc_lim->nb_max != 0)
>> + *nb_desc = RTE_MIN(*nb_desc, desc_lim->nb_max);
>> +
>> + *nb_desc = RTE_MAX(*nb_desc, desc_lim->nb_min);
>> +}
>> +
>> +int
>> +rte_eth_dev_adjust_nb_rx_tx_desc(uint8_t port_id,
>> + uint16_t *nb_rx_desc,
>> + uint16_t *nb_tx_desc)
>> +{
>> + struct rte_eth_dev *dev;
>> + struct rte_eth_dev_info dev_info;
>> +
>> + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
>> +
>> + dev = &rte_eth_devices[port_id];
>> + RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_infos_get, -ENOTSUP);
>> +
>> + rte_eth_dev_info_get(port_id, &dev_info);
>> +
>> + if (nb_rx_desc != NULL)
>> + rte_eth_dev_adjust_nb_desc(nb_rx_desc, &dev_info.rx_desc_lim);
>> +
>> + if (nb_tx_desc != NULL)
>> + rte_eth_dev_adjust_nb_desc(nb_tx_desc, &dev_info.tx_desc_lim);
>> +
>> + return 0;
>> +}
> [...]
>> +/**
>> + * Check that numbers of Rx and Tx descriptors satisfy descriptors limits from
>> + * the ethernet device information, otherwise adjust them to boundaries.
>> + *
>> + * @param port_id
>> + * The port identifier of the Ethernet device.
>> + * @param nb_rx_desc
>> + * A pointer to a uint16_t where the number of receive
>> + * descriptors stored.
>> + * @param nb_tx_desc
>> + * A pointer to a uint16_t where the number of transmit
>> + * descriptors stored.
>> + * @return
>> + * - (0) if successful.
>> + * - (-ENOTSUP, -ENODEV or -EINVAL) on failure.
>> + */
>> +int rte_eth_dev_adjust_nb_rx_tx_desc(uint8_t port_id,
>> + uint16_t *nb_rx_desc,
>> + uint16_t *nb_tx_desc);
>> +
next prev parent reply other threads:[~2017-04-25 7:40 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-02 13:05 [dpdk-dev] [RFC PATCH 0/2] Helper function to ajdust Rx/Tx descriptor numbers Andrew Rybchenko
2017-03-02 13:05 ` [dpdk-dev] [RFC PATCH 1/2] ethdev: add function to adjust number of descriptors Andrew Rybchenko
2017-04-24 15:13 ` Thomas Monjalon
2017-04-25 7:39 ` Andrew Rybchenko [this message]
2017-05-25 15:57 ` [dpdk-dev] [PATCH " Andrew Rybchenko
2017-05-25 15:57 ` [dpdk-dev] [PATCH 2/2] examples: adjust Rx and Tx descriptors to device limits Andrew Rybchenko
2017-07-08 17:05 ` Stephen Hemminger
2017-07-09 9:40 ` Andrew Rybchenko
2017-05-25 17:40 ` [dpdk-dev] [PATCH 1/2] ethdev: add function to adjust number of descriptors Stephen Hemminger
2017-06-14 10:37 ` Andrew Rybchenko
2017-07-05 23:00 ` Thomas Monjalon
2017-07-08 16:45 ` Thomas Monjalon
2017-03-02 13:05 ` [dpdk-dev] [RFC PATCH 2/2] examples/l3fwd: add check of Rx and Tx descriptors number Andrew Rybchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c82d3a61-b3ba-fc42-87cb-e892ccdd20f0@solarflare.com \
--to=arybchenko@solarflare.com \
--cc=Roman.Zhukov@oktetlabs.ru \
--cc=dev@dpdk.org \
--cc=thomas@monjalon.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).