From: "David Laight" <David.Laight@ACULAB.COM>
To: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>,
<davem@davemloft.net>, <nhorman@tuxdriver.com>
Cc: <john.r.fastabend@intel.com>, <gaofeng@cn.fujitsu.com>,
<eric.dumazet@gmail.com>, <mark.d.rustad@intel.com>,
<lizefan@huawei.com>, <netdev@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: RE: [PATCH 2/2] netprio_cgroup: Optimize the priomap copy loop slightly
Date: Tue, 11 Sep 2012 12:42:23 +0100 [thread overview]
Message-ID: <AE90C24D6B3A694183C094C60CF0A2F6026B6FE9@saturn3.aculab.com> (raw)
In-Reply-To: <20120911112237.13852.1095.stgit@srivatsabhat.in.ibm.com>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 596 bytes --]
> - for (i = 0;
> - old_priomap && (i < old_priomap->priomap_len);
> - i++)
> - new_priomap->priomap[i] = old_priomap->priomap[i];
> + if (old_priomap) {
> + old_len = old_priomap->priomap_len;
> +
> + for (i = 0; i < old_len; i++)
> + new_priomap->priomap[i] = old_priomap->priomap[i];
> + }
Or:
memcpy(new_priomap->priomap, old_priomap->priomap,
old_priomap->priomap_len * sizeof old_priomap->priomap[0]);
David
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
next prev parent reply other threads:[~2012-09-11 11:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-11 11:22 [PATCH 1/2] netprio_cgroup: Remove update_netdev_tables() since it is unnecessary Srivatsa S. Bhat
2012-09-11 11:22 ` [PATCH 2/2] netprio_cgroup: Optimize the priomap copy loop slightly Srivatsa S. Bhat
2012-09-11 11:42 ` David Laight [this message]
2012-09-11 15:33 ` Neil Horman
2012-09-12 6:05 ` Srivatsa S. Bhat
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=AE90C24D6B3A694183C094C60CF0A2F6026B6FE9@saturn3.aculab.com \
--to=david.laight@aculab.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=gaofeng@cn.fujitsu.com \
--cc=john.r.fastabend@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lizefan@huawei.com \
--cc=mark.d.rustad@intel.com \
--cc=netdev@vger.kernel.org \
--cc=nhorman@tuxdriver.com \
--cc=srivatsa.bhat@linux.vnet.ibm.com \
/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).