From: Rami Rosen <roszenrami@gmail.com>
To: dev@dpdk.org
Cc: emma.finn@intel.com
Subject: Re: [dpdk-dev] [PATCH v1] testpmd: add new command for show port info
Date: Wed, 29 Aug 2018 08:36:44 +0300 [thread overview]
Message-ID: <CAKoUArk3DmSGM7ZrqgdsZorC6FX6=YFLFP-oiJ9kZ9e5HpEGZg@mail.gmail.com> (raw)
Hi,
Thanks for this patch, this patch is something needed.
It seems to me that adding get_valid_ports() is not necessary, as you have
rte_eth_dev_count_avail(), which is implemented the same; please look
in rte_ethdev.[c,h; and actually, testpmd uses
rte_eth_dev_count_avail(), for example, in attach_port() in testpmd.c.
Besides, it should return uint16_t and not int, as DPDK ports are 16
bits, and count is defined as uint16_t.
+int get_valid_ports(void)
+{
+ portid_t pid;
+ uint16_t count = 0;
+
+ RTE_ETH_FOREACH_DEV(pid) {
+ count ++;
+ }
+ return count;
+}
and in rte_ethdev.c you have:
uint16_t
rte_eth_dev_count_avail(void)
{
uint16_t p;
uint16_t count;
count = 0;
RTE_ETH_FOREACH_DEV(p)
count++;
return count;
}
Regards,
Rami Rosen
next reply other threads:[~2018-08-29 5:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-29 5:36 Rami Rosen [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-08-28 14:11 Emma Finn
2018-08-28 16:55 ` Stephen Hemminger
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='CAKoUArk3DmSGM7ZrqgdsZorC6FX6=YFLFP-oiJ9kZ9e5HpEGZg@mail.gmail.com' \
--to=roszenrami@gmail.com \
--cc=dev@dpdk.org \
--cc=emma.finn@intel.com \
/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).