Hi all,
I need some help from the virtio gurus...
i've been trying to make the checksum offloading capabilities of the
Intel NIC available to NFV setups. all the tests done with made-up
packets do work, but there's at least a couple of issues when trying
to get it meshed with the virtio code.
first about negotiation:
it seems that i only need to add C.VIRTIO_NET_F_CSUM to the
supported_features variable defined in lib/virtio/net_device.lua,
right?
when i do that, the output of "ethtool -k eth0" from within the VM is
as follows:
Features for eth0:
rx-checksumming: off [fixed]
tx-checksumming: on
tx-checksum-ipv4: off [fixed]
tx-checksum-ip-generic: on
tx-checksum-ipv6: off [fixed]
tx-checksum-fcoe-crc: off [fixed]
tx-checksum-sctp: off [fixed]
scatter-gather: on
tx-scatter-gather: on
tx-scatter-gather-fraglist: on
tcp-segmentation-offload: off
tx-tcp-segmentation: off [fixed]
tx-tcp-ecn-segmentation: off [fixed]
tx-tcp6-segmentation: off [fixed]
udp-fragmentation-offload: off [fixed]
generic-segmentation-offload: on
generic-receive-offload: on
large-receive-offload: off [fixed]
rx-vlan-offload: off [fixed]
tx-vlan-offload: off [fixed]
ntuple-filters: off [fixed]
receive-hashing: off [fixed]
highdma: on [fixed]
rx-vlan-filter: off [fixed]
vlan-challenged: off [fixed]
tx-lockless: off [fixed]
netns-local: off [fixed]
tx-gso-robust: off [fixed]
tx-fcoe-segmentation: off [fixed]
tx-gre-segmentation: off [fixed]
tx-ipip-segmentation: off [fixed]
tx-sit-segmentation: off [fixed]
tx-udp_tnl-segmentation: off [fixed]
tx-mpls-segmentation: off [fixed]
fcoe-mtu: off [fixed]
tx-nocache-copy: on
loopback: off [fixed]
rx-fcs: off [fixed]
rx-all: off [fixed]
tx-vlan-stag-hw-insert: off [fixed]
rx-vlan-stag-hw-parse: off [fixed]
rx-vlan-stag-filter: off [fixed]
l2-fwd-offload: off [fixed]
i don't know if that's enough, there are still too many "off [fixed]"
lines, so the original test_checksum function of lib/nfv/selftest.sh
still fails, as it checks for rx-checksumming, tx-checksumming,
tx-checksum-ipv4 and rx-checksum-ipv6 to be all 'on'
regardless all those 'off [fixed]', the iperf traffic i get does have
the C.PACKET_NEEDS_CSUM field of packet.info.flags set, so the driver
is relegating the checksum to the 'hardware'.
Q1:
maybe the "tx-checksumming: on" and "tx-checksum-ip-generic: on" are
enough even if the more specific tx-checksum-ipv4 and tx-checksum-ipv6
are off?
Q2:
rx-checksumming is off, but I can set the C.PACKET_CSUM_VALID field of
packet.info.flags if the NIC has already checked the checksums anyway.
Would the virtio driver accept it and skip checking incoming packets
again?
Second, kernel driver complains:
even while small traffic (ping) does work, bigger loads (iperf) die
with a message like "virtio_net virtio0: output.0:id 4294967295 out of
range" that seems to be generated from the virtqueue_get_buf()
function in drivers/virtio/virtio_ring.c
(
http://lxr.free-electrons.com/source/drivers/virtio/virtio_ring.c#L552)
it looks like there's an '.id' field of some vring structure that
gets an absurd number
does that mean i'm putting corrupted data in the virtio ring?
the checksum engines in the Intel chip are managed by inserting some
non-packet entries in the TX ring. initially, things were a little
confusing in the packet-releasing code until i managed to make it
ignore those entries. maybe some of this non-packet is leaking to the
virtio code?
Q3:
what does that "id" field means? it comes from
"vq->vring.used->ring[last_used].id". is that a private structure of
the virtio driver? or does it get from the vhost part in SnS?
Q4:
is there any way to know if this bug is happening at the sending or
receiving path?
Q4:
some debugging tips... at which points of the Lua virtio code could I
check if the data flowing to/from the VM is sane?
--
Javier