[v7,1/5] examples/l3fwd: fix LPM IPv6 subnets

Message ID 20210406111106.2020555-2-conor.walsh@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series examples/l3fwd: add FIB lookup method to l3fwd |

Checks

Context Check Description
ci/checkpatch warning coding style issues

Commit Message

Conor Walsh April 6, 2021, 11:11 a.m. UTC
The IPv6 subnets used were not within the 2001:200::/48 subnet
Changed to 2001:200:0:{0-7}::/64 where 0-7 is the port ID

Fixes: 37afe381bde4 ("examples/l3fwd: use reserved IP addresses")

Signed-off-by: Conor Walsh <conor.walsh@intel.com>
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
---
 examples/l3fwd/l3fwd_lpm.c | 26 ++++++++++++++++----------
 1 file changed, 16 insertions(+), 10 deletions(-)
  

Comments

David Marchand April 14, 2021, 8:59 p.m. UTC | #1
On Tue, Apr 6, 2021 at 1:11 PM Conor Walsh <conor.walsh@intel.com> wrote:
>
> The IPv6 subnets used were not within the 2001:200::/48 subnet

{{32, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 48, 0},
{{32, 1, 2, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, 48, 1},
etc...

Err... all those subnets were exactly == 2001:200::/48.
Is the issue that the example needs *separate* subnets taken from
within 2001:200::/48 ?


> Changed to 2001:200:0:{0-7}::/64 where 0-7 is the port ID
>
> Fixes: 37afe381bde4 ("examples/l3fwd: use reserved IP addresses")

And this looks like a Cc: stable@dpdk.org candidate.

>
> Signed-off-by: Conor Walsh <conor.walsh@intel.com>
> Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
  
Conor Walsh April 15, 2021, 8:44 a.m. UTC | #2
<snip>

> >
> > The IPv6 subnets used were not within the 2001:200::/48 subnet
> 
> {{32, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 48, 0},
> {{32, 1, 2, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, 48, 1},
> etc...
> 
> Err... all those subnets were exactly == 2001:200::/48.
> Is the issue that the example needs *separate* subnets taken from
> within 2001:200::/48 ?

Hi David,
As it is ATM any IP with that range will match for all the rules for the 8 ports and the application cannot differentiate between them and it just returns the traffic to sender.
After this change the ports can be individually matched using the smaller /64 ranges for each port which are still within the given /48 subnet range (RFC5180).

> 
> 
> > Changed to 2001:200:0:{0-7}::/64 where 0-7 is the port ID
> >
> > Fixes: 37afe381bde4 ("examples/l3fwd: use reserved IP addresses")
> 
> And this looks like a Cc: stable@dpdk.org candidate.

I can send a v8 and CC stable if you think that’s needed.
Thanks,
Conor.

> 
> >
> > Signed-off-by: Conor Walsh <conor.walsh@intel.com>
> > Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
> 
> 
> --
> David Marchand
  
David Marchand April 15, 2021, 2:31 p.m. UTC | #3
On Thu, Apr 15, 2021 at 10:44 AM Walsh, Conor <conor.walsh@intel.com> wrote:
>
> <snip>
>
> > >
> > > The IPv6 subnets used were not within the 2001:200::/48 subnet
> >
> > {{32, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 48, 0},
> > {{32, 1, 2, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, 48, 1},
> > etc...
> >
> > Err... all those subnets were exactly == 2001:200::/48.
> > Is the issue that the example needs *separate* subnets taken from
> > within 2001:200::/48 ?
>
> Hi David,
> As it is ATM any IP with that range will match for all the rules for the 8 ports and the application cannot differentiate between them and it just returns the traffic to sender.
> After this change the ports can be individually matched using the smaller /64 ranges for each port which are still within the given /48 subnet range (RFC5180).

Ok, thanks for confirming, could you update the commitlog to make it clear?

>
> >
> >
> > > Changed to 2001:200:0:{0-7}::/64 where 0-7 is the port ID
> > >
> > > Fixes: 37afe381bde4 ("examples/l3fwd: use reserved IP addresses")
> >
> > And this looks like a Cc: stable@dpdk.org candidate.
>
> I can send a v8 and CC stable if you think that’s needed.

Yes please.
I was waiting to look at the rest of the series, I have some comments
that will require a v8 (from my pov).
  
Conor Walsh April 15, 2021, 3:18 p.m. UTC | #4
<snip>

> > > > The IPv6 subnets used were not within the 2001:200::/48 subnet
> > >
> > > {{32, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 48, 0},
> > > {{32, 1, 2, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, 48, 1},
> > > etc...
> > >
> > > Err... all those subnets were exactly == 2001:200::/48.
> > > Is the issue that the example needs *separate* subnets taken from
> > > within 2001:200::/48 ?
> >
> > Hi David,
> > As it is ATM any IP with that range will match for all the rules for the 8 ports
> and the application cannot differentiate between them and it just returns
> the traffic to sender.
> > After this change the ports can be individually matched using the smaller
> /64 ranges for each port which are still within the given /48 subnet range
> (RFC5180).
> 
> Ok, thanks for confirming, could you update the commitlog to make it clear?

Hi David,

Thanks for your feedback on this patch and the other patches in the series, I will address them in v8.

Thanks,
Conor.

> 
> >
> > >
> > >
> > > > Changed to 2001:200:0:{0-7}::/64 where 0-7 is the port ID
> > > >
> > > > Fixes: 37afe381bde4 ("examples/l3fwd: use reserved IP addresses")
> > >
> > > And this looks like a Cc: stable@dpdk.org candidate.
> >
> > I can send a v8 and CC stable if you think that’s needed.
> 
> Yes please.
> I was waiting to look at the rest of the series, I have some comments
> that will require a v8 (from my pov).
> 
> 
> --
> David Marchand
  

Patch

diff --git a/examples/l3fwd/l3fwd_lpm.c b/examples/l3fwd/l3fwd_lpm.c
index 3dcf1fef18..1cfaf36572 100644
--- a/examples/l3fwd/l3fwd_lpm.c
+++ b/examples/l3fwd/l3fwd_lpm.c
@@ -42,7 +42,10 @@  struct ipv6_l3fwd_lpm_route {
 	uint8_t  if_out;
 };
 
-/* 198.18.0.0/16 are set aside for RFC2544 benchmarking (RFC5735). */
+/*
+ * 198.18.0.0/16 are set aside for RFC2544 benchmarking (RFC5735).
+ * 198.18.{0-7}.0/24 = Port {0-7}
+ */
 static const struct ipv4_l3fwd_lpm_route ipv4_l3fwd_lpm_route_array[] = {
 	{RTE_IPV4(198, 18, 0, 0), 24, 0},
 	{RTE_IPV4(198, 18, 1, 0), 24, 1},
@@ -54,16 +57,19 @@  static const struct ipv4_l3fwd_lpm_route ipv4_l3fwd_lpm_route_array[] = {
 	{RTE_IPV4(198, 18, 7, 0), 24, 7},
 };
 
-/* 2001:0200::/48 is IANA reserved range for IPv6 benchmarking (RFC5180) */
+/*
+ * 2001:200::/48 is IANA reserved range for IPv6 benchmarking (RFC5180).
+ * 2001:200:0:{0-7}::/64 = Port {0-7}
+ */
 static const struct ipv6_l3fwd_lpm_route ipv6_l3fwd_lpm_route_array[] = {
-	{{32, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 48, 0},
-	{{32, 1, 2, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, 48, 1},
-	{{32, 1, 2, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0}, 48, 2},
-	{{32, 1, 2, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0}, 48, 3},
-	{{32, 1, 2, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0}, 48, 4},
-	{{32, 1, 2, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0}, 48, 5},
-	{{32, 1, 2, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0}, 48, 6},
-	{{32, 1, 2, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0}, 48, 7},
+	{{32, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 64, 0},
+	{{32, 1, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0}, 64, 1},
+	{{32, 1, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0}, 64, 2},
+	{{32, 1, 2, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0}, 64, 3},
+	{{32, 1, 2, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0}, 64, 4},
+	{{32, 1, 2, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0}, 64, 5},
+	{{32, 1, 2, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0}, 64, 6},
+	{{32, 1, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0}, 64, 7},
 };
 
 #define IPV4_L3FWD_LPM_MAX_RULES         1024