src/dpdk/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c
static struct rte_ring *
aesni_mb_pmd_qp_create_processed_ops_ring(struct aesni_mb_qp *qp,
		unsigned int ring_size, int socket_id)
{
	struct rte_ring *r;
	char ring_name[RTE_CRYPTODEV_NAME_MAX_LEN];

	unsigned int n = strlcpy(ring_name, qp->name, sizeof(ring_name));

	if (n >= sizeof(ring_name))
		return NULL;

	r = rte_ring_lookup(ring_name);
	if (r) {
		if (rte_ring_get_size(r) >= ring_size) {
			AESNI_MB_LOG(INFO, "Reusing existing ring %s for processed ops",
			ring_name);
			return r;
		}

		AESNI_MB_LOG(ERR, "Unable to reuse existing ring %s for processed ops",
			ring_name);
		return NULL;
	}

	return rte_ring_create(ring_name, ring_size, socket_id,
			RING_F_SP_ENQ | RING_F_SC_DEQ);
}
/** Create a ring to place processed operations on */
Create a ring to place processed operations on
Create a ring to place processed operations on
static struct rte_ring *
aesni_mb_pmd_qp_create_processed_ops_ring(struct aesni_mb_qp *qp,
		unsigned int ring_size, int socket_id)
{
	struct rte_ring *r;
	char ring_name[RTE_CRYPTODEV_NAME_MAX_LEN];
	unsigned int n = strlcpy(ring_name, qp->name, sizeof(ring_name));
	if (n >= sizeof(ring_name))
		return NULL;
	r = rte_ring_lookup(ring_name);
	if (r) {
		if (rte_ring_get_size(r) >= ring_size) {
			AESNI_MB_LOG(INFO, "Reusing existing ring %s for processed ops",
			ring_name);
			return r;
		}
		AESNI_MB_LOG(ERR, "Unable to reuse existing ring %s for processed ops",
			ring_name);
		return NULL;
	}
	return rte_ring_create(ring_name, ring_size, socket_id,
			RING_F_SP_ENQ | RING_F_SC_DEQ);
}
static struct rte_ring * aesni_mb_pmd_qp_create_processed_ops_ring ( struct aesni_mb_qp * qp , unsigned int ring_size , int socket_id ) { struct rte_ring * r ; char ring_name [ RTE_CRYPTODEV_NAME_MAX_LEN ] ; unsigned int n = strlcpy ( ring_name , qp -> name , sizeof ( ring_name ) ) ; if ( n >= sizeof ( ring_name ) ) return NULL ; r = rte_ring_lookup ( ring_name ) ; if ( r ) { if ( rte_ring_get_size ( r ) >= ring_size ) { AESNI_MB_LOG ( INFO , " " , ring_name ) ; return r ; } AESNI_MB_LOG ( ERR , " " , ring_name ) ; return NULL ; } return rte_ring_create ( ring_name , ring_size , socket_id , RING_F_SP_ENQ | RING_F_SC_DEQ ) ; }
Create a ring to place processed operations on
Create a ring to place processed operations on