On Tue, Mar 27, 2018 at 10:28 AM, Paolo Bonzini <pbonz...@redhat.com> wrote: > On 27/03/2018 18:47, Dr. David Alan Gilbert wrote: >>> So if the subsection is absent you >>> have to migrate either tx.tso_props or tx.props, depending on s->tx.cptse. >> Do you mean when sending you have to decide which set to send in the >> non-subsection data? And with cptse true that means use tso_props? > > Yes. > >>> Likewise if you migrate from older versions: if s->tx.props.tse && >>> s->tx.cptse, you have to copy s->tx.props to s->tx.tso_props and clear >>> s->tx.props. >> >> I don't see any equivalent code in the existing non-subsection postload to >> do this; so I'm guessing there are some cases of 2.11->2.12 that will >> break at the moment? > > Yes, I think so. > >>> My understanding is that s->tx.tso_props.tse will be 1 if >>> and only if the source sent s->tx.tso_props. >> I don't see anything in the current code that migrates tso_props.tse - >> where does it come from? > > Ouch... The tse field is more or less dead in current code AFAICS, but > it was used in the previous version. What's the best way then to find > if the subsection was transmitted? Do we have anything like a post_load > callback in the subsection itself?
The TSE flag in the cmd_and_length field of the context descriptor is useful only as an indication of which context is being updated: TSO (tso_props) or non-TSO (props). There is no reason to store it or migrate it, and all prior uses of the stored field were based on an incorrect understanding of its meaning. Now props.tse is always 0, and tso_props.tse is always 1 after the first TSO context is processed. > To find out which "props" to transmit to older QEMU, you can add a > tp->use_tso_for_migration = tp->cptse just before "if (!(txd_lower & > E1000_TXD_CMD_EOP))" in process_tx_desc... tp->cptse only indicates whether the current tx data descriptor should be segmented using parameters from the last TSO context descriptor. It's perfectly legal for the guest to set up a TSO context and then use it for some but not all subsequent data descriptors. tp->cptse doesn't help in deciding what to migrate. Whether to migrate props or tso_props back to 2.11 should be instead based on which was updated last by a context descriptor. Something like if (dtype == E1000_TXD_CMD_DEXT) { /* context descriptor */ if (le32_to_cpu(xp->cmd_and_length) & E1000_TXD_CMD_TSE) { e1000x_read_tx_ctx_descr(xp, &tp->tso_props); tp->use_tso_for_migration = 1; tp->tso_frames = 0; } else { e1000x_read_tx_ctx_descr(xp, &tp->props); tp->use_tso_for_migration = 0; } return; --Ed