DPDK patches and discussions
 help / color / mirror / Atom feed
From: Yong Wang <yongwang@vmware.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v3 1/4] vmxnet3: restore tx data ring support
Date: Wed, 13 Jan 2016 02:20:01 +0000	[thread overview]
Message-ID: <6EDC655B-0C21-4C63-997D-87BD2B35BAEB@vmware.com> (raw)
In-Reply-To: <20160105164849.526442a8@xeon-e3>

On 1/5/16, 4:48 PM, "Stephen Hemminger" <stephen@networkplumber.org> wrote:


>On Tue,  5 Jan 2016 16:12:55 -0800
>Yong Wang <yongwang@vmware.com> wrote:
>
>> @@ -365,6 +366,14 @@ vmxnet3_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
>>  			break;
>>  		}
>>  
>> +		if (rte_pktmbuf_pkt_len(txm) <= VMXNET3_HDR_COPY_SIZE) {
>> +			struct Vmxnet3_TxDataDesc *tdd;
>> +
>> +			tdd = txq->data_ring.base + txq->cmd_ring.next2fill;
>> +			copy_size = rte_pktmbuf_pkt_len(txm);
>> +			rte_memcpy(tdd->data, rte_pktmbuf_mtod(txm, char *), copy_size);
>> +		}
>
>Good idea to use a local region which optmizes the copy in the host,
>but this implementation needs to be more general.
>
>As written it is broken for multi-segment packets. A multi-segment
>packet will have a pktlen >= datalen as in:
>  m -> mb_segs=3, pktlen=1200, datalen=200
>    -> datalen=900
>    -> datalen=100
>
>There are two ways to fix this. You could test for nb_segs == 1
>or better yet. Optimize each segment it might be that the first
>segment (or tail segment) would fit in the available data area.

Currently the vmxnet3 backend has a limitation of 128B data area so
it should work even for the multi-segmented pkt shown above. But
I agree it does not work for all multi-segmented packets.  The
following packet will be such an example.

m -> nb_segs=3, pktlen=128, datalen=64
    -> datalen=32
    -> datalen=32


It’s unclear if/how we might get into such a multi-segmented pkt
but I agree we should handle this case.  Patch updated taking the
simple approach (checking for nb_segs == 1).  I’ll leave the
optimization as a future patch.

  reply	other threads:[~2016-01-13  2:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-06  0:12 [dpdk-dev] [PATCH v3 0/4] vmxnet3 TSO and tx cksum offload Yong Wang
2016-01-06  0:12 ` [dpdk-dev] [PATCH v3 1/4] vmxnet3: restore tx data ring support Yong Wang
2016-01-06  0:48   ` Stephen Hemminger
2016-01-13  2:20     ` Yong Wang [this message]
2016-01-13  4:50       ` Stephen Hemminger
2016-01-06  0:12 ` [dpdk-dev] [PATCH v3 2/4] vmxnet3: add tx l4 cksum offload Yong Wang
2016-01-06  0:51   ` Stephen Hemminger
2016-01-13  2:20     ` Yong Wang
2016-01-06  0:12 ` [dpdk-dev] [PATCH v3 3/4] vmxnet3: add TSO support Yong Wang
2016-01-06  0:12 ` [dpdk-dev] [PATCH v3 4/4] vmxnet3: announce device offload capability Yong Wang
2016-01-06  0:52   ` Stephen Hemminger
2016-01-13  2:20     ` Yong Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6EDC655B-0C21-4C63-997D-87BD2B35BAEB@vmware.com \
    --to=yongwang@vmware.com \
    --cc=dev@dpdk.org \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).