diff options
| author | Dave Airlie <airlied@redhat.com> | 2016-09-27 22:08:49 -0400 |
|---|---|---|
| committer | Dave Airlie <airlied@redhat.com> | 2016-09-27 22:08:49 -0400 |
| commit | ca09fb9f60b5f3ab2d57e761aaeea89a5147d784 (patch) | |
| tree | 908e42ecf32d2601f4c5c340c6c4626841baa661 /include/linux/skbuff.h | |
| parent | 9f4ef05bcdcfdf911b056b471dd3c6a4f331b644 (diff) | |
| parent | 08895a8b6b06ed2323cd97a36ee40a116b3db8ed (diff) | |
Merge tag 'v4.8-rc8' into drm-next
Linux 4.8-rc8
There was a lot of fallout in the imx/amdgpu/i915 drivers, so backmerge
it now to avoid troubles.
* tag 'v4.8-rc8': (1442 commits)
Linux 4.8-rc8
fault_in_multipages_readable() throws set-but-unused error
mm: check VMA flags to avoid invalid PROT_NONE NUMA balancing
radix tree: fix sibling entry handling in radix_tree_descend()
radix tree test suite: Test radix_tree_replace_slot() for multiorder entries
fix memory leaks in tracing_buffers_splice_read()
tracing: Move mutex to protect against resetting of seq data
MIPS: Fix delay slot emulation count in debugfs
MIPS: SMP: Fix possibility of deadlock when bringing CPUs online
mm: delete unnecessary and unsafe init_tlb_ubc()
huge tmpfs: fix Committed_AS leak
shmem: fix tmpfs to handle the huge= option properly
blk-mq: skip unmapped queues in blk_mq_alloc_request_hctx
MIPS: Fix pre-r6 emulation FPU initialisation
arm64: kgdb: handle read-only text / modules
arm64: Call numa_store_cpu_info() earlier.
locking/hung_task: Fix typo in CONFIG_DETECT_HUNG_TASK help text
nvme-rdma: only clear queue flags after successful connect
i2c: qup: skip qup_i2c_suspend if the device is already runtime suspended
perf/core: Limit matching exclusive events to one PMU
...
Diffstat (limited to 'include/linux/skbuff.h')
| -rw-r--r-- | include/linux/skbuff.h | 52 |
1 files changed, 33 insertions, 19 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 6f0b3e0adc73..0f665cb26b50 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
| @@ -2847,6 +2847,18 @@ static inline int skb_linearize_cow(struct sk_buff *skb) | |||
| 2847 | __skb_linearize(skb) : 0; | 2847 | __skb_linearize(skb) : 0; |
| 2848 | } | 2848 | } |
| 2849 | 2849 | ||
| 2850 | static __always_inline void | ||
| 2851 | __skb_postpull_rcsum(struct sk_buff *skb, const void *start, unsigned int len, | ||
| 2852 | unsigned int off) | ||
| 2853 | { | ||
| 2854 | if (skb->ip_summed == CHECKSUM_COMPLETE) | ||
| 2855 | skb->csum = csum_block_sub(skb->csum, | ||
| 2856 | csum_partial(start, len, 0), off); | ||
| 2857 | else if (skb->ip_summed == CHECKSUM_PARTIAL && | ||
| 2858 | skb_checksum_start_offset(skb) < 0) | ||
| 2859 | skb->ip_summed = CHECKSUM_NONE; | ||
| 2860 | } | ||
| 2861 | |||
| 2850 | /** | 2862 | /** |
| 2851 | * skb_postpull_rcsum - update checksum for received skb after pull | 2863 | * skb_postpull_rcsum - update checksum for received skb after pull |
| 2852 | * @skb: buffer to update | 2864 | * @skb: buffer to update |
| @@ -2857,36 +2869,38 @@ static inline int skb_linearize_cow(struct sk_buff *skb) | |||
| 2857 | * update the CHECKSUM_COMPLETE checksum, or set ip_summed to | 2869 | * update the CHECKSUM_COMPLETE checksum, or set ip_summed to |
| 2858 | * CHECKSUM_NONE so that it can be recomputed from scratch. | 2870 | * CHECKSUM_NONE so that it can be recomputed from scratch. |
| 2859 | */ | 2871 | */ |
| 2860 | |||
| 2861 | static inline void skb_postpull_rcsum(struct sk_buff *skb, | 2872 | static inline void skb_postpull_rcsum(struct sk_buff *skb, |
| 2862 | const void *start, unsigned int len) | 2873 | const void *start, unsigned int len) |
| 2863 | { | 2874 | { |
| 2864 | if (skb->ip_summed == CHECKSUM_COMPLETE) | 2875 | __skb_postpull_rcsum(skb, start, len, 0); |
| 2865 | skb->csum = csum_sub(skb->csum, csum_partial(start, len, 0)); | ||
| 2866 | else if (skb->ip_summed == CHECKSUM_PARTIAL && | ||
| 2867 | skb_checksum_start_offset(skb) < 0) | ||
| 2868 | skb->ip_summed = CHECKSUM_NONE; | ||
| 2869 | } | 2876 | } |
| 2870 | 2877 | ||
| 2871 | unsigned char *skb_pull_rcsum(struct sk_buff *skb, unsigned int len); | 2878 | static __always_inline void |
| 2879 | __skb_postpush_rcsum(struct sk_buff *skb, const void *start, unsigned int len, | ||
| 2880 | unsigned int off) | ||
| 2881 | { | ||
| 2882 | if (skb->ip_summed == CHECKSUM_COMPLETE) | ||
| 2883 | skb->csum = csum_block_add(skb->csum, | ||
| 2884 | csum_partial(start, len, 0), off); | ||
| 2885 | } | ||
| 2872 | 2886 | ||
| 2887 | /** | ||
| 2888 | * skb_postpush_rcsum - update checksum for received skb after push | ||
| 2889 | * @skb: buffer to update | ||
| 2890 | * @start: start of data after push | ||
| 2891 | * @len: length of data pushed | ||
| 2892 | * | ||
| 2893 | * After doing a push on a received packet, you need to call this to | ||
| 2894 | * update the CHECKSUM_COMPLETE checksum. | ||
| 2895 | */ | ||
| 2873 | static inline void skb_postpush_rcsum(struct sk_buff *skb, | 2896 | static inline void skb_postpush_rcsum(struct sk_buff *skb, |
| 2874 | const void *start, unsigned int len) | 2897 | const void *start, unsigned int len) |
| 2875 | { | 2898 | { |
| 2876 | /* For performing the reverse operation to skb_postpull_rcsum(), | 2899 | __skb_postpush_rcsum(skb, start, len, 0); |
| 2877 | * we can instead of ... | ||
| 2878 | * | ||
| 2879 | * skb->csum = csum_add(skb->csum, csum_partial(start, len, 0)); | ||
| 2880 | * | ||
| 2881 | * ... just use this equivalent version here to save a few | ||
| 2882 | * instructions. Feeding csum of 0 in csum_partial() and later | ||
| 2883 | * on adding skb->csum is equivalent to feed skb->csum in the | ||
| 2884 | * first place. | ||
| 2885 | */ | ||
| 2886 | if (skb->ip_summed == CHECKSUM_COMPLETE) | ||
| 2887 | skb->csum = csum_partial(start, len, skb->csum); | ||
| 2888 | } | 2900 | } |
| 2889 | 2901 | ||
| 2902 | unsigned char *skb_pull_rcsum(struct sk_buff *skb, unsigned int len); | ||
| 2903 | |||
| 2890 | /** | 2904 | /** |
| 2891 | * skb_push_rcsum - push skb and update receive checksum | 2905 | * skb_push_rcsum - push skb and update receive checksum |
| 2892 | * @skb: buffer to update | 2906 | * @skb: buffer to update |
