aboutsummaryrefslogtreecommitdiffstats
path: root/include/rdma
diff options
context:
space:
mode:
authorMaor Gottlieb <maorg@mellanox.com>2016-08-30 09:58:32 -0400
committerDoug Ledford <dledford@redhat.com>2016-10-07 16:54:17 -0400
commit15dfbd6b4f058571f41be5b7917465dab2ff55da (patch)
treedbe6fa3fa476627230384d75f9f0c3685121b040 /include/rdma
parentc47ac6aee6df4dc17460f56dd66af0a271e8392c (diff)
IB/uverbs: Add support to extend flow steering specifications
Flow steering specifications structures were implemented as in an extensible way that allows one to add new filters and new fields to existing filters. These specifications have never been extended, therefore the kernel flow specifications size and the user flow specifications size were must to be equal. In downstream patch, the IPv4 flow specifications type is extended to support TOS and TTL fields. To support an extension we change the flow specifications size condition test to be as following: * If the user flow specifications is bigger than the kernel specifications, we verify that all the bits which not in the kernel specifications are zeros and the flow is added only with the kernel specifications fields. * Otherwise, we add flow rule only with the user specifications fields. User space filters must be aligned with 32bits. Signed-off-by: Maor Gottlieb <maorg@mellanox.com> Signed-off-by: Leon Romanovsky <leon@kernel.org> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'include/rdma')
-rw-r--r--include/rdma/ib_verbs.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index d74c76bf76d3..4570d8844f63 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -1623,6 +1623,8 @@ struct ib_flow_eth_filter {
1623 u8 src_mac[6]; 1623 u8 src_mac[6];
1624 __be16 ether_type; 1624 __be16 ether_type;
1625 __be16 vlan_tag; 1625 __be16 vlan_tag;
1626 /* Must be last */
1627 u8 real_sz[0];
1626}; 1628};
1627 1629
1628struct ib_flow_spec_eth { 1630struct ib_flow_spec_eth {
@@ -1635,6 +1637,8 @@ struct ib_flow_spec_eth {
1635struct ib_flow_ib_filter { 1637struct ib_flow_ib_filter {
1636 __be16 dlid; 1638 __be16 dlid;
1637 __u8 sl; 1639 __u8 sl;
1640 /* Must be last */
1641 u8 real_sz[0];
1638}; 1642};
1639 1643
1640struct ib_flow_spec_ib { 1644struct ib_flow_spec_ib {
@@ -1647,6 +1651,8 @@ struct ib_flow_spec_ib {
1647struct ib_flow_ipv4_filter { 1651struct ib_flow_ipv4_filter {
1648 __be32 src_ip; 1652 __be32 src_ip;
1649 __be32 dst_ip; 1653 __be32 dst_ip;
1654 /* Must be last */
1655 u8 real_sz[0];
1650}; 1656};
1651 1657
1652struct ib_flow_spec_ipv4 { 1658struct ib_flow_spec_ipv4 {
@@ -1659,6 +1665,8 @@ struct ib_flow_spec_ipv4 {
1659struct ib_flow_ipv6_filter { 1665struct ib_flow_ipv6_filter {
1660 u8 src_ip[16]; 1666 u8 src_ip[16];
1661 u8 dst_ip[16]; 1667 u8 dst_ip[16];
1668 /* Must be last */
1669 u8 real_sz[0];
1662}; 1670};
1663 1671
1664struct ib_flow_spec_ipv6 { 1672struct ib_flow_spec_ipv6 {
@@ -1671,6 +1679,8 @@ struct ib_flow_spec_ipv6 {
1671struct ib_flow_tcp_udp_filter { 1679struct ib_flow_tcp_udp_filter {
1672 __be16 dst_port; 1680 __be16 dst_port;
1673 __be16 src_port; 1681 __be16 src_port;
1682 /* Must be last */
1683 u8 real_sz[0];
1674}; 1684};
1675 1685
1676struct ib_flow_spec_tcp_udp { 1686struct ib_flow_spec_tcp_udp {