From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f175.google.com (mail-pf0-f175.google.com [209.85.192.175]) by dpdk.org (Postfix) with ESMTP id 4E4CD9406 for ; Wed, 6 Jan 2016 01:48:44 +0100 (CET) Received: by mail-pf0-f175.google.com with SMTP id q63so192873526pfb.0 for ; Tue, 05 Jan 2016 16:48:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=uqlf7nzVI9Yd9Gjb3NSgSPNSKbldywQwaUlKXYBrhT0=; b=k0RESY0VskTpiccQLG0aVk98Ue2W4CCYy1Br9bQfe+hSGUQCFHbL8VusHydx9cnFv2 8zYuLnoFrEAC5Z3vS5uIkyfeW5jhU2sLU7wlubFsORkhA9jZ42xvcrxdT2qCYN0Tq4II 38EaCoRe4o7gg5Tv9kW+ax7mNp8vqrDipu353wo0uDuEY5DDA9rThMwwKT5swRHEBcaN Pv9ZBpXHEDtd9BcZYTzaJg5yhTfGgHMMAiCKSpdfDNpz4Ad3NR1SnQez0D50+qBgcUHo hDkehGGqiH92XQbmQ1Ki3UoyF7hIlSBqVysOLkimWIfTCCFbQn2JuQvvAmTWAKHyPeh5 Qxjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=uqlf7nzVI9Yd9Gjb3NSgSPNSKbldywQwaUlKXYBrhT0=; b=Yl7R923OCWoudWUKkcNWzrwlwnu3+yk9LZUSAxtg8sJoElAkvSJXhOrzhFyql40uGa WW6Jq1uhgv1eIzGBAnxTZ3H+3s4yhtEPVlLwmTKyhCGXYWlMt0p02AENmqzPbzH9eg4D P/V9TcZBkCnEVRphHWLCgIYt48ATTsR5v4g7k25jKV98/3Q43JsTFZf368qUrWkR7bPG F6uJj5ty/pyIdatM/nARbvMgkcmBOEacfuo6/uNsgDzF7OVQwpnHSFe8YQ4KXYdotjzv +DlNyP+Yotx57CbnPcMq7pCfl0hYLMVtmaQJNOPduF28tLom1kZ0xtkAoUnFZC5Pan0G e8OQ== X-Gm-Message-State: ALoCoQlXFVsvJ9PGFfHIqhXIZIVwt36Wpy7wsVmfUJizQB0bWKXQvKKXzIXJ2B9zKghCLOO7SuXzu4XsFoik37ZsTUBMXvkwrw== X-Received: by 10.98.74.5 with SMTP id x5mr111176920pfa.102.1452041323424; Tue, 05 Jan 2016 16:48:43 -0800 (PST) Received: from xeon-e3 (static-50-53-82-155.bvtn.or.frontiernet.net. [50.53.82.155]) by smtp.gmail.com with ESMTPSA id x3sm68876877pfi.21.2016.01.05.16.48.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Jan 2016 16:48:43 -0800 (PST) Date: Tue, 5 Jan 2016 16:48:49 -0800 From: Stephen Hemminger To: Yong Wang Message-ID: <20160105164849.526442a8@xeon-e3> In-Reply-To: <1452039178-15635-2-git-send-email-yongwang@vmware.com> References: <1452039178-15635-1-git-send-email-yongwang@vmware.com> <1452039178-15635-2-git-send-email-yongwang@vmware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v3 1/4] vmxnet3: restore tx data ring support X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 00:48:44 -0000 On Tue, 5 Jan 2016 16:12:55 -0800 Yong Wang 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.