From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com [74.125.82.41]) by dpdk.org (Postfix) with ESMTP id 618F2F614 for ; Wed, 11 Jan 2017 15:51:18 +0100 (CET) Received: by mail-wm0-f41.google.com with SMTP id f73so27312974wmf.1 for ; Wed, 11 Jan 2017 06:51:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:user-agent:in-reply-to :references:mime-version:content-transfer-encoding; bh=w+voc7EpB+PSsRlNVJMX3OYDs+9HPe/vf4FeckCRlQg=; b=zwsRoHJoAH0HUZIlqoPp3HyAcBPLqxbOkxZnT66E+73J2eQpK2N6m2boLHO6kRgrF0 +X75Kj3Db7anZGo4gAiGJCmNdgHdRvT/eTBFcA9vgzAvSNErC6FPKYy2UMC+NmWGGfHE c4Zg7xXwbsxtKfZKGWXj9uKDxbkzppbCgtSSWK+U9O5lSeJaPgHQj1X3zdJvY5uRxzUs seGP31WpxF82xvfzhzBkjFouxx/dgdh2aOYDqIrFinrNY5HnO7OBaGq3NGvEtx62FWrz pUmeKc3qTxo/IbZUteaszG7FGHq0fYiOlNH29ju6N3HB+pwBAwd//jWrsIcxEzT4u/d7 meFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:user-agent :in-reply-to:references:mime-version:content-transfer-encoding; bh=w+voc7EpB+PSsRlNVJMX3OYDs+9HPe/vf4FeckCRlQg=; b=I++wJHu3N7u7v+SxeXKT8RyWavQoUwCajfH7kgbhidhZdyQE6/Pl/BbpozZAtJge2A gpY2MLzjCgGg7zoGhariD5BV/p0DuJipbLiIRoFCusVa0HE+tby8WHkrcI0arZahUkO5 A4eoVGZocBvKI/cpF+EMCU+d8SonJILBunYnBrCoadM+/BMj19J4POzRo8tacE/VXGec R8WsPv5YYUsbmHDT08F/QMNnMunanm5LrSlltsk0wRQyWiuOexlIcZB38m1ueubM9Cyy zVoIxt4L9bkWyB9Xgs5ypI//NrIB8JRaLiC83pim3Z8M16sn0MIsjN8HPE6QtvrdUHF0 51CA== X-Gm-Message-State: AIkVDXLqocoInTFzm6hdSJchdXG0iC1/rShvpMfQ/dvins/Je9y4mbHsxX17FD2HYT0SaLUE X-Received: by 10.28.221.11 with SMTP id u11mr5264090wmg.75.1484146278126; Wed, 11 Jan 2017 06:51:18 -0800 (PST) Received: from xps13.localnet (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by smtp.gmail.com with ESMTPSA id g197sm30176395wmd.15.2017.01.11.06.51.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Jan 2017 06:51:17 -0800 (PST) From: Thomas Monjalon To: Yuanhan Liu , Jianbo Liu , Jerin Jacob , Jan Viktorin , Chao Zhu Cc: dev@dpdk.org, Tan Jianfeng , Wang Zhihong , Olivier Matz , Maxime Coquelin , "Michael S. Tsirkin" Date: Wed, 11 Jan 2017 15:51:22 +0100 Message-ID: <1610499.AMUobBPor6@xps13> User-Agent: KMail/4.14.10 (Linux/4.5.4-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: <1484108832-19907-2-git-send-email-yuanhan.liu@linux.intel.com> References: <1484108832-19907-1-git-send-email-yuanhan.liu@linux.intel.com> <1484108832-19907-2-git-send-email-yuanhan.liu@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH 1/2] net/virtio: fix performance regression due to TSO enabling X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 14:51:18 -0000 2017-01-11 12:27, Yuanhan Liu: > The fact that virtio net header is initiated to zero in PMD driver > init stage means that these costly writes are unnecessary and could > be avoided: > > if (hdr->csum_start != 0) > hdr->csum_start = 0; > > And that's what the macro ASSIGN_UNLESS_EQUAL does. With this, the > performance drop introduced by TSO enabling is recovered: it could > be up to 20% in micro benchmarking. This patch is adding a condition to assignments. We need a benchmark on other architectures like ARM. Please anyone? [...] > +/* avoid write operation when necessary, to lessen cache issues */ > +#define ASSIGN_UNLESS_EQUAL(var, val) do { \ > + if ((var) != (val)) \ > + (var) = (val); \ > +} while (0)