History

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

Two easily resolvable overlapping change conflicts, one in TCP and one in the eBPF verifier.

David S. Miller committed 7 years ago

Commit 375ca542 parents 58066ac 40e196a142 files · +1175 −735Browse files

Showing the changes to include/linux (8 of 142 files). Show all

Unified · Split

8 files
  1. include/linux/compiler_attributes.h +14 −0
  2. include/linux/efi.h +0 −7
  3. include/linux/memblock.h +0 −3
  4. include/linux/module.h +2 −2
  5. include/linux/netdev_features.h +22 −2
  6. include/linux/perf_event.h +5 −0
  7. include/linux/skbuff.h +7 −1
  8. include/linux/virtio_net.h +9 −0
include/linux/compiler_attributes.h+14−0
@@ -34,6 +34,7 @@ · 33 unmodified lines
3434 #ifndef __has_attribute
3535 # define __has_attribute(x) __GCC4_has_attribute_##x
3636 # define __GCC4_has_attribute___assume_aligned__ (__GNUC_MINOR__ >= 9)
37+# define __GCC4_has_attribute___copy__ 0
3738 # define __GCC4_has_attribute___designated_init__ 0
3839 # define __GCC4_has_attribute___externally_visible__ 1
3940 # define __GCC4_has_attribute___noclone__ 1
@@ -100,6 +101,19 @@ · 60 unmodified lines
100101 */
101102 #define __attribute_const__ __attribute__((__const__))
102103
104+/*
105+ * Optional: only supported since gcc >= 9
106+ * Optional: not supported by clang
107+ * Optional: not supported by icc
108+ *
109+ * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-copy-function-attribute
110+ */
111+#if __has_attribute(__copy__)
112+# define __copy(symbol) __attribute__((__copy__(symbol)))
113+#else
114+# define __copy(symbol)
115+#endif
116+
103117 /*
104118 * Don't. Just don't. See commit 771c035372a0 ("deprecate the '__deprecated'
105119 * attribute warnings entirely and for good") for more information.
include/linux/efi.h+0−7
@@ -1198,8 +1198,6 @@ static inline bool efi_enabled(int feature) · 1197 unmodified lines
11981198 extern void efi_reboot(enum reboot_mode reboot_mode, const char *__unused);
11991199
12001200 extern bool efi_is_table_address(unsigned long phys_addr);
1201−
1202−extern int efi_apply_persistent_mem_reservations(void);
12031201 #else
12041202 static inline bool efi_enabled(int feature)
12051203 {
@@ -1218,11 +1216,6 @@ static inline bool efi_is_table_address(unsigned long phys_addr) · 12 unmodified lines
12181216 {
12191217 return false;
12201218 }
1221−
1222−static inline int efi_apply_persistent_mem_reservations(void)
1223−{
1224− return 0;
1225−}
12261219 #endif
12271220
12281221 extern int efi_status_to_err(efi_status_t status);
include/linux/memblock.h+0−3
@@ -29,9 +29,6 @@ extern unsigned long max_pfn; · 28 unmodified lines
2929 */
3030 extern unsigned long long max_possible_pfn;
3131
32−#define INIT_MEMBLOCK_REGIONS 128
33−#define INIT_PHYSMEM_REGIONS 4
34−
3532 /**
3633 * enum memblock_flags - definition of memory region attributes
3734 * @MEMBLOCK_NONE: no special request
include/linux/module.h+2−2
@@ -129,13 +129,13 @@ extern void cleanup_module(void); · 128 unmodified lines
129129 #define module_init(initfn) \
130130 static inline initcall_t __maybe_unused __inittest(void) \
131131 { return initfn; } \
132− int init_module(void) __attribute__((alias(#initfn)));
132+ int init_module(void) __copy(initfn) __attribute__((alias(#initfn)));
133133
134134 /* This is only required if you want to be unloadable. */
135135 #define module_exit(exitfn) \
136136 static inline exitcall_t __maybe_unused __exittest(void) \
137137 { return exitfn; } \
138− void cleanup_module(void) __attribute__((alias(#exitfn)));
138+ void cleanup_module(void) __copy(exitfn) __attribute__((alias(#exitfn)));
139139
140140 #endif
141141
include/linux/netdev_features.h+22−2
@@ -11,6 +11,8 @@ · 10 unmodified lines
1111 #define _LINUX_NETDEV_FEATURES_H
1212
1313 #include <linux/types.h>
14+#include <linux/bitops.h>
15+#include <asm/byteorder.h>
1416
1517 typedef u64 netdev_features_t;
1618
@@ -154,8 +156,26 @@ enum { · 137 unmodified lines
154156 #define NETIF_F_HW_TLS_TX __NETIF_F(HW_TLS_TX)
155157 #define NETIF_F_HW_TLS_RX __NETIF_F(HW_TLS_RX)
156158
157−#define for_each_netdev_feature(mask_addr, bit) \
158− for_each_set_bit(bit, (unsigned long *)mask_addr, NETDEV_FEATURE_COUNT)
159+/* Finds the next feature with the highest number of the range of start till 0.
160+ */
161+static inline int find_next_netdev_feature(u64 feature, unsigned long start)
162+{
163+ /* like BITMAP_LAST_WORD_MASK() for u64
164+ * this sets the most significant 64 - start to 0.
165+ */
166+ feature &= ~0ULL >> (-start & ((sizeof(feature) * 8) - 1));
167+
168+ return fls64(feature) - 1;
169+}
170+
171+/* This goes for the MSB to the LSB through the set feature bits,
172+ * mask_addr should be a u64 and bit an int
173+ */
174+#define for_each_netdev_feature(mask_addr, bit) \
175+ for ((bit) = find_next_netdev_feature((mask_addr), \
176+ NETDEV_FEATURE_COUNT); \
177+ (bit) >= 0; \
178+ (bit) = find_next_netdev_feature((mask_addr), (bit) - 1))
159179
160180 /* Features valid for ethtool to change */
161181 /* = all defined minus driver/device-class-related */
include/linux/perf_event.h+5−0
@@ -447,6 +447,11 @@ struct pmu { · 446 unmodified lines
447447 * Filter events for PMU-specific reasons.
448448 */
449449 int (*filter_match) (struct perf_event *event); /* optional */
450+
451+ /*
452+ * Check period value for PERF_EVENT_IOC_PERIOD ioctl.
453+ */
454+ int (*check_period) (struct perf_event *event, u64 value); /* optional */
450455 };
451456
452457 enum perf_addr_filter_action_t {
include/linux/skbuff.h+7−1
@@ -2439,7 +2439,7 @@ static inline void skb_probe_transport_header(struct sk_buff *skb, · 2438 unmodified lines
24392439
24402440 if (skb_flow_dissect_flow_keys_basic(skb, &keys, NULL, 0, 0, 0, 0))
24412441 skb_set_transport_header(skb, keys.control.thoff);
2442− else
2442+ else if (offset_hint >= 0)
24432443 skb_set_transport_header(skb, offset_hint);
24442444 }
24452445
@@ -4235,6 +4235,12 @@ static inline bool skb_is_gso_sctp(const struct sk_buff *skb) · 1789 unmodified lines
42354235 return skb_shinfo(skb)->gso_type & SKB_GSO_SCTP;
42364236 }
42374237
4238+static inline bool skb_is_gso_tcp(const struct sk_buff *skb)
4239+{
4240+ return skb_is_gso(skb) &&
4241+ skb_shinfo(skb)->gso_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6);
4242+}
4243+
42384244 static inline void skb_gso_reset(struct sk_buff *skb)
42394245 {
42404246 skb_shinfo(skb)->gso_size = 0;
include/linux/virtio_net.h+9−0
@@ -57,6 +57,15 @@ static inline int virtio_net_hdr_to_skb(struct sk_buff *skb, · 56 unmodified lines
5757
5858 if (!skb_partial_csum_set(skb, start, off))
5959 return -EINVAL;
60+ } else {
61+ /* gso packets without NEEDS_CSUM do not set transport_offset.
62+ * probe and drop if does not match one of the above types.
63+ */
64+ if (gso_type) {
65+ skb_probe_transport_header(skb, -1);
66+ if (!skb_transport_header_was_set(skb))
67+ return -EINVAL;
68+ }
6069 }
6170
6271 if (hdr->gso_type != VIRTIO_NET_HDR_GSO_NONE) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t