Lines Matching defs:g_accel_mlx5
240 static struct accel_mlx5_module g_accel_mlx5;
798 crypto_key_ok = (task->crypto_key && task->crypto_key->module_if == &g_accel_mlx5.module &&
1725 crypto_key_ok = (task->crypto_key && task->crypto_key->module_if == &g_accel_mlx5.module &&
1739 if (spdk_unlikely(g_accel_mlx5.attr.crypto_split_blocks &&
1740 num_blocks > g_accel_mlx5.attr.crypto_split_blocks)) {
1742 num_blocks, g_accel_mlx5.attr.crypto_split_blocks);
2139 assert(g_accel_mlx5.crypto_supported);
2144 assert(g_accel_mlx5.crypto_supported);
2189 assert(g_accel_mlx5.enabled);
2281 mlx5_qp_attr.cap.max_send_wr = g_accel_mlx5.attr.qp_size;
2450 assert(g_accel_mlx5.enabled);
2457 return g_accel_mlx5.crypto_supported;
2460 return g_accel_mlx5.crc32c_supported;
2469 assert(g_accel_mlx5.enabled);
2470 return spdk_get_io_channel(&g_accel_mlx5);
2479 mlx5_qp_attr.cap.max_send_wr = g_accel_mlx5.attr.qp_size;
2493 qp->wrs_max = g_accel_mlx5.attr.qp_size;
2543 spdk_spin_lock(&g_accel_mlx5.lock);
2544 accel_mlx5_add_stats(&g_accel_mlx5.stats, &dev->stats);
2545 spdk_spin_unlock(&g_accel_mlx5.lock);
2560 ch->devs = calloc(g_accel_mlx5.num_ctxs, sizeof(*ch->devs));
2566 for (i = 0; i < g_accel_mlx5.num_ctxs; i++) {
2567 dev_ctx = &g_accel_mlx5.dev_ctxs[i];
2603 cq_attr.cqe_cnt = g_accel_mlx5.attr.qp_size;
2628 dev->crypto_split_blocks = dev_ctx->crypto_multi_block ? g_accel_mlx5.attr.crypto_split_blocks : 0;
2629 dev->wrs_in_cq_max = g_accel_mlx5.attr.qp_size;
2639 accel_mlx5_destroy_cb(&g_accel_mlx5, ctx_buf);
2660 if (!g_accel_mlx5.allowed_devs) {
2664 for (i = 0; i < g_accel_mlx5.allowed_devs_count; i++) {
2665 free(g_accel_mlx5.allowed_devs[i]);
2667 free(g_accel_mlx5.attr.allowed_devs);
2668 free(g_accel_mlx5.allowed_devs);
2669 g_accel_mlx5.attr.allowed_devs = NULL;
2670 g_accel_mlx5.allowed_devs = NULL;
2671 g_accel_mlx5.allowed_devs_count = 0;
2694 g_accel_mlx5.allowed_devs = calloc(devs_count, sizeof(char *));
2695 if (!g_accel_mlx5.allowed_devs) {
2703 g_accel_mlx5.allowed_devs[devs_count] = strdup(tok);
2704 if (!g_accel_mlx5.allowed_devs[devs_count]) {
2711 g_accel_mlx5.allowed_devs_count++;
2724 if (g_accel_mlx5.enabled) {
2737 g_accel_mlx5.attr = *attr;
2738 g_accel_mlx5.attr.allowed_devs = NULL;
2742 g_accel_mlx5.attr.allowed_devs = strndup(attr->allowed_devs, ACCEL_MLX5_ALLOWED_DEVS_MAX_LEN);
2743 if (!g_accel_mlx5.attr.allowed_devs) {
2746 rc = accel_mlx5_allowed_devs_parse(g_accel_mlx5.attr.allowed_devs);
2750 rc = spdk_mlx5_crypto_devs_allow((const char *const *)g_accel_mlx5.allowed_devs,
2751 g_accel_mlx5.allowed_devs_count);
2758 accel_mlx5_get_default_attr(&g_accel_mlx5.attr);
2761 g_accel_mlx5.enabled = true;
2762 spdk_accel_module_list_add(&g_accel_mlx5.module);
2776 num_psvs = g_accel_mlx5.attr.num_requests;
2802 for (i = 0; i < g_accel_mlx5.num_ctxs; i++) {
2803 dev_ctx = &g_accel_mlx5.dev_ctxs[i];
2822 free(g_accel_mlx5.dev_ctxs);
2823 g_accel_mlx5.dev_ctxs = NULL;
2824 g_accel_mlx5.initialized = false;
2831 spdk_spin_destroy(&g_accel_mlx5.lock);
2839 if (g_accel_mlx5.allowed_devs) {
2843 if (g_accel_mlx5.initialized) {
2844 spdk_io_device_unregister(&g_accel_mlx5, accel_mlx5_deinit_cb);
2874 assert(obj_idx < g_accel_mlx5.attr.num_requests);
2896 uint32_t num_psvs = g_accel_mlx5.attr.num_requests;
2961 rc = accel_mlx5_mkeys_create(pd, g_accel_mlx5.attr.num_requests, 0);
2968 if (g_accel_mlx5.crypto_supported) {
2970 if (!dev_ctx->crypto_multi_block && g_accel_mlx5.attr.crypto_split_blocks) {
2974 rc = accel_mlx5_mkeys_create(pd, g_accel_mlx5.attr.num_requests, SPDK_MLX5_MKEY_POOL_FLAG_CRYPTO);
2981 if (g_accel_mlx5.crc32c_supported) {
2982 rc = accel_mlx5_mkeys_create(pd, g_accel_mlx5.attr.num_requests,
3035 if (g_accel_mlx5.allowed_devs_count) {
3037 for (j = 0; j < g_accel_mlx5.allowed_devs_count; j++) {
3038 if (strcmp(g_accel_mlx5.allowed_devs[j], dev->device->name) == 0) {
3075 bool find_best_dev = g_accel_mlx5.allowed_devs_count == 0;
3077 if (!g_accel_mlx5.enabled) {
3081 spdk_spin_init(&g_accel_mlx5.lock);
3092 g_accel_mlx5.crypto_supported = true;
3093 g_accel_mlx5.crc32c_supported = true;
3094 g_accel_mlx5.num_ctxs = 0;
3109 g_accel_mlx5.crypto_supported = false;
3114 g_accel_mlx5.crc32c_supported = false;
3131 g_accel_mlx5.crypto_supported = accel_mlx5_dev_supports_crypto(&caps[best_dev]);
3132 g_accel_mlx5.crc32c_supported = caps[best_dev].crc32c_supported;
3134 g_accel_mlx5.crypto_supported, g_accel_mlx5.crc32c_supported);
3137 if (g_accel_mlx5.crypto_supported) {
3143 SPDK_NOTICELOG("Found %d devices, crypto %d\n", num_devs, g_accel_mlx5.crypto_supported);
3146 g_accel_mlx5.dev_ctxs = calloc(num_devs, sizeof(*g_accel_mlx5.dev_ctxs));
3147 if (!g_accel_mlx5.dev_ctxs) {
3154 rc = accel_mlx5_dev_ctx_init(&g_accel_mlx5.dev_ctxs[g_accel_mlx5.num_ctxs++],
3162 spdk_io_device_register(&g_accel_mlx5, accel_mlx5_create_cb, accel_mlx5_destroy_cb,
3164 g_accel_mlx5.initialized = true;
3168 if (g_accel_mlx5.attr.enable_driver) {
3181 spdk_spin_destroy(&g_accel_mlx5.lock);
3189 if (g_accel_mlx5.enabled) {
3193 spdk_json_write_named_uint16(w, "qp_size", g_accel_mlx5.attr.qp_size);
3194 spdk_json_write_named_uint32(w, "num_requests", g_accel_mlx5.attr.num_requests);
3195 if (g_accel_mlx5.attr.allowed_devs) {
3196 spdk_json_write_named_string(w, "allowed_devs", g_accel_mlx5.attr.allowed_devs);
3198 spdk_json_write_named_uint16(w, "crypto_split_blocks", g_accel_mlx5.attr.crypto_split_blocks);
3199 spdk_json_write_named_bool(w, "enable_driver", g_accel_mlx5.attr.enable_driver);
3247 if (!key || key->module_if != &g_accel_mlx5.module || !key->priv) {
3363 spdk_spin_lock(&g_accel_mlx5.lock);
3365 accel_mlx5_add_stats(&ctx->total, &g_accel_mlx5.stats);
3366 spdk_spin_unlock(&g_accel_mlx5.lock);
3391 if (!g_accel_mlx5.initialized) {
3410 spdk_for_each_channel(&g_accel_mlx5, accel_mlx5_dump_channel_stat, stat_ctx,
3433 return (int)g_accel_mlx5.num_ctxs;
3436 size = spdk_min(array_size, (int)g_accel_mlx5.num_ctxs);
3439 domains[i] = g_accel_mlx5.dev_ctxs[i].domain;
3442 return (int)g_accel_mlx5.num_ctxs;
3603 static struct accel_mlx5_module g_accel_mlx5 = {