net: Always untag vlan-tagged traffic on input.
[deliverable/linux.git] / include / linux / skbuff.h
index 890fb3307dd620b623a692b4a47cf9e802be2ef0..abde271c18ae30989e6675708e70a6c9bb656300 100644 (file)
 #define CHECKSUM_COMPLETE      2
 #define CHECKSUM_PARTIAL       3
 
-#define SKB_DATA_ALIGN(X)      (((X) + (SMP_CACHE_BYTES - 1)) & \
-                                ~(SMP_CACHE_BYTES - 1))
+#define SKB_DATA_ALIGN(X)      ALIGN(X, SMP_CACHE_BYTES)
 #define SKB_WITH_OVERHEAD(X)   \
        ((X) - SKB_DATA_ALIGN(sizeof(struct skb_shared_info)))
 #define SKB_MAX_ORDER(X, ORDER) \
@@ -211,18 +210,9 @@ static inline void skb_frag_size_sub(skb_frag_t *frag, int delta)
  * struct skb_shared_hwtstamps - hardware time stamps
  * @hwtstamp:  hardware time stamp transformed into duration
  *             since arbitrary point in time
- * @syststamp: hwtstamp transformed to system time base
  *
  * Software time stamps generated by ktime_get_real() are stored in
- * skb->tstamp. The relation between the different kinds of time
- * stamps is as follows:
- *
- * syststamp and tstamp can be compared against each other in
- * arbitrary combinations.  The accuracy of a
- * syststamp/tstamp/"syststamp from other device" comparison is
- * limited by the accuracy of the transformation into system time
- * base. This depends on the device driver and its underlying
- * hardware.
+ * skb->tstamp.
  *
  * hwtstamps can only be compared against other hwtstamps from
  * the same device.
@@ -232,7 +222,6 @@ static inline void skb_frag_size_sub(skb_frag_t *frag, int delta)
  */
 struct skb_shared_hwtstamps {
        ktime_t hwtstamp;
-       ktime_t syststamp;
 };
 
 /* Definitions for tx_flags in struct skb_shared_info */
@@ -240,7 +229,7 @@ enum {
        /* generate hardware time stamp */
        SKBTX_HW_TSTAMP = 1 << 0,
 
-       /* generate software time stamp */
+       /* generate software time stamp when queueing packet to NIC */
        SKBTX_SW_TSTAMP = 1 << 1,
 
        /* device driver is going to provide hardware time stamp */
@@ -258,8 +247,19 @@ enum {
         * all frags to avoid possible bad checksum
         */
        SKBTX_SHARED_FRAG = 1 << 5,
+
+       /* generate software time stamp when entering packet scheduling */
+       SKBTX_SCHED_TSTAMP = 1 << 6,
+
+       /* generate software timestamp on peer data acknowledgment */
+       SKBTX_ACK_TSTAMP = 1 << 7,
 };
 
+#define SKBTX_ANY_SW_TSTAMP    (SKBTX_SW_TSTAMP    | \
+                                SKBTX_SCHED_TSTAMP | \
+                                SKBTX_ACK_TSTAMP)
+#define SKBTX_ANY_TSTAMP       (SKBTX_HW_TSTAMP | SKBTX_ANY_SW_TSTAMP)
+
 /*
  * The callback notifies userspace to release buffers when skb DMA is done in
  * lower device, the skb last reference should be 0 when calling this.
@@ -286,6 +286,7 @@ struct skb_shared_info {
        unsigned short  gso_type;
        struct sk_buff  *frag_list;
        struct skb_shared_hwtstamps hwtstamps;
+       u32             tskey;
        __be32          ip6_frag_id;
 
        /*
@@ -2554,6 +2555,7 @@ int skb_shift(struct sk_buff *tgt, struct sk_buff *skb, int shiftlen);
 void skb_scrub_packet(struct sk_buff *skb, bool xnet);
 unsigned int skb_gso_transport_seglen(const struct sk_buff *skb);
 struct sk_buff *skb_segment(struct sk_buff *skb, netdev_features_t features);
+struct sk_buff *skb_vlan_untag(struct sk_buff *skb);
 
 struct skb_checksum_ops {
        __wsum (*update)(const void *mem, int len, __wsum wsum);
@@ -2702,6 +2704,10 @@ static inline bool skb_defer_rx_timestamp(struct sk_buff *skb)
 void skb_complete_tx_timestamp(struct sk_buff *skb,
                               struct skb_shared_hwtstamps *hwtstamps);
 
+void __skb_tstamp_tx(struct sk_buff *orig_skb,
+                    struct skb_shared_hwtstamps *hwtstamps,
+                    struct sock *sk, int tstype);
+
 /**
  * skb_tstamp_tx - queue clone of skb with send time stamps
  * @orig_skb:  the original outgoing packet
This page took 0.02636 seconds and 5 git commands to generate.