[ovs-dev] [PATCH] datapath: Clean up vswitch_skb_checksum_setup().

Ben Pfaff blp at nicira.com
Wed Jan 20 22:33:11 UTC 2010


vswitch_skb_checksum_setup() can be defined in datapath.h as a no-op
when defined(CONFIG_XEN) && defined(HAVE_PROTO_DATA_VALID) is false.

Also, skb_checksum_setup(), which was defined similarly, can be dropped
now, since it was unused.
---
 datapath/datapath.c |    4 +---
 datapath/datapath.h |    8 +++-----
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/datapath/datapath.c b/datapath/datapath.c
index 2a8fb50..1279895 100644
--- a/datapath/datapath.c
+++ b/datapath/datapath.c
@@ -621,9 +621,7 @@ int vswitch_skb_checksum_setup(struct sk_buff *skb)
 out:
 	return -EPROTO;
 }
-#else
-int vswitch_skb_checksum_setup(struct sk_buff *skb) { return 0; }
-#endif /* CONFIG_XEN && linux == 2.6.18 */
+#endif /* CONFIG_XEN && HAVE_PROTO_DATA_VALID */
 
 /* Append each packet in 'skb' list to 'queue'.  There will be only one packet
  * unless we broke up a GSO packet. */
diff --git a/datapath/datapath.h b/datapath/datapath.h
index 9b4c438..643c91a 100644
--- a/datapath/datapath.h
+++ b/datapath/datapath.h
@@ -159,15 +159,13 @@ static inline const char *dp_name(const struct datapath *dp)
 	return dp->ports[ODPP_LOCAL]->dev->name;
 }
 
-#ifdef CONFIG_XEN
-int skb_checksum_setup(struct sk_buff *skb);
+#if defined(CONFIG_XEN) && defined(HAVE_PROTO_DATA_VALID)
+int vswitch_skb_checksum_setup(struct sk_buff *skb);
 #else
-static inline int skb_checksum_setup(struct sk_buff *skb)
+static inline int vswitch_skb_checksum_setup(struct sk_buff *skb)
 {
 	return 0;
 }
 #endif
 
-int vswitch_skb_checksum_setup(struct sk_buff *skb);
-
 #endif /* datapath.h */
-- 
1.6.3.3





More information about the dev mailing list