History

IB/core: Add IPv6 support to flow steering

Add IPv6 flow specification support.

Maor Gottlieb committed 10 years ago

Commit 4c2aae71 parent 89ea94a4 files · +42 −0Browse files

Unified · Split

4 files
  1. drivers/infiniband/core/uverbs.h +1 −0
  2. drivers/infiniband/core/uverbs_cmd.c +9 −0
  3. include/rdma/ib_verbs.h +14 −0
  4. include/uapi/rdma/ib_user_verbs.h +18 −0
drivers/infiniband/core/uverbs.h+1−0
@@ -226,6 +226,7 @@ struct ib_uverbs_flow_spec { · 225 unmodified lines
226226 struct ib_uverbs_flow_spec_eth eth;
227227 struct ib_uverbs_flow_spec_ipv4 ipv4;
228228 struct ib_uverbs_flow_spec_tcp_udp tcp_udp;
229+ struct ib_uverbs_flow_spec_ipv6 ipv6;
229230 };
230231 };
231232
drivers/infiniband/core/uverbs_cmd.c+9−0
@@ -3105,6 +3105,15 @@ static int kern_spec_to_ib_spec(struct ib_uverbs_flow_spec *kern_spec, · 3104 unmodified lines
31053105 memcpy(&ib_spec->ipv4.mask, &kern_spec->ipv4.mask,
31063106 sizeof(struct ib_flow_ipv4_filter));
31073107 break;
3108+ case IB_FLOW_SPEC_IPV6:
3109+ ib_spec->ipv6.size = sizeof(struct ib_flow_spec_ipv6);
3110+ if (ib_spec->ipv6.size != kern_spec->ipv6.size)
3111+ return -EINVAL;
3112+ memcpy(&ib_spec->ipv6.val, &kern_spec->ipv6.val,
3113+ sizeof(struct ib_flow_ipv6_filter));
3114+ memcpy(&ib_spec->ipv6.mask, &kern_spec->ipv6.mask,
3115+ sizeof(struct ib_flow_ipv6_filter));
3116+ break;
31083117 case IB_FLOW_SPEC_TCP:
31093118 case IB_FLOW_SPEC_UDP:
31103119 ib_spec->tcp_udp.size = sizeof(struct ib_flow_spec_tcp_udp);
include/rdma/ib_verbs.h+14−0
@@ -1569,6 +1569,7 @@ enum ib_flow_spec_type { · 1568 unmodified lines
15691569 IB_FLOW_SPEC_IB = 0x22,
15701570 /* L3 header*/
15711571 IB_FLOW_SPEC_IPV4 = 0x30,
1572+ IB_FLOW_SPEC_IPV6 = 0x31,
15721573 /* L4 headers*/
15731574 IB_FLOW_SPEC_TCP = 0x40,
15741575 IB_FLOW_SPEC_UDP = 0x41
@@ -1630,6 +1631,18 @@ struct ib_flow_spec_ipv4 { · 55 unmodified lines
16301631 struct ib_flow_ipv4_filter mask;
16311632 };
16321633
1634+struct ib_flow_ipv6_filter {
1635+ u8 src_ip[16];
1636+ u8 dst_ip[16];
1637+};
1638+
1639+struct ib_flow_spec_ipv6 {
1640+ enum ib_flow_spec_type type;
1641+ u16 size;
1642+ struct ib_flow_ipv6_filter val;
1643+ struct ib_flow_ipv6_filter mask;
1644+};
1645+
16331646 struct ib_flow_tcp_udp_filter {
16341647 __be16 dst_port;
16351648 __be16 src_port;
@@ -1651,6 +1664,7 @@ union ib_flow_spec { · 15 unmodified lines
16511664 struct ib_flow_spec_ib ib;
16521665 struct ib_flow_spec_ipv4 ipv4;
16531666 struct ib_flow_spec_tcp_udp tcp_udp;
1667+ struct ib_flow_spec_ipv6 ipv6;
16541668 };
16551669
16561670 struct ib_flow_attr {
include/uapi/rdma/ib_user_verbs.h+18−0
@@ -867,6 +867,24 @@ struct ib_uverbs_flow_spec_tcp_udp { · 866 unmodified lines
867867 struct ib_uverbs_flow_tcp_udp_filter mask;
868868 };
869869
870+struct ib_uverbs_flow_ipv6_filter {
871+ __u8 src_ip[16];
872+ __u8 dst_ip[16];
873+};
874+
875+struct ib_uverbs_flow_spec_ipv6 {
876+ union {
877+ struct ib_uverbs_flow_spec_hdr hdr;
878+ struct {
879+ __u32 type;
880+ __u16 size;
881+ __u16 reserved;
882+ };
883+ };
884+ struct ib_uverbs_flow_ipv6_filter val;
885+ struct ib_uverbs_flow_ipv6_filter mask;
886+};
887+
870888 struct ib_uverbs_flow_attr {
871889 __u32 type;
872890 __u16 size;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t