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
226 struct ib_uverbs_flow_spec_eth eth;226 struct ib_uverbs_flow_spec_eth eth;
227 struct ib_uverbs_flow_spec_ipv4 ipv4;227 struct ib_uverbs_flow_spec_ipv4 ipv4;
228 struct ib_uverbs_flow_spec_tcp_udp tcp_udp;228 struct ib_uverbs_flow_spec_tcp_udp tcp_udp;
229 struct ib_uverbs_flow_spec_ipv6 ipv6;
229 };230 };
230};231};
231 232
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
3105 memcpy(&ib_spec->ipv4.mask, &kern_spec->ipv4.mask,3105 memcpy(&ib_spec->ipv4.mask, &kern_spec->ipv4.mask,
3106 sizeof(struct ib_flow_ipv4_filter));3106 sizeof(struct ib_flow_ipv4_filter));
3107 break;3107 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;
3108 case IB_FLOW_SPEC_TCP:3117 case IB_FLOW_SPEC_TCP:
3109 case IB_FLOW_SPEC_UDP:3118 case IB_FLOW_SPEC_UDP:
3110 ib_spec->tcp_udp.size = sizeof(struct ib_flow_spec_tcp_udp);3119 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
1569 IB_FLOW_SPEC_IB = 0x22,1569 IB_FLOW_SPEC_IB = 0x22,
1570 /* L3 header*/1570 /* L3 header*/
1571 IB_FLOW_SPEC_IPV4 = 0x30,1571 IB_FLOW_SPEC_IPV4 = 0x30,
1572 IB_FLOW_SPEC_IPV6 = 0x31,
1572 /* L4 headers*/1573 /* L4 headers*/
1573 IB_FLOW_SPEC_TCP = 0x40,1574 IB_FLOW_SPEC_TCP = 0x40,
1574 IB_FLOW_SPEC_UDP = 0x411575 IB_FLOW_SPEC_UDP = 0x41
@@ -1630,6 +1631,18 @@ struct ib_flow_spec_ipv4 { · 55 unmodified lines
1630 struct ib_flow_ipv4_filter mask;1631 struct ib_flow_ipv4_filter mask;
1631};1632};
1632 1633
1634struct ib_flow_ipv6_filter {
1635 u8 src_ip[16];
1636 u8 dst_ip[16];
1637};
1638
1639struct 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
1633struct ib_flow_tcp_udp_filter {1646struct ib_flow_tcp_udp_filter {
1634 __be16 dst_port;1647 __be16 dst_port;
1635 __be16 src_port;1648 __be16 src_port;
@@ -1651,6 +1664,7 @@ union ib_flow_spec { · 15 unmodified lines
1651 struct ib_flow_spec_ib ib;1664 struct ib_flow_spec_ib ib;
1652 struct ib_flow_spec_ipv4 ipv4;1665 struct ib_flow_spec_ipv4 ipv4;
1653 struct ib_flow_spec_tcp_udp tcp_udp;1666 struct ib_flow_spec_tcp_udp tcp_udp;
1667 struct ib_flow_spec_ipv6 ipv6;
1654};1668};
1655 1669
1656struct ib_flow_attr {1670struct 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
867 struct ib_uverbs_flow_tcp_udp_filter mask;867 struct ib_uverbs_flow_tcp_udp_filter mask;
868};868};
869 869
870struct ib_uverbs_flow_ipv6_filter {
871 __u8 src_ip[16];
872 __u8 dst_ip[16];
873};
874
875struct 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
870struct ib_uverbs_flow_attr {888struct ib_uverbs_flow_attr {
871 __u32 type;889 __u32 type;
872 __u16 size;890 __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