[dpdk-dev] [PATCH v2 4/9] net/hns3: modify custom macro
Wei Hu (Xavier)
huwei013 at chinasoftinc.com
Sat Dec 14 11:29:29 CET 2019
From: Huisong Li <lihuisong at 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 at huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei at 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 5795b3b34..981e05b61 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -2148,7 +2148,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
More information about the dev
mailing list