[ovs-dev] [PATCH v5 2/9] dp-packet: Constantify offloading APIs.

Ilya Maximets i.maximets at samsung.com
Mon Feb 18 16:00:18 UTC 2019


Getters should have const arguments.

Acked-by: Flavio Leitner <fbl at sysclose.org>
Signed-off-by: Ilya Maximets <i.maximets at samsung.com>
---
 lib/dp-packet.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/dp-packet.h b/lib/dp-packet.h
index 5b13329da..c6672f6be 100644
--- a/lib/dp-packet.h
+++ b/lib/dp-packet.h
@@ -482,7 +482,7 @@ dp_packet_set_allocated(struct dp_packet *b, uint16_t s)
 /* Returns the RSS hash of the packet 'p'.  Note that the returned value is
  * correct only if 'dp_packet_rss_valid(p)' returns true */
 static inline uint32_t
-dp_packet_get_rss_hash(struct dp_packet *p)
+dp_packet_get_rss_hash(const struct dp_packet *p)
 {
     return p->mbuf.hash.rss;
 }
@@ -495,7 +495,7 @@ dp_packet_set_rss_hash(struct dp_packet *p, uint32_t hash)
 }
 
 static inline bool
-dp_packet_rss_valid(struct dp_packet *p)
+dp_packet_rss_valid(const struct dp_packet *p)
 {
     return p->mbuf.ol_flags & PKT_RX_RSS_HASH;
 }
@@ -557,7 +557,7 @@ reset_dp_packet_checksum_ol_flags(struct dp_packet *p)
 }
 
 static inline bool
-dp_packet_has_flow_mark(struct dp_packet *p, uint32_t *mark)
+dp_packet_has_flow_mark(const struct dp_packet *p, uint32_t *mark)
 {
     if (p->mbuf.ol_flags & PKT_RX_FDIR_ID) {
         *mark = p->mbuf.hash.fdir.hi;
@@ -619,7 +619,7 @@ dp_packet_set_allocated(struct dp_packet *b, uint16_t s)
 /* Returns the RSS hash of the packet 'p'.  Note that the returned value is
  * correct only if 'dp_packet_rss_valid(p)' returns true */
 static inline uint32_t
-dp_packet_get_rss_hash(struct dp_packet *p)
+dp_packet_get_rss_hash(const struct dp_packet *p)
 {
     return p->rss_hash;
 }
@@ -632,7 +632,7 @@ dp_packet_set_rss_hash(struct dp_packet *p, uint32_t hash)
 }
 
 static inline bool
-dp_packet_rss_valid(struct dp_packet *p)
+dp_packet_rss_valid(const struct dp_packet *p)
 {
     return p->rss_hash_valid;
 }
@@ -683,7 +683,7 @@ reset_dp_packet_checksum_ol_flags(struct dp_packet *p OVS_UNUSED)
 }
 
 static inline bool
-dp_packet_has_flow_mark(struct dp_packet *p OVS_UNUSED,
+dp_packet_has_flow_mark(const struct dp_packet *p OVS_UNUSED,
                         uint32_t *mark OVS_UNUSED)
 {
     return false;
-- 
2.17.1



More information about the dev mailing list