Thread (122 messages) 122 messages, 8 authors, 2016-02-03

Re: [PATCH v2 0/7] virtio 1.0 enabling for virtio pmd driver

From: Yuanhan Liu <hidden>
Date: 2016-01-14 06:43:44

On Thu, Jan 14, 2016 at 02:09:18PM +0800, Tan, Jianfeng wrote:
...
I basically agree with you. We have two dimensions here:

legacy             modern
physical virtio device:                     Use virtio_read_caps_phys() to
distinguish
virtual virtio device (Tetsuya):       Use virtio_read_caps_virt() to
distinguish
virtual virtio device (Jianfeng):    does not need a "configuration space
layout", no need to distinguish
I guess you meant to build a form or something, but seems you failed :)
So in vtpci_init(), we needs to test "eth_dev->dev_type" firstly

vtpci_init() {
    if (eth_dev->dev_type == RTE_ETH_DEV_PCI) {
        if (virtio_read_caps_phys()) {
            // modern
        } else {
            // legacy
        }
    } else {
        if (Tetsuya's way) {
            if (virtio_read_caps_virt()) {
                // modern
            } else {
                // legacy
            }
        } else {
            // Jianfeng's way
        }
    }
}
Normally, I'd like to hide the details inside virtio_read_caps(): I don't
want similar codes to be appeared twice. And if it can be simply done
by "if (eth_dev->dev_type == ...)", I'd like to do it in this way. If not,
introducing another set of operation abstractions as suggested in my
another email might be a better option.
And from Yuanhan's angle, I think he does not need to address this problem.
Yep; it just has nothing to do with this patch set.

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