Imported Upstream version 16.07.2
[deb_dpdk.git] / examples / ipsec-secgw / ipsec-secgw.c
index 1ca144b..266ae20 100644 (file)
@@ -390,7 +390,7 @@ inbound_sp_sa(struct sp_ctx *sp, struct sa_ctx *sa, struct traffic_type *ip,
        struct rte_mbuf *m;
        uint32_t i, j, res, sa_idx;
 
-       if (ip->num == 0)
+       if (ip->num == 0 || sp == NULL)
                return;
 
        rte_acl_classify((struct rte_acl_ctx *)sp, ip->data, ip->res,
@@ -465,7 +465,7 @@ outbound_sp(struct sp_ctx *sp, struct traffic_type *ip,
        struct rte_mbuf *m;
        uint32_t i, j, sa_idx;
 
-       if (ip->num == 0)
+       if (ip->num == 0 || sp == NULL)
                return;
 
        rte_acl_classify((struct rte_acl_ctx *)sp, ip->data, ip->res,
@@ -1273,6 +1273,10 @@ cryptodevs_init(void)
                                                &qp_conf, dev_conf.socket_id))
                                rte_panic("Failed to setup queue %u for "
                                                "cdev_id %u\n", 0, cdev_id);
+
+               if (rte_cryptodev_start(cdev_id))
+                       rte_panic("Failed to start cryptodev %u\n",
+                                       cdev_id);
        }
 
        printf("\n");