From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id CC7D32B9A for ; Tue, 19 Jul 2016 15:03:34 +0200 (CEST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP; 19 Jul 2016 06:03:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,389,1464678000"; d="scan'208";a="141851027" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga004.fm.intel.com with ESMTP; 19 Jul 2016 06:03:07 -0700 Received: from FMSMSX109.amr.corp.intel.com (10.18.116.9) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 19 Jul 2016 06:03:06 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx109.amr.corp.intel.com (10.18.116.9) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 19 Jul 2016 06:03:05 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.181]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.8]) with mapi id 14.03.0248.002; Tue, 19 Jul 2016 21:03:02 +0800 From: "Tan, Jianfeng" To: Olivier Matz , "dev@dpdk.org" , "Xie, Huawei" , "yuanhan.liu@linux.intel.com" Thread-Topic: [PATCH] virtio: fix packet corruption Thread-Index: AQHR4bmfu4jhgh1RaEuZY16Y/8PJDaAft+RA Date: Tue, 19 Jul 2016 13:03:02 +0000 Message-ID: References: <1468931519-7381-1-git-send-email-olivier.matz@6wind.com> In-Reply-To: <1468931519-7381-1-git-send-email-olivier.matz@6wind.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] virtio: fix packet corruption 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: Tue, 19 Jul 2016 13:03:35 -0000 Hi Oliver, > -----Original Message----- > From: Olivier Matz [mailto:olivier.matz@6wind.com] > Sent: Tuesday, July 19, 2016 8:32 PM > To: dev@dpdk.org; Tan, Jianfeng; Xie, Huawei; yuanhan.liu@linux.intel.com > Subject: [PATCH] virtio: fix packet corruption >=20 > The support of virtio-user changed the way the mbuf dma address is > retrieved, using a physical address in case of virtio-pci and a virtual > address in case of virtio-user. >=20 > This change introduced some possible memory corruption in packets, > replacing: > m->buf_physaddr + RTE_PKTMBUF_HEADROOM > by: > m->buf_physaddr + m->data_off (through a macro) >=20 > This patch fixes this issue, restoring the original behavior. Could you be more specific on why we cannot use m->data_off here? Thanks, Jianfeng >=20 > By the way, it also rework the macros, adding a "VIRTIO_" prefix and > API comments. >=20 > Fixes: f24f8f9fee8a ("net/virtio: allow virtual address to fill vring des= criptors") >=20 > Signed-off-by: Olivier Matz > --- > drivers/net/virtio/virtio_ethdev.c | 2 +- > drivers/net/virtio/virtio_rxtx.c | 5 +++-- > drivers/net/virtio/virtio_rxtx_simple.c | 13 +++++++------ > drivers/net/virtio/virtqueue.h | 25 +++++++++++++++++-------- > 4 files changed, 28 insertions(+), 17 deletions(-) >=20