From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp3.jd.com (smtp3.jd.com [59.151.64.88]) by dpdk.org (Postfix) with ESMTP id 65FDD5B2C; Wed, 10 Apr 2019 07:57:13 +0200 (CEST) Received: from BJMAILD1MBX106.360buyAD.local (172.31.0.106) by BJMAILD1MBX43.360buyAD.local (172.31.0.43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1415.2; Wed, 10 Apr 2019 13:56:48 +0800 Received: from BJMAILD1MBX106.360buyAD.local (172.31.0.106) by BJMAILD1MBX106.360buyAD.local (172.31.0.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1415.2; Wed, 10 Apr 2019 13:56:47 +0800 Received: from HUB04.360buyAD.local (172.17.27.18) by BJMAILD1MBX106.360buyAD.local (172.31.0.106) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA_P256) id 15.1.1415.2 via Frontend Transport; Wed, 10 Apr 2019 13:56:47 +0800 Received: from hb1-lan-wangyandlvs-01.hb1.jd.local (103.235.240.10) by hub04.360buyAD.local (172.17.27.18) with Microsoft SMTP Server id 14.3.361.1; Wed, 10 Apr 2019 13:56:47 +0800 From: Jie Pan To: CC: , Jie Pan , Date: Wed, 10 Apr 2019 14:09:49 +0800 Message-ID: <1554876589-4315-1-git-send-email-panjie5@jd.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1548301983-20020-1-git-send-email-panjie5@jd.com> References: <1548301983-20020-1-git-send-email-panjie5@jd.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [103.235.240.10] X-Mailman-Approved-At: Wed, 10 Apr 2019 11:01:32 +0200 Subject: [dpdk-dev] [PATCH v2] kni: fix the type for MAC address 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: , X-List-Received-Date: Wed, 10 Apr 2019 05:57:14 -0000 The type for MAC address should be unsigned. Fixes: 1cfe212ed17a ("kni: support MAC address change") Cc: stable@dpdk.org Signed-off-by: Jie Pan --- kernel/linux/kni/kni_misc.c | 2 +- lib/librte_eal/linux/eal/include/rte_kni_common.h | 2 +- lib/librte_kni/rte_kni.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/linux/kni/kni_misc.c b/kernel/linux/kni/kni_misc.c index 31845e1..b6f474d 100644 --- a/kernel/linux/kni/kni_misc.c +++ b/kernel/linux/kni/kni_misc.c @@ -447,7 +447,7 @@ struct kni_net { ether_addr_copy(net_dev->dev_addr, kni->lad_dev->dev_addr); else { /* if user has provided a valid mac address */ - if (is_valid_ether_addr((unsigned char *)(dev_info.mac_addr))) + if (is_valid_ether_addr(dev_info.mac_addr)) memcpy(net_dev->dev_addr, dev_info.mac_addr, ETH_ALEN); else /* diff --git a/lib/librte_eal/linux/eal/include/rte_kni_common.h b/lib/librte_eal/linux/eal/include/rte_kni_common.h index 5afa087..5db5a13 100644 --- a/lib/librte_eal/linux/eal/include/rte_kni_common.h +++ b/lib/librte_eal/linux/eal/include/rte_kni_common.h @@ -127,7 +127,7 @@ struct rte_kni_device_info { /* mbuf size */ unsigned mbuf_size; unsigned int mtu; - char mac_addr[6]; + uint8_t mac_addr[6]; }; #define KNI_DEVICE "kni" diff --git a/lib/librte_kni/rte_kni.h b/lib/librte_kni/rte_kni.h index 9a9a7d7..c93d3a9 100644 --- a/lib/librte_kni/rte_kni.h +++ b/lib/librte_kni/rte_kni.h @@ -68,7 +68,7 @@ struct rte_kni_conf { __extension__ uint8_t force_bind : 1; /* Flag to bind kernel thread */ - char mac_addr[ETHER_ADDR_LEN]; /* MAC address assigned to KNI */ + uint8_t mac_addr[ETHER_ADDR_LEN]; /* MAC address assigned to KNI */ uint16_t mtu; }; -- 1.8.3.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id BAFE0A0096 for ; Wed, 10 Apr 2019 11:01:35 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 408CE5B2C; Wed, 10 Apr 2019 11:01:34 +0200 (CEST) Received: from smtp3.jd.com (smtp3.jd.com [59.151.64.88]) by dpdk.org (Postfix) with ESMTP id 65FDD5B2C; Wed, 10 Apr 2019 07:57:13 +0200 (CEST) Received: from BJMAILD1MBX106.360buyAD.local (172.31.0.106) by BJMAILD1MBX43.360buyAD.local (172.31.0.43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1415.2; Wed, 10 Apr 2019 13:56:48 +0800 Received: from BJMAILD1MBX106.360buyAD.local (172.31.0.106) by BJMAILD1MBX106.360buyAD.local (172.31.0.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1415.2; Wed, 10 Apr 2019 13:56:47 +0800 Received: from HUB04.360buyAD.local (172.17.27.18) by BJMAILD1MBX106.360buyAD.local (172.31.0.106) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA_P256) id 15.1.1415.2 via Frontend Transport; Wed, 10 Apr 2019 13:56:47 +0800 Received: from hb1-lan-wangyandlvs-01.hb1.jd.local (103.235.240.10) by hub04.360buyAD.local (172.17.27.18) with Microsoft SMTP Server id 14.3.361.1; Wed, 10 Apr 2019 13:56:47 +0800 From: Jie Pan To: CC: , Jie Pan , Date: Wed, 10 Apr 2019 14:09:49 +0800 Message-ID: <1554876589-4315-1-git-send-email-panjie5@jd.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1548301983-20020-1-git-send-email-panjie5@jd.com> References: <1548301983-20020-1-git-send-email-panjie5@jd.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Originating-IP: [103.235.240.10] X-Mailman-Approved-At: Wed, 10 Apr 2019 11:01:32 +0200 Subject: [dpdk-dev] [PATCH v2] kni: fix the type for MAC address 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" Message-ID: <20190410060949.ueiNxalMS-xwrOsycwlq8tUi_K8NM-dtcoQTf6e5fiY@z> The type for MAC address should be unsigned. Fixes: 1cfe212ed17a ("kni: support MAC address change") Cc: stable@dpdk.org Signed-off-by: Jie Pan --- kernel/linux/kni/kni_misc.c | 2 +- lib/librte_eal/linux/eal/include/rte_kni_common.h | 2 +- lib/librte_kni/rte_kni.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/linux/kni/kni_misc.c b/kernel/linux/kni/kni_misc.c index 31845e1..b6f474d 100644 --- a/kernel/linux/kni/kni_misc.c +++ b/kernel/linux/kni/kni_misc.c @@ -447,7 +447,7 @@ struct kni_net { ether_addr_copy(net_dev->dev_addr, kni->lad_dev->dev_addr); else { /* if user has provided a valid mac address */ - if (is_valid_ether_addr((unsigned char *)(dev_info.mac_addr))) + if (is_valid_ether_addr(dev_info.mac_addr)) memcpy(net_dev->dev_addr, dev_info.mac_addr, ETH_ALEN); else /* diff --git a/lib/librte_eal/linux/eal/include/rte_kni_common.h b/lib/librte_eal/linux/eal/include/rte_kni_common.h index 5afa087..5db5a13 100644 --- a/lib/librte_eal/linux/eal/include/rte_kni_common.h +++ b/lib/librte_eal/linux/eal/include/rte_kni_common.h @@ -127,7 +127,7 @@ struct rte_kni_device_info { /* mbuf size */ unsigned mbuf_size; unsigned int mtu; - char mac_addr[6]; + uint8_t mac_addr[6]; }; #define KNI_DEVICE "kni" diff --git a/lib/librte_kni/rte_kni.h b/lib/librte_kni/rte_kni.h index 9a9a7d7..c93d3a9 100644 --- a/lib/librte_kni/rte_kni.h +++ b/lib/librte_kni/rte_kni.h @@ -68,7 +68,7 @@ struct rte_kni_conf { __extension__ uint8_t force_bind : 1; /* Flag to bind kernel thread */ - char mac_addr[ETHER_ADDR_LEN]; /* MAC address assigned to KNI */ + uint8_t mac_addr[ETHER_ADDR_LEN]; /* MAC address assigned to KNI */ uint16_t mtu; }; -- 1.8.3.1