Thread (75 messages) flat view 75 messages, 5 authors, 2016-11-29

Re: [PATCH 2/6] vhost: get guest/host physical address mappings

From: Maxime Coquelin <hidden>
Date: 2016-08-23 13:25:37


On 08/23/2016 02:32 PM, Yuanhan Liu wrote:
quoted
quoted
+
quoted
quoted
+	/* FIXME */
+	RTE_LOG(INFO, VHOST_CONFIG, ":: %u ::\n", pre_read);
For my information, what is the purpose of pre_read?
Again, I put a FIXME here, but I forgot to add some explanation.

Here is the thing: the read will make sure the kernel populate the
corresponding PTE entry, so that rte_mem_virt2phy() will return proper
physical address, otherwise, invalid value is returned.

I can't simply do the read but do not actually reference/consume it.
Otherwise, the compiler will treat it as some noops and remove it.

An ugly RTE_LOG will make sure the read operation is not eliminated.
I'm seeking a more proper way to achieve that. Maybe I can add a new
field in virtio_net structure and store it there.

Or, do you have better ideas?
This behavior is pretty twisted, no?
Shouldn't be rte_mem_virt2phy() role to ensure returning a valid value?

I have no better idea for now, but I will think about it.

Regards,
Maxime
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help