src/dpdk/drivers/crypto/mvsam/rte_mrvl_pmd.c
static int
cryptodev_mrvl_crypto_init(struct rte_vdev_device *vdev)
{
	struct mrvl_pmd_init_params init_params = {
		.common = {
			.name = "",
			.private_data_size =
				sizeof(struct mrvl_crypto_private),
			.max_nb_queue_pairs =
				sam_get_num_inst() * sam_get_num_cios(0),
			.socket_id = rte_socket_id()
		},
		.max_nb_sessions = MRVL_PMD_DEFAULT_MAX_NB_SESSIONS
	};

	const char *name, *args;
	int ret;

	name = rte_vdev_device_name(vdev);
	if (name == NULL)
		return -EINVAL;
	args = rte_vdev_device_args(vdev);

	ret = mrvl_pmd_parse_input_args(&init_params, args);
	if (ret) {
		MRVL_LOG(ERR, "Failed to parse initialisation arguments[%s]!",
			 args);
		return -EINVAL;
	}

	return cryptodev_mrvl_crypto_create(name, vdev, &init_params);
}
/**
 * Initialize the crypto device.
 *
 * @param vdev Pointer to device structure.
 * @returns 0 in case of success, negative value otherwise.
 */
Initialize the crypto device.
@param vdev Pointer to device structure.
@returns 0 in case of success, negative value otherwise.
Initialize the crypto device . @param vdev Pointer to device structure . @returns 0 in case of success negative value otherwise .
static int
cryptodev_mrvl_crypto_init(struct rte_vdev_device *vdev)
{
	struct mrvl_pmd_init_params init_params = {
		.common = {
			.name = "",
			.private_data_size =
				sizeof(struct mrvl_crypto_private),
			.max_nb_queue_pairs =
				sam_get_num_inst() * sam_get_num_cios(0),
			.socket_id = rte_socket_id()
		},
		.max_nb_sessions = MRVL_PMD_DEFAULT_MAX_NB_SESSIONS
	};
	const char *name, *args;
	int ret;
	name = rte_vdev_device_name(vdev);
	if (name == NULL)
		return -EINVAL;
	args = rte_vdev_device_args(vdev);
	ret = mrvl_pmd_parse_input_args(&init_params, args);
	if (ret) {
		MRVL_LOG(ERR, "Failed to parse initialisation arguments[%s]!",
			 args);
		return -EINVAL;
	}
	return cryptodev_mrvl_crypto_create(name, vdev, &init_params);
}
static int cryptodev_mrvl_crypto_init ( struct rte_vdev_device * vdev ) { struct mrvl_pmd_init_params init_params = { . common = { . name = " " , . private_data_size = sizeof ( struct mrvl_crypto_private ) , . max_nb_queue_pairs = sam_get_num_inst ( ) * sam_get_num_cios ( 0 ) , . socket_id = rte_socket_id ( ) } , . max_nb_sessions = MRVL_PMD_DEFAULT_MAX_NB_SESSIONS } ; const char * name , * args ; int ret ; name = rte_vdev_device_name ( vdev ) ; if ( name == NULL ) return - EINVAL ; args = rte_vdev_device_args ( vdev ) ; ret = mrvl_pmd_parse_input_args ( & init_params , args ) ; if ( ret ) { MRVL_LOG ( ERR , " " , args ) ; return - EINVAL ; } return cryptodev_mrvl_crypto_create ( name , vdev , & init_params ) ; }
Initialize the crypto device.
Initialize the crypto device .