On 3/13/2019 11:23 AM, Ilya Maximets wrote:
On 13.03.2019 14:14, Ian Stokes wrote:
On 2/26/2019 10:38 AM, Ilya Maximets wrote:
Additionally, new API call 'dp_packet_set_flow_mark' is needed
for packet clone. Mostly for dummy HWOL implementation.

Acked-by: Flavio Leitner <f...@sysclose.org>
Signed-off-by: Ilya Maximets <i.maxim...@samsung.com>
---
   lib/dp-packet.h | 23 +++++++++++++++++++++--
   1 file changed, 21 insertions(+), 2 deletions(-)

diff --git a/lib/dp-packet.h b/lib/dp-packet.h
index b34dada78..a5e9ade12 100644
--- a/lib/dp-packet.h
+++ b/lib/dp-packet.h
@@ -50,6 +50,7 @@ enum OVS_PACKED_ENUM dp_packet_source {
   /* Bit masks for the 'ol_flags' member of the 'dp_packet' structure. */
   enum dp_packet_offload_mask {
       DP_PACKET_OL_RSS_HASH_MASK  = 0x1, /* Is the 'rss_hash' valid? */
+    DP_PACKET_OL_FLOW_MARK_MASK = 0x2, /* Is the 'flow_mark' valid? */
   };
   #endif
   @@ -67,6 +68,7 @@ struct dp_packet {
       uint32_t size_;             /* Number of bytes in use. */
       uint32_t ol_flags;          /* Offloading flags. */
       uint32_t rss_hash;          /* Packet hash. */
+    uint32_t flow_mark;         /* Packet flow mark. */
   #endif
       enum dp_packet_source source;  /* Source of memory allocated as 'base'. 
*/
   @@ -562,6 +564,13 @@ dp_packet_has_flow_mark(const struct dp_packet *p, 
uint32_t *mark)
       return false;
   }
   +static inline void
+dp_packet_set_flow_mark(struct dp_packet *p, uint32_t mark)
+{
+    p->mbuf.hash.fdir.hi = mark;

Just a query query, these functions only set the hi mark, not the lo, is the 
expectation that lo is not needed or is it that the id and hash would be used 
instead of lo?

hash.fdir.lo overlaps with hash.rss. So, we should not touch it.
And MARK action sets the hash.fdir.hi field only.


Sure, that's in keeping with what I suspected but just wanted to confirm. LGTM, applied to master.

Ian
_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to