From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A6E67A0543; Wed, 12 Oct 2022 16:20:58 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4A6F04303E; Wed, 12 Oct 2022 16:20:58 +0200 (CEST) Received: from smail.rz.tu-ilmenau.de (smail.rz.tu-ilmenau.de [141.24.186.67]) by mails.dpdk.org (Postfix) with ESMTP id 3BC9C42EF7 for ; Wed, 12 Oct 2022 16:20:57 +0200 (CEST) Received: from [10.183.254.100] (unknown [80.88.23.165]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smail.rz.tu-ilmenau.de (Postfix) with ESMTPSA id B4B78580098; Wed, 12 Oct 2022 16:20:56 +0200 (CEST) Message-ID: <0f1d4dd2-8331-93a9-29f8-c885ab1234a8@tu-ilmenau.de> Date: Wed, 12 Oct 2022 16:20:56 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Subject: Re: [PATCH] net/bonding: fix socket_id type Content-Language: en-US To: Ferruh Yigit , dev@dpdk.org Cc: Chas Williams , Min Hu , Thorben Roemer References: <20221012114523.9569-1-markus.theil@tu-ilmenau.de> From: Markus Theil In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 10/12/22 14:23, Ferruh Yigit wrote: > On 10/12/2022 12:45 PM, Markus Theil wrote: >> From: Thorben Roemer >> >> DPDK uses int or u32 in most other places for >> socket IDs. Fix compilation warnings by also >> using int in the bonding code. >> > > Hi Markus, > > 'rte_eth_bond_create()' is part of API, so changing it impacts the users. > > Since 'rte_socket_id()' returns 'int', it is reasonable to make > 'socket_id' parameter type 'int', but I am not sure if it worth the > trouble it may cause in user end. > > Maybe we can announce the change in this release and update the API in > v23.11? > Hi Ferruh, I've searched in the whole DPDK for the usage of socket IDs. Nearly every integral type pops up when doing this. We should postpone this patch. Maybe announce a cleanup + API change for the next release and fix this treewide (I can try to do this after 22.11 is out and you agree with the cleanup). > > Can you please list the mentioned compile warning? The warning only happens when we compile our code, which uses DPDK with Wconversion enabled. Our code stores socket ids as int. Therefore the compiler notices the int to u8 conversion and warns us. > >> Signed-off-by: Thorben Roemer >> --- >>   drivers/net/bonding/rte_eth_bond.h     | 2 +- >>   drivers/net/bonding/rte_eth_bond_api.c | 2 +- >>   2 files changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/net/bonding/rte_eth_bond.h >> b/drivers/net/bonding/rte_eth_bond.h >> index 874aa91a5f..3ce2b29052 100644 >> --- a/drivers/net/bonding/rte_eth_bond.h >> +++ b/drivers/net/bonding/rte_eth_bond.h >> @@ -99,7 +99,7 @@ extern "C" { >>    *    Port Id of created rte_eth_dev on success, negative value >> otherwise >>    */ >>   int >> -rte_eth_bond_create(const char *name, uint8_t mode, uint8_t socket_id); >> +rte_eth_bond_create(const char *name, uint8_t mode, int socket_id); >>     /** >>    * Free a bonded rte_eth_dev device >> diff --git a/drivers/net/bonding/rte_eth_bond_api.c >> b/drivers/net/bonding/rte_eth_bond_api.c >> index b44dd219cb..3c6e236382 100644 >> --- a/drivers/net/bonding/rte_eth_bond_api.c >> +++ b/drivers/net/bonding/rte_eth_bond_api.c >> @@ -148,7 +148,7 @@ deactivate_slave(struct rte_eth_dev *eth_dev, >> uint16_t port_id) >>   } >>     int >> -rte_eth_bond_create(const char *name, uint8_t mode, uint8_t socket_id) >> +rte_eth_bond_create(const char *name, uint8_t mode, int socket_id) >>   { >>       struct bond_dev_private *internals; >>       struct rte_eth_dev *bond_dev; >