[ovs-dev,v5,01/11] dp-packet: Add const qualifiers for checksum apis.

Message ID 1517761364-17655-2-git-send-email-dlu998@gmail.com
State Superseded
Delegated to: Ian Stokes
Headers show
Series
  • Userspace datapath: Add fragmentation support.
Related show

Commit Message

Darrell Ball Feb. 4, 2018, 4:22 p.m.
Signed-off-by: Darrell Ball <dlu998@gmail.com>
---
 lib/dp-packet.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Justin Pettit April 4, 2018, 8:46 p.m. | #1
The functions dp_packet_l4_checksum_valid() and dp_packet_l4_checksum_bad() seem similar.  Should we also add "const" to them?

Acked-by: Justin Pettit <jpettit@ovn.org>

--Justin


> On Feb 4, 2018, at 8:22 AM, Darrell Ball <dlu998@gmail.com> wrote:
> 
> Signed-off-by: Darrell Ball <dlu998@gmail.com>
> ---
> lib/dp-packet.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/dp-packet.h b/lib/dp-packet.h
> index b4b721c..61d4cd4 100644
> --- a/lib/dp-packet.h
> +++ b/lib/dp-packet.h
> @@ -637,7 +637,7 @@ dp_packet_mbuf_init(struct dp_packet *p OVS_UNUSED)
> }
> 
> static inline bool
> -dp_packet_ip_checksum_valid(struct dp_packet *p OVS_UNUSED)
> +dp_packet_ip_checksum_valid(const struct dp_packet *p OVS_UNUSED)
> {
> #ifdef DPDK_NETDEV
>     return (p->mbuf.ol_flags & PKT_RX_IP_CKSUM_MASK) ==
> @@ -648,7 +648,7 @@ dp_packet_ip_checksum_valid(struct dp_packet *p OVS_UNUSED)
> }
> 
> static inline bool
> -dp_packet_ip_checksum_bad(struct dp_packet *p OVS_UNUSED)
> +dp_packet_ip_checksum_bad(const struct dp_packet *p OVS_UNUSED)
> {
> #ifdef DPDK_NETDEV
>     return (p->mbuf.ol_flags & PKT_RX_IP_CKSUM_MASK) ==
> -- 
> 1.9.1
> 
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Darrell Ball April 4, 2018, 8:54 p.m. | #2
On 4/4/18, 1:46 PM, "ovs-dev-bounces@openvswitch.org on behalf of Justin Pettit" <ovs-dev-bounces@openvswitch.org on behalf of jpettit@ovn.org> wrote:

    The functions dp_packet_l4_checksum_valid() and dp_packet_l4_checksum_bad() seem similar.  Should we also add "const" to them?

Good idea
Thanks

    
    Acked-by: Justin Pettit <jpettit@ovn.org>
    
    --Justin
    
    
    > On Feb 4, 2018, at 8:22 AM, Darrell Ball <dlu998@gmail.com> wrote:
    > 
    > Signed-off-by: Darrell Ball <dlu998@gmail.com>
    > ---
    > lib/dp-packet.h | 4 ++--
    > 1 file changed, 2 insertions(+), 2 deletions(-)
    > 
    > diff --git a/lib/dp-packet.h b/lib/dp-packet.h
    > index b4b721c..61d4cd4 100644
    > --- a/lib/dp-packet.h
    > +++ b/lib/dp-packet.h
    > @@ -637,7 +637,7 @@ dp_packet_mbuf_init(struct dp_packet *p OVS_UNUSED)
    > }
    > 
    > static inline bool
    > -dp_packet_ip_checksum_valid(struct dp_packet *p OVS_UNUSED)
    > +dp_packet_ip_checksum_valid(const struct dp_packet *p OVS_UNUSED)
    > {
    > #ifdef DPDK_NETDEV
    >     return (p->mbuf.ol_flags & PKT_RX_IP_CKSUM_MASK) ==
    > @@ -648,7 +648,7 @@ dp_packet_ip_checksum_valid(struct dp_packet *p OVS_UNUSED)
    > }
    > 
    > static inline bool
    > -dp_packet_ip_checksum_bad(struct dp_packet *p OVS_UNUSED)
    > +dp_packet_ip_checksum_bad(const struct dp_packet *p OVS_UNUSED)
    > {
    > #ifdef DPDK_NETDEV
    >     return (p->mbuf.ol_flags & PKT_RX_IP_CKSUM_MASK) ==
    > -- 
    > 1.9.1
    > 
    > _______________________________________________
    > dev mailing list
    > dev@openvswitch.org
    > https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.openvswitch.org_mailman_listinfo_ovs-2Ddev&d=DwICAg&c=uilaK90D4TOVoH58JNXRgQ&r=BVhFA09CGX7JQ5Ih-uZnsw&m=8tyGzqlrfwtPlY-2DtHMJFEbXlPVU3hdmNAxT_h7lvk&s=hSoviCBQ4df7xVBnrWZcpQND-VXdhFBZgoDq3qwmMhE&e=
    
    _______________________________________________
    dev mailing list
    dev@openvswitch.org
    https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.openvswitch.org_mailman_listinfo_ovs-2Ddev&d=DwICAg&c=uilaK90D4TOVoH58JNXRgQ&r=BVhFA09CGX7JQ5Ih-uZnsw&m=8tyGzqlrfwtPlY-2DtHMJFEbXlPVU3hdmNAxT_h7lvk&s=hSoviCBQ4df7xVBnrWZcpQND-VXdhFBZgoDq3qwmMhE&e=

Patch

diff --git a/lib/dp-packet.h b/lib/dp-packet.h
index b4b721c..61d4cd4 100644
--- a/lib/dp-packet.h
+++ b/lib/dp-packet.h
@@ -637,7 +637,7 @@  dp_packet_mbuf_init(struct dp_packet *p OVS_UNUSED)
 }
 
 static inline bool
-dp_packet_ip_checksum_valid(struct dp_packet *p OVS_UNUSED)
+dp_packet_ip_checksum_valid(const struct dp_packet *p OVS_UNUSED)
 {
 #ifdef DPDK_NETDEV
     return (p->mbuf.ol_flags & PKT_RX_IP_CKSUM_MASK) ==
@@ -648,7 +648,7 @@  dp_packet_ip_checksum_valid(struct dp_packet *p OVS_UNUSED)
 }
 
 static inline bool
-dp_packet_ip_checksum_bad(struct dp_packet *p OVS_UNUSED)
+dp_packet_ip_checksum_bad(const struct dp_packet *p OVS_UNUSED)
 {
 #ifdef DPDK_NETDEV
     return (p->mbuf.ol_flags & PKT_RX_IP_CKSUM_MASK) ==