Skip to contentSkip to conversation

rte_kni: Fix documentation.

PATCH In review Alex Wang 2 participants 5 messages May 17, 2016 – May 23, 2016

lore
Share & tools
lore

Alex Wang

author
#0 lore raw

PATCH 1/2 rte_kni: Fix documentation.

From: Alex Wang <[email protected]>

The 'mbufs' alloc/free descriptions for 'rte_kni_tx_burst()' and 'rte_kni_rx_burst()' should be inverted.

---
 lib/librte_kni/rte_kni.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
lib/librte_kni/rte_kni.h +4 -4
index ef9faa9..25fa45e 100644
@@ -161,8 +161,8 @@ extern int rte_kni_handle_request(struct rte_kni *kni);
 /**
  * Retrieve a burst of packets from a KNI interface. The retrieved packets are
  * stored in rte_mbuf structures whose pointers are supplied in the array of
- * mbufs, and the maximum number is indicated by num. It handles the freeing of
- * the mbufs in the free queue of KNI interface.
+ * mbufs, and the maximum number is indicated by num. It handles allocating
+ * the mbufs for KNI interface alloc queue.
  *
  * @param kni
  *  The KNI interface context.
@@ -180,8 +180,8 @@ extern unsigned rte_kni_rx_burst(struct rte_kni *kni,
 /**
  * Send a burst of packets to a KNI interface. The packets to be sent out are
  * stored in rte_mbuf structures whose pointers are supplied in the array of
- * mbufs, and the maximum number is indicated by num. It handles allocating
- * the mbufs for KNI interface alloc queue.
+ * mbufs, and the maximum number is indicated by num. It handles the freeing of
+ * the mbufs in the free queue of KNI interface.
  *
  * @param kni
  *  The KNI interface context.
Signature · 1 line
2.1.4
author
#1 lore raw

PATCH 2/2 rte_kni: Add documentation for the mempool capacity.

From: Alex Wang <[email protected]>

Function like 'rte_kni_rx_burst()' keeps allocating 'MAX_MBUF_BURST_NUM' mbufs to kni fifo queue unless the queue's capacity ('KNI_FIFO_COUNT_MAX') is reached. So, if the mempool is under-provisioned, user may run into "Out of Memory" logs from KNI code. This commit documents the need to provision mempool capacity of couple thousand elements for each KNI interface.

---
 lib/librte_kni/rte_kni.h | 3 +++
 1 file changed, 3 insertions(+)
lib/librte_kni/rte_kni.h +3 -0
index 25fa45e..05d2d39 100644
@@ -113,6 +113,9 @@ extern void rte_kni_init(unsigned int max_kni_ifaces);
  * The rte_kni_alloc shall not be called before rte_kni_init() has been
  * called. rte_kni_alloc is thread safe.
  *
+ * The mempool should have capacity of couple thousand elements for each
+ * KNI interface allocated.
+ *
  * @param pktmbuf_pool
  *  The mempool for allocting mbufs for packets.
  * @param conf
Signature · 1 line
2.1.4
#3 lore raw
In reply to Alex Wang
Quoted 27 lines · Alex Wang

From: Alex Wang <[email protected]>

The 'mbufs' alloc/free descriptions for 'rte_kni_tx_burst()' and 'rte_kni_rx_burst()' should be inverted.

---
 lib/librte_kni/rte_kni.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
lib/librte_kni/rte_kni.h +2 -2
index ef9faa9..25fa45e 100644
@@ -161,8 +161,8 @@ extern int rte_kni_handle_request(struct rte_kni *kni);
 /**
  * Retrieve a burst of packets from a KNI interface. The retrieved packets are
  * stored in rte_mbuf structures whose pointers are supplied in the array of
- * mbufs, and the maximum number is indicated by num. It handles the freeing of
- * the mbufs in the free queue of KNI interface.
+ * mbufs, and the maximum number is indicated by num. It handles allocating
+ * the mbufs for KNI interface alloc queue.
  *
  * @param kni
  *  The KNI interface context.

lib/librte_kni/rte_kni.h extern unsigned rte_kni_rx_burst(struct rte_kni *kni, · line 187

Quoted 10 lines
lib/librte_kni/rte_kni.h +2 -2
@@ -180,8 +180,8 @@ extern unsigned rte_kni_rx_burst(struct rte_kni *kni,
 /**
  * Send a burst of packets to a KNI interface. The packets to be sent out are
  * stored in rte_mbuf structures whose pointers are supplied in the array of
- * mbufs, and the maximum number is indicated by num. It handles allocating
- * the mbufs for KNI interface alloc queue.
+ * mbufs, and the maximum number is indicated by num. It handles the freeing of
+ * the mbufs in the free queue of KNI interface.
  *
  * @param kni
  *  The KNI interface context.

Hi Alex,

Can you please update the patch subject,
- replace "rte_kni" tag with a "kni",
- after space start with lowercase,
- remove the "." at the end of the sentences,
like:
"kni: fix documentation"
(these are defined in
http://dpdk.org/doc/guides/contributing/patches.html#commit-messages-subject-line)

Also can you please add a "Fixes" line, more details on:
http://dpdk.org/doc/guides/contributing/patches.html#commit-messages-body

Although this information converted into documentation, this is not really the documentation, and the patch title gives little information, if possible can you please add more information while keeping it around 50 chars limit.

finally, patch content is OK.

Thanks,
ferruh

#2 lore raw

Re: [PATCH 2/2] rte_kni: Add documentation for the mempool capacity.

In reply to Alex Wang
Quoted 21 lines · Alex Wang

From: Alex Wang <[email protected]>

Function like 'rte_kni_rx_burst()' keeps allocating 'MAX_MBUF_BURST_NUM' mbufs to kni fifo queue unless the queue's capacity ('KNI_FIFO_COUNT_MAX') is reached. So, if the mempool is under-provisioned, user may run into "Out of Memory" logs from KNI code. This commit documents the need to provision mempool capacity of couple thousand elements for each KNI interface.

---
 lib/librte_kni/rte_kni.h | 3 +++
 1 file changed, 3 insertions(+)
lib/librte_kni/rte_kni.h +0 -0
index 25fa45e..05d2d39 100644

lib/librte_kni/rte_kni.h extern void rte_kni_init(unsigned int max_kni_ifaces); · line 121

Quoted 9 lines
lib/librte_kni/rte_kni.h +3 -0
@@ -113,6 +113,9 @@ extern void rte_kni_init(unsigned int max_kni_ifaces);
  * The rte_kni_alloc shall not be called before rte_kni_init() has been
  * called. rte_kni_alloc is thread safe.
  *
+ * The mempool should have capacity of couple thousand elements for each
+ * KNI interface allocated.
+ *
  * @param pktmbuf_pool
  *  The mempool for allocting mbufs for packets.
  * @param conf

Hi Alex,

Same comments are valid for patch subject.

How about saying "more than 2xKNI_FIFO_COUNT_MAX" instead of saying "couple thousand elements"?

Thanks,
ferruh

author
#4 lore raw
In reply to Ferruh Yigit

Sorry for the delayed reply, just sent V2~

Quoted 75 lines · Ferruh Yigit

lib/librte_kni/rte_kni.h extern int rte_kni_handle_request(struct rte_kni

Quoted 15 lines · Alex Wang

From: Alex Wang <[email protected]>

The 'mbufs' alloc/free descriptions for 'rte_kni_tx_burst()' and 'rte_kni_rx_burst()' should be inverted.

---
 lib/librte_kni/rte_kni.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
lib/librte_kni/rte_kni.h +0 -0
index ef9faa9..25fa45e 100644
@@ -161,8 +161,8 @@ extern int rte_kni_handle_request(struct rte_kni

*kni);

lib/librte_kni/rte_kni.h extern int rte_kni_handle_request(struct rte_kni · line 162

Quoted 2 lines
lib/librte_kni/rte_kni.h +0 -0
 /**
  * Retrieve a burst of packets from a KNI interface. The retrieved

packets are

lib/librte_kni/rte_kni.h extern int rte_kni_handle_request(struct rte_kni · line 163

Quoted 1 line
lib/librte_kni/rte_kni.h +0 -0
  * stored in rte_mbuf structures whose pointers are supplied in the

array of

lib/librte_kni/rte_kni.h extern int rte_kni_handle_request(struct rte_kni · line 164

Quoted 1 line
lib/librte_kni/rte_kni.h +0 -1
- * mbufs, and the maximum number is indicated by num. It handles the

freeing of

lib/librte_kni/rte_kni.h extern int rte_kni_handle_request(struct rte_kni · line 164

Quoted 2 lines
lib/librte_kni/rte_kni.h +1 -1
- * the mbufs in the free queue of KNI interface.
+ * mbufs, and the maximum number is indicated by num. It handles

allocating

lib/librte_kni/rte_kni.h extern unsigned rte_kni_rx_burst(struct rte_kni *kni, · line 181

Quoted 7 lines
lib/librte_kni/rte_kni.h +1 -0
+ * the mbufs for KNI interface alloc queue.
  *
  * @param kni
  *  The KNI interface context.
@@ -180,8 +180,8 @@ extern unsigned rte_kni_rx_burst(struct rte_kni *kni,
 /**
  * Send a burst of packets to a KNI interface. The packets to be sent

out are

lib/librte_kni/rte_kni.h extern unsigned rte_kni_rx_burst(struct rte_kni *kni, · line 182

Quoted 1 line
lib/librte_kni/rte_kni.h +0 -0
  * stored in rte_mbuf structures whose pointers are supplied in the

array of

lib/librte_kni/rte_kni.h extern unsigned rte_kni_rx_burst(struct rte_kni *kni, · line 183

Quoted 1 line
lib/librte_kni/rte_kni.h +0 -1
- * mbufs, and the maximum number is indicated by num. It handles

allocating

lib/librte_kni/rte_kni.h extern unsigned rte_kni_rx_burst(struct rte_kni *kni, · line 183

Quoted 2 lines
lib/librte_kni/rte_kni.h +1 -1
- * the mbufs for KNI interface alloc queue.
+ * mbufs, and the maximum number is indicated by num. It handles the

freeing of

lib/librte_kni/rte_kni.h extern unsigned rte_kni_rx_burst(struct rte_kni *kni, · line 187

Quoted 5 lines
lib/librte_kni/rte_kni.h +1 -0
+ * the mbufs in the free queue of KNI interface.
  *
  * @param kni
  *  The KNI interface context.

Hi Alex,

Can you please update the patch subject,
- replace "rte_kni" tag with a "kni",
- after space start with lowercase,
- remove the "." at the end of the sentences,
like:
"kni: fix documentation"
(these are defined in

http://dpdk.org/doc/guides/contributing/patches.html#commit-messages-subject-line
)

Also can you please add a "Fixes" line, more details on:
http://dpdk.org/doc/guides/contributing/patches.html#commit-messages-body

Although this information converted into documentation, this is not really the documentation, and the patch title gives little information, if possible can you please add more information while keeping it around 50 chars limit.

finally, patch content is OK.

Thanks,
ferruh

Signature · 2 lines
Alex Wang,
Open vSwitch developer