docs: change the doc to highlight the allowed multicast addresses

Message ID 20220701103726.4190485-1-huzaifa.rahman@emumba.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series docs: change the doc to highlight the allowed multicast addresses |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/github-robot: build success github build: passed
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-abi-testing success Testing PASS

Commit Message

Huzaifa Rahman July 1, 2022, 10:37 a.m. UTC
  Bugzilla ID: 802

The ipv4_multicast example does not work with any multicast IPs.
Only a selected few IPs are allowed to send pakcets. These IPs
are listed in an mcast_group_table array along with their respective
port masks. A normal user would not know about this behaviour since
there is no mention of it in the docs

Added the mcast_group_table in the docs so user would know which
IPs are allowed.

Signed-off-by: huzaifa.rahman <huzaifa.rahman@emumba.com>
---
 doc/guides/sample_app_ug/ipv4_multicast.rst | 8 +++++++-
 examples/ipv4_multicast/main.c              | 2 ++
 2 files changed, 9 insertions(+), 1 deletion(-)
  

Comments

Huzaifa Rahman Aug. 11, 2022, 3:48 a.m. UTC | #1
Hi,

Is there any other work/changes required for this patch to be submitted?


Thanks


On Fri, Jul 1, 2022 at 3:37 PM huzaifa.rahman <huzaifa.rahman@emumba.com>
wrote:

> Bugzilla ID: 802
>
> The ipv4_multicast example does not work with any multicast IPs.
> Only a selected few IPs are allowed to send pakcets. These IPs
> are listed in an mcast_group_table array along with their respective
> port masks. A normal user would not know about this behaviour since
> there is no mention of it in the docs
>
> Added the mcast_group_table in the docs so user would know which
> IPs are allowed.
>
> Signed-off-by: huzaifa.rahman <huzaifa.rahman@emumba.com>
> ---
>  doc/guides/sample_app_ug/ipv4_multicast.rst | 8 +++++++-
>  examples/ipv4_multicast/main.c              | 2 ++
>  2 files changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/doc/guides/sample_app_ug/ipv4_multicast.rst
> b/doc/guides/sample_app_ug/ipv4_multicast.rst
> index f87f7be57e..7c49212c64 100644
> --- a/doc/guides/sample_app_ug/ipv4_multicast.rst
> +++ b/doc/guides/sample_app_ug/ipv4_multicast.rst
> @@ -22,7 +22,13 @@ There are two key differences from the L2 Forwarding
> sample application:
>
>  The lookup method is the Four-byte Key (FBK) hash-based method.
>  The lookup table is composed of pairs of destination IPv4 address (the
> FBK)
> -and a port mask associated with that IPv4 address.
> +and a port mask associated with that IPv4 address. By default, the
> following IP addresses and their respective
> +port masks are added:
> +
> +.. literalinclude:: ../../../examples/ipv4_multicast/main.c
> +    :language: c
> +    :start-after: Create the mcast group table. 8<
> +    :end-before: >8 End of create mcast group table.
>
>  .. note::
>
> diff --git a/examples/ipv4_multicast/main.c
> b/examples/ipv4_multicast/main.c
> index bdcaa3bcd1..c086149eca 100644
> --- a/examples/ipv4_multicast/main.c
> +++ b/examples/ipv4_multicast/main.c
> @@ -139,6 +139,7 @@ struct mcast_group_params {
>         uint16_t port_mask;
>  };
>
> +/* Create the mcast group table. 8< */
>  static struct mcast_group_params mcast_group_table[] = {
>                 {RTE_IPV4(224,0,0,101), 0x1},
>                 {RTE_IPV4(224,0,0,102), 0x2},
> @@ -156,6 +157,7 @@ static struct mcast_group_params mcast_group_table[] =
> {
>                 {RTE_IPV4(224,0,0,114), 0xE},
>                 {RTE_IPV4(224,0,0,115), 0xF},
>  };
> +/* >8 End of create mcast group table. */
>
>  /* Send burst of packets on an output interface */
>  static void
> --
> 2.25.1
>
>
  
Thomas Monjalon March 31, 2023, 10:23 a.m. UTC | #2
01/07/2022 12:37, huzaifa.rahman:
> Bugzilla ID: 802
> 
> The ipv4_multicast example does not work with any multicast IPs.
> Only a selected few IPs are allowed to send pakcets. These IPs
> are listed in an mcast_group_table array along with their respective
> port masks. A normal user would not know about this behaviour since
> there is no mention of it in the docs
> 
> Added the mcast_group_table in the docs so user would know which
> IPs are allowed.
> 
> Signed-off-by: huzaifa.rahman <huzaifa.rahman@emumba.com>
> ---
> +.. literalinclude:: ../../../examples/ipv4_multicast/main.c
> +    :language: c
> +    :start-after: Create the mcast group table. 8<
> +    :end-before: >8 End of create mcast group table.

No need to add artificial comments. The following works fine:
	:start-after: mcast_group_table
	:end-before: };

Applied with above simplification, thanks.
  

Patch

diff --git a/doc/guides/sample_app_ug/ipv4_multicast.rst b/doc/guides/sample_app_ug/ipv4_multicast.rst
index f87f7be57e..7c49212c64 100644
--- a/doc/guides/sample_app_ug/ipv4_multicast.rst
+++ b/doc/guides/sample_app_ug/ipv4_multicast.rst
@@ -22,7 +22,13 @@  There are two key differences from the L2 Forwarding sample application:
 
 The lookup method is the Four-byte Key (FBK) hash-based method.
 The lookup table is composed of pairs of destination IPv4 address (the FBK)
-and a port mask associated with that IPv4 address.
+and a port mask associated with that IPv4 address. By default, the following IP addresses and their respective
+port masks are added:
+
+.. literalinclude:: ../../../examples/ipv4_multicast/main.c
+    :language: c
+    :start-after: Create the mcast group table. 8<
+    :end-before: >8 End of create mcast group table.
 
 .. note::
 
diff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c
index bdcaa3bcd1..c086149eca 100644
--- a/examples/ipv4_multicast/main.c
+++ b/examples/ipv4_multicast/main.c
@@ -139,6 +139,7 @@  struct mcast_group_params {
 	uint16_t port_mask;
 };
 
+/* Create the mcast group table. 8< */
 static struct mcast_group_params mcast_group_table[] = {
 		{RTE_IPV4(224,0,0,101), 0x1},
 		{RTE_IPV4(224,0,0,102), 0x2},
@@ -156,6 +157,7 @@  static struct mcast_group_params mcast_group_table[] = {
 		{RTE_IPV4(224,0,0,114), 0xE},
 		{RTE_IPV4(224,0,0,115), 0xF},
 };
+/* >8 End of create mcast group table. */
 
 /* Send burst of packets on an output interface */
 static void