Skip to content

Commit 7f00fea

Browse files
tomratbertdavem330
authored andcommitted
ila: Add generic ILA translation facility
This patch implements an ILA tanslation table. This table can be configured with identifier to locator mappings, and can be be queried to resolve a mapping. Queries can be parameterized based on interface, direction (incoming or outoing), and matching locator. The table is implemented using rhashtable and is configured via netlink (through "ip ila .." in iproute). The table may be used as alternative means to do do ILA tanslations other than the lw tunnels Signed-off-by: Tom Herbert <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent fc9e50f commit 7f00fea

File tree

6 files changed

+731
-1
lines changed

6 files changed

+731
-1
lines changed

include/net/ila.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* ILA kernel interface
3+
*
4+
* Copyright (c) 2015 Tom Herbert <[email protected]>
5+
*
6+
* This program is free software; you can redistribute it and/or
7+
* modify it under the terms of the GNU General Public License as
8+
* published by the Free Software Foundation; either version 2 of
9+
* the License, or (at your option) any later version.
10+
*/
11+
12+
#ifndef _NET_ILA_H
13+
#define _NET_ILA_H
14+
15+
int ila_xlat_outgoing(struct sk_buff *skb);
16+
int ila_xlat_incoming(struct sk_buff *skb);
17+
18+
#endif /* _NET_ILA_H */

include/uapi/linux/ila.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,35 @@
33
#ifndef _UAPI_LINUX_ILA_H
44
#define _UAPI_LINUX_ILA_H
55

6+
/* NETLINK_GENERIC related info */
7+
#define ILA_GENL_NAME "ila"
8+
#define ILA_GENL_VERSION 0x1
9+
610
enum {
711
ILA_ATTR_UNSPEC,
812
ILA_ATTR_LOCATOR, /* u64 */
13+
ILA_ATTR_IDENTIFIER, /* u64 */
14+
ILA_ATTR_LOCATOR_MATCH, /* u64 */
15+
ILA_ATTR_IFINDEX, /* s32 */
16+
ILA_ATTR_DIR, /* u32 */
917

1018
__ILA_ATTR_MAX,
1119
};
1220

1321
#define ILA_ATTR_MAX (__ILA_ATTR_MAX - 1)
1422

23+
enum {
24+
ILA_CMD_UNSPEC,
25+
ILA_CMD_ADD,
26+
ILA_CMD_DEL,
27+
ILA_CMD_GET,
28+
29+
__ILA_CMD_MAX,
30+
};
31+
32+
#define ILA_CMD_MAX (__ILA_CMD_MAX - 1)
33+
34+
#define ILA_DIR_IN (1 << 0)
35+
#define ILA_DIR_OUT (1 << 1)
36+
1537
#endif /* _UAPI_LINUX_ILA_H */

net/ipv6/ila/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44

55
obj-$(CONFIG_IPV6_ILA) += ila.o
66

7-
ila-objs := ila_common.o ila_lwt.o
7+
ila-objs := ila_common.o ila_lwt.o ila_xlat.o

net/ipv6/ila/ila.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,7 @@ void update_ipv6_locator(struct sk_buff *skb, struct ila_params *p);
4242

4343
int ila_lwt_init(void);
4444
void ila_lwt_fini(void);
45+
int ila_xlat_init(void);
46+
void ila_xlat_fini(void);
4547

4648
#endif /* __ILA_H */

net/ipv6/ila/ila_common.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,20 @@ static int __init ila_init(void)
8080
if (ret)
8181
goto fail_lwt;
8282

83+
ret = ila_xlat_init();
84+
if (ret)
85+
goto fail_xlat;
86+
87+
return 0;
88+
fail_xlat:
89+
ila_lwt_fini();
8390
fail_lwt:
8491
return ret;
8592
}
8693

8794
static void __exit ila_fini(void)
8895
{
96+
ila_xlat_fini();
8997
ila_lwt_fini();
9098
}
9199

0 commit comments

Comments
 (0)