diff options
| author | Yann Droneaud <ydroneaud@opteya.com> | 2013-11-06 17:21:47 -0500 |
|---|---|---|
| committer | Roland Dreier <roland@purestorage.com> | 2013-11-17 11:22:08 -0500 |
| commit | 58913efba9c3aa7992f2a4d630135ded833d988e (patch) | |
| tree | 987ea27f67babcf65ab0186503dc2aedb30b527e /include/uapi | |
| parent | b68c956021386eead6b8b28e445f33c8c985d7d2 (diff) | |
IB/core: Use a common header for uverbs flow_specs
A common header will allows better checking of flow specs size, while
ensuring strict alignment to 64 bits.
Signed-off-by: Yann Droneaud <ydroneaud@opteya.com>
Link: http://marc.info/?i=cover.1383773832.git.ydroneaud@opteya.com
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'include/uapi')
| -rw-r--r-- | include/uapi/rdma/ib_user_verbs.h | 53 |
1 files changed, 40 insertions, 13 deletions
diff --git a/include/uapi/rdma/ib_user_verbs.h b/include/uapi/rdma/ib_user_verbs.h index ef2be64bf4c3..43014981550a 100644 --- a/include/uapi/rdma/ib_user_verbs.h +++ b/include/uapi/rdma/ib_user_verbs.h | |||
| @@ -701,6 +701,14 @@ struct ib_uverbs_detach_mcast { | |||
| 701 | }; | 701 | }; |
| 702 | 702 | ||
| 703 | #ifdef CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING | 703 | #ifdef CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING |
| 704 | struct ib_uverbs_flow_spec_hdr { | ||
| 705 | __u32 type; | ||
| 706 | __u16 size; | ||
| 707 | __u16 reserved; | ||
| 708 | /* followed by flow_spec */ | ||
| 709 | __u64 flow_spec_data[0]; | ||
| 710 | }; | ||
| 711 | |||
| 704 | struct ib_uverbs_flow_eth_filter { | 712 | struct ib_uverbs_flow_eth_filter { |
| 705 | __u8 dst_mac[6]; | 713 | __u8 dst_mac[6]; |
| 706 | __u8 src_mac[6]; | 714 | __u8 src_mac[6]; |
| @@ -709,9 +717,14 @@ struct ib_uverbs_flow_eth_filter { | |||
| 709 | }; | 717 | }; |
| 710 | 718 | ||
| 711 | struct ib_uverbs_flow_spec_eth { | 719 | struct ib_uverbs_flow_spec_eth { |
| 712 | __u32 type; | 720 | union { |
| 713 | __u16 size; | 721 | struct ib_uverbs_flow_spec_hdr hdr; |
| 714 | __u16 reserved; | 722 | struct { |
| 723 | __u32 type; | ||
| 724 | __u16 size; | ||
| 725 | __u16 reserved; | ||
| 726 | }; | ||
| 727 | }; | ||
| 715 | struct ib_uverbs_flow_eth_filter val; | 728 | struct ib_uverbs_flow_eth_filter val; |
| 716 | struct ib_uverbs_flow_eth_filter mask; | 729 | struct ib_uverbs_flow_eth_filter mask; |
| 717 | }; | 730 | }; |
| @@ -722,9 +735,14 @@ struct ib_uverbs_flow_ipv4_filter { | |||
| 722 | }; | 735 | }; |
| 723 | 736 | ||
| 724 | struct ib_uverbs_flow_spec_ipv4 { | 737 | struct ib_uverbs_flow_spec_ipv4 { |
| 725 | __u32 type; | 738 | union { |
| 726 | __u16 size; | 739 | struct ib_uverbs_flow_spec_hdr hdr; |
| 727 | __u16 reserved; | 740 | struct { |
| 741 | __u32 type; | ||
| 742 | __u16 size; | ||
| 743 | __u16 reserved; | ||
| 744 | }; | ||
| 745 | }; | ||
| 728 | struct ib_uverbs_flow_ipv4_filter val; | 746 | struct ib_uverbs_flow_ipv4_filter val; |
| 729 | struct ib_uverbs_flow_ipv4_filter mask; | 747 | struct ib_uverbs_flow_ipv4_filter mask; |
| 730 | }; | 748 | }; |
| @@ -735,19 +753,27 @@ struct ib_uverbs_flow_tcp_udp_filter { | |||
| 735 | }; | 753 | }; |
| 736 | 754 | ||
| 737 | struct ib_uverbs_flow_spec_tcp_udp { | 755 | struct ib_uverbs_flow_spec_tcp_udp { |
| 738 | __u32 type; | 756 | union { |
| 739 | __u16 size; | 757 | struct ib_uverbs_flow_spec_hdr hdr; |
| 740 | __u16 reserved; | 758 | struct { |
| 759 | __u32 type; | ||
| 760 | __u16 size; | ||
| 761 | __u16 reserved; | ||
| 762 | }; | ||
| 763 | }; | ||
| 741 | struct ib_uverbs_flow_tcp_udp_filter val; | 764 | struct ib_uverbs_flow_tcp_udp_filter val; |
| 742 | struct ib_uverbs_flow_tcp_udp_filter mask; | 765 | struct ib_uverbs_flow_tcp_udp_filter mask; |
| 743 | }; | 766 | }; |
| 744 | 767 | ||
| 745 | struct ib_uverbs_flow_spec { | 768 | struct ib_uverbs_flow_spec { |
| 746 | union { | 769 | union { |
| 747 | struct { | 770 | union { |
| 748 | __u32 type; | 771 | struct ib_uverbs_flow_spec_hdr hdr; |
| 749 | __u16 size; | 772 | struct { |
| 750 | __u16 reserved; | 773 | __u32 type; |
| 774 | __u16 size; | ||
| 775 | __u16 reserved; | ||
| 776 | }; | ||
| 751 | }; | 777 | }; |
| 752 | struct ib_uverbs_flow_spec_eth eth; | 778 | struct ib_uverbs_flow_spec_eth eth; |
| 753 | struct ib_uverbs_flow_spec_ipv4 ipv4; | 779 | struct ib_uverbs_flow_spec_ipv4 ipv4; |
| @@ -767,6 +793,7 @@ struct ib_uverbs_flow_attr { | |||
| 767 | * struct ib_flow_spec_xxx | 793 | * struct ib_flow_spec_xxx |
| 768 | * struct ib_flow_spec_yyy | 794 | * struct ib_flow_spec_yyy |
| 769 | */ | 795 | */ |
| 796 | struct ib_uverbs_flow_spec_hdr flow_specs[0]; | ||
| 770 | }; | 797 | }; |
| 771 | 798 | ||
| 772 | struct ib_uverbs_create_flow { | 799 | struct ib_uverbs_create_flow { |
