* Re: [PATCHv2] iproute2: generalize VXLAN forwarding tables
[not found] ` <OF46B0FF88.56F246DA-ON85257B59.004C2332-85257B59.004D92F4@us.ibm.com>
@ 2013-04-26 20:08 ` Stephen Hemminger
0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2013-04-26 20:08 UTC (permalink / raw)
To: David Stevens; +Cc: netdev
On Fri, 26 Apr 2013 10:07:17 -0400
David Stevens <dlstevens@us.ibm.com> wrote:
> Stephen,
> I assume you mean below that you're waiting for net-next changes
> to
> be merged in Linus' tree for your build, but to be honest I'm not sure how
> I can
> tell if this has happened or not. Do you do announcements for opening up
> 3.10 iproute2, or should I be watching a particular Linus git tree for the
> include
> file changes?
> I'd guess this is open again by now, and if so, I can merge and
> resubmit,
> but I'd like to know for the future how I should time iproute2
> submissions, so that
> you have the needed include file changes before I submit. Or, if you're
> doing
> announcements, I can tweak my mail filters to make sure I see them.
> Sorry if this is a newbie question or is covered in a FAQ
> somewhere--
> it just never came up for me before.
> thanks,
> +-DLS
Up until now, I have mostly been lazy and only one branch of iproute2.
The master corresponds to the current Linus kernel headers and features.
Then I would collect patches during the merge window of the next release.
This is because the number of new features going into iproute2 was limited to 1 or 2
per release. But the speed is accelerating.
For next-release, I will split this into
master == davem net == linus
net-next == davem net-next
Which will mean more work for me and submitters (getting right branch), but
will make sure stuff doesn't get held out for so long.
Not changing right now, but will start after 3.10
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCHv2] iproute2: generalize VXLAN forwarding tables
@ 2013-03-29 15:47 David L Stevens
0 siblings, 0 replies; 2+ messages in thread
From: David L Stevens @ 2013-03-29 15:47 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev
iproute2 patch to generalize VXLAN forwarding tables
This is the iproute2 support allowing an administrator to specify alternate
ports, vnis and outgoing interfaces for VXLAN device forwarding tables.
Changes since v2: fixed missing port assignment for ports-by-name
Signed-Off-By: David L Stevens <dlstevens@us.ibm.com>
diff --git a/bridge/fdb.c b/bridge/fdb.c
index 6ad8118..821d3c5 100644
--- a/bridge/fdb.c
+++ b/bridge/fdb.c
@@ -9,6 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
+#include <netdb.h>
#include <time.h>
#include <fcntl.h>
#include <sys/socket.h>
@@ -30,7 +31,8 @@ int filter_index;
static void usage(void)
{
fprintf(stderr, "Usage: bridge fdb { add | del } ADDR dev DEV {self|master} [ temp ]\n"
- " [ dst IPADDR] [ vlan VID ]\n");
+ " [ dst IPADDR] [ vlan VID ]\n"
+ " [ port PORT] [ vni VNI ] [via DEV]\n");
fprintf(stderr, " bridge fdb {show} [ dev DEV ]\n");
exit(-1);
}
@@ -113,6 +115,23 @@ int print_fdb(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
fprintf(fp, "vlan %hu ", vid);
}
+ if (tb[NDA_PORT])
+ fprintf(fp, "port %d ", rta_getattr_u32(tb[NDA_PORT]));
+ if (tb[NDA_VNI])
+ fprintf(fp, "vni %d ", rta_getattr_u32(tb[NDA_VNI]));
+ if (tb[NDA_IFINDEX]) {
+ unsigned int ifindex = rta_getattr_u32(tb[NDA_IFINDEX]);
+
+ if (ifindex) {
+ char ifname[IF_NAMESIZE];
+
+ if (if_indextoname(ifindex, ifname))
+ fprintf(fp, "via %s ", ifname);
+ else
+ fprintf(fp, "via ifindex %u ", ifindex);
+ }
+ }
+
if (show_stats && tb[NDA_CACHEINFO]) {
struct nda_cacheinfo *ci = RTA_DATA(tb[NDA_CACHEINFO]);
int hz = get_user_hz();
@@ -177,6 +196,10 @@ static int fdb_modify(int cmd, int flags, int argc, char **argv)
char abuf[ETH_ALEN];
int dst_ok = 0;
inet_prefix dst;
+ unsigned long port = 0;
+ unsigned long vni = ~0;
+ unsigned int via = 0;
+ char *endptr;
short vid = -1;
memset(&req, 0, sizeof(req));
@@ -197,6 +220,29 @@ static int fdb_modify(int cmd, int flags, int argc, char **argv)
duparg2("dst", *argv);
get_addr(&dst, *argv, preferred_family);
dst_ok = 1;
+ } else if (strcmp(*argv, "port") == 0) {
+
+ NEXT_ARG();
+ port = strtoul(*argv, &endptr, 0);
+ if (endptr && *endptr) {
+ struct servent *pse;
+
+ pse = getservbyname(*argv, "udp");
+ if (!pse)
+ invarg("invalid port\n", *argv);
+ } else if (port > 0xffff)
+ invarg("invalid port\n", *argv);
+ } else if (strcmp(*argv, "vni") == 0) {
+ NEXT_ARG();
+ vni = strtoul(*argv, &endptr, 0);
+ if ((endptr && *endptr) ||
+ (vni >> 24) || vni == ULONG_MAX)
+ invarg("invalid VNI\n", *argv);
+ } else if (strcmp(*argv, "via") == 0) {
+ NEXT_ARG();
+ via = if_nametoindex(*argv);
+ if (via == 0)
+ invarg("invalid device\n", *argv);
} else if (strcmp(*argv, "self") == 0) {
req.ndm.ndm_flags |= NTF_SELF;
} else if (matches(*argv, "master") == 0) {
@@ -251,6 +297,13 @@ static int fdb_modify(int cmd, int flags, int argc, char **argv)
if (vid >= 0)
addattr16(&req.n, sizeof(req), NDA_VLAN, vid);
+ if (port)
+ addattr32(&req.n, sizeof(req), NDA_PORT, port);
+ if (vni != ~0)
+ addattr32(&req.n, sizeof(req), NDA_VNI, vni);
+ if (via)
+ addattr32(&req.n, sizeof(req), NDA_IFINDEX, via);
+
req.ndm.ndm_ifindex = ll_name_to_index(d);
if (req.ndm.ndm_ifindex == 0) {
fprintf(stderr, "Cannot find device \"%s\"\n", d);
@@ -270,6 +323,8 @@ int do_fdb(int argc, char **argv)
if (argc > 0) {
if (matches(*argv, "add") == 0)
return fdb_modify(RTM_NEWNEIGH, NLM_F_CREATE|NLM_F_EXCL, argc-1, argv+1);
+ if (matches(*argv, "append") == 0)
+ return fdb_modify(RTM_NEWNEIGH, NLM_F_CREATE|NLM_F_APPEND, argc-1, argv+1);
if (matches(*argv, "delete") == 0)
return fdb_modify(RTM_DELNEIGH, 0, argc-1, argv+1);
if (matches(*argv, "show") == 0 ||
diff --git a/include/linux/neighbour.h b/include/linux/neighbour.h
index adb068c..f175212 100644
--- a/include/linux/neighbour.h
+++ b/include/linux/neighbour.h
@@ -21,6 +21,9 @@ enum {
NDA_CACHEINFO,
NDA_PROBES,
NDA_VLAN,
+ NDA_PORT,
+ NDA_VNI,
+ NDA_IFINDEX,
__NDA_MAX
};
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-04-26 20:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1902752B0C92F943AB7EA9EE13E2DEEC0DE5332594@HQ1-EXCH02.corp.brocade.com>
[not found] ` <20130329085845.76c8b1e9@nehalam.linuxnetplumber.net>
[not found] ` <OF46B0FF88.56F246DA-ON85257B59.004C2332-85257B59.004D92F4@us.ibm.com>
2013-04-26 20:08 ` [PATCHv2] iproute2: generalize VXLAN forwarding tables Stephen Hemminger
2013-03-29 15:47 David L Stevens
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox