From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 77D9FA04B3; Sat, 21 Dec 2019 11:33:46 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 86DBB1BF75; Sat, 21 Dec 2019 11:33:13 +0100 (CET) Received: from incedge.chinasoftinc.com (unknown [114.113.233.8]) by dpdk.org (Postfix) with ESMTP id 39ABC37A2 for ; Sat, 21 Dec 2019 11:33:04 +0100 (CET) X-ASG-Debug-ID: 1576924379-0a3dd11b2f40d90005-TfluYd Received: from mail.chinasoftinc.com (inccas002.ito.icss [10.168.0.52]) by incedge.chinasoftinc.com with ESMTP id k01zQ5oy1JdHratc (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 21 Dec 2019 18:33:01 +0800 (CST) X-Barracuda-Envelope-From: huwei013@chinasoftinc.com X-Barracuda-RBL-Trusted-Forwarder: 10.168.0.52 X-ASG-Whitelist: Client Received: from localhost.localdomain (114.119.4.74) by INCCAS002.ito.icss (10.168.0.60) with Microsoft SMTP Server id 14.3.439.0; Sat, 21 Dec 2019 18:33:00 +0800 From: "Wei Hu (Xavier)" X-Barracuda-RBL-Trusted-Forwarder: 10.168.0.60 To: Date: Sat, 21 Dec 2019 18:32:48 +0800 X-ASG-Orig-Subj: [PATCH v3 4/9] net/hns3: modify custom macro Message-ID: <20191221103253.30746-5-huwei013@chinasoftinc.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191221103253.30746-1-huwei013@chinasoftinc.com> References: <20191221103253.30746-1-huwei013@chinasoftinc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [114.119.4.74] X-Barracuda-Connect: inccas002.ito.icss[10.168.0.52] X-Barracuda-Start-Time: 1576924381 X-Barracuda-Encrypted: ECDHE-RSA-AES256-SHA X-Barracuda-URL: https://spam.chinasoftinc.com:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at chinasoftinc.com X-Barracuda-Scan-Msg-Size: 1906 Subject: [dpdk-dev] [PATCH v3 4/9] net/hns3: modify custom macro X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Huisong Li 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 Signed-off-by: Wei Hu (Xavier) --- 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 fa0af847a..4ce9515a9 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 e1bdba972..d9219d123 100644 --- a/drivers/net/hns3/hns3_rxtx.c +++ b/drivers/net/hns3/hns3_rxtx.c @@ -1551,7 +1551,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