#include "virtio_cryptodev.h"
#include "virtqueue.h"
#include "virtio_crypto_algs.h"
+#include "virtio_crypto_capabilities.h"
int virtio_crypto_logtype_init;
int virtio_crypto_logtype_session;
{ .vendor_id = 0, /* sentinel */ },
};
+static const struct rte_cryptodev_capabilities virtio_capabilities[] = {
+ VIRTIO_SYM_CAPABILITIES,
+ RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST()
+};
+
uint8_t cryptodev_virtio_driver_id;
#define NUM_ENTRY_SYM_CREATE_SESSION 4
hw = cryptodev->data->dev_private;
hw->dev_id = cryptodev->data->dev_id;
+ hw->virtio_dev_capabilities = virtio_capabilities;
VIRTIO_CRYPTO_INIT_LOG_DBG("dev %d vendorID=0x%x deviceID=0x%x",
cryptodev->data->dev_id, pci_dev->id.vendor_id,
struct rte_crypto_cipher_xform *cipher_xform)
{
switch (cipher_xform->algo) {
+ case RTE_CRYPTO_CIPHER_AES_CBC:
+ para->algo = VIRTIO_CRYPTO_CIPHER_AES_CBC;
+ break;
default:
VIRTIO_CRYPTO_SESSION_LOG_ERR("Crypto: Unsupported "
"Cipher alg %u", cipher_xform->algo);
}
switch (auth_xform->algo) {
+ case RTE_CRYPTO_AUTH_SHA1_HMAC:
+ *algo = VIRTIO_CRYPTO_MAC_HMAC_SHA1;
+ break;
default:
VIRTIO_CRYPTO_SESSION_LOG_ERR(
"Crypto: Undefined Hash algo %u specified",
auth_xform->algo);
- *algo = VIRTIO_CRYPTO_NO_MAC;
return -1;
}
info->max_nb_queue_pairs = hw->max_dataqueues;
info->sym.max_nb_sessions =
RTE_VIRTIO_CRYPTO_PMD_MAX_NB_SESSIONS;
+ info->capabilities = hw->virtio_dev_capabilities;
}
}