DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: dev@dpdk.org
Cc: Ferruh Yigit <ferruh.yigit@intel.com>
Subject: [dpdk-dev] [PATCH v3 05/19] kni: prefer unsigned int to unsigned
Date: Mon, 26 Sep 2016 16:39:24 +0100	[thread overview]
Message-ID: <20160926153938.7575-6-ferruh.yigit@intel.com> (raw)
In-Reply-To: <20160926153938.7575-1-ferruh.yigit@intel.com>

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 lib/librte_eal/linuxapp/kni/kni_dev.h   |  4 ++--
 lib/librte_eal/linuxapp/kni/kni_fifo.h  | 28 ++++++++++++++--------------
 lib/librte_eal/linuxapp/kni/kni_net.c   | 22 +++++++++++-----------
 lib/librte_eal/linuxapp/kni/kni_vhost.c | 12 ++++++------
 4 files changed, 33 insertions(+), 33 deletions(-)

diff --git a/lib/librte_eal/linuxapp/kni/kni_dev.h b/lib/librte_eal/linuxapp/kni/kni_dev.h
index e1c79b1..1d01fb1 100644
--- a/lib/librte_eal/linuxapp/kni/kni_dev.h
+++ b/lib/librte_eal/linuxapp/kni/kni_dev.h
@@ -51,7 +51,7 @@ struct kni_dev {
 	struct net_device_stats stats;
 	int status;
 	uint16_t group_id;           /* Group ID of a group of KNI devices */
-	unsigned core_id;            /* Core ID to bind */
+	unsigned int core_id;        /* Core ID to bind */
 	char name[RTE_KNI_NAMESIZE]; /* Network device name */
 	struct task_struct *pthread;
 
@@ -92,7 +92,7 @@ struct kni_dev {
 	void *mbuf_va;
 
 	/* mbuf size */
-	unsigned mbuf_size;
+	unsigned int mbuf_size;
 
 	/* synchro for request processing */
 	unsigned long synchro;
diff --git a/lib/librte_eal/linuxapp/kni/kni_fifo.h b/lib/librte_eal/linuxapp/kni/kni_fifo.h
index 4006b1f..94a7f9d 100644
--- a/lib/librte_eal/linuxapp/kni/kni_fifo.h
+++ b/lib/librte_eal/linuxapp/kni/kni_fifo.h
@@ -30,13 +30,13 @@
 /**
  * Adds num elements into the fifo. Return the number actually written
  */
-static inline unsigned
-kni_fifo_put(struct rte_kni_fifo *fifo, void **data, unsigned num)
+static inline unsigned int
+kni_fifo_put(struct rte_kni_fifo *fifo, void **data, unsigned int num)
 {
-	unsigned i = 0;
-	unsigned fifo_write = fifo->write;
-	unsigned fifo_read = fifo->read;
-	unsigned new_write = fifo_write;
+	unsigned int i = 0;
+	unsigned int fifo_write = fifo->write;
+	unsigned int fifo_read = fifo->read;
+	unsigned int new_write = fifo_write;
 
 	for (i = 0; i < num; i++) {
 		new_write = (new_write + 1) & (fifo->len - 1);
@@ -54,12 +54,12 @@ kni_fifo_put(struct rte_kni_fifo *fifo, void **data, unsigned num)
 /**
  * Get up to num elements from the fifo. Return the number actully read
  */
-static inline unsigned
-kni_fifo_get(struct rte_kni_fifo *fifo, void **data, unsigned num)
+static inline unsigned int
+kni_fifo_get(struct rte_kni_fifo *fifo, void **data, unsigned int num)
 {
-	unsigned i = 0;
-	unsigned new_read = fifo->read;
-	unsigned fifo_write = fifo->write;
+	unsigned int i = 0;
+	unsigned int new_read = fifo->read;
+	unsigned int fifo_write = fifo->write;
 
 	for (i = 0; i < num; i++) {
 		if (new_read == fifo_write)
@@ -76,7 +76,7 @@ kni_fifo_get(struct rte_kni_fifo *fifo, void **data, unsigned num)
 /**
  * Get the num of elements in the fifo
  */
-static inline unsigned
+static inline unsigned int
 kni_fifo_count(struct rte_kni_fifo *fifo)
 {
 	return (fifo->len + fifo->write - fifo->read) & (fifo->len - 1);
@@ -85,7 +85,7 @@ kni_fifo_count(struct rte_kni_fifo *fifo)
 /**
  * Get the num of available elements in the fifo
  */
-static inline unsigned
+static inline unsigned int
 kni_fifo_free_count(struct rte_kni_fifo *fifo)
 {
 	return (fifo->read - fifo->write - 1) & (fifo->len - 1);
@@ -96,7 +96,7 @@ kni_fifo_free_count(struct rte_kni_fifo *fifo)
  * Initializes the kni fifo structure
  */
 static inline void
-kni_fifo_init(struct rte_kni_fifo *fifo, unsigned size)
+kni_fifo_init(struct rte_kni_fifo *fifo, unsigned int size)
 {
 	fifo->write = 0;
 	fifo->read = 0;
diff --git a/lib/librte_eal/linuxapp/kni/kni_net.c b/lib/librte_eal/linuxapp/kni/kni_net.c
index 138297f..937dd09 100644
--- a/lib/librte_eal/linuxapp/kni/kni_net.c
+++ b/lib/librte_eal/linuxapp/kni/kni_net.c
@@ -157,9 +157,9 @@ kni_net_config(struct net_device *dev, struct ifmap *map)
 static void
 kni_net_rx_normal(struct kni_dev *kni)
 {
-	unsigned ret;
+	unsigned int ret;
 	uint32_t len;
-	unsigned i, num_rx, num_fq;
+	unsigned int i, num_rx, num_fq;
 	struct rte_kni_mbuf *kva;
 	void *data_kva;
 	struct sk_buff *skb;
@@ -173,7 +173,7 @@ kni_net_rx_normal(struct kni_dev *kni)
 	}
 
 	/* Calculate the number of entries to dequeue from rx_q */
-	num_rx = min(num_fq, (unsigned)MBUF_BURST_SZ);
+	num_rx = min(num_fq, (unsigned int)MBUF_BURST_SZ);
 
 	/* Burst dequeue from rx_q */
 	num_rx = kni_fifo_get(kni->rx_q, kni->pa, num_rx);
@@ -241,9 +241,9 @@ kni_net_rx_normal(struct kni_dev *kni)
 static void
 kni_net_rx_lo_fifo(struct kni_dev *kni)
 {
-	unsigned ret;
+	unsigned int ret;
 	uint32_t len;
-	unsigned i, num, num_rq, num_tq, num_aq, num_fq;
+	unsigned int i, num, num_rq, num_tq, num_aq, num_fq;
 	struct rte_kni_mbuf *kva;
 	void *data_kva;
 	struct rte_kni_mbuf *alloc_kva;
@@ -265,7 +265,7 @@ kni_net_rx_lo_fifo(struct kni_dev *kni)
 	num = min(num_rq, num_tq);
 	num = min(num, num_aq);
 	num = min(num, num_fq);
-	num = min(num, (unsigned)MBUF_BURST_SZ);
+	num = min(num, (unsigned int)MBUF_BURST_SZ);
 
 	/* Return if no entry to dequeue from rx_q */
 	if (num == 0)
@@ -326,9 +326,9 @@ kni_net_rx_lo_fifo(struct kni_dev *kni)
 static void
 kni_net_rx_lo_fifo_skb(struct kni_dev *kni)
 {
-	unsigned ret;
+	unsigned int ret;
 	uint32_t len;
-	unsigned i, num_rq, num_fq, num;
+	unsigned int i, num_rq, num_fq, num;
 	struct rte_kni_mbuf *kva;
 	void *data_kva;
 	struct sk_buff *skb;
@@ -342,7 +342,7 @@ kni_net_rx_lo_fifo_skb(struct kni_dev *kni)
 
 	/* Calculate the number of entries to dequeue from rx_q */
 	num = min(num_rq, num_fq);
-	num = min(num, (unsigned)MBUF_BURST_SZ);
+	num = min(num, (unsigned int)MBUF_BURST_SZ);
 
 	/* Return if no entry to dequeue from rx_q */
 	if (num == 0)
@@ -448,7 +448,7 @@ static int
 kni_net_tx(struct sk_buff *skb, struct net_device *dev)
 {
 	int len = 0;
-	unsigned ret;
+	unsigned int ret;
 	struct kni_dev *kni = netdev_priv(dev);
 	struct rte_kni_mbuf *pkt_kva = NULL;
 	void *pkt_pa = NULL;
@@ -595,7 +595,7 @@ kni_net_process_request(struct kni_dev *kni, struct rte_kni_request *req)
 {
 	int ret = -1;
 	void *resp_va;
-	unsigned num;
+	unsigned int num;
 	int ret_val;
 
 	if (!kni || !req) {
diff --git a/lib/librte_eal/linuxapp/kni/kni_vhost.c b/lib/librte_eal/linuxapp/kni/kni_vhost.c
index b4d91ca..f1345c3 100644
--- a/lib/librte_eal/linuxapp/kni/kni_vhost.c
+++ b/lib/librte_eal/linuxapp/kni/kni_vhost.c
@@ -69,7 +69,7 @@ static struct proto kni_raw_proto = {
 
 static inline int
 kni_vhost_net_tx(struct kni_dev *kni, struct msghdr *m,
-		 unsigned offset, unsigned len)
+		 unsigned int offset, unsigned int len)
 {
 	struct rte_kni_mbuf *pkt_kva = NULL;
 	struct rte_kni_mbuf *pkt_va = NULL;
@@ -145,7 +145,7 @@ drop:
 
 static inline int
 kni_vhost_net_rx(struct kni_dev *kni, struct msghdr *m,
-		 unsigned offset, unsigned len)
+		 unsigned int offset, unsigned int len)
 {
 	uint32_t pkt_len;
 	struct rte_kni_mbuf *kva;
@@ -280,9 +280,9 @@ int
 kni_chk_vhost_rx(struct kni_dev *kni)
 {
 	struct kni_vhost_queue *q = kni->vhost_queue;
-	unsigned nb_in, nb_mbuf, nb_skb;
-	const unsigned BURST_MASK = RX_BURST_SZ - 1;
-	unsigned nb_burst, nb_backlog, i;
+	unsigned int nb_in, nb_mbuf, nb_skb;
+	const unsigned int BURST_MASK = RX_BURST_SZ - 1;
+	unsigned int nb_burst, nb_backlog, i;
 	struct sk_buff *skb[RX_BURST_SZ];
 	struct rte_kni_mbuf *va[RX_BURST_SZ];
 
@@ -298,7 +298,7 @@ kni_chk_vhost_rx(struct kni_dev *kni)
 	nb_mbuf = kni_fifo_count(kni->rx_q);
 
 	nb_in = min(nb_mbuf, nb_skb);
-	nb_in = min(nb_in, (unsigned)RX_BURST_SZ);
+	nb_in = min(nb_in, (unsigned int)RX_BURST_SZ);
 	nb_burst   = (nb_in & ~BURST_MASK);
 	nb_backlog = (nb_in & BURST_MASK);
 
-- 
2.7.4

  parent reply	other threads:[~2016-09-26 15:41 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-15 15:46 [dpdk-dev] [PATCH 00/19] KNI checkpatch cleanup Ferruh Yigit
2016-09-15 15:46 ` [dpdk-dev] [PATCH 01/19] kni: move externs to the header file Ferruh Yigit
2016-09-15 15:46 ` [dpdk-dev] [PATCH 02/19] kni: uninitialize global variables Ferruh Yigit
2016-09-15 15:46 ` [dpdk-dev] [PATCH 03/19] kni: make static struct const Ferruh Yigit
2016-09-15 15:46 ` [dpdk-dev] [PATCH 04/19] kni: whitespace, indentation, long line corrections Ferruh Yigit
2016-09-15 15:46 ` [dpdk-dev] [PATCH 05/19] kni: prefer unsigned int to unsigned Ferruh Yigit
2016-09-15 15:46 ` [dpdk-dev] [PATCH 06/19] kni: remove useless return Ferruh Yigit
2016-09-15 15:46 ` [dpdk-dev] [PATCH 07/19] kni: comparisons should place the constant on the right Ferruh Yigit
2016-09-15 15:46 ` [dpdk-dev] [PATCH 08/19] kni: trailing statements should be on next line Ferruh Yigit
2016-09-15 15:46 ` [dpdk-dev] [PATCH 09/19] kni: do not use assignment in if condition Ferruh Yigit
2016-09-15 15:46 ` [dpdk-dev] [PATCH 10/19] kni: macros with complex values should be enclosed in parentheses Ferruh Yigit
2016-09-15 15:46 ` [dpdk-dev] [PATCH 11/19] kni: prefer min_t to min Ferruh Yigit
2016-09-15 15:46 ` [dpdk-dev] [PATCH 12/19] kni: prefer ether_addr_copy to memcpy Ferruh Yigit
2016-09-15 15:46 ` [dpdk-dev] [PATCH 13/19] kni: update kernel logging Ferruh Yigit
2016-09-15 15:46 ` [dpdk-dev] [PATCH 14/19] kni: remove unnecessary 'out of memory' message Ferruh Yigit
2016-09-15 15:46 ` [dpdk-dev] [PATCH 15/19] kni: move functions to eliminate function declarations Ferruh Yigit
2016-09-15 15:46 ` [dpdk-dev] [PATCH 16/19] kni: remove compile time debug configuration Ferruh Yigit
2016-09-15 15:46 ` [dpdk-dev] [PATCH 17/19] kni: updated log messages Ferruh Yigit
2016-09-15 15:46 ` [dpdk-dev] [PATCH 18/19] kni: prefer uint32_t to unsigned int Ferruh Yigit
2016-09-15 15:46 ` [dpdk-dev] [PATCH 19/19] kni: move kernel version ifdefs to compat header Ferruh Yigit
2016-09-16 16:26 ` [dpdk-dev] [PATCH v2 00/19] KNI checkpatch cleanup Ferruh Yigit
2016-09-26 15:39   ` [dpdk-dev] [PATCH v3 " Ferruh Yigit
2016-09-26 15:39     ` [dpdk-dev] [PATCH v3 01/19] kni: move externs to the header file Ferruh Yigit
2016-09-26 15:39     ` [dpdk-dev] [PATCH v3 02/19] kni: uninitialize global variables Ferruh Yigit
2016-09-26 15:39     ` [dpdk-dev] [PATCH v3 03/19] kni: make static struct const Ferruh Yigit
2016-09-26 15:39     ` [dpdk-dev] [PATCH v3 04/19] kni: whitespace, indentation, long line corrections Ferruh Yigit
2016-09-26 15:39     ` Ferruh Yigit [this message]
2016-09-26 15:39     ` [dpdk-dev] [PATCH v3 06/19] kni: remove useless return Ferruh Yigit
2016-09-26 15:39     ` [dpdk-dev] [PATCH v3 07/19] kni: comparisons should place the constant on the right Ferruh Yigit
2016-09-26 15:39     ` [dpdk-dev] [PATCH v3 08/19] kni: trailing statements should be on next line Ferruh Yigit
2016-09-26 15:39     ` [dpdk-dev] [PATCH v3 09/19] kni: do not use assignment in if condition Ferruh Yigit
2016-09-26 15:39     ` [dpdk-dev] [PATCH v3 10/19] kni: macros with complex values should be enclosed in parentheses Ferruh Yigit
2016-09-26 15:39     ` [dpdk-dev] [PATCH v3 11/19] kni: prefer min_t to min Ferruh Yigit
2016-09-26 15:39     ` [dpdk-dev] [PATCH v3 12/19] kni: prefer ether_addr_copy to memcpy Ferruh Yigit
2016-09-26 15:39     ` [dpdk-dev] [PATCH v3 13/19] kni: update kernel logging Ferruh Yigit
2016-09-26 15:39     ` [dpdk-dev] [PATCH v3 14/19] kni: remove unnecessary 'out of memory' message Ferruh Yigit
2016-09-26 15:39     ` [dpdk-dev] [PATCH v3 15/19] kni: move functions to eliminate function declarations Ferruh Yigit
2016-09-26 15:39     ` [dpdk-dev] [PATCH v3 16/19] kni: remove compile time debug configuration Ferruh Yigit
2016-09-26 15:39     ` [dpdk-dev] [PATCH v3 17/19] kni: updated log messages Ferruh Yigit
2016-09-26 15:39     ` [dpdk-dev] [PATCH v3 18/19] kni: prefer uint32_t to unsigned int Ferruh Yigit
2016-09-26 15:39     ` [dpdk-dev] [PATCH v3 19/19] kni: move kernel version ifdefs to compat header Ferruh Yigit
2016-10-13 21:15     ` [dpdk-dev] [PATCH v3 00/19] KNI checkpatch cleanup Thomas Monjalon
2016-09-16 16:26 ` [dpdk-dev] [PATCH v2 01/19] kni: move externs to the header file Ferruh Yigit
2016-09-16 16:26 ` [dpdk-dev] [PATCH v2 02/19] kni: uninitialize global variables Ferruh Yigit
2016-09-16 16:26 ` [dpdk-dev] [PATCH v2 03/19] kni: make static struct const Ferruh Yigit
2016-09-16 16:26 ` [dpdk-dev] [PATCH v2 04/19] kni: whitespace, indentation, long line corrections Ferruh Yigit
2016-09-16 16:26 ` [dpdk-dev] [PATCH v2 05/19] kni: prefer unsigned int to unsigned Ferruh Yigit
2016-09-16 16:26 ` [dpdk-dev] [PATCH v2 06/19] kni: remove useless return Ferruh Yigit
2016-09-16 16:26 ` [dpdk-dev] [PATCH v2 07/19] kni: comparisons should place the constant on the right Ferruh Yigit
2016-09-16 16:26 ` [dpdk-dev] [PATCH v2 08/19] kni: trailing statements should be on next line Ferruh Yigit
2016-09-16 16:26 ` [dpdk-dev] [PATCH v2 09/19] kni: do not use assignment in if condition Ferruh Yigit
2016-09-16 16:26 ` [dpdk-dev] [PATCH v2 10/19] kni: macros with complex values should be enclosed in parentheses Ferruh Yigit
2016-09-16 16:26 ` [dpdk-dev] [PATCH v2 11/19] kni: prefer min_t to min Ferruh Yigit
2016-09-16 16:26 ` [dpdk-dev] [PATCH v2 12/19] kni: prefer ether_addr_copy to memcpy Ferruh Yigit
2016-09-16 16:26 ` [dpdk-dev] [PATCH v2 13/19] kni: update kernel logging Ferruh Yigit
2016-09-16 16:26 ` [dpdk-dev] [PATCH v2 14/19] kni: remove unnecessary 'out of memory' message Ferruh Yigit
2016-09-16 16:26 ` [dpdk-dev] [PATCH v2 15/19] kni: move functions to eliminate function declarations Ferruh Yigit
2016-09-16 16:26 ` [dpdk-dev] [PATCH v2 16/19] kni: remove compile time debug configuration Ferruh Yigit
2016-09-16 16:26 ` [dpdk-dev] [PATCH v2 17/19] kni: updated log messages Ferruh Yigit
2016-09-16 16:26 ` [dpdk-dev] [PATCH v2 18/19] kni: prefer uint32_t to unsigned int Ferruh Yigit
2016-09-16 16:26 ` [dpdk-dev] [PATCH v2 19/19] kni: move kernel version ifdefs to compat header Ferruh Yigit
2016-10-05 10:38 ` [dpdk-dev] [PATCH 00/19] KNI checkpatch cleanup Pattan, Reshma
2016-10-10 12:37   ` Ferruh Yigit

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=20160926153938.7575-6-ferruh.yigit@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=dev@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).