From: Ajay Sharma <sharmaajay@microsoft.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: Ferruh Yigit <ferruh.yigit@amd.com>,
Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
"dev@dpdk.org" <dev@dpdk.org>, Long Li <longli@microsoft.com>,
"stable@dpdk.org" <stable@dpdk.org>,
Ajay Sharma <sharmaajay@microsoft.com>
Subject: RE: [EXTERNAL] Re: EXTERNAL] [PATCH ] Add checks for the port capabilties
Date: Mon, 29 May 2023 01:41:40 +0000 [thread overview]
Message-ID: <BY5PR21MB1394C305FD2F1F31F7568AA6D64AA@BY5PR21MB1394.namprd21.prod.outlook.com> (raw)
In-Reply-To: <20230525203049.638180a6@hermes.local>
From 1290db88b8748085c9f09a58b336b8c757442b87 Mon Sep 17 00:00:00 2001
From: Ajay Sharma <sharmaajay@microsoft.com>
Date: Sun, 28 May 2023 18:31:59 -0700
Subject: [PATCH] Change USHRT_MAX to UINT16_MAX
---
drivers/net/mana/mana.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/net/mana/mana.c b/drivers/net/mana/mana.c
index 3a7e302c86..a39d6798bf 100644
--- a/drivers/net/mana/mana.c
+++ b/drivers/net/mana/mana.c
@@ -292,8 +292,8 @@ mana_dev_info_get(struct rte_eth_dev *dev,
dev_info->min_rx_bufsize = MIN_RX_BUF_SIZE;
dev_info->max_rx_pktlen = MAX_FRAME_SIZE;
- dev_info->max_rx_queues = RTE_MIN(priv->max_rx_queues, USHRT_MAX);
- dev_info->max_tx_queues = RTE_MIN(priv->max_tx_queues, USHRT_MAX);
+ dev_info->max_rx_queues = RTE_MIN(priv->max_rx_queues, UINT16_MAX);
+ dev_info->max_tx_queues = RTE_MIN(priv->max_tx_queues, UINT16_MAX);
dev_info->max_mac_addrs = MANA_MAX_MAC_ADDR;
@@ -335,17 +335,17 @@ mana_dev_info_get(struct rte_eth_dev *dev,
/* Buffer limits */
dev_info->rx_desc_lim.nb_min = MIN_BUFFERS_PER_QUEUE;
- dev_info->rx_desc_lim.nb_max = RTE_MIN(priv->max_rx_desc, USHRT_MAX);
+ dev_info->rx_desc_lim.nb_max = RTE_MIN(priv->max_rx_desc, UINT16_MAX);
dev_info->rx_desc_lim.nb_align = MIN_BUFFERS_PER_QUEUE;
- dev_info->rx_desc_lim.nb_seg_max = RTE_MIN(priv->max_recv_sge, USHRT_MAX);
- dev_info->rx_desc_lim.nb_mtu_seg_max = RTE_MIN(priv->max_recv_sge, USHRT_MAX);
+ dev_info->rx_desc_lim.nb_seg_max = RTE_MIN(priv->max_recv_sge, UINT16_MAX);
+ dev_info->rx_desc_lim.nb_mtu_seg_max = RTE_MIN(priv->max_recv_sge, UINT16_MAX);
dev_info->tx_desc_lim.nb_min = MIN_BUFFERS_PER_QUEUE;
- dev_info->tx_desc_lim.nb_max = RTE_MIN(priv->max_tx_desc, USHRT_MAX);
+ dev_info->tx_desc_lim.nb_max = RTE_MIN(priv->max_tx_desc, UINT16_MAX);
dev_info->tx_desc_lim.nb_align = MIN_BUFFERS_PER_QUEUE;
- dev_info->tx_desc_lim.nb_seg_max = RTE_MIN(priv->max_send_sge, USHRT_MAX);
- dev_info->rx_desc_lim.nb_mtu_seg_max = RTE_MIN(priv->max_recv_sge, USHRT_MAX);
+ dev_info->tx_desc_lim.nb_seg_max = RTE_MIN(priv->max_send_sge, UINT16_MAX);
+ dev_info->rx_desc_lim.nb_mtu_seg_max = RTE_MIN(priv->max_recv_sge, UINT16_MAX);
/* Speed */
dev_info->speed_capa = RTE_ETH_LINK_SPEED_100G;
--
2.25.1
> -----Original Message-----
> From: Stephen Hemminger <stephen@networkplumber.org>
> Sent: Thursday, May 25, 2023 8:31 PM
> To: Ajay Sharma <sharmaajay@microsoft.com>
> Cc: Ferruh Yigit <ferruh.yigit@amd.com>; Andrew Rybchenko
> <andrew.rybchenko@oktetlabs.ru>; dev@dpdk.org; Long Li
> <longli@microsoft.com>; stable@dpdk.org
> Subject: [EXTERNAL] Re: EXTERNAL] [PATCH ] Add checks for the port
> capabilties
>
> On Fri, 26 May 2023 00:19:59 +0000
> Ajay Sharma <sharmaajay@microsoft.com> wrote:
>
> > + dev_info->max_rx_queues = RTE_MIN(priv->max_rx_queues,
> USHRT_MAX);
> > + dev_info->max_tx_queues = RTE_MIN(priv->max_tx_queues,
> USHRT_MAX);
> > +
>
> Please use UINT16_MAX instead of USHRT_MAX since that is the type of
> max_rx_queues.
> Both are the same size but best to be consistent.
prev parent reply other threads:[~2023-05-29 1:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-28 3:36 [PATCH] net/mana: suppress TX CQE generation whenever possible longli
2023-05-06 1:32 ` [PATCH v2] " longli
2023-05-19 16:34 ` Ferruh Yigit
2023-05-19 16:40 ` Ferruh Yigit
2023-05-26 0:19 ` EXTERNAL] [PATCH ] Add checks for the port capabilties Ajay Sharma
2023-05-26 3:30 ` Stephen Hemminger
2023-05-29 1:41 ` Ajay Sharma [this message]
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=BY5PR21MB1394C305FD2F1F31F7568AA6D64AA@BY5PR21MB1394.namprd21.prod.outlook.com \
--to=sharmaajay@microsoft.com \
--cc=andrew.rybchenko@oktetlabs.ru \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@amd.com \
--cc=longli@microsoft.com \
--cc=stable@dpdk.org \
--cc=stephen@networkplumber.org \
/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).