DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Wei Hu (Xavier)" <huwei013@chinasoftinc.com>
To: <dev@dpdk.org>
Cc: <ferruh.yigit@intel.com>, <xavier.huwei@huawei.com>
Subject: [dpdk-dev] [PATCH 07/11] net/hns3: replace private macro with RTE MAX
Date: Tue, 25 Aug 2020 19:53:01 +0800	[thread overview]
Message-ID: <20200825115305.58490-8-huwei013@chinasoftinc.com> (raw)
In-Reply-To: <20200825115305.58490-1-huwei013@chinasoftinc.com>

From: Huisong Li <lihuisong@huawei.com>

This patch uses RTE_MAX function in DPDK lib to replace the private
macro named max_t in hns3 PMD driver.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
---
 drivers/net/hns3/hns3_ethdev.c | 5 ++---
 drivers/net/hns3/hns3_ethdev.h | 5 -----
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index b9ee11413..fca035d4f 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -3285,7 +3285,7 @@ hns3_is_rx_buf_ok(struct hns3_hw *hw, struct hns3_pkt_buf_alloc *buf_alloc,
 					+ pf->dv_buf_size;
 
 	shared_buf_tc = tc_num * aligned_mps + aligned_mps;
-	shared_std = roundup(max_t(uint32_t, shared_buf_min, shared_buf_tc),
+	shared_std = roundup(RTE_MAX(shared_buf_min, shared_buf_tc),
 			     HNS3_BUF_SIZE_UNIT);
 
 	rx_priv = hns3_get_rx_priv_buff_alloced(buf_alloc);
@@ -3315,8 +3315,7 @@ hns3_is_rx_buf_ok(struct hns3_hw *hw, struct hns3_pkt_buf_alloc *buf_alloc,
 		if (tc_num)
 			hi_thrd = hi_thrd / tc_num;
 
-		hi_thrd = max_t(uint32_t, hi_thrd,
-				HNS3_BUF_MUL_BY * aligned_mps);
+		hi_thrd = RTE_MAX(hi_thrd, HNS3_BUF_MUL_BY * aligned_mps);
 		hi_thrd = rounddown(hi_thrd, HNS3_BUF_SIZE_UNIT);
 		lo_thrd = hi_thrd - aligned_mps / HNS3_BUF_DIV_BY;
 	} else {
diff --git a/drivers/net/hns3/hns3_ethdev.h b/drivers/net/hns3/hns3_ethdev.h
index ca4cade42..a42479d64 100644
--- a/drivers/net/hns3/hns3_ethdev.h
+++ b/drivers/net/hns3/hns3_ethdev.h
@@ -708,11 +708,6 @@ struct hns3_adapter {
 
 #define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
 
-#define max_t(type, x, y) ({                    \
-	type __max1 = (x);                      \
-	type __max2 = (y);                      \
-	__max1 > __max2 ? __max1 : __max2; })
-
 static inline void hns3_write_reg(void *base, uint32_t reg, uint32_t value)
 {
 	rte_write32(value, (volatile void *)((char *)base + reg));
-- 
2.27.0


  parent reply	other threads:[~2020-08-25 11:54 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-25 11:52 [dpdk-dev] [PATCH 00/11] updates for hns3 PMD driver Wei Hu (Xavier)
2020-08-25 11:52 ` [dpdk-dev] [PATCH 01/11] net/hns3: get device capability from firmware Wei Hu (Xavier)
2020-08-25 11:52 ` [dpdk-dev] [PATCH 02/11] net/hns3: get dev specifications " Wei Hu (Xavier)
2020-08-25 11:52 ` [dpdk-dev] [PATCH 03/11] net/hns3: compatibility issues about Rx interrupts Wei Hu (Xavier)
2020-08-25 11:52 ` [dpdk-dev] [PATCH 04/11] net/hns3: compatibility issues about Tx padding short frame Wei Hu (Xavier)
2020-08-25 11:52 ` [dpdk-dev] [PATCH 05/11] net/hns3: add more hardware error types Wei Hu (Xavier)
2020-09-04 10:34   ` Ferruh Yigit
2020-08-25 11:53 ` [dpdk-dev] [PATCH 06/11] net/hns3: support a maximun 256 FDIR counter Wei Hu (Xavier)
2020-08-25 11:53 ` Wei Hu (Xavier) [this message]
2020-08-25 11:53 ` [dpdk-dev] [PATCH 08/11] net/hns3: change the log level to INFO Wei Hu (Xavier)
2020-09-04 10:34   ` Ferruh Yigit
2020-09-07 11:34     ` Wei Hu (Xavier)
2020-09-07 12:10       ` Ferruh Yigit
2020-09-07 12:28         ` Wei Hu (Xavier)
2020-08-25 11:53 ` [dpdk-dev] [PATCH 09/11] net/hns3: fix default MAC addr from firmware Wei Hu (Xavier)
2020-08-25 11:53 ` [dpdk-dev] [PATCH 10/11] net/hns3: fix Rx/Tx queue offload capability Wei Hu (Xavier)
2020-09-04 10:34   ` Ferruh Yigit
2020-09-08 11:48     ` Wei Hu (Xavier)
2020-09-08 12:28   ` [dpdk-dev] [PATCH v2] " Wei Hu (Xavier)
2020-09-15 13:35     ` Ferruh Yigit
2020-08-25 11:53 ` [dpdk-dev] [PATCH 11/11] net/hns3: fix some incomplete command structures Wei Hu (Xavier)
2020-09-03  1:04 ` [dpdk-dev] [PATCH 00/11] updates for hns3 PMD driver Wei Hu (Xavier)
2020-09-04 10:34   ` Ferruh Yigit

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=20200825115305.58490-8-huwei013@chinasoftinc.com \
    --to=huwei013@chinasoftinc.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=xavier.huwei@huawei.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).