]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - net/openvswitch/vport.h
openvswitch: make skb->csum consistent with rest of networking stack.
[mirror_ubuntu-bionic-kernel.git] / net / openvswitch / vport.h
index 68a377bc0841e7bfd0a5b1200a4a3b938adc9251..293278c4c2df8b3774074af997fe0a1125bc74b7 100644 (file)
@@ -123,9 +123,8 @@ struct vport_parms {
  * existing vport to a &struct sk_buff.  May be %NULL for a vport that does not
  * have any configuration.
  * @get_name: Get the device's name.
- * @get_config: Get the device's configuration.
- * May be null if the device does not have an ifindex.
- * @send: Send a packet on the device.  Returns the length of the packet sent.
+ * @send: Send a packet on the device.  Returns the length of the packet sent,
+ * zero for dropped packets or negative for error.
  */
 struct vport_ops {
        enum ovs_vport_type type;
@@ -139,7 +138,6 @@ struct vport_ops {
 
        /* Called with rcu_read_lock or ovs_mutex. */
        const char *(*get_name)(const struct vport *);
-       void (*get_config)(const struct vport *, void *);
 
        int (*send)(struct vport *, struct sk_buff *);
 };
@@ -194,4 +192,11 @@ void ovs_vport_record_error(struct vport *, enum vport_err_type err_type);
 extern const struct vport_ops ovs_netdev_vport_ops;
 extern const struct vport_ops ovs_internal_vport_ops;
 
+static inline void ovs_skb_postpush_rcsum(struct sk_buff *skb,
+                                     const void *start, unsigned int len)
+{
+       if (skb->ip_summed == CHECKSUM_COMPLETE)
+               skb->csum = csum_add(skb->csum, csum_partial(start, len, 0));
+}
+
 #endif /* vport.h */