DPDK-dev Archive on lore.kernel.org
 help / color / Atom feed
From: "Wei Hu (Xavier)" <xavier.huwei@tom.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 4/9] net/hns3: modify custom macro
Date: Mon,  2 Dec 2019 10:51:21 +0800
Message-ID: <20191202025126.73423-5-xavier.huwei@tom.com> (raw)
In-Reply-To: <20191202025126.73423-1-xavier.huwei@tom.com>

From: Huisong Li <lihuisong@huawei.com>

This patch replaces custom macro named HNS3_MIN_FRAME_LEN for ethernet
minimum frame length with the macro named RTE_ETHER_MIN_LEN that defined
in dpdk framework.

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

diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index 3c591be51..e401bc0d0 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -2147,7 +2147,7 @@ hns3_set_mac_mtu(struct hns3_hw *hw, uint16_t new_mps)
 
 	req = (struct hns3_config_max_frm_size_cmd *)desc.data;
 	req->max_frm_size = rte_cpu_to_le_16(new_mps);
-	req->min_frm_size = HNS3_MIN_FRAME_LEN;
+	req->min_frm_size = RTE_ETHER_MIN_LEN;
 
 	return hns3_cmd_send(hw, &desc, 1);
 }
diff --git a/drivers/net/hns3/hns3_ethdev.h b/drivers/net/hns3/hns3_ethdev.h
index 004cd75a9..7422706a8 100644
--- a/drivers/net/hns3/hns3_ethdev.h
+++ b/drivers/net/hns3/hns3_ethdev.h
@@ -33,7 +33,6 @@
 #define HNS3_MAX_BD_SIZE		65535
 #define HNS3_MAX_TX_BD_PER_PKT		8
 #define HNS3_MAX_FRAME_LEN		9728
-#define HNS3_MIN_FRAME_LEN		64
 #define HNS3_VLAN_TAG_SIZE		4
 #define HNS3_DEFAULT_RX_BUF_LEN		2048
 
diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
index e7f0c8fc9..0090cda31 100644
--- a/drivers/net/hns3/hns3_rxtx.c
+++ b/drivers/net/hns3/hns3_rxtx.c
@@ -1561,7 +1561,7 @@ hns3_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 		m = tx_pkts[i];
 
 		/* check the size of packet */
-		if (m->pkt_len < HNS3_MIN_FRAME_LEN) {
+		if (m->pkt_len < RTE_ETHER_MIN_LEN) {
 			rte_errno = EINVAL;
 			return i;
 		}
-- 
2.23.0


  parent reply index

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-02  2:51 [dpdk-dev] [PATCH 0/9] updates for hns3 PMD driver Wei Hu (Xavier)
2019-12-02  2:51 ` [dpdk-dev] [PATCH 1/9] net/hns3: support Rx interrupt Wei Hu (Xavier)
2019-12-02  2:51 ` [dpdk-dev] [PATCH 2/9] net/hns3: get link state change through mailbox Wei Hu (Xavier)
2019-12-03 13:16   ` Ferruh Yigit
2019-12-03 13:19     ` Ferruh Yigit
2019-12-14 10:12       ` Wei Hu (Xavier)
2019-12-14 10:26     ` Wei Hu (Xavier)
2019-12-02  2:51 ` [dpdk-dev] [PATCH 3/9] net/hns3: modify the return value of enable msix Wei Hu (Xavier)
2019-12-02  2:51 ` Wei Hu (Xavier) [this message]
2019-12-02  2:51 ` [dpdk-dev] [PATCH 5/9] net/hns3: optimize RSS's default algorithm Wei Hu (Xavier)
2019-12-02  2:51 ` [dpdk-dev] [PATCH 6/9] net/hns3: remove the redundant function call Wei Hu (Xavier)
2019-12-02  2:51 ` [dpdk-dev] [PATCH 7/9] net/hns3: remove the redundant variable initialization Wei Hu (Xavier)
2019-12-02  2:51 ` [dpdk-dev] [PATCH 8/9] net/hns3: remove the unnecessary assignment Wei Hu (Xavier)
2019-12-02  2:51 ` [dpdk-dev] [PATCH 9/9] net/hns3: remove the unused macros Wei Hu (Xavier)

Reply instructions:

You may reply publically 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=20191202025126.73423-5-xavier.huwei@tom.com \
    --to=xavier.huwei@tom.com \
    --cc=dev@dpdk.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

DPDK-dev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/dpdk-dev/0 dpdk-dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dpdk-dev dpdk-dev/ https://lore.kernel.org/dpdk-dev \
		dev@dpdk.org
	public-inbox-index dpdk-dev

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git