forked from illumos/illumos-gate
-
Notifications
You must be signed in to change notification settings - Fork 108
OS-6768 overlays should be capable of L3 routing #341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jasonbking
wants to merge
17
commits into
master
Choose a base branch
from
vpc2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 16 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
fd57b1c
Add bsearch to genunix
b0d574f
Add 2Q cache (qqcache) to kernel
22c97b7
QQcache stats
df92df6
Use qqcache instead of refhash
be5a661
Overlay routing
d7cc1a3
start ofovroute(1m)
21dc9a2
Fix dtrace probe arguments, add mblk corner case
a758f5f
Improved drop reasons
abe4a19
Router now ARPs itself
897b6c8
Add example to ovroute(1M)
0dae518
NDP replies for router IP
cb4ceac
-o and -p options
a3649d0
Fixup hold functions
b54a51a
ovroute cleanups
556c6b4
ID validation
751b22c
Fix AVL comparison
6c82676
Feedback, cstyle cleanups
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -300,6 +300,7 @@ COMMON_SUBDIRS= \ | |
| oamuser \ | ||
| oawk \ | ||
| od \ | ||
| ovroute \ | ||
| pack \ | ||
| pagesize \ | ||
| passmgmt \ | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -71,6 +71,7 @@ GENUNIX_SRCS = \ | |
| nvpair.c \ | ||
| pci.c \ | ||
| pg.c \ | ||
| qqcache.c \ | ||
| rctl.c \ | ||
| refhash.c \ | ||
| refstr.c \ | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,117 @@ | ||
| /* | ||
| * This file and its contents are supplied under the terms of the | ||
| * Common Development and Distribution License ("CDDL"), version 1.0. | ||
| * You may only use this file in accordance with the terms of version | ||
| * 1.0 of the CDDL. | ||
| * | ||
| * A full copy of the text of the CDDL should have accompanied this | ||
| * source. A copy of the CDDL is also available via the Internet at | ||
| * http://www.illumos.org/license/CDDL. | ||
| */ | ||
|
|
||
| /* | ||
| * Copyright 2018, Joyent, Inc. | ||
| */ | ||
|
|
||
| #include <mdb/mdb_modapi.h> | ||
| #include <mdb/mdb_ctf.h> | ||
|
|
||
| #include <sys/qqcache.h> | ||
| #include <sys/qqcache_impl.h> | ||
|
|
||
| #include "qqcache.h" | ||
|
|
||
| typedef struct qqcache_walk_data { | ||
| size_t qwd_link_off; | ||
| } qqcache_walk_data_t; | ||
|
|
||
| typedef struct mdb_qqcache { | ||
| size_t qqc_link_off; | ||
| size_t qqc_nbuckets; | ||
| } mdb_qqcache_t; | ||
|
|
||
| static int | ||
| qqcache_walk_init(mdb_walk_state_t *wsp, boolean_t use_hash) | ||
| { | ||
| qqcache_walk_data_t *qwd; | ||
| uintptr_t base; | ||
| size_t i, n, qqc_list_sz; | ||
| int cache_off, bucket_off, list_off; | ||
| mdb_qqcache_t qc; | ||
|
|
||
| /* mdb_ctf_offsetof_by_name will print any errors */ | ||
| cache_off = mdb_ctf_offsetof_by_name("qqcache_t", "qqc_lists"); | ||
| if (cache_off == -1) | ||
| return (WALK_ERR); | ||
|
|
||
| bucket_off = mdb_ctf_offsetof_by_name("qqcache_t", "qqc_buckets"); | ||
| if (bucket_off == -1) | ||
| return (WALK_ERR); | ||
|
|
||
| list_off = mdb_ctf_offsetof_by_name("qqcache_list_t", "qqcl_list"); | ||
| if (list_off == -1) | ||
| return (WALK_ERR); | ||
|
|
||
| /* mdb_ctf_sizeof_by_name will print any errors */ | ||
| qqc_list_sz = mdb_ctf_sizeof_by_name("qqcache_list_t"); | ||
| if (qqc_list_sz == -1) | ||
| return (WALK_ERR); | ||
|
|
||
| if (mdb_ctf_vread(&qc, "qqcache_t", "mdb_qqcache_t", wsp->walk_addr, | ||
| 0) == -1) { | ||
| mdb_warn("failed to read qqcache_t at %#lx", wsp->walk_addr); | ||
| return (WALK_ERR); | ||
| } | ||
|
|
||
| qwd = wsp->walk_data = mdb_zalloc(sizeof (*qwd), UM_SLEEP); | ||
| qwd->qwd_link_off = qc.qqc_link_off; | ||
|
|
||
| if (use_hash) { | ||
| base = wsp->walk_addr + bucket_off; | ||
| n = qc.qqc_nbuckets; | ||
| } else { | ||
| base = wsp->walk_addr + cache_off; | ||
| n = QQCACHE_NUM_LISTS; | ||
| } | ||
|
|
||
| for (i = 0; i < n; i++) { | ||
| wsp->walk_addr = base + i * qqc_list_sz + list_off; | ||
|
|
||
| if (mdb_layered_walk("list", wsp) == -1) { | ||
| mdb_warn("can't walk qqcache_t"); | ||
| mdb_free(qwd, sizeof (*qwd)); | ||
| return (WALK_ERR); | ||
| } | ||
| } | ||
|
|
||
| return (WALK_NEXT); | ||
| } | ||
|
|
||
| int | ||
| qqcache_walk_init_cache(mdb_walk_state_t *wsp) | ||
| { | ||
| return (qqcache_walk_init(wsp, B_FALSE)); | ||
| } | ||
|
|
||
| int | ||
| qqcache_walk_init_hash(mdb_walk_state_t *wsp) | ||
| { | ||
| return (qqcache_walk_init(wsp, B_TRUE)); | ||
| } | ||
|
|
||
| int | ||
| qqcache_walk_step(mdb_walk_state_t *wsp) | ||
| { | ||
| qqcache_walk_data_t *qwd = wsp->walk_data; | ||
| uintptr_t addr = wsp->walk_addr - qwd->qwd_link_off; | ||
|
|
||
| return (wsp->walk_callback(addr, wsp->walk_layer, wsp->walk_cbdata)); | ||
| } | ||
|
|
||
| void | ||
| qqcache_walk_fini(mdb_walk_state_t *wsp) | ||
| { | ||
| qqcache_walk_data_t *qwd = wsp->walk_data; | ||
|
|
||
| mdb_free(qwd, sizeof (*qwd)); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| /* | ||
| * This file and its contents are supplied under the terms of the | ||
| * Common Development and Distribution License ("CDDL"), version 1.0. | ||
| * You may only use this file in accordance with the terms of version | ||
| * 1.0 of the CDDL. | ||
| * | ||
| * A full copy of the text of the CDDL should have accompanied this | ||
| * source. A copy of the CDDL is also available via the Internet at | ||
| * http://www.illumos.org/license/CDDL. | ||
| */ | ||
|
|
||
| /* | ||
| * Copyright 2018, Joyent Inc. | ||
| */ | ||
|
|
||
| #ifndef _MDB_QQCACHE_H | ||
| #define _MDB_QQCACHE_H | ||
|
|
||
| #ifdef __cplusplus | ||
| extern "C" { | ||
| #endif | ||
|
|
||
| #define QQCACHE_WALK_NAME "qqcache" | ||
| #define QQCACHE_WALK_DESC "walk a qqcache (2Q cache)" | ||
|
|
||
| #define QQCACHE_HASH_WALK_NAME "qqhash" | ||
| #define QQCACHE_HASH_WALK_DESC "walk a qqcache (2Q cache) via the hash buckets" | ||
|
|
||
| struct mdb_walk_state; | ||
|
|
||
| extern int qqcache_walk_init_cache(struct mdb_walk_state *); | ||
| extern int qqcache_walk_init_hash(struct mdb_walk_state *); | ||
| extern int qqcache_walk_step(struct mdb_walk_state *); | ||
| extern void qqcache_walk_fini(struct mdb_walk_state *); | ||
|
|
||
| #ifdef __cplusplus | ||
| } | ||
| #endif | ||
|
|
||
| #endif /* _MDB_QQCACHE_H */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| # | ||
| # This file and its contents are supplied under the terms of the | ||
| # Common Development and Distribution License ("CDDL"), version 1.0. | ||
| # You may only use this file in accordance with the terms of version | ||
| # 1.0 of the CDDL. | ||
| # | ||
| # A full copy of the text of the CDDL should have accompanied this | ||
| # source. A copy of the CDDL is also available via the Internet at | ||
| # http://www.illumos.org/license/CDDL. | ||
| # | ||
|
|
||
| # | ||
| # Copyright 2020 Joyent, Inc. | ||
| # | ||
|
|
||
| PROG= ovroute | ||
| OBJS= ovroute.o | ||
| SRCS= $(OBJS:%.o=../%.c) | ||
|
|
||
| include ../Makefile.cmd | ||
| include ../Makefile.ctf | ||
|
|
||
| CSTD = $(CSTD_GNU99) | ||
| CLEANFILES += $(OBJS) | ||
| CPPFLAGS += -D_REENTRANT | ||
| CFLAGS += $(CCVERBOSE) | ||
| LDLIBS += -lumem -lofmt -ldladm -lsocket | ||
| $(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG | ||
|
|
||
| .KEEP_STATE: | ||
|
|
||
| all: $(PROG) | ||
|
|
||
| $(PROG): $(OBJS) | ||
| $(LINK64.c) -o $@ $(OBJS) $(LDLIBS) | ||
| $(POST_PROCESS) | ||
|
|
||
| clean: | ||
| -$(RM) $(CLEANFILES) | ||
|
|
||
| %.o: %.c | ||
| $(COMPILE64.c) $< | ||
| $(POST_PROCESS_O) | ||
|
|
||
| clobber: clean | ||
| $(RM) $(PROG) | ||
|
|
||
| install: $(PROG) $(ROOTUSRSBINPROG) | ||
|
|
||
| FRC: | ||
|
|
||
| include ../Makefile.targ |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.