eal: add assert macro for debug
[dpdk.git] / examples / ipsec-secgw / ipsec.c
index d385100..4566d38 100644 (file)
@@ -30,7 +30,7 @@
  *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
-
+#include <sys/types.h>
 #include <netinet/in.h>
 #include <netinet/ip.h>
 
@@ -58,13 +58,13 @@ create_session(struct ipsec_ctx *ipsec_ctx __rte_unused, struct ipsec_sa *sa)
        ret = rte_hash_lookup_data(ipsec_ctx->cdev_map, &key,
                        (void **)&cdev_id_qp);
        if (ret < 0) {
-               IPSEC_LOG(ERR, IPSEC, "No cryptodev: core %u, cipher_algo %u, "
+               RTE_LOG(ERR, IPSEC, "No cryptodev: core %u, cipher_algo %u, "
                                "auth_algo %u\n", key.lcore_id, key.cipher_algo,
                                key.auth_algo);
                return -1;
        }
 
-       IPSEC_LOG(DEBUG, IPSEC, "Create session for SA spi %u on cryptodev "
+       RTE_LOG(DEBUG, IPSEC, "Create session for SA spi %u on cryptodev "
                        "%u qp %u\n", sa->spi, ipsec_ctx->tbl[cdev_id_qp].id,
                        ipsec_ctx->tbl[cdev_id_qp].qp);
 
@@ -87,7 +87,7 @@ enqueue_cop(struct cdev_qp *cqp, struct rte_crypto_op *cop)
                ret = rte_cryptodev_enqueue_burst(cqp->id, cqp->qp,
                                cqp->buf, cqp->len);
                if (ret < cqp->len) {
-                       IPSEC_LOG(DEBUG, IPSEC, "Cryptodev %u queue %u:"
+                       RTE_LOG(DEBUG, IPSEC, "Cryptodev %u queue %u:"
                                        " enqueued %u crypto ops out of %u\n",
                                         cqp->id, cqp->qp,
                                         ret, cqp->len);
@@ -117,7 +117,7 @@ ipsec_processing(struct ipsec_ctx *ipsec_ctx, struct rte_mbuf *pkts[],
                sa = sas[i];
                priv->sa = sa;
 
-               IPSEC_ASSERT(sa != NULL);
+               RTE_ASSERT(sa != NULL);
 
                priv->cop.type = RTE_CRYPTO_OP_TYPE_SYMMETRIC;
 
@@ -139,7 +139,7 @@ ipsec_processing(struct ipsec_ctx *ipsec_ctx, struct rte_mbuf *pkts[],
                        continue;
                }
 
-               IPSEC_ASSERT(sa->cdev_id_qp < ipsec_ctx->nb_qps);
+               RTE_ASSERT(sa->cdev_id_qp < ipsec_ctx->nb_qps);
                enqueue_cop(&ipsec_ctx->tbl[sa->cdev_id_qp], &priv->cop);
        }
 
@@ -166,7 +166,7 @@ ipsec_processing(struct ipsec_ctx *ipsec_ctx, struct rte_mbuf *pkts[],
                        priv = get_priv(pkt);
                        sa = priv->sa;
 
-                       IPSEC_ASSERT(sa != NULL);
+                       RTE_ASSERT(sa != NULL);
 
                        ret = sa->post_crypto(pkt, sa, cops[j]);
                        if (unlikely(ret))