-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vdpa/virtio: Move doorbell relay disable to dev close #54
Conversation
drivers/vdpa/virtio/virtio_vdpa.c
Outdated
@@ -474,6 +474,25 @@ virtio_vdpa_dev_notifier_work(void *arg) | |||
return ret; | |||
} | |||
|
|||
static void virtio_vdpa_doorbell_relay_disable(struct virtio_vdpa_priv *priv) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DPDK coding style, should be:
static void
virtio_vdpa...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
drivers/vdpa/virtio/virtio_vdpa.c
Outdated
@@ -474,6 +474,25 @@ virtio_vdpa_dev_notifier_work(void *arg) | |||
return ret; | |||
} | |||
|
|||
static void virtio_vdpa_doorbell_relay_disable(struct virtio_vdpa_priv *priv) | |||
{ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this line can be deleted
drivers/vdpa/virtio/virtio_vdpa.c
Outdated
uint16_t nr_virtqs = priv->hw_nr_virtqs; | ||
int vq_idx, ret; | ||
|
||
for(vq_idx = 0; vq_idx < nr_virtqs; vq_idx++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need a space after 'for'
drivers/vdpa/virtio/virtio_vdpa.c
Outdated
ret = virtio_vdpa_virtq_doorbell_relay_disable(priv, vq_idx); | ||
if (ret) { | ||
DRV_LOG(ERR, "%s doorbell relay disable failed ret:%d", | ||
priv->vdev->device->name, ret); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better to add vq_idx to log
drivers/vdpa/virtio/virtio_vdpa.c
Outdated
DRV_LOG(ERR, "%s doorbell relay disable failed ret:%d", | ||
priv->vdev->device->name, ret); | ||
} | ||
priv->vrings[vq_idx]->notifier_state = VIRTIO_VDPA_NOTIFIER_RELAY_DISABLED; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the state seems to be set in virtio_vdpa_virtq_doorbell_relay_disable already. so this is not needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -1630,6 +1642,7 @@ virtio_vdpa_dev_do_remove(struct rte_pci_device *pci_dev, struct virtio_vdpa_pri | |||
|
|||
if (priv->configured) | |||
virtio_vdpa_dev_close(priv->vid); | |||
virtio_vdpa_doorbell_relay_disable(priv); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this? if configured, it will be done in close. if not configured, it seems relay will not be enabled. Is there any case that this function call is necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just prevent if config fail, still check doorbell relay setting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
priv->configured flag is set in the end of config, just after relay_enable. relay enable fail will not return in current code. so if config fail, it's failing before enable. right?
Doorbell relay is enabled when dev config, set vring state should not disble doorbell, only in dev close or rpc remove device, we need disable relay RM:3725995 Signed-off-by: Kailiang <kailiangz@nvidia.com>
Doorbell relay is enabled when dev config, set vring state should not disble doorbell, only in dev close or rpc remove device, we need disable relay
RM:3725995