public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Allow to specify PCP on packets not belonging to any VLAN.
@ 2018-08-24 13:11 Sebastian Huber
0 siblings, 0 replies; only message in thread
From: Sebastian Huber @ 2018-08-24 13:11 UTC (permalink / raw)
To: newlib-cvs
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=b0250c735673311c2d5d268257bc379792a275f8
commit b0250c735673311c2d5d268257bc379792a275f8
Author: kib <kib@FreeBSD.org>
Date: Tue Mar 27 15:29:32 2018 +0000
Allow to specify PCP on packets not belonging to any VLAN.
According to 802.1Q-2014, VLAN tagged packets with VLAN id 0 should be
considered as untagged, and only PCP and DEI values from the VLAN tag
are meaningful. See for instance
https://www.cisco.com/c/en/us/td/docs/switches/connectedgrid/cg-switch-sw-master/software/configuration/guide/vlan0/b_vlan_0.html.
Make it possible to specify PCP value for outgoing packets on an
ethernet interface. When PCP is supplied, the tag is appended, VLAN
id set to 0, and PCP is filled by the supplied value. The code to do
VLAN tag encapsulation is refactored from the if_vlan.c and moved into
if_ethersubr.c.
Drivers might have issues with filtering VID 0 packets on
receive. This bug should be fixed for each driver.
Reviewed by: ae (previous version), hselasky, melifaro
Sponsored by: Mellanox Technologies
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D14702
Diff:
---
newlib/libc/sys/rtems/include/net/if.h | 3 +++
newlib/libc/sys/rtems/include/sys/sockio.h | 3 +++
2 files changed, 6 insertions(+)
diff --git a/newlib/libc/sys/rtems/include/net/if.h b/newlib/libc/sys/rtems/include/net/if.h
index b73c9f6..d13e737 100644
--- a/newlib/libc/sys/rtems/include/net/if.h
+++ b/newlib/libc/sys/rtems/include/net/if.h
@@ -416,6 +416,7 @@ struct ifreq {
#define ifr_index ifr_ifru.ifru_index /* interface index */
#define ifr_fib ifr_ifru.ifru_fib /* interface fib */
#define ifr_vlan_pcp ifr_ifru.ifru_vlan_pcp /* VLAN priority */
+#define ifr_lan_pcp ifr_ifru.ifru_vlan_pcp /* VLAN priority */
};
#define _SIZEOF_ADDR_IFREQ(ifr) \
@@ -565,6 +566,8 @@ struct ifrsshash {
uint32_t ifrh_types; /* RSS_TYPE_ */
};
+#define IFNET_PCP_NONE 0xff /* PCP disabled */
+
#endif /* __BSD_VISIBLE */
#ifdef _KERNEL
diff --git a/newlib/libc/sys/rtems/include/sys/sockio.h b/newlib/libc/sys/rtems/include/sys/sockio.h
index a81a563..1ef52c4 100644
--- a/newlib/libc/sys/rtems/include/sys/sockio.h
+++ b/newlib/libc/sys/rtems/include/sys/sockio.h
@@ -140,4 +140,7 @@
#define SIOCGIFRSSHASH _IOWR('i', 151, struct ifrsshash)/* get the current RSS
type/func settings */
+#define SIOCGLANPCP _IOWR('i', 152, struct ifreq) /* Get (V)LAN PCP */
+#define SIOCSLANPCP _IOW('i', 153, struct ifreq) /* Set (V)LAN PCP */
+
#endif /* !_SYS_SOCKIO_H_ */
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2018-08-24 13:11 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-24 13:11 [newlib-cygwin] Allow to specify PCP on packets not belonging to any VLAN Sebastian Huber
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 read-only IMAP folder(s) and NNTP newsgroup(s).