[dpdk-dev,v2,3/5] crypto/null: use ring size function

Message ID 1487868123-30262-4-git-send-email-bruce.richardson@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers

Checks

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

Commit Message

Bruce Richardson Feb. 23, 2017, 4:42 p.m. UTC
  Rather than reading the size directly from the ring structure,
use the dedicated function for that purpose.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/crypto/null/null_crypto_pmd_ops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Doherty, Declan Feb. 24, 2017, 2:20 p.m. UTC | #1
On 23/02/2017 4:42 PM, Bruce Richardson wrote:
> Rather than reading the size directly from the ring structure,
> use the dedicated function for that purpose.
>
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
...
>

Acked-by: Declan Doherty <declan.doherty@intel.com>
  

Patch

diff --git a/drivers/crypto/null/null_crypto_pmd_ops.c b/drivers/crypto/null/null_crypto_pmd_ops.c
index 26ff631..4a24537 100644
--- a/drivers/crypto/null/null_crypto_pmd_ops.c
+++ b/drivers/crypto/null/null_crypto_pmd_ops.c
@@ -193,7 +193,7 @@  null_crypto_pmd_qp_create_processed_pkts_ring(struct null_crypto_qp *qp,
 
 	r = rte_ring_lookup(qp->name);
 	if (r) {
-		if (r->prod.size >= ring_size) {
+		if (rte_ring_get_size(r) >= ring_size) {
 			NULL_CRYPTO_LOG_INFO(
 				"Reusing existing ring %s for processed packets",
 				qp->name);