X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fvhost%2Fvhost_crypto.c;h=b1c0eb6a0f975473ff0899ec3fb2d01a1221a736;hb=1fd3de64ff47f8865f9cbd13bb8f20611beb3cfa;hp=6689c52df2393f266d0ec44a706d0ab17646a71b;hpb=99a2dd955fba6e4cc23b77d590a033650ced9c45;p=dpdk.git diff --git a/lib/vhost/vhost_crypto.c b/lib/vhost/vhost_crypto.c index 6689c52df2..b1c0eb6a0f 100644 --- a/lib/vhost/vhost_crypto.c +++ b/lib/vhost/vhost_crypto.c @@ -453,7 +453,7 @@ vhost_crypto_msg_post_handler(int vid, void *msg) { struct virtio_net *dev = get_device(vid); struct vhost_crypto *vcrypto; - VhostUserMsg *vmsg = msg; + struct vhu_msg_context *ctx = msg; enum rte_vhost_msg_result ret = RTE_VHOST_MSG_RESULT_OK; if (dev == NULL) { @@ -467,15 +467,15 @@ vhost_crypto_msg_post_handler(int vid, void *msg) return RTE_VHOST_MSG_RESULT_ERR; } - switch (vmsg->request.master) { + switch (ctx->msg.request.master) { case VHOST_USER_CRYPTO_CREATE_SESS: vhost_crypto_create_sess(vcrypto, - &vmsg->payload.crypto_session); - vmsg->fd_num = 0; + &ctx->msg.payload.crypto_session); + ctx->fd_num = 0; ret = RTE_VHOST_MSG_RESULT_REPLY; break; case VHOST_USER_CRYPTO_CLOSE_SESS: - if (vhost_crypto_close_sess(vcrypto, vmsg->payload.u64)) + if (vhost_crypto_close_sess(vcrypto, ctx->msg.payload.u64)) ret = RTE_VHOST_MSG_RESULT_ERR; break; default: @@ -1337,13 +1337,15 @@ vhost_crypto_finalize_one_request(struct rte_crypto_op *op, struct rte_mbuf *m_src = op->sym->m_src; struct rte_mbuf *m_dst = op->sym->m_dst; struct vhost_crypto_data_req *vc_req = rte_mbuf_to_priv(m_src); - struct vhost_virtqueue *vq = vc_req->vq; - uint16_t used_idx = vc_req->desc_idx, desc_idx; + struct vhost_virtqueue *vq; + uint16_t used_idx, desc_idx; if (unlikely(!vc_req)) { VC_LOG_ERR("Failed to retrieve vc_req"); return NULL; } + vq = vc_req->vq; + used_idx = vc_req->desc_idx; if (old_vq && (vq != old_vq)) return vq; @@ -1496,10 +1498,8 @@ rte_vhost_crypto_create(int vid, uint8_t cryptodev_id, return 0; error_exit: - if (vcrypto->session_map) - rte_hash_free(vcrypto->session_map); - if (vcrypto->mbuf_pool) - rte_mempool_free(vcrypto->mbuf_pool); + rte_hash_free(vcrypto->session_map); + rte_mempool_free(vcrypto->mbuf_pool); rte_free(vcrypto);