[PATCH rdma-core 08/11] verbs: Add flow steering egress support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Matan Barak <matanb@xxxxxxxxxxxx>

Sometimes we want to carry actions when packets are sent out to the
port. In that case, we need an EGRESS based flow steering rule.
The semantics of this new EGRESS flag is port-wide, meaning - any
packet that is sent to the port is matched, regardless of the QP that
this packet originated from. The flow steering QP parameter is used
only in order to represent the device and is ignored in the matching
process.

Signed-off-by: Matan Barak <matanb@xxxxxxxxxxxx>
Signed-off-by: Yishai Hadas <yishaih@xxxxxxxxxxxx>
---
 libibverbs/man/ibv_create_flow.3 | 7 +++++++
 libibverbs/verbs.h               | 1 +
 2 files changed, 8 insertions(+)

diff --git a/libibverbs/man/ibv_create_flow.3 b/libibverbs/man/ibv_create_flow.3
index 48bbb14..1762503 100644
--- a/libibverbs/man/ibv_create_flow.3
+++ b/libibverbs/man/ibv_create_flow.3
@@ -52,6 +52,7 @@ enum ibv_flow_flags {
 .in +8
 IBV_FLOW_ATTR_FLAGS_ALLOW_LOOP_BACK = 1 << 0,	/* Apply the rules on packets that were sent from the attached QP through loopback */
 IBV_FLOW_ATTR_FLAGS_DONT_TRAP       = 1 << 1,	/* Rule doesn't trap received packets, allowing them to match lower prioritized rules */
+IBV_FLOW_ATTR_FLAGS_EGRESS          = 1 << 2,	/* Match sent packets against EGRESS rules and carry associated actions if required */
 .in -8
 };
 .fi
@@ -87,6 +88,10 @@ struct ibv_flow_xxx_filter mask; /* Defines which bits from the filter value are
 .PP
 Each spec struct holds the relevant network layer parameters for matching. To enforce the match, the user sets a mask for each parameter.
 .br
+Packets coming from the wire are matched against the flow specification. If a match is found, the associated flow actions are executed on the packet.
+.br
+In ingress flows, the QP parameter is treated as another action of scattering the packet to the respected QP.
+.br
 If the bit is set in the mask, the corresponding bit in the value should be matched.
 .br
 Note that most vendors support either full mask (all "1"s) or zero mask (all "0"s).
@@ -142,6 +147,8 @@ or
 .br
 5. No specifications are needed for IBV_FLOW_ATTR_SNIFFER rule type.
 .br
+6. When IBV_FLOW_ATTR_FLAGS_EGRESS flag is set, the qp parameter is used only as a mean to get the device.
+.br
 .PP
 .SH EXAMPLE
 .br
diff --git a/libibverbs/verbs.h b/libibverbs/verbs.h
index 5bbc963..8dbfcf1 100644
--- a/libibverbs/verbs.h
+++ b/libibverbs/verbs.h
@@ -1357,6 +1357,7 @@ struct ibv_ah {
 enum ibv_flow_flags {
 	IBV_FLOW_ATTR_FLAGS_ALLOW_LOOP_BACK = 1 << 0,
 	IBV_FLOW_ATTR_FLAGS_DONT_TRAP = 1 << 1,
+	IBV_FLOW_ATTR_FLAGS_EGRESS = 1 << 2,
 };
 
 enum ibv_flow_attr_type {
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux