[dpdk-dev] [PATCH v6 04/13] vhost: rxtx: prepare work for multiple queue support

Thomas Monjalon thomas.monjalon at 6wind.com
Tue Oct 20 09:24:09 CEST 2015


2015-10-20 15:10, Yuanhan Liu:
> On Tue, Oct 20, 2015 at 08:57:52AM +0200, Thomas Monjalon wrote:
> > > -	if (unlikely(queue_id != VIRTIO_RXQ)) {
> > > -		LOG_DEBUG(VHOST_DATA, "mq isn't supported in this version.\n");
> > > +	if (unlikely(!is_valid_virt_queue_idx(queue_id, 0, dev->virt_qp_nb))) {
> > > +		RTE_LOG(ERR, VHOST_DATA,
> > > +			"%s (%"PRIu64"): virtqueue idx:%d invalid.\n",
> > > +			__func__, dev->device_fh, queue_id);
> > [...]
> > > -	if (unlikely(queue_id != VIRTIO_RXQ)) {
> > > -		LOG_DEBUG(VHOST_DATA, "mq isn't supported in this version.\n");
> > > +	if (unlikely(!is_valid_virt_queue_idx(queue_id, 0, dev->virt_qp_nb))) {
> > > +		RTE_LOG(ERR, VHOST_DATA,
> > > +			"%s (%"PRIu64"): virtqueue idx:%d invalid.\n",
> > > +			__func__, dev->device_fh, queue_id);
> > > +		return 0;
> > [...]
> > > -	if (unlikely(queue_id != VIRTIO_TXQ)) {
> > > -		LOG_DEBUG(VHOST_DATA, "mq isn't supported in this version.\n");
> > > +	if (unlikely(!is_valid_virt_queue_idx(queue_id, 1, dev->virt_qp_nb))) {
> > > +		RTE_LOG(ERR, VHOST_DATA,
> > > +			"%s (%"PRIu64"): virtqueue idx:%d invalid.\n",
> > > +			__func__, dev->device_fh, queue_id);
> > 
> > Why not use the log macros in drivers/net/virtio/virtio_logs.h?
> 
> Do you mean I should keep using LOG_DEBUG instead?

No you can use the error level.
Actually I was checking the logs in virtio which use some log wrapper to keep
some consistency. But the vhost code doesn't seem to have such policy.
So you are free :)
But I would say you should avoid changing the log format if does not comply
with the rest of the library. The __func__ macro is not really used.
Maybe Huawei could give a general policy for vhost logs (having a general
consistency in all DPDK libs is better).


More information about the dev mailing list