vhost: always inline spdk_vhost_dev_has_feature
spdk_vhost_dev_has_feature() is internal function so we can move it's declaration to header file. This remove function call overhead. Change-Id: I1704e8279cd6720177047a1ae8818f68982998db Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com> Reviewed-on: https://review.gerrithub.io/400241 Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
parent
c83cd9375b
commit
1655fa48a8
@ -457,12 +457,6 @@ spdk_vhost_vring_desc_to_iov(struct spdk_vhost_dev *vdev, struct iovec *iov,
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool
|
||||
spdk_vhost_dev_has_feature(struct spdk_vhost_dev *vdev, unsigned feature_id)
|
||||
{
|
||||
return vdev->negotiated_features & (1ULL << feature_id);
|
||||
}
|
||||
|
||||
static struct spdk_vhost_dev *
|
||||
spdk_vhost_dev_find_by_id(unsigned id)
|
||||
{
|
||||
|
@ -238,7 +238,12 @@ bool spdk_vhost_vring_desc_is_wr(struct vring_desc *cur_desc);
|
||||
|
||||
int spdk_vhost_vring_desc_to_iov(struct spdk_vhost_dev *vdev, struct iovec *iov,
|
||||
uint16_t *iov_index, const struct vring_desc *desc);
|
||||
bool spdk_vhost_dev_has_feature(struct spdk_vhost_dev *vdev, unsigned feature_id);
|
||||
|
||||
static inline bool __attribute__((always_inline))
|
||||
spdk_vhost_dev_has_feature(struct spdk_vhost_dev *vdev, unsigned feature_id)
|
||||
{
|
||||
return vdev->negotiated_features & (1ULL << feature_id);
|
||||
}
|
||||
|
||||
int spdk_vhost_dev_register(struct spdk_vhost_dev *vdev, const char *name, const char *mask_str,
|
||||
const struct spdk_vhost_dev_backend *backend);
|
||||
|
@ -84,8 +84,6 @@ DEFINE_STUB_V(spdk_vhost_unlock, (void));
|
||||
DEFINE_STUB(spdk_env_get_current_core, uint32_t, (void), 0);
|
||||
DEFINE_STUB_V(spdk_vhost_call_external_event, (const char *ctrlr_name, spdk_vhost_event_fn fn,
|
||||
void *arg));
|
||||
DEFINE_STUB(spdk_vhost_dev_has_feature, bool, (struct spdk_vhost_dev *vdev, unsigned feature_id),
|
||||
false);
|
||||
DEFINE_STUB(spdk_vhost_vring_desc_has_next, bool, (struct vring_desc *cur_desc), false);
|
||||
DEFINE_STUB_VP(spdk_vhost_gpa_to_vva, (struct spdk_vhost_dev *vdev, uint64_t addr), {0});
|
||||
DEFINE_STUB(spdk_scsi_dev_get_id, int, (const struct spdk_scsi_dev *dev), {0});
|
||||
|
@ -208,7 +208,6 @@ vhost_scsi_dev_remove_dev_test(void)
|
||||
svdev->vdev.lcore = 0;
|
||||
scsi_dev = alloc_scsi_dev();
|
||||
svdev->scsi_dev[0] = scsi_dev;
|
||||
MOCK_SET(spdk_vhost_dev_has_feature, bool, false);
|
||||
rc = spdk_vhost_scsi_dev_remove_tgt(&svdev->vdev, 0, NULL, NULL);
|
||||
CU_ASSERT(rc == -ENOTSUP);
|
||||
free(scsi_dev);
|
||||
@ -231,7 +230,6 @@ vhost_scsi_dev_add_dev_test(void)
|
||||
|
||||
svdev = alloc_svdev();
|
||||
vdev = &svdev->vdev;
|
||||
MOCK_SET(spdk_vhost_dev_has_feature, bool, false);
|
||||
|
||||
/* Add device when max devices is reached */
|
||||
rc = spdk_vhost_scsi_dev_add_tgt(vdev,
|
||||
|
Loading…
Reference in New Issue
Block a user