[dpdk-dev] net/tap: update tap index to unsgined

Message ID 1526106612-149893-1-git-send-email-vipin.varghese@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers

Checks

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

Commit Message

Varghese, Vipin May 12, 2018, 6:30 a.m. UTC
  Updating the logic to reflect unsigned integer as index for TAP PMD.

Signed-off-by: Vipin Varghese <vipin.varghese@intel.com>
---
 drivers/net/tap/rte_eth_tap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Wiles, Keith May 15, 2018, 12:36 p.m. UTC | #1
> On May 12, 2018, at 1:30 AM, Vipin Varghese <vipin.varghese@intel.com> wrote:
> 
> Updating the logic to reflect unsigned integer as index for TAP PMD.
> 
> Signed-off-by: Vipin Varghese <vipin.varghese@intel.com>
> ---
> drivers/net/tap/rte_eth_tap.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
> index 48c61b3..db397d6 100644
> --- a/drivers/net/tap/rte_eth_tap.c
> +++ b/drivers/net/tap/rte_eth_tap.c
> @@ -64,7 +64,7 @@ static const char *valid_arguments[] = {
> 	NULL
> };
> 
> -static int tap_unit;
> +static unsigned int tap_unit;
> static unsigned int tun_unit;
> 
> static int tap_type;
> @@ -1735,7 +1735,7 @@ rte_pmd_tap_probe(struct rte_vdev_device *dev)
> 	}
> 
> 	speed = ETH_SPEED_NUM_10G;
> -	snprintf(tap_name, sizeof(tap_name), "%s%d",
> +	snprintf(tap_name, sizeof(tap_name), "%s%u",
> 		 DEFAULT_TAP_NAME, tap_unit++);
> 	memset(remote_iface, 0, RTE_ETH_NAME_MAX_LEN);
> 
> -- 
> 2.7.4
> 

Acked by Keith Wiles<keith.wiles@intel.com>

Regards,
Keith
  
Ferruh Yigit May 31, 2018, 4:07 p.m. UTC | #2
On 5/15/2018 1:36 PM, Wiles, Keith wrote:
> 
> 
>> On May 12, 2018, at 1:30 AM, Vipin Varghese <vipin.varghese@intel.com> wrote:
>>
>> Updating the logic to reflect unsigned integer as index for TAP PMD.
>>
>> Signed-off-by: Vipin Varghese <vipin.varghese@intel.com>

<...>

> Acked by Keith Wiles<keith.wiles@intel.com>

Repeating ack with "-" to help patchwork:
Acked-by: Keith Wiles <keith.wiles@intel.com>

Applied to dpdk-next-net/master, thanks.
  

Patch

diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
index 48c61b3..db397d6 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -64,7 +64,7 @@  static const char *valid_arguments[] = {
 	NULL
 };
 
-static int tap_unit;
+static unsigned int tap_unit;
 static unsigned int tun_unit;
 
 static int tap_type;
@@ -1735,7 +1735,7 @@  rte_pmd_tap_probe(struct rte_vdev_device *dev)
 	}
 
 	speed = ETH_SPEED_NUM_10G;
-	snprintf(tap_name, sizeof(tap_name), "%s%d",
+	snprintf(tap_name, sizeof(tap_name), "%s%u",
 		 DEFAULT_TAP_NAME, tap_unit++);
 	memset(remote_iface, 0, RTE_ETH_NAME_MAX_LEN);