DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jie Pan <panjie5@jd.com>
To: <ferruh.yigit@intel.com>
Cc: <dev@dpdk.org>, Jie Pan <panjie5@jd.com>, <stable@dpdk.org>
Subject: [dpdk-dev] [PATCH v2] kni: fix the type for MAC address
Date: Wed, 10 Apr 2019 14:20:55 +0800	[thread overview]
Message-ID: <1554877255-5937-1-git-send-email-panjie5@jd.com> (raw)
Message-ID: <20190410062055.IREFR_D3Ci1vuEXz_IXeeB5MSDLJ8aw2AHTqxKTPbqA@z> (raw)
In-Reply-To: <1548301983-20020-1-git-send-email-panjie5@jd.com>

The type for MAC address should be unsigned.

Fixes: 1cfe212ed17a ("kni: support MAC address change")
Cc: stable@dpdk.org

Signed-off-by: Jie Pan <panjie5@jd.com>
---
 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


  parent reply	other threads:[~2019-04-10  6:07 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-24  3:53 [dpdk-dev] [PATCH] lib/librte_kni: fix the type for mac address Jie Pan
2019-04-04 23:27 ` Thomas Monjalon
2019-04-04 23:27   ` Thomas Monjalon
2019-04-09 19:47 ` Yigit, Ferruh
2019-04-09 19:47   ` Yigit, Ferruh
2019-04-10  6:20   ` [dpdk-dev] 答复: " 潘杰
2019-04-10  6:20     ` 潘杰
2019-04-10  6:09 ` [dpdk-dev] [PATCH v2] kni: fix the type for MAC address Jie Pan
2019-04-10  6:09   ` Jie Pan
2019-04-10  6:20 ` Jie Pan [this message]
2019-04-10  6:20   ` Jie Pan
2019-04-19 12:15   ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
2019-04-19 12:15     ` Ferruh Yigit
2019-04-19 15:29     ` Rami Rosen
2019-04-19 15:29       ` Rami Rosen
2019-04-19 20:58       ` Thomas Monjalon
2019-04-19 20:58         ` Thomas Monjalon

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=1554877255-5937-1-git-send-email-panjie5@jd.com \
    --to=panjie5@jd.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=stable@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
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).