DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Dumitrescu, Cristian" <cristian.dumitrescu@intel.com>
To: Thomas Monjalon <thomas.monjalon@6wind.com>,
	"Jastrzebski, MichalX K" <michalx.k.jastrzebski@intel.com>,
	"Kobylinski, MichalX" <michalx.kobylinski@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] lib/table: fix wrong type of nht field
Date: Tue, 21 Jun 2016 11:16:46 +0000	[thread overview]
Message-ID: <3EB4FA525960D640B5BDFFD6A3D8912647A0A7CA@IRSMSX108.ger.corp.intel.com> (raw)
In-Reply-To: <4861300.L4XUoLVI0K@xps13>



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Thomas Monjalon
> Sent: Monday, June 20, 2016 11:14 AM
> To: Jastrzebski, MichalX K <michalx.k.jastrzebski@intel.com>; Kobylinski,
> MichalX <michalx.kobylinski@intel.com>
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] lib/table: fix wrong type of nht field
> 
> 2016-06-20 12:10, Michal Jastrzebski:
> > From: Michal Kobylinski <michalx.kobylinski@intel.com>
> >
> > Change type of nht field from uint32_t to uint8_t and increase max of
> > next hops.
> >
> > Fixes: dc81ebbacaeb ("lpm: extend IPv4 next hop field")
> 
> Why the type is wrong?

The lpm->nht is simply some raw memory allocated at the end of the table context using the usual pattern:
struct rte_table_lpm {
	... 
	uint8_t nht[0] __rte_cache_aligned;
}

Therefore, when we do: 
	nht_entry = &lpm->nht[i * lpm->entry_size];
in several places, it makes big difference whether nht_entry is declared as uin8_t * (correct) or uint32_t * (incorrect), as the position computed by the latter is 4 times the position computed by the former ;(

Michal K and Michal J,
	I just realized we still need to do a small change to this patch, I will reply to the original mail now. So Thomas, sorry, there is one small change, we'll send new version soon.

Thanks,
Cristian

  reply	other threads:[~2016-06-21 11:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-20 10:10 Michal Jastrzebski
2016-06-20 10:13 ` Thomas Monjalon
2016-06-21 11:16   ` Dumitrescu, Cristian [this message]
2016-06-21 11:20 ` Dumitrescu, Cristian
2016-06-21 12:27 ` [dpdk-dev] [PATCH v2] " Michal Kobylinski
2016-06-21 13:09   ` Dumitrescu, Cristian
2016-06-21 13:15     ` Thomas Monjalon
2016-06-21 13:21       ` Dumitrescu, Cristian
2016-06-21 13:20   ` [dpdk-dev] [PATCH v3] " Michal Kobylinski
2016-06-21 20:43     ` Thomas Monjalon

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=3EB4FA525960D640B5BDFFD6A3D8912647A0A7CA@IRSMSX108.ger.corp.intel.com \
    --to=cristian.dumitrescu@intel.com \
    --cc=dev@dpdk.org \
    --cc=michalx.k.jastrzebski@intel.com \
    --cc=michalx.kobylinski@intel.com \
    --cc=thomas.monjalon@6wind.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).