helper routine to enqueue bulk of crypto ops */
| 27 | |
| 28 | /* helper routine to enqueue bulk of crypto ops */ |
| 29 | static inline void |
| 30 | enqueue_cop_bulk(struct cdev_qp *cqp, struct rte_crypto_op *cop[], uint32_t num) |
| 31 | { |
| 32 | uint32_t i, k, len, n; |
| 33 | |
| 34 | len = cqp->len; |
| 35 | |
| 36 | /* |
| 37 | * if cqp is empty and we have enough ops, |
| 38 | * then queue them to the PMD straightway. |
| 39 | */ |
| 40 | if (num >= RTE_DIM(cqp->buf) * 3 / 4 && len == 0) { |
| 41 | n = rte_cryptodev_enqueue_burst(cqp->id, cqp->qp, cop, num); |
| 42 | cqp->in_flight += n; |
| 43 | free_cops(cop + n, num - n); |
| 44 | return; |
| 45 | } |
| 46 | |
| 47 | k = 0; |
| 48 | |
| 49 | do { |
| 50 | n = RTE_DIM(cqp->buf) - len; |
| 51 | n = RTE_MIN(num - k, n); |
| 52 | |
| 53 | /* put packets into cqp */ |
| 54 | for (i = 0; i != n; i++) |
| 55 | cqp->buf[len + i] = cop[k + i]; |
| 56 | |
| 57 | len += n; |
| 58 | k += n; |
| 59 | |
| 60 | /* if cqp is full then, enqueue crypto-ops to PMD */ |
| 61 | if (len == RTE_DIM(cqp->buf)) { |
| 62 | n = rte_cryptodev_enqueue_burst(cqp->id, cqp->qp, |
| 63 | cqp->buf, len); |
| 64 | cqp->in_flight += n; |
| 65 | free_cops(cqp->buf + n, len - n); |
| 66 | len = 0; |
| 67 | } |
| 68 | |
| 69 | |
| 70 | } while (k != num); |
| 71 | |
| 72 | cqp->len = len; |
| 73 | } |
| 74 | |
| 75 | static inline int |
| 76 | check_ipsec_session(const struct rte_ipsec_session *ss) |
no test coverage detected