]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - net/core/skbuff.c
net: allow simultaneous SW and HW transmit timestamping
[karo-tx-linux.git] / net / core / skbuff.c
index f1d04592ace02f32efa6e05df89c9a5e0023157f..780b7c1563d03d9f38ab97fd21bf157ebf62a01a 100644 (file)
@@ -1982,7 +1982,6 @@ int skb_splice_bits(struct sk_buff *skb, struct sock *sk, unsigned int offset,
                .pages = pages,
                .partial = partial,
                .nr_pages_max = MAX_SKB_FRAGS,
-               .flags = flags,
                .ops = &nosteal_pipe_buf_ops,
                .spd_release = sock_spd_release,
        };
@@ -2244,6 +2243,32 @@ __wsum skb_copy_and_csum_bits(const struct sk_buff *skb, int offset,
 }
 EXPORT_SYMBOL(skb_copy_and_csum_bits);
 
+static __wsum warn_crc32c_csum_update(const void *buff, int len, __wsum sum)
+{
+       net_warn_ratelimited(
+               "%s: attempt to compute crc32c without libcrc32c.ko\n",
+               __func__);
+       return 0;
+}
+
+static __wsum warn_crc32c_csum_combine(__wsum csum, __wsum csum2,
+                                      int offset, int len)
+{
+       net_warn_ratelimited(
+               "%s: attempt to compute crc32c without libcrc32c.ko\n",
+               __func__);
+       return 0;
+}
+
+static const struct skb_checksum_ops default_crc32c_ops = {
+       .update  = warn_crc32c_csum_update,
+       .combine = warn_crc32c_csum_combine,
+};
+
+const struct skb_checksum_ops *crc32c_csum_stub __read_mostly =
+       &default_crc32c_ops;
+EXPORT_SYMBOL(crc32c_csum_stub);
+
  /**
  *     skb_zerocopy_headlen - Calculate headroom needed for skb_zerocopy()
  *     @from: source buffer
@@ -3102,7 +3127,7 @@ struct sk_buff *skb_segment(struct sk_buff *head_skb,
                        skb_walk_frags(head_skb, iter) {
                                if (frag_len != iter->len && iter->next)
                                        goto normal;
-                               if (skb_headlen(iter))
+                               if (skb_headlen(iter) && !iter->head_frag)
                                        goto normal;
 
                                len -= iter->len;
@@ -3876,6 +3901,10 @@ void __skb_tstamp_tx(struct sk_buff *orig_skb,
        if (!sk)
                return;
 
+       if (!hwtstamps && !(sk->sk_tsflags & SOF_TIMESTAMPING_OPT_TX_SWHW) &&
+           skb_shinfo(orig_skb)->tx_flags & SKBTX_IN_PROGRESS)
+               return;
+
        tsonly = sk->sk_tsflags & SOF_TIMESTAMPING_OPT_TSONLY;
        if (!skb_may_tx_timestamp(sk, tsonly))
                return;