diff mbox

[API-NEXT,PATCHv2,1/6] api: packet: add bcast/mcast parse documentation

Message ID 1453925534-29840-2-git-send-email-bill.fischofer@linaro.org
State Superseded
Headers show

Commit Message

Bill Fischofer Jan. 27, 2016, 8:12 p.m. UTC
Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
---
 include/odp/api/packet_flags.h | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

Comments

Bill Fischofer Jan. 28, 2016, 12:13 p.m. UTC | #1
On Thu, Jan 28, 2016 at 2:14 AM, Savolainen, Petri (Nokia - FI/Espoo) <
petri.savolainen@nokia.com> wrote:

>

>

> > -----Original Message-----

> > From: lng-odp [mailto:lng-odp-bounces@lists.linaro.org] On Behalf Of EXT

> > Bill Fischofer

> > Sent: Wednesday, January 27, 2016 10:12 PM

> > To: lng-odp@lists.linaro.org

> > Subject: [lng-odp] [API-NEXT PATCHv2 1/6] api: packet: add bcast/mcast

> > parse documentation

> >

> > Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>

> > ---

> >  include/odp/api/packet_flags.h | 16 ++++++++++++++++

> >  1 file changed, 16 insertions(+)

> >

> > diff --git a/include/odp/api/packet_flags.h

> > b/include/odp/api/packet_flags.h

> > index 65fd3ce..a9fd07a 100644

> > --- a/include/odp/api/packet_flags.h

> > +++ b/include/odp/api/packet_flags.h

> > @@ -109,6 +109,9 @@ int odp_packet_has_eth(odp_packet_t pkt);

> >  /**

> >   * Check for Ethernet broadcast address

> >   *

> > + * ODP recognizes the destination MAC address as broadcast if it begins

> > + * FF:FF:

>

> I think it's safer to specify all ones (FF:FF:FF:FF:FF:FF) since all HW

> parser would consider that bcast and application does not need to check

> last 4 bytes for FF:FF:FF:FF.

>


OK.  I didn't want to incur the overhead but can see the value of that in
the spec.  I'll send a v3 with that correction.


>

> Otherwise the patch set looks good.

>

> -Petri

>

>
diff mbox

Patch

diff --git a/include/odp/api/packet_flags.h b/include/odp/api/packet_flags.h
index 65fd3ce..a9fd07a 100644
--- a/include/odp/api/packet_flags.h
+++ b/include/odp/api/packet_flags.h
@@ -109,6 +109,9 @@  int odp_packet_has_eth(odp_packet_t pkt);
 /**
  * Check for Ethernet broadcast address
  *
+ * ODP recognizes the destination MAC address as broadcast if it begins
+ * FF:FF:
+ *
  * @param pkt Packet handle
  * @retval non-zero if Ethernet destination address is the broadcast address
  * @retval 0 if Ethernet destination address is not the broadcast address
@@ -118,6 +121,8 @@  int odp_packet_has_eth_bcast(odp_packet_t pkt);
 /**
  * Check for Ethernet multicast address
  *
+ * ODP recognizes the destination MAC address as multicast if bit 7 is 1.
+ *
  * @param pkt Packet handle
  * @retval non-zero if Ethernet destination address is a multicast address
  * @retval 0 if Ethernet destination address is not a multicast address
@@ -181,6 +186,11 @@  int odp_packet_has_ipv6(odp_packet_t pkt);
 /**
  * Check for IP broadcast address
  *
+ * For IPv4, ODP recognizes the destination IP address 255.255.255.255 as
+ * a broadcast address. All other addresses are considered non-broadcast.
+ *
+ * For IPv6, no destination addresses are recognized as broadcast addresses.
+ *
  * @param pkt Packet handle
  * @retval non-zero if IP destination address is a broadcast address
  * @retval 0 if IP destination address is not a broadcast address
@@ -190,6 +200,12 @@  int odp_packet_has_ip_bcast(odp_packet_t pkt);
 /**
  * Check for IP multicast address
  *
+ * For IPv4 ODP recognizes destination IP addresses in the range 224.0.0.0
+ * through 239.255.255.255 as multicast addresses.
+ *
+ * For IPv6 ODP recognizes destination IP addresses with prefixes FF00::
+ * through FFFF:: as multicast addresses.
+ *
  * @param pkt Packet handle
  * @retval non-zero if IP destination address is a multicast address
  * @retval 0 if IP destination address is not a multicast address