Lines Matching refs:bdev
29 struct spdk_bdev crypto_bdev; /* the crypto virtual bdev */
54 /* This is the crypto per IO context that the bdev layer allocates for us opaquely and attaches to
63 void *aux_buf_raw; /* raw buffer that the bdev layer gave us for write buffer */
77 static void vbdev_crypto_examine(struct spdk_bdev *bdev);
92 /* This function can only be used to fail an IO that hasn't been sent to the base bdev,
101 struct vbdev_crypto *crypto_bdev = SPDK_CONTAINEROF(bdev_io->bdev, struct vbdev_crypto,
144 total_length = bdev_io->u.bdev.num_blocks * blocklen;
149 crypto_io->aux_offset_blocks = bdev_io->u.bdev.offset_blocks;
150 crypto_io->aux_num_blocks = bdev_io->u.bdev.num_blocks;
155 bdev_io->u.bdev.iovs, bdev_io->u.bdev.iovcnt,
156 bdev_io->u.bdev.memory_domain,
157 bdev_io->u.bdev.memory_domain_ctx,
158 bdev_io->u.bdev.offset_blocks, blocklen,
219 crypto_io->bdev_io_wait.bdev = bdev_io->bdev;
224 rc = spdk_bdev_queue_io_wait(bdev_io->bdev, crypto_io->crypto_ch->base_ch,
236 struct vbdev_crypto *crypto_bdev = SPDK_CONTAINEROF(bdev_io->bdev, struct vbdev_crypto,
243 opts.memory_domain = bdev_io->u.bdev.memory_domain;
244 opts.memory_domain_ctx = bdev_io->u.bdev.memory_domain_ctx;
247 bdev_io->u.bdev.iovs, bdev_io->u.bdev.iovcnt,
248 bdev_io->u.bdev.offset_blocks, bdev_io->u.bdev.num_blocks,
261 /* Callback for getting a buf from the bdev pool in the event that the caller passed
281 bdev_io->u.bdev.iovs, bdev_io->u.bdev.iovcnt,
282 bdev_io->u.bdev.memory_domain,
283 bdev_io->u.bdev.memory_domain_ctx,
284 bdev_io->u.bdev.iovs, bdev_io->u.bdev.iovcnt,
285 bdev_io->u.bdev.memory_domain,
286 bdev_io->u.bdev.memory_domain_ctx,
287 bdev_io->u.bdev.offset_blocks, blocklen,
305 * we're simply passing it on here via SPDK IO calls which in turn allocate another bdev IO
308 * (writes) then call back into bdev to submit it or we'll submit a read and then catch it
314 struct vbdev_crypto *crypto_bdev = SPDK_CONTAINEROF(bdev_io->bdev, struct vbdev_crypto,
323 crypto_io->seq = bdev_io->u.bdev.accel_sequence;
328 bdev_io->u.bdev.num_blocks * bdev_io->bdev->blocklen);
336 bdev_io->u.bdev.num_blocks * bdev_io->bdev->blocklen,
345 bdev_io->u.bdev.offset_blocks,
346 bdev_io->u.bdev.num_blocks,
351 bdev_io->u.bdev.offset_blocks,
352 bdev_io->u.bdev.num_blocks,
377 /* We'll just call the base bdev and let it answer except for WZ command which
378 * we always say we don't support so that the bdev layer will actually send us
394 /* Force the bdev layer to issue actual writes of zeroes so we can
416 /* Wrapper for the bdev close operation. */
436 /* Unclaim the underlying bdev. */
439 /* Close the underlying bdev on its same opened thread. */
453 * bdev. This is how they get a channel. We are passed the same context we provided when
454 * we created our crypto vbdev in examine() which, for this bdev, is the address of one of
509 * we can communicate with the base bdev on a per channel basis. We also register the
520 SPDK_ERRLOG("Failed to get base bdev IO channel (bdev: %s)\n",
527 SPDK_ERRLOG("Failed to get accel IO channel (bdev: %s)\n",
551 /* Create the association from the bdev and vbdev name and insert
563 SPDK_ERRLOG("Crypto bdev %s already exists\n", opts->vbdev_name);
617 SPDK_NOTICELOG("vbdev creation deferred pending base bdev arrival\n");
688 /* Called when the underlying base bdev triggers asynchronous event such as bdev removal. */
690 vbdev_crypto_base_bdev_event_cb(enum spdk_bdev_event_type type, struct spdk_bdev *bdev,
695 vbdev_crypto_base_bdev_hotremove_cb(bdev);
698 vbdev_crypto_base_bdev_resize_cb(bdev);
701 SPDK_NOTICELOG("Unsupported bdev event: type %d\n", type);
743 /* When we register our bdev this is how we specify our entry points. */
770 struct spdk_bdev *bdev;
782 /* Check our list of names from config versus this bdev and if
783 * there's a match, create the crypto_bdev & bdev accordingly.
809 SPDK_ERRLOG("Failed to open bdev %s: error %d\n", bdev_name, rc);
814 bdev = spdk_bdev_desc_get_bdev(vbdev->base_desc);
815 vbdev->base_bdev = bdev;
817 vbdev->crypto_bdev.write_cache = bdev->write_cache;
818 vbdev->crypto_bdev.optimal_io_boundary = bdev->optimal_io_boundary;
820 bdev->max_rw_size ? bdev->max_rw_size : UINT32_MAX,
821 iobuf_opts.large_bufsize / bdev->blocklen);
824 opctx.block_size = bdev->blocklen;
826 spdk_max(bdev->required_alignment,
830 vbdev->crypto_bdev.blocklen = bdev->blocklen;
831 vbdev->crypto_bdev.blockcnt = bdev->blockcnt;
833 /* This is the context that is passed to us when the bdev
844 /* Generate UUID based on namespace UUID + base bdev UUID */
848 SPDK_ERRLOG("Unable to generate new UUID for crypto bdev\n");
860 rc = spdk_bdev_module_claim_bdev(bdev, vbdev->base_desc, vbdev->crypto_bdev.module);
862 SPDK_ERRLOG("Failed to claim bdev %s\n", spdk_bdev_get_name(bdev));
872 SPDK_DEBUGLOG(vbdev_crypto, "Registered io_device and virtual bdev for: %s\n",
907 /* Remove the association (vbdev, bdev) from g_bdev_names. This is required so that the
908 * vbdev does not get re-created if the same bdev is constructed at some other time,
909 * unless the underlying bdev was hot-removed. */
950 SPDK_ERRLOG("Encountered an error during bdev unregistration\n");
957 /* Because we specified this function in our crypto bdev function table when we
958 * registered our crypto bdev, we'll get this call anytime a new bdev shows up.
960 * parsed the config file at init so we check the new bdev against the list
962 * bdev, here's where we do it.
965 vbdev_crypto_examine(struct spdk_bdev *bdev)
967 vbdev_crypto_claim(spdk_bdev_get_name(bdev));