Skip to content

Instantly share code, notes, and snippets.

@danmcd
Created March 13, 2018 19:21
Show Gist options
  • Save danmcd/23e3f77be688c4a9686d578eaa0895f6 to your computer and use it in GitHub Desktop.
Save danmcd/23e3f77be688c4a9686d578eaa0895f6 to your computer and use it in GitHub Desktop.
What I imagine the first step to make overlay deal with routed destinations. Thanks JBK for the overlay_targ_lookup_t changes.
diff --git a/usr/src/uts/common/sys/overlay_target.h b/usr/src/uts/common/sys/overlay_target.h
index cae193c..d09c776 100644
--- a/usr/src/uts/common/sys/overlay_target.h
+++ b/usr/src/uts/common/sys/overlay_target.h
@@ -29,10 +29,21 @@
extern "C" {
#endif
+/*
+ * The answer we want at the end of the day. What are the target and source
+ * MAC addresses and VLAN ID (because the source VL2 MAC header may need to be
+ * rewritten if the UL3 is in a far-remote/routed network), target UL3 IP and
+ * target UL3 UDP port?
+ *
+ * If a supplied MAC address or vlan is 0, do NOT replace the existing VL2
+ * field with it.
+ */
typedef struct overlay_target_point {
uint8_t otp_mac[ETHERADDRL];
- struct in6_addr otp_ip;
+ uint8_t otp_srcmac[ETHERADDRL];
uint16_t otp_port;
+ uint16_t otp_vlan;
+ struct in6_addr otp_ip;
} overlay_target_point_t;
#define OVERLAY_TARG_IOCTL (('o' << 24) | ('v' << 16) | ('t' << 8))
@@ -159,12 +170,22 @@ typedef struct overlay_targ_lookup {
uint64_t otl_vnetid;
uint64_t otl_hdrsize;
uint64_t otl_pktsize;
+ uint32_t otl_dcid; /* */
uint8_t otl_srcaddr[ETHERADDRL];
- uint8_t otl_dstaddr[ETHERADDRL];
- uint32_t otl_dsttype;
+ boolean_t otl_l3req;
+ union {
+ struct in6_addr otlu_vl3addr;
+ struct {
+ uint8_t otlu_dstaddr[ETHERADDRL];
+ uint32_t oltu_dsttype;
+ } oltu_vl2addr;
+ } otl_dst;
uint32_t otl_sap;
int32_t otl_vlan;
} overlay_targ_lookup_t;
+#define otl_dstaddr otl_dst.otlu_vl2addr.otlu_dstaddr
+#define otl_dsttype otl_dst.otlu_vl2addr.otlu_dsttype
+#define otl_dstvl3addr otl_dst.otlu_vl3addr
typedef struct overlay_targ_resp {
uint64_t otr_reqid;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment