lib/librte_kni: fix the type for mac address

Message ID 1548301983-20020-1-git-send-email-panjie5@jd.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series lib/librte_kni: fix the type for mac address |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Jie Pan Jan. 24, 2019, 3:53 a.m. UTC
  The type for mac address in struct rte_kni_conf should be unsigned.

Signed-off-by: Jie Pan <panjie5@jd.com>
---
 lib/librte_kni/rte_kni.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Thomas Monjalon April 4, 2019, 11:27 p.m. UTC | #1
24/01/2019 04:53, Jie Pan:
> The type for mac address in struct rte_kni_conf should be unsigned.
> 
> Signed-off-by: Jie Pan <panjie5@jd.com>
> ---
>  lib/librte_kni/rte_kni.h | 2 +-
> -	char mac_addr[ETHER_ADDR_LEN]; /* MAC address assigned to KNI */
> +	uint8_t mac_addr[ETHER_ADDR_LEN]; /* MAC address assigned to KNI */

Ferruh, it seems this patch is lacking a review.
  
Ferruh Yigit April 9, 2019, 7:47 p.m. UTC | #2
On 1/24/2019 3:53 AM, Jie Pan wrote:
> The type for mac address in struct rte_kni_conf should be unsigned.
> 
> Signed-off-by: Jie Pan <panjie5@jd.com>
> ---
>  lib/librte_kni/rte_kni.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/librte_kni/rte_kni.h b/lib/librte_kni/rte_kni.h
> index 02ca43b..d44496c 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;
>  };
>  
> 


Suggested title:
kni:  fix the type for MAC address

In commit log, needs:
"
Fixes: 1cfe212ed17a ("kni: support MAC address change")
Cc: stable@dpdk.org
"

Hi Jie,

What do you think about 'rte_kni_common.h', 'struct rte_kni_device_info' 'char
mac_addr[6];' field, seems added with same patch adds above 'mac_addr', does it
make sense to fix it too?
also "(unsigned char *)(dev_info.mac_addr)" in 'kni_misc.c'...
If so can you please send a new version with above fixes?

Thanks,
ferruh
  
Jie Pan April 10, 2019, 6:20 a.m. UTC | #3
Hi, Ferruh

Sure, what you said is ok.
Re-fix have upload at following link.
https://patches.dpdk.org/patch/52526/

It generate another patchwork, is that OK? 
I am not sure about this, I have used --in-reply-to option when "git send-email".

Thanks.
Jie.

-----邮件原件-----
发件人: Yigit, Ferruh <ferruh.yigit@linux.intel.com> 
发送时间: 2019年4月10日 3:48
收件人: 潘杰 <panjie5@jd.com>; ferruh.yigit@intel.com
抄送: dev@dpdk.org
主题: Re: [dpdk-dev] [PATCH] lib/librte_kni: fix the type for mac address

On 1/24/2019 3:53 AM, Jie Pan wrote:
> The type for mac address in struct rte_kni_conf should be unsigned.
> 
> Signed-off-by: Jie Pan <panjie5@jd.com>
> ---
>  lib/librte_kni/rte_kni.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/librte_kni/rte_kni.h b/lib/librte_kni/rte_kni.h index 
> 02ca43b..d44496c 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;
>  };
>  
> 


Suggested title:
kni:  fix the type for MAC address

In commit log, needs:
"
Fixes: 1cfe212ed17a ("kni: support MAC address change")
Cc: stable@dpdk.org
"

Hi Jie,

What do you think about 'rte_kni_common.h', 'struct rte_kni_device_info' 'char mac_addr[6];' field, seems added with same patch adds above 'mac_addr', does it make sense to fix it too?
also "(unsigned char *)(dev_info.mac_addr)" in 'kni_misc.c'...
If so can you please send a new version with above fixes?

Thanks,
ferruh
  

Patch

diff --git a/lib/librte_kni/rte_kni.h b/lib/librte_kni/rte_kni.h
index 02ca43b..d44496c 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;
 };