aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/bcma/bcma.h3
-rw-r--r--include/linux/bcma/bcma_driver_chipcommon.h42
-rw-r--r--include/linux/bitmap.h10
-rw-r--r--include/linux/bpf.h32
-rw-r--r--include/linux/ethtool.h102
-rw-r--r--include/linux/ieee80211.h26
-rw-r--r--include/linux/if_bridge.h4
-rw-r--r--include/linux/if_team.h1
-rw-r--r--include/linux/igmp.h5
-rw-r--r--include/linux/inet_lro.h142
-rw-r--r--include/linux/ipv6.h3
-rw-r--r--include/linux/kernel.h2
-rw-r--r--include/linux/mbus.h3
-rw-r--r--include/linux/mlx4/driver.h3
-rw-r--r--include/linux/mlx5/device.h17
-rw-r--r--include/linux/mlx5/driver.h40
-rw-r--r--include/linux/mlx5/mlx5_ifc.h109
-rw-r--r--include/linux/mlx5/port.h87
-rw-r--r--include/linux/net.h1
-rw-r--r--include/linux/netdev_features.h3
-rw-r--r--include/linux/netdevice.h101
-rw-r--r--include/linux/netfilter.h29
-rw-r--r--include/linux/netfilter/nfnetlink.h2
-rw-r--r--include/linux/netfilter/x_tables.h6
-rw-r--r--include/linux/netfilter_arp/arp_tables.h9
-rw-r--r--include/linux/netfilter_ipv4/ip_tables.h9
-rw-r--r--include/linux/netfilter_ipv6/ip6_tables.h9
-rw-r--r--include/linux/netlink.h10
-rw-r--r--include/linux/perf_event.h13
-rw-r--r--include/linux/phy.h3
-rw-r--r--include/linux/phy_fixed.h5
-rw-r--r--include/linux/platform_data/brcmfmac-sdio.h135
-rw-r--r--include/linux/platform_data/brcmfmac.h185
-rw-r--r--include/linux/platform_data/microread.h35
-rw-r--r--include/linux/qed/common_hsi.h36
-rw-r--r--include/linux/qed/eth_common.h171
-rw-r--r--include/linux/qed/qed_chain.h4
-rw-r--r--include/linux/qed/qed_eth_if.h14
-rw-r--r--include/linux/qed/qed_if.h14
-rw-r--r--include/linux/rculist.h21
-rw-r--r--include/linux/rfkill-gpio.h37
-rw-r--r--include/linux/rfkill.h18
-rw-r--r--include/linux/skbuff.h69
-rw-r--r--include/linux/socket.h7
-rw-r--r--include/linux/stmmac.h17
-rw-r--r--include/linux/tcp.h14
46 files changed, 1077 insertions, 531 deletions
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h
index 3feb1b2d75d8..0367c63f5960 100644
--- a/include/linux/bcma/bcma.h
+++ b/include/linux/bcma/bcma.h
@@ -151,6 +151,8 @@ struct bcma_host_ops {
151#define BCMA_CORE_PCIE2 0x83C /* PCI Express Gen2 */ 151#define BCMA_CORE_PCIE2 0x83C /* PCI Express Gen2 */
152#define BCMA_CORE_USB30_DEV 0x83D 152#define BCMA_CORE_USB30_DEV 0x83D
153#define BCMA_CORE_ARM_CR4 0x83E 153#define BCMA_CORE_ARM_CR4 0x83E
154#define BCMA_CORE_GCI 0x840
155#define BCMA_CORE_CMEM 0x846 /* CNDS DDR2/3 memory controller */
154#define BCMA_CORE_ARM_CA7 0x847 156#define BCMA_CORE_ARM_CA7 0x847
155#define BCMA_CORE_SYS_MEM 0x849 157#define BCMA_CORE_SYS_MEM 0x849
156#define BCMA_CORE_DEFAULT 0xFFF 158#define BCMA_CORE_DEFAULT 0xFFF
@@ -199,6 +201,7 @@ struct bcma_host_ops {
199#define BCMA_PKG_ID_BCM4707 1 201#define BCMA_PKG_ID_BCM4707 1
200#define BCMA_PKG_ID_BCM4708 2 202#define BCMA_PKG_ID_BCM4708 2
201#define BCMA_PKG_ID_BCM4709 0 203#define BCMA_PKG_ID_BCM4709 0
204#define BCMA_CHIP_ID_BCM47094 53030
202#define BCMA_CHIP_ID_BCM53018 53018 205#define BCMA_CHIP_ID_BCM53018 53018
203 206
204/* Board types (on PCI usually equals to the subsystem dev id) */ 207/* Board types (on PCI usually equals to the subsystem dev id) */
diff --git a/include/linux/bcma/bcma_driver_chipcommon.h b/include/linux/bcma/bcma_driver_chipcommon.h
index db51a6ffb7d6..846513c73606 100644
--- a/include/linux/bcma/bcma_driver_chipcommon.h
+++ b/include/linux/bcma/bcma_driver_chipcommon.h
@@ -217,6 +217,11 @@
217#define BCMA_CC_CLKDIV_JTAG_SHIFT 8 217#define BCMA_CC_CLKDIV_JTAG_SHIFT 8
218#define BCMA_CC_CLKDIV_UART 0x000000FF 218#define BCMA_CC_CLKDIV_UART 0x000000FF
219#define BCMA_CC_CAP_EXT 0x00AC /* Capabilities */ 219#define BCMA_CC_CAP_EXT 0x00AC /* Capabilities */
220#define BCMA_CC_CAP_EXT_SECI_PRESENT 0x00000001
221#define BCMA_CC_CAP_EXT_GSIO_PRESENT 0x00000002
222#define BCMA_CC_CAP_EXT_GCI_PRESENT 0x00000004
223#define BCMA_CC_CAP_EXT_SECI_PUART_PRESENT 0x00000008 /* UART present */
224#define BCMA_CC_CAP_EXT_AOB_PRESENT 0x00000040
220#define BCMA_CC_PLLONDELAY 0x00B0 /* Rev >= 4 only */ 225#define BCMA_CC_PLLONDELAY 0x00B0 /* Rev >= 4 only */
221#define BCMA_CC_FREFSELDELAY 0x00B4 /* Rev >= 4 only */ 226#define BCMA_CC_FREFSELDELAY 0x00B4 /* Rev >= 4 only */
222#define BCMA_CC_SLOWCLKCTL 0x00B8 /* 6 <= Rev <= 9 only */ 227#define BCMA_CC_SLOWCLKCTL 0x00B8 /* 6 <= Rev <= 9 only */
@@ -351,12 +356,12 @@
351#define BCMA_CC_PMU_RES_REQTS 0x0640 /* PMU res req timer sel */ 356#define BCMA_CC_PMU_RES_REQTS 0x0640 /* PMU res req timer sel */
352#define BCMA_CC_PMU_RES_REQT 0x0644 /* PMU res req timer */ 357#define BCMA_CC_PMU_RES_REQT 0x0644 /* PMU res req timer */
353#define BCMA_CC_PMU_RES_REQM 0x0648 /* PMU res req mask */ 358#define BCMA_CC_PMU_RES_REQM 0x0648 /* PMU res req mask */
354#define BCMA_CC_CHIPCTL_ADDR 0x0650 359#define BCMA_CC_PMU_CHIPCTL_ADDR 0x0650
355#define BCMA_CC_CHIPCTL_DATA 0x0654 360#define BCMA_CC_PMU_CHIPCTL_DATA 0x0654
356#define BCMA_CC_REGCTL_ADDR 0x0658 361#define BCMA_CC_PMU_REGCTL_ADDR 0x0658
357#define BCMA_CC_REGCTL_DATA 0x065C 362#define BCMA_CC_PMU_REGCTL_DATA 0x065C
358#define BCMA_CC_PLLCTL_ADDR 0x0660 363#define BCMA_CC_PMU_PLLCTL_ADDR 0x0660
359#define BCMA_CC_PLLCTL_DATA 0x0664 364#define BCMA_CC_PMU_PLLCTL_DATA 0x0664
360#define BCMA_CC_PMU_STRAPOPT 0x0668 /* (corerev >= 28) */ 365#define BCMA_CC_PMU_STRAPOPT 0x0668 /* (corerev >= 28) */
361#define BCMA_CC_PMU_XTAL_FREQ 0x066C /* (pmurev >= 10) */ 366#define BCMA_CC_PMU_XTAL_FREQ 0x066C /* (pmurev >= 10) */
362#define BCMA_CC_PMU_XTAL_FREQ_ILPCTL_MASK 0x00001FFF 367#define BCMA_CC_PMU_XTAL_FREQ_ILPCTL_MASK 0x00001FFF
@@ -566,17 +571,16 @@
566 * Check availability with ((struct bcma_chipcommon)->capabilities & BCMA_CC_CAP_PMU) 571 * Check availability with ((struct bcma_chipcommon)->capabilities & BCMA_CC_CAP_PMU)
567 */ 572 */
568struct bcma_chipcommon_pmu { 573struct bcma_chipcommon_pmu {
574 struct bcma_device *core; /* Can be separated core or just ChipCommon one */
569 u8 rev; /* PMU revision */ 575 u8 rev; /* PMU revision */
570 u32 crystalfreq; /* The active crystal frequency (in kHz) */ 576 u32 crystalfreq; /* The active crystal frequency (in kHz) */
571}; 577};
572 578
573#ifdef CONFIG_BCMA_DRIVER_MIPS 579#ifdef CONFIG_BCMA_PFLASH
574struct bcma_pflash { 580struct bcma_pflash {
575 bool present; 581 bool present;
576 u8 buswidth;
577 u32 window;
578 u32 window_size;
579}; 582};
583#endif
580 584
581#ifdef CONFIG_BCMA_SFLASH 585#ifdef CONFIG_BCMA_SFLASH
582struct mtd_info; 586struct mtd_info;
@@ -600,6 +604,7 @@ struct bcma_nflash {
600}; 604};
601#endif 605#endif
602 606
607#ifdef CONFIG_BCMA_DRIVER_MIPS
603struct bcma_serial_port { 608struct bcma_serial_port {
604 void *regs; 609 void *regs;
605 unsigned long clockspeed; 610 unsigned long clockspeed;
@@ -619,8 +624,9 @@ struct bcma_drv_cc {
619 /* Fast Powerup Delay constant */ 624 /* Fast Powerup Delay constant */
620 u16 fast_pwrup_delay; 625 u16 fast_pwrup_delay;
621 struct bcma_chipcommon_pmu pmu; 626 struct bcma_chipcommon_pmu pmu;
622#ifdef CONFIG_BCMA_DRIVER_MIPS 627#ifdef CONFIG_BCMA_PFLASH
623 struct bcma_pflash pflash; 628 struct bcma_pflash pflash;
629#endif
624#ifdef CONFIG_BCMA_SFLASH 630#ifdef CONFIG_BCMA_SFLASH
625 struct bcma_sflash sflash; 631 struct bcma_sflash sflash;
626#endif 632#endif
@@ -628,6 +634,7 @@ struct bcma_drv_cc {
628 struct bcma_nflash nflash; 634 struct bcma_nflash nflash;
629#endif 635#endif
630 636
637#ifdef CONFIG_BCMA_DRIVER_MIPS
631 int nr_serial_ports; 638 int nr_serial_ports;
632 struct bcma_serial_port serial_ports[4]; 639 struct bcma_serial_port serial_ports[4];
633#endif /* CONFIG_BCMA_DRIVER_MIPS */ 640#endif /* CONFIG_BCMA_DRIVER_MIPS */
@@ -660,6 +667,19 @@ struct bcma_drv_cc_b {
660#define bcma_cc_maskset32(cc, offset, mask, set) \ 667#define bcma_cc_maskset32(cc, offset, mask, set) \
661 bcma_cc_write32(cc, offset, (bcma_cc_read32(cc, offset) & (mask)) | (set)) 668 bcma_cc_write32(cc, offset, (bcma_cc_read32(cc, offset) & (mask)) | (set))
662 669
670/* PMU registers access */
671#define bcma_pmu_read32(cc, offset) \
672 bcma_read32((cc)->pmu.core, offset)
673#define bcma_pmu_write32(cc, offset, val) \
674 bcma_write32((cc)->pmu.core, offset, val)
675
676#define bcma_pmu_mask32(cc, offset, mask) \
677 bcma_pmu_write32(cc, offset, bcma_pmu_read32(cc, offset) & (mask))
678#define bcma_pmu_set32(cc, offset, set) \
679 bcma_pmu_write32(cc, offset, bcma_pmu_read32(cc, offset) | (set))
680#define bcma_pmu_maskset32(cc, offset, mask, set) \
681 bcma_pmu_write32(cc, offset, (bcma_pmu_read32(cc, offset) & (mask)) | (set))
682
663extern u32 bcma_chipco_watchdog_timer_set(struct bcma_drv_cc *cc, u32 ticks); 683extern u32 bcma_chipco_watchdog_timer_set(struct bcma_drv_cc *cc, u32 ticks);
664 684
665extern u32 bcma_chipco_get_alp_clock(struct bcma_drv_cc *cc); 685extern u32 bcma_chipco_get_alp_clock(struct bcma_drv_cc *cc);
diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h
index 9653fdb76a42..e9b0b9ab07e5 100644
--- a/include/linux/bitmap.h
+++ b/include/linux/bitmap.h
@@ -59,6 +59,8 @@
59 * bitmap_find_free_region(bitmap, bits, order) Find and allocate bit region 59 * bitmap_find_free_region(bitmap, bits, order) Find and allocate bit region
60 * bitmap_release_region(bitmap, pos, order) Free specified bit region 60 * bitmap_release_region(bitmap, pos, order) Free specified bit region
61 * bitmap_allocate_region(bitmap, pos, order) Allocate specified bit region 61 * bitmap_allocate_region(bitmap, pos, order) Allocate specified bit region
62 * bitmap_from_u32array(dst, nbits, buf, nwords) *dst = *buf (nwords 32b words)
63 * bitmap_to_u32array(buf, nwords, src, nbits) *buf = *dst (nwords 32b words)
62 */ 64 */
63 65
64/* 66/*
@@ -163,6 +165,14 @@ extern void bitmap_fold(unsigned long *dst, const unsigned long *orig,
163extern int bitmap_find_free_region(unsigned long *bitmap, unsigned int bits, int order); 165extern int bitmap_find_free_region(unsigned long *bitmap, unsigned int bits, int order);
164extern void bitmap_release_region(unsigned long *bitmap, unsigned int pos, int order); 166extern void bitmap_release_region(unsigned long *bitmap, unsigned int pos, int order);
165extern int bitmap_allocate_region(unsigned long *bitmap, unsigned int pos, int order); 167extern int bitmap_allocate_region(unsigned long *bitmap, unsigned int pos, int order);
168extern unsigned int bitmap_from_u32array(unsigned long *bitmap,
169 unsigned int nbits,
170 const u32 *buf,
171 unsigned int nwords);
172extern unsigned int bitmap_to_u32array(u32 *buf,
173 unsigned int nwords,
174 const unsigned long *bitmap,
175 unsigned int nbits);
166#ifdef __BIG_ENDIAN 176#ifdef __BIG_ENDIAN
167extern void bitmap_copy_le(unsigned long *dst, const unsigned long *src, unsigned int nbits); 177extern void bitmap_copy_le(unsigned long *dst, const unsigned long *src, unsigned int nbits);
168#else 178#else
diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index 83d1926c61e4..21ee41b92e8a 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -10,6 +10,7 @@
10#include <uapi/linux/bpf.h> 10#include <uapi/linux/bpf.h>
11#include <linux/workqueue.h> 11#include <linux/workqueue.h>
12#include <linux/file.h> 12#include <linux/file.h>
13#include <linux/percpu.h>
13 14
14struct bpf_map; 15struct bpf_map;
15 16
@@ -36,6 +37,7 @@ struct bpf_map {
36 u32 key_size; 37 u32 key_size;
37 u32 value_size; 38 u32 value_size;
38 u32 max_entries; 39 u32 max_entries;
40 u32 map_flags;
39 u32 pages; 41 u32 pages;
40 struct user_struct *user; 42 struct user_struct *user;
41 const struct bpf_map_ops *ops; 43 const struct bpf_map_ops *ops;
@@ -65,6 +67,7 @@ enum bpf_arg_type {
65 */ 67 */
66 ARG_PTR_TO_STACK, /* any pointer to eBPF program stack */ 68 ARG_PTR_TO_STACK, /* any pointer to eBPF program stack */
67 ARG_CONST_STACK_SIZE, /* number of bytes accessed from stack */ 69 ARG_CONST_STACK_SIZE, /* number of bytes accessed from stack */
70 ARG_CONST_STACK_SIZE_OR_ZERO, /* number of bytes accessed from stack or 0 */
68 71
69 ARG_PTR_TO_CTX, /* pointer to context */ 72 ARG_PTR_TO_CTX, /* pointer to context */
70 ARG_ANYTHING, /* any (initialized) argument is ok */ 73 ARG_ANYTHING, /* any (initialized) argument is ok */
@@ -151,6 +154,7 @@ struct bpf_array {
151 union { 154 union {
152 char value[0] __aligned(8); 155 char value[0] __aligned(8);
153 void *ptrs[0] __aligned(8); 156 void *ptrs[0] __aligned(8);
157 void __percpu *pptrs[0] __aligned(8);
154 }; 158 };
155}; 159};
156#define MAX_TAIL_CALL_CNT 32 160#define MAX_TAIL_CALL_CNT 32
@@ -161,6 +165,8 @@ bool bpf_prog_array_compatible(struct bpf_array *array, const struct bpf_prog *f
161const struct bpf_func_proto *bpf_get_trace_printk_proto(void); 165const struct bpf_func_proto *bpf_get_trace_printk_proto(void);
162 166
163#ifdef CONFIG_BPF_SYSCALL 167#ifdef CONFIG_BPF_SYSCALL
168DECLARE_PER_CPU(int, bpf_prog_active);
169
164void bpf_register_prog_type(struct bpf_prog_type_list *tl); 170void bpf_register_prog_type(struct bpf_prog_type_list *tl);
165void bpf_register_map_type(struct bpf_map_type_list *tl); 171void bpf_register_map_type(struct bpf_map_type_list *tl);
166 172
@@ -173,6 +179,7 @@ struct bpf_map *__bpf_map_get(struct fd f);
173void bpf_map_inc(struct bpf_map *map, bool uref); 179void bpf_map_inc(struct bpf_map *map, bool uref);
174void bpf_map_put_with_uref(struct bpf_map *map); 180void bpf_map_put_with_uref(struct bpf_map *map);
175void bpf_map_put(struct bpf_map *map); 181void bpf_map_put(struct bpf_map *map);
182int bpf_map_precharge_memlock(u32 pages);
176 183
177extern int sysctl_unprivileged_bpf_disabled; 184extern int sysctl_unprivileged_bpf_disabled;
178 185
@@ -182,6 +189,30 @@ int bpf_prog_new_fd(struct bpf_prog *prog);
182int bpf_obj_pin_user(u32 ufd, const char __user *pathname); 189int bpf_obj_pin_user(u32 ufd, const char __user *pathname);
183int bpf_obj_get_user(const char __user *pathname); 190int bpf_obj_get_user(const char __user *pathname);
184 191
192int bpf_percpu_hash_copy(struct bpf_map *map, void *key, void *value);
193int bpf_percpu_array_copy(struct bpf_map *map, void *key, void *value);
194int bpf_percpu_hash_update(struct bpf_map *map, void *key, void *value,
195 u64 flags);
196int bpf_percpu_array_update(struct bpf_map *map, void *key, void *value,
197 u64 flags);
198int bpf_stackmap_copy(struct bpf_map *map, void *key, void *value);
199
200/* memcpy that is used with 8-byte aligned pointers, power-of-8 size and
201 * forced to use 'long' read/writes to try to atomically copy long counters.
202 * Best-effort only. No barriers here, since it _will_ race with concurrent
203 * updates from BPF programs. Called from bpf syscall and mostly used with
204 * size 8 or 16 bytes, so ask compiler to inline it.
205 */
206static inline void bpf_long_memcpy(void *dst, const void *src, u32 size)
207{
208 const long *lsrc = src;
209 long *ldst = dst;
210
211 size /= sizeof(long);
212 while (size--)
213 *ldst++ = *lsrc++;
214}
215
185/* verify correctness of eBPF program */ 216/* verify correctness of eBPF program */
186int bpf_check(struct bpf_prog **fp, union bpf_attr *attr); 217int bpf_check(struct bpf_prog **fp, union bpf_attr *attr);
187#else 218#else
@@ -213,6 +244,7 @@ extern const struct bpf_func_proto bpf_get_current_uid_gid_proto;
213extern const struct bpf_func_proto bpf_get_current_comm_proto; 244extern const struct bpf_func_proto bpf_get_current_comm_proto;
214extern const struct bpf_func_proto bpf_skb_vlan_push_proto; 245extern const struct bpf_func_proto bpf_skb_vlan_push_proto;
215extern const struct bpf_func_proto bpf_skb_vlan_pop_proto; 246extern const struct bpf_func_proto bpf_skb_vlan_pop_proto;
247extern const struct bpf_func_proto bpf_get_stackid_proto;
216 248
217/* Shared helpers among cBPF and eBPF. */ 249/* Shared helpers among cBPF and eBPF. */
218void bpf_user_rnd_init_once(void); 250void bpf_user_rnd_init_once(void);
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index 653dc9c4ebac..e2b7bf27c03e 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -12,6 +12,7 @@
12#ifndef _LINUX_ETHTOOL_H 12#ifndef _LINUX_ETHTOOL_H
13#define _LINUX_ETHTOOL_H 13#define _LINUX_ETHTOOL_H
14 14
15#include <linux/bitmap.h>
15#include <linux/compat.h> 16#include <linux/compat.h>
16#include <uapi/linux/ethtool.h> 17#include <uapi/linux/ethtool.h>
17 18
@@ -40,9 +41,6 @@ struct compat_ethtool_rxnfc {
40 41
41#include <linux/rculist.h> 42#include <linux/rculist.h>
42 43
43extern int __ethtool_get_settings(struct net_device *dev,
44 struct ethtool_cmd *cmd);
45
46/** 44/**
47 * enum ethtool_phys_id_state - indicator state for physical identification 45 * enum ethtool_phys_id_state - indicator state for physical identification
48 * @ETHTOOL_ID_INACTIVE: Physical ID indicator should be deactivated 46 * @ETHTOOL_ID_INACTIVE: Physical ID indicator should be deactivated
@@ -97,13 +95,70 @@ static inline u32 ethtool_rxfh_indir_default(u32 index, u32 n_rx_rings)
97 return index % n_rx_rings; 95 return index % n_rx_rings;
98} 96}
99 97
98/* number of link mode bits/ulongs handled internally by kernel */
99#define __ETHTOOL_LINK_MODE_MASK_NBITS \
100 (__ETHTOOL_LINK_MODE_LAST + 1)
101
102/* declare a link mode bitmap */
103#define __ETHTOOL_DECLARE_LINK_MODE_MASK(name) \
104 DECLARE_BITMAP(name, __ETHTOOL_LINK_MODE_MASK_NBITS)
105
106/* drivers must ignore base.cmd and base.link_mode_masks_nwords
107 * fields, but they are allowed to overwrite them (will be ignored).
108 */
109struct ethtool_link_ksettings {
110 struct ethtool_link_settings base;
111 struct {
112 __ETHTOOL_DECLARE_LINK_MODE_MASK(supported);
113 __ETHTOOL_DECLARE_LINK_MODE_MASK(advertising);
114 __ETHTOOL_DECLARE_LINK_MODE_MASK(lp_advertising);
115 } link_modes;
116};
117
118/**
119 * ethtool_link_ksettings_zero_link_mode - clear link_ksettings link mode mask
120 * @ptr : pointer to struct ethtool_link_ksettings
121 * @name : one of supported/advertising/lp_advertising
122 */
123#define ethtool_link_ksettings_zero_link_mode(ptr, name) \
124 bitmap_zero((ptr)->link_modes.name, __ETHTOOL_LINK_MODE_MASK_NBITS)
125
126/**
127 * ethtool_link_ksettings_add_link_mode - set bit in link_ksettings
128 * link mode mask
129 * @ptr : pointer to struct ethtool_link_ksettings
130 * @name : one of supported/advertising/lp_advertising
131 * @mode : one of the ETHTOOL_LINK_MODE_*_BIT
132 * (not atomic, no bound checking)
133 */
134#define ethtool_link_ksettings_add_link_mode(ptr, name, mode) \
135 __set_bit(ETHTOOL_LINK_MODE_ ## mode ## _BIT, (ptr)->link_modes.name)
136
137/**
138 * ethtool_link_ksettings_test_link_mode - test bit in ksettings link mode mask
139 * @ptr : pointer to struct ethtool_link_ksettings
140 * @name : one of supported/advertising/lp_advertising
141 * @mode : one of the ETHTOOL_LINK_MODE_*_BIT
142 * (not atomic, no bound checking)
143 *
144 * Returns true/false.
145 */
146#define ethtool_link_ksettings_test_link_mode(ptr, name, mode) \
147 test_bit(ETHTOOL_LINK_MODE_ ## mode ## _BIT, (ptr)->link_modes.name)
148
149extern int
150__ethtool_get_link_ksettings(struct net_device *dev,
151 struct ethtool_link_ksettings *link_ksettings);
152
100/** 153/**
101 * struct ethtool_ops - optional netdev operations 154 * struct ethtool_ops - optional netdev operations
102 * @get_settings: Get various device settings including Ethernet link 155 * @get_settings: DEPRECATED, use %get_link_ksettings/%set_link_ksettings
156 * API. Get various device settings including Ethernet link
103 * settings. The @cmd parameter is expected to have been cleared 157 * settings. The @cmd parameter is expected to have been cleared
104 * before get_settings is called. Returns a negative error code or 158 * before get_settings is called. Returns a negative error code
105 * zero. 159 * or zero.
106 * @set_settings: Set various device settings including Ethernet link 160 * @set_settings: DEPRECATED, use %get_link_ksettings/%set_link_ksettings
161 * API. Set various device settings including Ethernet link
107 * settings. Returns a negative error code or zero. 162 * settings. Returns a negative error code or zero.
108 * @get_drvinfo: Report driver/device information. Should only set the 163 * @get_drvinfo: Report driver/device information. Should only set the
109 * @driver, @version, @fw_version and @bus_info fields. If not 164 * @driver, @version, @fw_version and @bus_info fields. If not
@@ -201,6 +256,29 @@ static inline u32 ethtool_rxfh_indir_default(u32 index, u32 n_rx_rings)
201 * @get_module_eeprom: Get the eeprom information from the plug-in module 256 * @get_module_eeprom: Get the eeprom information from the plug-in module
202 * @get_eee: Get Energy-Efficient (EEE) supported and status. 257 * @get_eee: Get Energy-Efficient (EEE) supported and status.
203 * @set_eee: Set EEE status (enable/disable) as well as LPI timers. 258 * @set_eee: Set EEE status (enable/disable) as well as LPI timers.
259 * @get_per_queue_coalesce: Get interrupt coalescing parameters per queue.
260 * It must check that the given queue number is valid. If neither a RX nor
261 * a TX queue has this number, return -EINVAL. If only a RX queue or a TX
262 * queue has this number, set the inapplicable fields to ~0 and return 0.
263 * Returns a negative error code or zero.
264 * @set_per_queue_coalesce: Set interrupt coalescing parameters per queue.
265 * It must check that the given queue number is valid. If neither a RX nor
266 * a TX queue has this number, return -EINVAL. If only a RX queue or a TX
267 * queue has this number, ignore the inapplicable fields.
268 * Returns a negative error code or zero.
269 * @get_link_ksettings: When defined, takes precedence over the
270 * %get_settings method. Get various device settings
271 * including Ethernet link settings. The %cmd and
272 * %link_mode_masks_nwords fields should be ignored (use
273 * %__ETHTOOL_LINK_MODE_MASK_NBITS instead of the latter), any
274 * change to them will be overwritten by kernel. Returns a
275 * negative error code or zero.
276 * @set_link_ksettings: When defined, takes precedence over the
277 * %set_settings method. Set various device settings including
278 * Ethernet link settings. The %cmd and %link_mode_masks_nwords
279 * fields should be ignored (use %__ETHTOOL_LINK_MODE_MASK_NBITS
280 * instead of the latter), any change to them will be overwritten
281 * by kernel. Returns a negative error code or zero.
204 * 282 *
205 * All operations are optional (i.e. the function pointer may be set 283 * All operations are optional (i.e. the function pointer may be set
206 * to %NULL) and callers must take this into account. Callers must 284 * to %NULL) and callers must take this into account. Callers must
@@ -279,7 +357,13 @@ struct ethtool_ops {
279 const struct ethtool_tunable *, void *); 357 const struct ethtool_tunable *, void *);
280 int (*set_tunable)(struct net_device *, 358 int (*set_tunable)(struct net_device *,
281 const struct ethtool_tunable *, const void *); 359 const struct ethtool_tunable *, const void *);
282 360 int (*get_per_queue_coalesce)(struct net_device *, u32,
283 361 struct ethtool_coalesce *);
362 int (*set_per_queue_coalesce)(struct net_device *, u32,
363 struct ethtool_coalesce *);
364 int (*get_link_ksettings)(struct net_device *,
365 struct ethtool_link_ksettings *);
366 int (*set_link_ksettings)(struct net_device *,
367 const struct ethtool_link_ksettings *);
284}; 368};
285#endif /* _LINUX_ETHTOOL_H */ 369#endif /* _LINUX_ETHTOOL_H */
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 452c0b0d2f32..3b1f6cef9513 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -163,6 +163,14 @@ static inline u16 ieee80211_sn_sub(u16 sn1, u16 sn2)
163/* 30 byte 4 addr hdr, 2 byte QoS, 2304 byte MSDU, 12 byte crypt, 4 byte FCS */ 163/* 30 byte 4 addr hdr, 2 byte QoS, 2304 byte MSDU, 12 byte crypt, 4 byte FCS */
164#define IEEE80211_MAX_FRAME_LEN 2352 164#define IEEE80211_MAX_FRAME_LEN 2352
165 165
166/* Maximal size of an A-MSDU */
167#define IEEE80211_MAX_MPDU_LEN_HT_3839 3839
168#define IEEE80211_MAX_MPDU_LEN_HT_7935 7935
169
170#define IEEE80211_MAX_MPDU_LEN_VHT_3895 3895
171#define IEEE80211_MAX_MPDU_LEN_VHT_7991 7991
172#define IEEE80211_MAX_MPDU_LEN_VHT_11454 11454
173
166#define IEEE80211_MAX_SSID_LEN 32 174#define IEEE80211_MAX_SSID_LEN 32
167 175
168#define IEEE80211_MAX_MESH_ID_LEN 32 176#define IEEE80211_MAX_MESH_ID_LEN 32
@@ -843,6 +851,8 @@ enum ieee80211_vht_opmode_bits {
843}; 851};
844 852
845#define WLAN_SA_QUERY_TR_ID_LEN 2 853#define WLAN_SA_QUERY_TR_ID_LEN 2
854#define WLAN_MEMBERSHIP_LEN 8
855#define WLAN_USER_POSITION_LEN 16
846 856
847/** 857/**
848 * struct ieee80211_tpc_report_ie 858 * struct ieee80211_tpc_report_ie
@@ -991,6 +1001,11 @@ struct ieee80211_mgmt {
991 } __packed vht_opmode_notif; 1001 } __packed vht_opmode_notif;
992 struct { 1002 struct {
993 u8 action_code; 1003 u8 action_code;
1004 u8 membership[WLAN_MEMBERSHIP_LEN];
1005 u8 position[WLAN_USER_POSITION_LEN];
1006 } __packed vht_group_notif;
1007 struct {
1008 u8 action_code;
994 u8 dialog_token; 1009 u8 dialog_token;
995 u8 tpc_elem_id; 1010 u8 tpc_elem_id;
996 u8 tpc_elem_length; 1011 u8 tpc_elem_length;
@@ -1498,6 +1513,7 @@ struct ieee80211_vht_operation {
1498#define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_3895 0x00000000 1513#define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_3895 0x00000000
1499#define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_7991 0x00000001 1514#define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_7991 0x00000001
1500#define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454 0x00000002 1515#define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454 0x00000002
1516#define IEEE80211_VHT_CAP_MAX_MPDU_MASK 0x00000003
1501#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ 0x00000004 1517#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ 0x00000004
1502#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ 0x00000008 1518#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ 0x00000008
1503#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK 0x0000000C 1519#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK 0x0000000C
@@ -2079,6 +2095,16 @@ enum ieee80211_tdls_actioncode {
2079#define WLAN_EXT_CAPA8_TDLS_WIDE_BW_ENABLED BIT(5) 2095#define WLAN_EXT_CAPA8_TDLS_WIDE_BW_ENABLED BIT(5)
2080#define WLAN_EXT_CAPA8_OPMODE_NOTIF BIT(6) 2096#define WLAN_EXT_CAPA8_OPMODE_NOTIF BIT(6)
2081 2097
2098/* Defines the maximal number of MSDUs in an A-MSDU. */
2099#define WLAN_EXT_CAPA8_MAX_MSDU_IN_AMSDU_LSB BIT(7)
2100#define WLAN_EXT_CAPA9_MAX_MSDU_IN_AMSDU_MSB BIT(0)
2101
2102/*
2103 * Fine Timing Measurement Initiator - bit 71 of @WLAN_EID_EXT_CAPABILITY
2104 * information element
2105 */
2106#define WLAN_EXT_CAPA9_FTM_INITIATOR BIT(7)
2107
2082/* TDLS specific payload type in the LLC/SNAP header */ 2108/* TDLS specific payload type in the LLC/SNAP header */
2083#define WLAN_TDLS_SNAP_RFTYPE 0x2 2109#define WLAN_TDLS_SNAP_RFTYPE 0x2
2084 2110
diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h
index a338a688ee4a..dcb89e3515db 100644
--- a/include/linux/if_bridge.h
+++ b/include/linux/if_bridge.h
@@ -46,10 +46,6 @@ struct br_ip_list {
46#define BR_LEARNING_SYNC BIT(9) 46#define BR_LEARNING_SYNC BIT(9)
47#define BR_PROXYARP_WIFI BIT(10) 47#define BR_PROXYARP_WIFI BIT(10)
48 48
49/* values as per ieee8021QBridgeFdbAgingTime */
50#define BR_MIN_AGEING_TIME (10 * HZ)
51#define BR_MAX_AGEING_TIME (1000000 * HZ)
52
53#define BR_DEFAULT_AGEING_TIME (300 * HZ) 49#define BR_DEFAULT_AGEING_TIME (300 * HZ)
54 50
55extern void brioctl_set(int (*ioctl_hook)(struct net *, unsigned int, void __user *)); 51extern void brioctl_set(int (*ioctl_hook)(struct net *, unsigned int, void __user *));
diff --git a/include/linux/if_team.h b/include/linux/if_team.h
index b84e49c3a738..174f43f43aff 100644
--- a/include/linux/if_team.h
+++ b/include/linux/if_team.h
@@ -24,6 +24,7 @@ struct team_pcpu_stats {
24 struct u64_stats_sync syncp; 24 struct u64_stats_sync syncp;
25 u32 rx_dropped; 25 u32 rx_dropped;
26 u32 tx_dropped; 26 u32 tx_dropped;
27 u32 rx_nohandler;
27}; 28};
28 29
29struct team; 30struct team;
diff --git a/include/linux/igmp.h b/include/linux/igmp.h
index 9c9de11549a7..12f6fba6d21a 100644
--- a/include/linux/igmp.h
+++ b/include/linux/igmp.h
@@ -37,11 +37,6 @@ static inline struct igmpv3_query *
37 return (struct igmpv3_query *)skb_transport_header(skb); 37 return (struct igmpv3_query *)skb_transport_header(skb);
38} 38}
39 39
40extern int sysctl_igmp_llm_reports;
41extern int sysctl_igmp_max_memberships;
42extern int sysctl_igmp_max_msf;
43extern int sysctl_igmp_qrv;
44
45struct ip_sf_socklist { 40struct ip_sf_socklist {
46 unsigned int sl_max; 41 unsigned int sl_max;
47 unsigned int sl_count; 42 unsigned int sl_count;
diff --git a/include/linux/inet_lro.h b/include/linux/inet_lro.h
deleted file mode 100644
index 9a715cfa1fe3..000000000000
--- a/include/linux/inet_lro.h
+++ /dev/null
@@ -1,142 +0,0 @@
1/*
2 * linux/include/linux/inet_lro.h
3 *
4 * Large Receive Offload (ipv4 / tcp)
5 *
6 * (C) Copyright IBM Corp. 2007
7 *
8 * Authors:
9 * Jan-Bernd Themann <themann@de.ibm.com>
10 * Christoph Raisch <raisch@de.ibm.com>
11 *
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2, or (at your option)
16 * any later version.
17 *
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 */
27
28#ifndef __INET_LRO_H_
29#define __INET_LRO_H_
30
31#include <net/ip.h>
32#include <net/tcp.h>
33
34/*
35 * LRO statistics
36 */
37
38struct net_lro_stats {
39 unsigned long aggregated;
40 unsigned long flushed;
41 unsigned long no_desc;
42};
43
44/*
45 * LRO descriptor for a tcp session
46 */
47struct net_lro_desc {
48 struct sk_buff *parent;
49 struct sk_buff *last_skb;
50 struct skb_frag_struct *next_frag;
51 struct iphdr *iph;
52 struct tcphdr *tcph;
53 __wsum data_csum;
54 __be32 tcp_rcv_tsecr;
55 __be32 tcp_rcv_tsval;
56 __be32 tcp_ack;
57 u32 tcp_next_seq;
58 u32 skb_tot_frags_len;
59 u16 ip_tot_len;
60 u16 tcp_saw_tstamp; /* timestamps enabled */
61 __be16 tcp_window;
62 int pkt_aggr_cnt; /* counts aggregated packets */
63 int vlan_packet;
64 int mss;
65 int active;
66};
67
68/*
69 * Large Receive Offload (LRO) Manager
70 *
71 * Fields must be set by driver
72 */
73
74struct net_lro_mgr {
75 struct net_device *dev;
76 struct net_lro_stats stats;
77
78 /* LRO features */
79 unsigned long features;
80#define LRO_F_NAPI 1 /* Pass packets to stack via NAPI */
81#define LRO_F_EXTRACT_VLAN_ID 2 /* Set flag if VLAN IDs are extracted
82 from received packets and eth protocol
83 is still ETH_P_8021Q */
84
85 /*
86 * Set for generated SKBs that are not added to
87 * the frag list in fragmented mode
88 */
89 u32 ip_summed;
90 u32 ip_summed_aggr; /* Set in aggregated SKBs: CHECKSUM_UNNECESSARY
91 * or CHECKSUM_NONE */
92
93 int max_desc; /* Max number of LRO descriptors */
94 int max_aggr; /* Max number of LRO packets to be aggregated */
95
96 int frag_align_pad; /* Padding required to properly align layer 3
97 * headers in generated skb when using frags */
98
99 struct net_lro_desc *lro_arr; /* Array of LRO descriptors */
100
101 /*
102 * Optimized driver functions
103 *
104 * get_skb_header: returns tcp and ip header for packet in SKB
105 */
106 int (*get_skb_header)(struct sk_buff *skb, void **ip_hdr,
107 void **tcpudp_hdr, u64 *hdr_flags, void *priv);
108
109 /* hdr_flags: */
110#define LRO_IPV4 1 /* ip_hdr is IPv4 header */
111#define LRO_TCP 2 /* tcpudp_hdr is TCP header */
112
113 /*
114 * get_frag_header: returns mac, tcp and ip header for packet in SKB
115 *
116 * @hdr_flags: Indicate what kind of LRO has to be done
117 * (IPv4/IPv6/TCP/UDP)
118 */
119 int (*get_frag_header)(struct skb_frag_struct *frag, void **mac_hdr,
120 void **ip_hdr, void **tcpudp_hdr, u64 *hdr_flags,
121 void *priv);
122};
123
124/*
125 * Processes a SKB
126 *
127 * @lro_mgr: LRO manager to use
128 * @skb: SKB to aggregate
129 * @priv: Private data that may be used by driver functions
130 * (for example get_tcp_ip_hdr)
131 */
132
133void lro_receive_skb(struct net_lro_mgr *lro_mgr,
134 struct sk_buff *skb,
135 void *priv);
136/*
137 * Forward all aggregated SKBs held by lro_mgr to network stack
138 */
139
140void lro_flush_all(struct net_lro_mgr *lro_mgr);
141
142#endif
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index 402753bccafa..7edc14fb66b6 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -50,16 +50,19 @@ struct ipv6_devconf {
50 __s32 mc_forwarding; 50 __s32 mc_forwarding;
51#endif 51#endif
52 __s32 disable_ipv6; 52 __s32 disable_ipv6;
53 __s32 drop_unicast_in_l2_multicast;
53 __s32 accept_dad; 54 __s32 accept_dad;
54 __s32 force_tllao; 55 __s32 force_tllao;
55 __s32 ndisc_notify; 56 __s32 ndisc_notify;
56 __s32 suppress_frag_ndisc; 57 __s32 suppress_frag_ndisc;
57 __s32 accept_ra_mtu; 58 __s32 accept_ra_mtu;
59 __s32 drop_unsolicited_na;
58 struct ipv6_stable_secret { 60 struct ipv6_stable_secret {
59 bool initialized; 61 bool initialized;
60 struct in6_addr secret; 62 struct in6_addr secret;
61 } stable_secret; 63 } stable_secret;
62 __s32 use_oif_addrs_only; 64 __s32 use_oif_addrs_only;
65 __s32 keep_addr_on_down;
63 void *sysctl; 66 void *sysctl;
64}; 67};
65 68
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index f4fa2b29c38c..b82646ee70eb 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -64,7 +64,7 @@
64#define round_down(x, y) ((x) & ~__round_mask(x, y)) 64#define round_down(x, y) ((x) & ~__round_mask(x, y))
65 65
66#define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f)) 66#define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f))
67#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) 67#define DIV_ROUND_UP __KERNEL_DIV_ROUND_UP
68#define DIV_ROUND_UP_ULL(ll,d) \ 68#define DIV_ROUND_UP_ULL(ll,d) \
69 ({ unsigned long long _tmp = (ll)+(d)-1; do_div(_tmp, d); _tmp; }) 69 ({ unsigned long long _tmp = (ll)+(d)-1; do_div(_tmp, d); _tmp; })
70 70
diff --git a/include/linux/mbus.h b/include/linux/mbus.h
index 1f7bc630d225..ea34a867caa0 100644
--- a/include/linux/mbus.h
+++ b/include/linux/mbus.h
@@ -69,6 +69,9 @@ static inline const struct mbus_dram_target_info *mv_mbus_dram_info_nooverlap(vo
69int mvebu_mbus_save_cpu_target(u32 *store_addr); 69int mvebu_mbus_save_cpu_target(u32 *store_addr);
70void mvebu_mbus_get_pcie_mem_aperture(struct resource *res); 70void mvebu_mbus_get_pcie_mem_aperture(struct resource *res);
71void mvebu_mbus_get_pcie_io_aperture(struct resource *res); 71void mvebu_mbus_get_pcie_io_aperture(struct resource *res);
72int mvebu_mbus_get_dram_win_info(phys_addr_t phyaddr, u8 *target, u8 *attr);
73int mvebu_mbus_get_io_win_info(phys_addr_t phyaddr, u32 *size, u8 *target,
74 u8 *attr);
72int mvebu_mbus_add_window_remap_by_id(unsigned int target, 75int mvebu_mbus_add_window_remap_by_id(unsigned int target,
73 unsigned int attribute, 76 unsigned int attribute,
74 phys_addr_t base, size_t size, 77 phys_addr_t base, size_t size,
diff --git a/include/linux/mlx4/driver.h b/include/linux/mlx4/driver.h
index 2e8af001c5da..bd0e7075ea6d 100644
--- a/include/linux/mlx4/driver.h
+++ b/include/linux/mlx4/driver.h
@@ -33,6 +33,7 @@
33#ifndef MLX4_DRIVER_H 33#ifndef MLX4_DRIVER_H
34#define MLX4_DRIVER_H 34#define MLX4_DRIVER_H
35 35
36#include <net/devlink.h>
36#include <linux/mlx4/device.h> 37#include <linux/mlx4/device.h>
37 38
38struct mlx4_dev; 39struct mlx4_dev;
@@ -89,6 +90,8 @@ int mlx4_port_map_set(struct mlx4_dev *dev, struct mlx4_port_map *v2p);
89 90
90void *mlx4_get_protocol_dev(struct mlx4_dev *dev, enum mlx4_protocol proto, int port); 91void *mlx4_get_protocol_dev(struct mlx4_dev *dev, enum mlx4_protocol proto, int port);
91 92
93struct devlink_port *mlx4_get_devlink_port(struct mlx4_dev *dev, int port);
94
92static inline u64 mlx4_mac_to_u64(u8 *addr) 95static inline u64 mlx4_mac_to_u64(u8 *addr)
93{ 96{
94 u64 mac = 0; 97 u64 mac = 0;
diff --git a/include/linux/mlx5/device.h b/include/linux/mlx5/device.h
index 9566b3b3b2c5..02ac3000ee3c 100644
--- a/include/linux/mlx5/device.h
+++ b/include/linux/mlx5/device.h
@@ -374,6 +374,12 @@ enum {
374}; 374};
375 375
376enum { 376enum {
377 MLX5_BW_NO_LIMIT = 0,
378 MLX5_100_MBPS_UNIT = 3,
379 MLX5_GBPS_UNIT = 4,
380};
381
382enum {
377 MLX5_MAX_PAGE_SHIFT = 31 383 MLX5_MAX_PAGE_SHIFT = 31
378}; 384};
379 385
@@ -1200,6 +1206,17 @@ enum {
1200 MLX5_RQC_RQ_TYPE_MEMORY_RQ_RPM = 0x1, 1206 MLX5_RQC_RQ_TYPE_MEMORY_RQ_RPM = 0x1,
1201}; 1207};
1202 1208
1209enum mlx5_wol_mode {
1210 MLX5_WOL_DISABLE = 0,
1211 MLX5_WOL_SECURED_MAGIC = 1 << 1,
1212 MLX5_WOL_MAGIC = 1 << 2,
1213 MLX5_WOL_ARP = 1 << 3,
1214 MLX5_WOL_BROADCAST = 1 << 4,
1215 MLX5_WOL_MULTICAST = 1 << 5,
1216 MLX5_WOL_UNICAST = 1 << 6,
1217 MLX5_WOL_PHY_ACTIVITY = 1 << 7,
1218};
1219
1203/* MLX5 DEV CAPs */ 1220/* MLX5 DEV CAPs */
1204 1221
1205/* TODO: EAT.ME */ 1222/* TODO: EAT.ME */
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h
index 9108904a6a56..3a954465b2bf 100644
--- a/include/linux/mlx5/driver.h
+++ b/include/linux/mlx5/driver.h
@@ -54,7 +54,7 @@ enum {
54 /* one minute for the sake of bringup. Generally, commands must always 54 /* one minute for the sake of bringup. Generally, commands must always
55 * complete and we may need to increase this timeout value 55 * complete and we may need to increase this timeout value
56 */ 56 */
57 MLX5_CMD_TIMEOUT_MSEC = 7200 * 1000, 57 MLX5_CMD_TIMEOUT_MSEC = 60 * 1000,
58 MLX5_CMD_WQ_MAX_NAME = 32, 58 MLX5_CMD_WQ_MAX_NAME = 32,
59}; 59};
60 60
@@ -99,6 +99,8 @@ enum {
99}; 99};
100 100
101enum { 101enum {
102 MLX5_REG_QETCR = 0x4005,
103 MLX5_REG_QTCT = 0x400a,
102 MLX5_REG_PCAP = 0x5001, 104 MLX5_REG_PCAP = 0x5001,
103 MLX5_REG_PMTU = 0x5003, 105 MLX5_REG_PMTU = 0x5003,
104 MLX5_REG_PTYS = 0x5004, 106 MLX5_REG_PTYS = 0x5004,
@@ -458,8 +460,6 @@ struct mlx5_priv {
458 struct mlx5_uuar_info uuari; 460 struct mlx5_uuar_info uuari;
459 MLX5_DECLARE_DOORBELL_LOCK(cq_uar_lock); 461 MLX5_DECLARE_DOORBELL_LOCK(cq_uar_lock);
460 462
461 struct io_mapping *bf_mapping;
462
463 /* pages stuff */ 463 /* pages stuff */
464 struct workqueue_struct *pg_wq; 464 struct workqueue_struct *pg_wq;
465 struct rb_root page_root; 465 struct rb_root page_root;
@@ -717,7 +717,8 @@ int mlx5_cmd_alloc_uar(struct mlx5_core_dev *dev, u32 *uarn);
717int mlx5_cmd_free_uar(struct mlx5_core_dev *dev, u32 uarn); 717int mlx5_cmd_free_uar(struct mlx5_core_dev *dev, u32 uarn);
718int mlx5_alloc_uuars(struct mlx5_core_dev *dev, struct mlx5_uuar_info *uuari); 718int mlx5_alloc_uuars(struct mlx5_core_dev *dev, struct mlx5_uuar_info *uuari);
719int mlx5_free_uuars(struct mlx5_core_dev *dev, struct mlx5_uuar_info *uuari); 719int mlx5_free_uuars(struct mlx5_core_dev *dev, struct mlx5_uuar_info *uuari);
720int mlx5_alloc_map_uar(struct mlx5_core_dev *mdev, struct mlx5_uar *uar); 720int mlx5_alloc_map_uar(struct mlx5_core_dev *mdev, struct mlx5_uar *uar,
721 bool map_wc);
721void mlx5_unmap_free_uar(struct mlx5_core_dev *mdev, struct mlx5_uar *uar); 722void mlx5_unmap_free_uar(struct mlx5_core_dev *mdev, struct mlx5_uar *uar);
722void mlx5_health_cleanup(struct mlx5_core_dev *dev); 723void mlx5_health_cleanup(struct mlx5_core_dev *dev);
723int mlx5_health_init(struct mlx5_core_dev *dev); 724int mlx5_health_init(struct mlx5_core_dev *dev);
@@ -796,37 +797,6 @@ int mlx5_core_access_reg(struct mlx5_core_dev *dev, void *data_in,
796 int size_in, void *data_out, int size_out, 797 int size_in, void *data_out, int size_out,
797 u16 reg_num, int arg, int write); 798 u16 reg_num, int arg, int write);
798 799
799int mlx5_set_port_caps(struct mlx5_core_dev *dev, u8 port_num, u32 caps);
800int mlx5_query_port_ptys(struct mlx5_core_dev *dev, u32 *ptys,
801 int ptys_size, int proto_mask, u8 local_port);
802int mlx5_query_port_proto_cap(struct mlx5_core_dev *dev,
803 u32 *proto_cap, int proto_mask);
804int mlx5_query_port_proto_admin(struct mlx5_core_dev *dev,
805 u32 *proto_admin, int proto_mask);
806int mlx5_query_port_link_width_oper(struct mlx5_core_dev *dev,
807 u8 *link_width_oper, u8 local_port);
808int mlx5_query_port_proto_oper(struct mlx5_core_dev *dev,
809 u8 *proto_oper, int proto_mask,
810 u8 local_port);
811int mlx5_set_port_proto(struct mlx5_core_dev *dev, u32 proto_admin,
812 int proto_mask);
813int mlx5_set_port_admin_status(struct mlx5_core_dev *dev,
814 enum mlx5_port_status status);
815int mlx5_query_port_admin_status(struct mlx5_core_dev *dev,
816 enum mlx5_port_status *status);
817
818int mlx5_set_port_mtu(struct mlx5_core_dev *dev, int mtu, u8 port);
819void mlx5_query_port_max_mtu(struct mlx5_core_dev *dev, int *max_mtu, u8 port);
820void mlx5_query_port_oper_mtu(struct mlx5_core_dev *dev, int *oper_mtu,
821 u8 port);
822
823int mlx5_query_port_vl_hw_cap(struct mlx5_core_dev *dev,
824 u8 *vl_hw_cap, u8 local_port);
825
826int mlx5_set_port_pause(struct mlx5_core_dev *dev, u32 rx_pause, u32 tx_pause);
827int mlx5_query_port_pause(struct mlx5_core_dev *dev,
828 u32 *rx_pause, u32 *tx_pause);
829
830int mlx5_debug_eq_add(struct mlx5_core_dev *dev, struct mlx5_eq *eq); 800int mlx5_debug_eq_add(struct mlx5_core_dev *dev, struct mlx5_eq *eq);
831void mlx5_debug_eq_remove(struct mlx5_core_dev *dev, struct mlx5_eq *eq); 801void mlx5_debug_eq_remove(struct mlx5_core_dev *dev, struct mlx5_eq *eq);
832int mlx5_core_eq_query(struct mlx5_core_dev *dev, struct mlx5_eq *eq, 802int mlx5_core_eq_query(struct mlx5_core_dev *dev, struct mlx5_eq *eq,
diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h
index 9b8a02b7880f..e52730e01ed6 100644
--- a/include/linux/mlx5/mlx5_ifc.h
+++ b/include/linux/mlx5/mlx5_ifc.h
@@ -166,6 +166,8 @@ enum {
166 MLX5_CMD_OP_SET_L2_TABLE_ENTRY = 0x829, 166 MLX5_CMD_OP_SET_L2_TABLE_ENTRY = 0x829,
167 MLX5_CMD_OP_QUERY_L2_TABLE_ENTRY = 0x82a, 167 MLX5_CMD_OP_QUERY_L2_TABLE_ENTRY = 0x82a,
168 MLX5_CMD_OP_DELETE_L2_TABLE_ENTRY = 0x82b, 168 MLX5_CMD_OP_DELETE_L2_TABLE_ENTRY = 0x82b,
169 MLX5_CMD_OP_SET_WOL_ROL = 0x830,
170 MLX5_CMD_OP_QUERY_WOL_ROL = 0x831,
169 MLX5_CMD_OP_CREATE_TIR = 0x900, 171 MLX5_CMD_OP_CREATE_TIR = 0x900,
170 MLX5_CMD_OP_MODIFY_TIR = 0x901, 172 MLX5_CMD_OP_MODIFY_TIR = 0x901,
171 MLX5_CMD_OP_DESTROY_TIR = 0x902, 173 MLX5_CMD_OP_DESTROY_TIR = 0x902,
@@ -730,7 +732,19 @@ struct mlx5_ifc_cmd_hca_cap_bits {
730 732
731 u8 reserved_at_1bf[0x3]; 733 u8 reserved_at_1bf[0x3];
732 u8 log_max_msg[0x5]; 734 u8 log_max_msg[0x5];
733 u8 reserved_at_1c7[0x18]; 735 u8 reserved_at_1c7[0x4];
736 u8 max_tc[0x4];
737 u8 reserved_at_1cf[0x6];
738 u8 rol_s[0x1];
739 u8 rol_g[0x1];
740 u8 reserved_at_1d7[0x1];
741 u8 wol_s[0x1];
742 u8 wol_g[0x1];
743 u8 wol_a[0x1];
744 u8 wol_b[0x1];
745 u8 wol_m[0x1];
746 u8 wol_u[0x1];
747 u8 wol_p[0x1];
734 748
735 u8 stat_rate_support[0x10]; 749 u8 stat_rate_support[0x10];
736 u8 reserved_at_1ef[0xc]; 750 u8 reserved_at_1ef[0xc];
@@ -6911,6 +6925,54 @@ struct mlx5_ifc_mtt_bits {
6911 u8 rd_en[0x1]; 6925 u8 rd_en[0x1];
6912}; 6926};
6913 6927
6928struct mlx5_ifc_query_wol_rol_out_bits {
6929 u8 status[0x8];
6930 u8 reserved_at_8[0x18];
6931
6932 u8 syndrome[0x20];
6933
6934 u8 reserved_at_40[0x10];
6935 u8 rol_mode[0x8];
6936 u8 wol_mode[0x8];
6937
6938 u8 reserved_at_60[0x20];
6939};
6940
6941struct mlx5_ifc_query_wol_rol_in_bits {
6942 u8 opcode[0x10];
6943 u8 reserved_at_10[0x10];
6944
6945 u8 reserved_at_20[0x10];
6946 u8 op_mod[0x10];
6947
6948 u8 reserved_at_40[0x40];
6949};
6950
6951struct mlx5_ifc_set_wol_rol_out_bits {
6952 u8 status[0x8];
6953 u8 reserved_at_8[0x18];
6954
6955 u8 syndrome[0x20];
6956
6957 u8 reserved_at_40[0x40];
6958};
6959
6960struct mlx5_ifc_set_wol_rol_in_bits {
6961 u8 opcode[0x10];
6962 u8 reserved_at_10[0x10];
6963
6964 u8 reserved_at_20[0x10];
6965 u8 op_mod[0x10];
6966
6967 u8 rol_mode_valid[0x1];
6968 u8 wol_mode_valid[0x1];
6969 u8 reserved_at_42[0xe];
6970 u8 rol_mode[0x8];
6971 u8 wol_mode[0x8];
6972
6973 u8 reserved_at_60[0x20];
6974};
6975
6914enum { 6976enum {
6915 MLX5_INITIAL_SEG_NIC_INTERFACE_FULL_DRIVER = 0x0, 6977 MLX5_INITIAL_SEG_NIC_INTERFACE_FULL_DRIVER = 0x0,
6916 MLX5_INITIAL_SEG_NIC_INTERFACE_DISABLED = 0x1, 6978 MLX5_INITIAL_SEG_NIC_INTERFACE_DISABLED = 0x1,
@@ -7102,4 +7164,49 @@ struct mlx5_ifc_modify_flow_table_in_bits {
7102 u8 reserved_at_100[0x100]; 7164 u8 reserved_at_100[0x100];
7103}; 7165};
7104 7166
7167struct mlx5_ifc_ets_tcn_config_reg_bits {
7168 u8 g[0x1];
7169 u8 b[0x1];
7170 u8 r[0x1];
7171 u8 reserved_at_3[0x9];
7172 u8 group[0x4];
7173 u8 reserved_at_10[0x9];
7174 u8 bw_allocation[0x7];
7175
7176 u8 reserved_at_20[0xc];
7177 u8 max_bw_units[0x4];
7178 u8 reserved_at_30[0x8];
7179 u8 max_bw_value[0x8];
7180};
7181
7182struct mlx5_ifc_ets_global_config_reg_bits {
7183 u8 reserved_at_0[0x2];
7184 u8 r[0x1];
7185 u8 reserved_at_3[0x1d];
7186
7187 u8 reserved_at_20[0xc];
7188 u8 max_bw_units[0x4];
7189 u8 reserved_at_30[0x8];
7190 u8 max_bw_value[0x8];
7191};
7192
7193struct mlx5_ifc_qetc_reg_bits {
7194 u8 reserved_at_0[0x8];
7195 u8 port_number[0x8];
7196 u8 reserved_at_10[0x30];
7197
7198 struct mlx5_ifc_ets_tcn_config_reg_bits tc_configuration[0x8];
7199 struct mlx5_ifc_ets_global_config_reg_bits global_configuration;
7200};
7201
7202struct mlx5_ifc_qtct_reg_bits {
7203 u8 reserved_at_0[0x8];
7204 u8 port_number[0x8];
7205 u8 reserved_at_10[0xd];
7206 u8 prio[0x3];
7207
7208 u8 reserved_at_20[0x1d];
7209 u8 tclass[0x3];
7210};
7211
7105#endif /* MLX5_IFC_H */ 7212#endif /* MLX5_IFC_H */
diff --git a/include/linux/mlx5/port.h b/include/linux/mlx5/port.h
new file mode 100644
index 000000000000..a1d145abd4eb
--- /dev/null
+++ b/include/linux/mlx5/port.h
@@ -0,0 +1,87 @@
1/*
2 * Copyright (c) 2016, Mellanox Technologies. All rights reserved.
3 *
4 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU
6 * General Public License (GPL) Version 2, available from the file
7 * COPYING in the main directory of this source tree, or the
8 * OpenIB.org BSD license below:
9 *
10 * Redistribution and use in source and binary forms, with or
11 * without modification, are permitted provided that the following
12 * conditions are met:
13 *
14 * - Redistributions of source code must retain the above
15 * copyright notice, this list of conditions and the following
16 * disclaimer.
17 *
18 * - Redistributions in binary form must reproduce the above
19 * copyright notice, this list of conditions and the following
20 * disclaimer in the documentation and/or other materials
21 * provided with the distribution.
22 *
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
27 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
28 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30 * SOFTWARE.
31 */
32
33#ifndef __MLX5_PORT_H__
34#define __MLX5_PORT_H__
35
36#include <linux/mlx5/driver.h>
37
38int mlx5_set_port_caps(struct mlx5_core_dev *dev, u8 port_num, u32 caps);
39int mlx5_query_port_ptys(struct mlx5_core_dev *dev, u32 *ptys,
40 int ptys_size, int proto_mask, u8 local_port);
41int mlx5_query_port_proto_cap(struct mlx5_core_dev *dev,
42 u32 *proto_cap, int proto_mask);
43int mlx5_query_port_proto_admin(struct mlx5_core_dev *dev,
44 u32 *proto_admin, int proto_mask);
45int mlx5_query_port_link_width_oper(struct mlx5_core_dev *dev,
46 u8 *link_width_oper, u8 local_port);
47int mlx5_query_port_proto_oper(struct mlx5_core_dev *dev,
48 u8 *proto_oper, int proto_mask,
49 u8 local_port);
50int mlx5_set_port_proto(struct mlx5_core_dev *dev, u32 proto_admin,
51 int proto_mask);
52int mlx5_set_port_admin_status(struct mlx5_core_dev *dev,
53 enum mlx5_port_status status);
54int mlx5_query_port_admin_status(struct mlx5_core_dev *dev,
55 enum mlx5_port_status *status);
56
57int mlx5_set_port_mtu(struct mlx5_core_dev *dev, int mtu, u8 port);
58void mlx5_query_port_max_mtu(struct mlx5_core_dev *dev, int *max_mtu, u8 port);
59void mlx5_query_port_oper_mtu(struct mlx5_core_dev *dev, int *oper_mtu,
60 u8 port);
61
62int mlx5_query_port_vl_hw_cap(struct mlx5_core_dev *dev,
63 u8 *vl_hw_cap, u8 local_port);
64
65int mlx5_set_port_pause(struct mlx5_core_dev *dev, u32 rx_pause, u32 tx_pause);
66int mlx5_query_port_pause(struct mlx5_core_dev *dev,
67 u32 *rx_pause, u32 *tx_pause);
68
69int mlx5_set_port_pfc(struct mlx5_core_dev *dev, u8 pfc_en_tx, u8 pfc_en_rx);
70int mlx5_query_port_pfc(struct mlx5_core_dev *dev, u8 *pfc_en_tx,
71 u8 *pfc_en_rx);
72
73int mlx5_max_tc(struct mlx5_core_dev *mdev);
74
75int mlx5_set_port_prio_tc(struct mlx5_core_dev *mdev, u8 *prio_tc);
76int mlx5_set_port_tc_group(struct mlx5_core_dev *mdev, u8 *tc_group);
77int mlx5_set_port_tc_bw_alloc(struct mlx5_core_dev *mdev, u8 *tc_bw);
78int mlx5_modify_port_ets_rate_limit(struct mlx5_core_dev *mdev,
79 u8 *max_bw_value,
80 u8 *max_bw_unit);
81int mlx5_query_port_ets_rate_limit(struct mlx5_core_dev *mdev,
82 u8 *max_bw_value,
83 u8 *max_bw_unit);
84int mlx5_set_port_wol(struct mlx5_core_dev *mdev, u8 wol_mode);
85int mlx5_query_port_wol(struct mlx5_core_dev *mdev, u8 *wol_mode);
86
87#endif /* __MLX5_PORT_H__ */
diff --git a/include/linux/net.h b/include/linux/net.h
index 0b4ac7da583a..49175e4ced11 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -215,6 +215,7 @@ int __sock_create(struct net *net, int family, int type, int proto,
215int sock_create(int family, int type, int proto, struct socket **res); 215int sock_create(int family, int type, int proto, struct socket **res);
216int sock_create_kern(struct net *net, int family, int type, int proto, struct socket **res); 216int sock_create_kern(struct net *net, int family, int type, int proto, struct socket **res);
217int sock_create_lite(int family, int type, int proto, struct socket **res); 217int sock_create_lite(int family, int type, int proto, struct socket **res);
218struct socket *sock_alloc(void);
218void sock_release(struct socket *sock); 219void sock_release(struct socket *sock);
219int sock_sendmsg(struct socket *sock, struct msghdr *msg); 220int sock_sendmsg(struct socket *sock, struct msghdr *msg);
220int sock_recvmsg(struct socket *sock, struct msghdr *msg, size_t size, 221int sock_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,
diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h
index d9654f0eecb3..a734bf43d190 100644
--- a/include/linux/netdev_features.h
+++ b/include/linux/netdev_features.h
@@ -67,6 +67,8 @@ enum {
67 NETIF_F_HW_L2FW_DOFFLOAD_BIT, /* Allow L2 Forwarding in Hardware */ 67 NETIF_F_HW_L2FW_DOFFLOAD_BIT, /* Allow L2 Forwarding in Hardware */
68 NETIF_F_BUSY_POLL_BIT, /* Busy poll */ 68 NETIF_F_BUSY_POLL_BIT, /* Busy poll */
69 69
70 NETIF_F_HW_TC_BIT, /* Offload TC infrastructure */
71
70 /* 72 /*
71 * Add your fresh new feature above and remember to update 73 * Add your fresh new feature above and remember to update
72 * netdev_features_strings[] in net/core/ethtool.c and maybe 74 * netdev_features_strings[] in net/core/ethtool.c and maybe
@@ -124,6 +126,7 @@ enum {
124#define NETIF_F_HW_VLAN_STAG_TX __NETIF_F(HW_VLAN_STAG_TX) 126#define NETIF_F_HW_VLAN_STAG_TX __NETIF_F(HW_VLAN_STAG_TX)
125#define NETIF_F_HW_L2FW_DOFFLOAD __NETIF_F(HW_L2FW_DOFFLOAD) 127#define NETIF_F_HW_L2FW_DOFFLOAD __NETIF_F(HW_L2FW_DOFFLOAD)
126#define NETIF_F_BUSY_POLL __NETIF_F(BUSY_POLL) 128#define NETIF_F_BUSY_POLL __NETIF_F(BUSY_POLL)
129#define NETIF_F_HW_TC __NETIF_F(HW_TC)
127 130
128#define for_each_netdev_feature(mask_addr, bit) \ 131#define for_each_netdev_feature(mask_addr, bit) \
129 for_each_set_bit(bit, (unsigned long *)mask_addr, NETDEV_FEATURE_COUNT) 132 for_each_set_bit(bit, (unsigned long *)mask_addr, NETDEV_FEATURE_COUNT)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 5440b7b705eb..be693b34662f 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -51,6 +51,7 @@
51#include <linux/neighbour.h> 51#include <linux/neighbour.h>
52#include <uapi/linux/netdevice.h> 52#include <uapi/linux/netdevice.h>
53#include <uapi/linux/if_bonding.h> 53#include <uapi/linux/if_bonding.h>
54#include <uapi/linux/pkt_cls.h>
54 55
55struct netpoll_info; 56struct netpoll_info;
56struct device; 57struct device;
@@ -267,6 +268,7 @@ struct header_ops {
267 void (*cache_update)(struct hh_cache *hh, 268 void (*cache_update)(struct hh_cache *hh,
268 const struct net_device *dev, 269 const struct net_device *dev,
269 const unsigned char *haddr); 270 const unsigned char *haddr);
271 bool (*validate)(const char *ll_header, unsigned int len);
270}; 272};
271 273
272/* These flag bits are private to the generic network queueing 274/* These flag bits are private to the generic network queueing
@@ -778,6 +780,27 @@ static inline bool netdev_phys_item_id_same(struct netdev_phys_item_id *a,
778typedef u16 (*select_queue_fallback_t)(struct net_device *dev, 780typedef u16 (*select_queue_fallback_t)(struct net_device *dev,
779 struct sk_buff *skb); 781 struct sk_buff *skb);
780 782
783/* These structures hold the attributes of qdisc and classifiers
784 * that are being passed to the netdevice through the setup_tc op.
785 */
786enum {
787 TC_SETUP_MQPRIO,
788 TC_SETUP_CLSU32,
789 TC_SETUP_CLSFLOWER,
790};
791
792struct tc_cls_u32_offload;
793
794struct tc_to_netdev {
795 unsigned int type;
796 union {
797 u8 tc;
798 struct tc_cls_u32_offload *cls_u32;
799 struct tc_cls_flower_offload *cls_flower;
800 };
801};
802
803
781/* 804/*
782 * This structure defines the management hooks for network devices. 805 * This structure defines the management hooks for network devices.
783 * The following hooks can be defined; unless noted otherwise, they are 806 * The following hooks can be defined; unless noted otherwise, they are
@@ -1073,6 +1096,12 @@ typedef u16 (*select_queue_fallback_t)(struct net_device *dev,
1073 * This function is used to get egress tunnel information for given skb. 1096 * This function is used to get egress tunnel information for given skb.
1074 * This is useful for retrieving outer tunnel header parameters while 1097 * This is useful for retrieving outer tunnel header parameters while
1075 * sampling packet. 1098 * sampling packet.
1099 * void (*ndo_set_rx_headroom)(struct net_device *dev, int needed_headroom);
1100 * This function is used to specify the headroom that the skb must
1101 * consider when allocation skb during packet reception. Setting
1102 * appropriate rx headroom value allows avoiding skb head copy on
1103 * forward. Setting a negative value reset the rx headroom to the
1104 * default value.
1076 * 1105 *
1077 */ 1106 */
1078struct net_device_ops { 1107struct net_device_ops {
@@ -1150,7 +1179,10 @@ struct net_device_ops {
1150 int (*ndo_set_vf_rss_query_en)( 1179 int (*ndo_set_vf_rss_query_en)(
1151 struct net_device *dev, 1180 struct net_device *dev,
1152 int vf, bool setting); 1181 int vf, bool setting);
1153 int (*ndo_setup_tc)(struct net_device *dev, u8 tc); 1182 int (*ndo_setup_tc)(struct net_device *dev,
1183 u32 handle,
1184 __be16 protocol,
1185 struct tc_to_netdev *tc);
1154#if IS_ENABLED(CONFIG_FCOE) 1186#if IS_ENABLED(CONFIG_FCOE)
1155 int (*ndo_fcoe_enable)(struct net_device *dev); 1187 int (*ndo_fcoe_enable)(struct net_device *dev);
1156 int (*ndo_fcoe_disable)(struct net_device *dev); 1188 int (*ndo_fcoe_disable)(struct net_device *dev);
@@ -1255,6 +1287,8 @@ struct net_device_ops {
1255 bool proto_down); 1287 bool proto_down);
1256 int (*ndo_fill_metadata_dst)(struct net_device *dev, 1288 int (*ndo_fill_metadata_dst)(struct net_device *dev,
1257 struct sk_buff *skb); 1289 struct sk_buff *skb);
1290 void (*ndo_set_rx_headroom)(struct net_device *dev,
1291 int needed_headroom);
1258}; 1292};
1259 1293
1260/** 1294/**
@@ -1291,6 +1325,10 @@ struct net_device_ops {
1291 * @IFF_OPENVSWITCH: device is a Open vSwitch master 1325 * @IFF_OPENVSWITCH: device is a Open vSwitch master
1292 * @IFF_L3MDEV_SLAVE: device is enslaved to an L3 master device 1326 * @IFF_L3MDEV_SLAVE: device is enslaved to an L3 master device
1293 * @IFF_TEAM: device is a team device 1327 * @IFF_TEAM: device is a team device
1328 * @IFF_RXFH_CONFIGURED: device has had Rx Flow indirection table configured
1329 * @IFF_PHONY_HEADROOM: the headroom value is controlled by an external
1330 * entity (i.e. the master device for bridged veth)
1331 * @IFF_MACSEC: device is a MACsec device
1294 */ 1332 */
1295enum netdev_priv_flags { 1333enum netdev_priv_flags {
1296 IFF_802_1Q_VLAN = 1<<0, 1334 IFF_802_1Q_VLAN = 1<<0,
@@ -1318,6 +1356,9 @@ enum netdev_priv_flags {
1318 IFF_OPENVSWITCH = 1<<22, 1356 IFF_OPENVSWITCH = 1<<22,
1319 IFF_L3MDEV_SLAVE = 1<<23, 1357 IFF_L3MDEV_SLAVE = 1<<23,
1320 IFF_TEAM = 1<<24, 1358 IFF_TEAM = 1<<24,
1359 IFF_RXFH_CONFIGURED = 1<<25,
1360 IFF_PHONY_HEADROOM = 1<<26,
1361 IFF_MACSEC = 1<<27,
1321}; 1362};
1322 1363
1323#define IFF_802_1Q_VLAN IFF_802_1Q_VLAN 1364#define IFF_802_1Q_VLAN IFF_802_1Q_VLAN
@@ -1345,6 +1386,8 @@ enum netdev_priv_flags {
1345#define IFF_OPENVSWITCH IFF_OPENVSWITCH 1386#define IFF_OPENVSWITCH IFF_OPENVSWITCH
1346#define IFF_L3MDEV_SLAVE IFF_L3MDEV_SLAVE 1387#define IFF_L3MDEV_SLAVE IFF_L3MDEV_SLAVE
1347#define IFF_TEAM IFF_TEAM 1388#define IFF_TEAM IFF_TEAM
1389#define IFF_RXFH_CONFIGURED IFF_RXFH_CONFIGURED
1390#define IFF_MACSEC IFF_MACSEC
1348 1391
1349/** 1392/**
1350 * struct net_device - The DEVICE structure. 1393 * struct net_device - The DEVICE structure.
@@ -1397,6 +1440,8 @@ enum netdev_priv_flags {
1397 * do not use this in drivers 1440 * do not use this in drivers
1398 * @tx_dropped: Dropped packets by core network, 1441 * @tx_dropped: Dropped packets by core network,
1399 * do not use this in drivers 1442 * do not use this in drivers
1443 * @rx_nohandler: nohandler dropped packets by core network on
1444 * inactive devices, do not use this in drivers
1400 * 1445 *
1401 * @wireless_handlers: List of functions to handle Wireless Extensions, 1446 * @wireless_handlers: List of functions to handle Wireless Extensions,
1402 * instead of ioctl, 1447 * instead of ioctl,
@@ -1420,8 +1465,7 @@ enum netdev_priv_flags {
1420 * @dma: DMA channel 1465 * @dma: DMA channel
1421 * @mtu: Interface MTU value 1466 * @mtu: Interface MTU value
1422 * @type: Interface hardware type 1467 * @type: Interface hardware type
1423 * @hard_header_len: Hardware header length, which means that this is the 1468 * @hard_header_len: Maximum hardware header length.
1424 * minimum size of a packet.
1425 * 1469 *
1426 * @needed_headroom: Extra headroom the hardware may need, but not in all 1470 * @needed_headroom: Extra headroom the hardware may need, but not in all
1427 * cases can this be guaranteed 1471 * cases can this be guaranteed
@@ -1611,6 +1655,7 @@ struct net_device {
1611 1655
1612 atomic_long_t rx_dropped; 1656 atomic_long_t rx_dropped;
1613 atomic_long_t tx_dropped; 1657 atomic_long_t tx_dropped;
1658 atomic_long_t rx_nohandler;
1614 1659
1615#ifdef CONFIG_WIRELESS_EXT 1660#ifdef CONFIG_WIRELESS_EXT
1616 const struct iw_handler_def * wireless_handlers; 1661 const struct iw_handler_def * wireless_handlers;
@@ -1908,6 +1953,26 @@ struct netdev_queue *netdev_pick_tx(struct net_device *dev,
1908 struct sk_buff *skb, 1953 struct sk_buff *skb,
1909 void *accel_priv); 1954 void *accel_priv);
1910 1955
1956/* returns the headroom that the master device needs to take in account
1957 * when forwarding to this dev
1958 */
1959static inline unsigned netdev_get_fwd_headroom(struct net_device *dev)
1960{
1961 return dev->priv_flags & IFF_PHONY_HEADROOM ? 0 : dev->needed_headroom;
1962}
1963
1964static inline void netdev_set_rx_headroom(struct net_device *dev, int new_hr)
1965{
1966 if (dev->netdev_ops->ndo_set_rx_headroom)
1967 dev->netdev_ops->ndo_set_rx_headroom(dev, new_hr);
1968}
1969
1970/* set the device rx headroom to the dev's default */
1971static inline void netdev_reset_rx_headroom(struct net_device *dev)
1972{
1973 netdev_set_rx_headroom(dev, -1);
1974}
1975
1911/* 1976/*
1912 * Net namespace inlines 1977 * Net namespace inlines
1913 */ 1978 */
@@ -2627,6 +2692,24 @@ static inline int dev_parse_header(const struct sk_buff *skb,
2627 return dev->header_ops->parse(skb, haddr); 2692 return dev->header_ops->parse(skb, haddr);
2628} 2693}
2629 2694
2695/* ll_header must have at least hard_header_len allocated */
2696static inline bool dev_validate_header(const struct net_device *dev,
2697 char *ll_header, int len)
2698{
2699 if (likely(len >= dev->hard_header_len))
2700 return true;
2701
2702 if (capable(CAP_SYS_RAWIO)) {
2703 memset(ll_header + len, 0, dev->hard_header_len - len);
2704 return true;
2705 }
2706
2707 if (dev->header_ops && dev->header_ops->validate)
2708 return dev->header_ops->validate(ll_header, len);
2709
2710 return false;
2711}
2712
2630typedef int gifconf_func_t(struct net_device * dev, char __user * bufptr, int len); 2713typedef int gifconf_func_t(struct net_device * dev, char __user * bufptr, int len);
2631int register_gifconf(unsigned int family, gifconf_func_t *gifconf); 2714int register_gifconf(unsigned int family, gifconf_func_t *gifconf);
2632static inline int unregister_gifconf(unsigned int family) 2715static inline int unregister_gifconf(unsigned int family)
@@ -3741,7 +3824,7 @@ void netdev_lower_state_changed(struct net_device *lower_dev,
3741 3824
3742/* RSS keys are 40 or 52 bytes long */ 3825/* RSS keys are 40 or 52 bytes long */
3743#define NETDEV_RSS_KEY_LEN 52 3826#define NETDEV_RSS_KEY_LEN 52
3744extern u8 netdev_rss_key[NETDEV_RSS_KEY_LEN]; 3827extern u8 netdev_rss_key[NETDEV_RSS_KEY_LEN] __read_mostly;
3745void netdev_rss_key_fill(void *buffer, size_t len); 3828void netdev_rss_key_fill(void *buffer, size_t len);
3746 3829
3747int dev_get_nest_level(struct net_device *dev, 3830int dev_get_nest_level(struct net_device *dev,
@@ -3965,6 +4048,11 @@ static inline void skb_gso_error_unwind(struct sk_buff *skb, __be16 protocol,
3965 skb->mac_len = mac_len; 4048 skb->mac_len = mac_len;
3966} 4049}
3967 4050
4051static inline bool netif_is_macsec(const struct net_device *dev)
4052{
4053 return dev->priv_flags & IFF_MACSEC;
4054}
4055
3968static inline bool netif_is_macvlan(const struct net_device *dev) 4056static inline bool netif_is_macvlan(const struct net_device *dev)
3969{ 4057{
3970 return dev->priv_flags & IFF_MACVLAN; 4058 return dev->priv_flags & IFF_MACVLAN;
@@ -4045,6 +4133,11 @@ static inline bool netif_is_lag_port(const struct net_device *dev)
4045 return netif_is_bond_slave(dev) || netif_is_team_port(dev); 4133 return netif_is_bond_slave(dev) || netif_is_team_port(dev);
4046} 4134}
4047 4135
4136static inline bool netif_is_rxfh_configured(const struct net_device *dev)
4137{
4138 return dev->priv_flags & IFF_RXFH_CONFIGURED;
4139}
4140
4048/* This device needs to keep skb dst for qdisc enqueue or ndo_start_xmit() */ 4141/* This device needs to keep skb dst for qdisc enqueue or ndo_start_xmit() */
4049static inline void netif_keep_dst(struct net_device *dev) 4142static inline void netif_keep_dst(struct net_device *dev)
4050{ 4143{
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
index 0ad556726181..9230f9aee896 100644
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -141,22 +141,6 @@ void nf_unregister_sockopt(struct nf_sockopt_ops *reg);
141 141
142#ifdef HAVE_JUMP_LABEL 142#ifdef HAVE_JUMP_LABEL
143extern struct static_key nf_hooks_needed[NFPROTO_NUMPROTO][NF_MAX_HOOKS]; 143extern struct static_key nf_hooks_needed[NFPROTO_NUMPROTO][NF_MAX_HOOKS];
144
145static inline bool nf_hook_list_active(struct list_head *hook_list,
146 u_int8_t pf, unsigned int hook)
147{
148 if (__builtin_constant_p(pf) &&
149 __builtin_constant_p(hook))
150 return static_key_false(&nf_hooks_needed[pf][hook]);
151
152 return !list_empty(hook_list);
153}
154#else
155static inline bool nf_hook_list_active(struct list_head *hook_list,
156 u_int8_t pf, unsigned int hook)
157{
158 return !list_empty(hook_list);
159}
160#endif 144#endif
161 145
162int nf_hook_slow(struct sk_buff *skb, struct nf_hook_state *state); 146int nf_hook_slow(struct sk_buff *skb, struct nf_hook_state *state);
@@ -177,9 +161,18 @@ static inline int nf_hook_thresh(u_int8_t pf, unsigned int hook,
177 int (*okfn)(struct net *, struct sock *, struct sk_buff *), 161 int (*okfn)(struct net *, struct sock *, struct sk_buff *),
178 int thresh) 162 int thresh)
179{ 163{
180 struct list_head *hook_list = &net->nf.hooks[pf][hook]; 164 struct list_head *hook_list;
165
166#ifdef HAVE_JUMP_LABEL
167 if (__builtin_constant_p(pf) &&
168 __builtin_constant_p(hook) &&
169 !static_key_false(&nf_hooks_needed[pf][hook]))
170 return 1;
171#endif
172
173 hook_list = &net->nf.hooks[pf][hook];
181 174
182 if (nf_hook_list_active(hook_list, pf, hook)) { 175 if (!list_empty(hook_list)) {
183 struct nf_hook_state state; 176 struct nf_hook_state state;
184 177
185 nf_hook_state_init(&state, hook_list, hook, thresh, 178 nf_hook_state_init(&state, hook_list, hook, thresh,
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h
index ba0d9789eb6e..1d82dd5e9a08 100644
--- a/include/linux/netfilter/nfnetlink.h
+++ b/include/linux/netfilter/nfnetlink.h
@@ -34,8 +34,6 @@ int nfnetlink_subsys_register(const struct nfnetlink_subsystem *n);
34int nfnetlink_subsys_unregister(const struct nfnetlink_subsystem *n); 34int nfnetlink_subsys_unregister(const struct nfnetlink_subsystem *n);
35 35
36int nfnetlink_has_listeners(struct net *net, unsigned int group); 36int nfnetlink_has_listeners(struct net *net, unsigned int group);
37struct sk_buff *nfnetlink_alloc_skb(struct net *net, unsigned int size,
38 u32 dst_portid, gfp_t gfp_mask);
39int nfnetlink_send(struct sk_buff *skb, struct net *net, u32 portid, 37int nfnetlink_send(struct sk_buff *skb, struct net *net, u32 portid,
40 unsigned int group, int echo, gfp_t flags); 38 unsigned int group, int echo, gfp_t flags);
41int nfnetlink_set_err(struct net *net, u32 portid, u32 group, int error); 39int nfnetlink_set_err(struct net *net, u32 portid, u32 group, int error);
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h
index c5577410c25d..80a305b85323 100644
--- a/include/linux/netfilter/x_tables.h
+++ b/include/linux/netfilter/x_tables.h
@@ -200,6 +200,9 @@ struct xt_table {
200 u_int8_t af; /* address/protocol family */ 200 u_int8_t af; /* address/protocol family */
201 int priority; /* hook order */ 201 int priority; /* hook order */
202 202
203 /* called when table is needed in the given netns */
204 int (*table_init)(struct net *net);
205
203 /* A unique name... */ 206 /* A unique name... */
204 const char name[XT_TABLE_MAXNAMELEN]; 207 const char name[XT_TABLE_MAXNAMELEN];
205}; 208};
@@ -408,8 +411,7 @@ xt_get_per_cpu_counter(struct xt_counters *cnt, unsigned int cpu)
408 return cnt; 411 return cnt;
409} 412}
410 413
411struct nf_hook_ops *xt_hook_link(const struct xt_table *, nf_hookfn *); 414struct nf_hook_ops *xt_hook_ops_alloc(const struct xt_table *, nf_hookfn *);
412void xt_hook_unlink(const struct xt_table *, struct nf_hook_ops *);
413 415
414#ifdef CONFIG_COMPAT 416#ifdef CONFIG_COMPAT
415#include <net/compat.h> 417#include <net/compat.h>
diff --git a/include/linux/netfilter_arp/arp_tables.h b/include/linux/netfilter_arp/arp_tables.h
index 6f074db2f23d..029b95e8924e 100644
--- a/include/linux/netfilter_arp/arp_tables.h
+++ b/include/linux/netfilter_arp/arp_tables.h
@@ -48,10 +48,11 @@ struct arpt_error {
48} 48}
49 49
50extern void *arpt_alloc_initial_table(const struct xt_table *); 50extern void *arpt_alloc_initial_table(const struct xt_table *);
51extern struct xt_table *arpt_register_table(struct net *net, 51int arpt_register_table(struct net *net, const struct xt_table *table,
52 const struct xt_table *table, 52 const struct arpt_replace *repl,
53 const struct arpt_replace *repl); 53 const struct nf_hook_ops *ops, struct xt_table **res);
54extern void arpt_unregister_table(struct xt_table *table); 54void arpt_unregister_table(struct net *net, struct xt_table *table,
55 const struct nf_hook_ops *ops);
55extern unsigned int arpt_do_table(struct sk_buff *skb, 56extern unsigned int arpt_do_table(struct sk_buff *skb,
56 const struct nf_hook_state *state, 57 const struct nf_hook_state *state,
57 struct xt_table *table); 58 struct xt_table *table);
diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h
index aa598f942c01..7bfc5893ec31 100644
--- a/include/linux/netfilter_ipv4/ip_tables.h
+++ b/include/linux/netfilter_ipv4/ip_tables.h
@@ -24,10 +24,11 @@
24 24
25extern void ipt_init(void) __init; 25extern void ipt_init(void) __init;
26 26
27extern struct xt_table *ipt_register_table(struct net *net, 27int ipt_register_table(struct net *net, const struct xt_table *table,
28 const struct xt_table *table, 28 const struct ipt_replace *repl,
29 const struct ipt_replace *repl); 29 const struct nf_hook_ops *ops, struct xt_table **res);
30extern void ipt_unregister_table(struct net *net, struct xt_table *table); 30void ipt_unregister_table(struct net *net, struct xt_table *table,
31 const struct nf_hook_ops *ops);
31 32
32/* Standard entry. */ 33/* Standard entry. */
33struct ipt_standard { 34struct ipt_standard {
diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h
index 0f76e5c674f9..b21c392d6012 100644
--- a/include/linux/netfilter_ipv6/ip6_tables.h
+++ b/include/linux/netfilter_ipv6/ip6_tables.h
@@ -25,10 +25,11 @@
25extern void ip6t_init(void) __init; 25extern void ip6t_init(void) __init;
26 26
27extern void *ip6t_alloc_initial_table(const struct xt_table *); 27extern void *ip6t_alloc_initial_table(const struct xt_table *);
28extern struct xt_table *ip6t_register_table(struct net *net, 28int ip6t_register_table(struct net *net, const struct xt_table *table,
29 const struct xt_table *table, 29 const struct ip6t_replace *repl,
30 const struct ip6t_replace *repl); 30 const struct nf_hook_ops *ops, struct xt_table **res);
31extern void ip6t_unregister_table(struct net *net, struct xt_table *table); 31void ip6t_unregister_table(struct net *net, struct xt_table *table,
32 const struct nf_hook_ops *ops);
32extern unsigned int ip6t_do_table(struct sk_buff *skb, 33extern unsigned int ip6t_do_table(struct sk_buff *skb,
33 const struct nf_hook_state *state, 34 const struct nf_hook_state *state,
34 struct xt_table *table); 35 struct xt_table *table);
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index 0b41959aab9f..da14ab61f363 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -69,16 +69,6 @@ extern void __netlink_clear_multicast_users(struct sock *sk, unsigned int group)
69extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err); 69extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err);
70extern int netlink_has_listeners(struct sock *sk, unsigned int group); 70extern int netlink_has_listeners(struct sock *sk, unsigned int group);
71 71
72extern struct sk_buff *__netlink_alloc_skb(struct sock *ssk, unsigned int size,
73 unsigned int ldiff, u32 dst_portid,
74 gfp_t gfp_mask);
75static inline struct sk_buff *
76netlink_alloc_skb(struct sock *ssk, unsigned int size, u32 dst_portid,
77 gfp_t gfp_mask)
78{
79 return __netlink_alloc_skb(ssk, size, 0, dst_portid, gfp_mask);
80}
81
82extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 portid, int nonblock); 72extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 portid, int nonblock);
83extern int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, __u32 portid, 73extern int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, __u32 portid,
84 __u32 group, gfp_t allocation); 74 __u32 group, gfp_t allocation);
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index 79ec7bbf0155..78fda2a69ab8 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -966,11 +966,20 @@ DECLARE_PER_CPU(struct perf_callchain_entry, perf_callchain_entry);
966 966
967extern void perf_callchain_user(struct perf_callchain_entry *entry, struct pt_regs *regs); 967extern void perf_callchain_user(struct perf_callchain_entry *entry, struct pt_regs *regs);
968extern void perf_callchain_kernel(struct perf_callchain_entry *entry, struct pt_regs *regs); 968extern void perf_callchain_kernel(struct perf_callchain_entry *entry, struct pt_regs *regs);
969extern struct perf_callchain_entry *
970get_perf_callchain(struct pt_regs *regs, u32 init_nr, bool kernel, bool user,
971 bool crosstask, bool add_mark);
972extern int get_callchain_buffers(void);
973extern void put_callchain_buffers(void);
969 974
970static inline void perf_callchain_store(struct perf_callchain_entry *entry, u64 ip) 975static inline int perf_callchain_store(struct perf_callchain_entry *entry, u64 ip)
971{ 976{
972 if (entry->nr < PERF_MAX_STACK_DEPTH) 977 if (entry->nr < PERF_MAX_STACK_DEPTH) {
973 entry->ip[entry->nr++] = ip; 978 entry->ip[entry->nr++] = ip;
979 return 0;
980 } else {
981 return -1; /* no more room, stop walking the stack */
982 }
974} 983}
975 984
976extern int sysctl_perf_event_paranoid; 985extern int sysctl_perf_event_paranoid;
diff --git a/include/linux/phy.h b/include/linux/phy.h
index d6f3641e7933..2abd7918f64f 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -327,8 +327,6 @@ struct phy_c45_device_ids {
327/* phy_device: An instance of a PHY 327/* phy_device: An instance of a PHY
328 * 328 *
329 * drv: Pointer to the driver for this PHY instance 329 * drv: Pointer to the driver for this PHY instance
330 * bus: Pointer to the bus this PHY is on
331 * dev: driver model device structure for this PHY
332 * phy_id: UID for this device found during discovery 330 * phy_id: UID for this device found during discovery
333 * c45_ids: 802.3-c45 Device Identifers if is_c45. 331 * c45_ids: 802.3-c45 Device Identifers if is_c45.
334 * is_c45: Set to true if this phy uses clause 45 addressing. 332 * is_c45: Set to true if this phy uses clause 45 addressing.
@@ -338,7 +336,6 @@ struct phy_c45_device_ids {
338 * suspended: Set to true if this phy has been suspended successfully. 336 * suspended: Set to true if this phy has been suspended successfully.
339 * state: state of the PHY for management purposes 337 * state: state of the PHY for management purposes
340 * dev_flags: Device-specific flags used by the PHY driver. 338 * dev_flags: Device-specific flags used by the PHY driver.
341 * addr: Bus address of PHY
342 * link_timeout: The number of timer firings to wait before the 339 * link_timeout: The number of timer firings to wait before the
343 * giving up on the current attempt at acquiring a link 340 * giving up on the current attempt at acquiring a link
344 * irq: IRQ number of the PHY's interrupt (-1 if none) 341 * irq: IRQ number of the PHY's interrupt (-1 if none)
diff --git a/include/linux/phy_fixed.h b/include/linux/phy_fixed.h
index 2400d2ea4f34..1d41ec44e39d 100644
--- a/include/linux/phy_fixed.h
+++ b/include/linux/phy_fixed.h
@@ -19,7 +19,7 @@ extern struct phy_device *fixed_phy_register(unsigned int irq,
19 struct fixed_phy_status *status, 19 struct fixed_phy_status *status,
20 int link_gpio, 20 int link_gpio,
21 struct device_node *np); 21 struct device_node *np);
22extern void fixed_phy_del(int phy_addr); 22extern void fixed_phy_unregister(struct phy_device *phydev);
23extern int fixed_phy_set_link_update(struct phy_device *phydev, 23extern int fixed_phy_set_link_update(struct phy_device *phydev,
24 int (*link_update)(struct net_device *, 24 int (*link_update)(struct net_device *,
25 struct fixed_phy_status *)); 25 struct fixed_phy_status *));
@@ -40,9 +40,8 @@ static inline struct phy_device *fixed_phy_register(unsigned int irq,
40{ 40{
41 return ERR_PTR(-ENODEV); 41 return ERR_PTR(-ENODEV);
42} 42}
43static inline int fixed_phy_del(int phy_addr) 43static inline void fixed_phy_unregister(struct phy_device *phydev)
44{ 44{
45 return -ENODEV;
46} 45}
47static inline int fixed_phy_set_link_update(struct phy_device *phydev, 46static inline int fixed_phy_set_link_update(struct phy_device *phydev,
48 int (*link_update)(struct net_device *, 47 int (*link_update)(struct net_device *,
diff --git a/include/linux/platform_data/brcmfmac-sdio.h b/include/linux/platform_data/brcmfmac-sdio.h
deleted file mode 100644
index e75dcbf2b230..000000000000
--- a/include/linux/platform_data/brcmfmac-sdio.h
+++ /dev/null
@@ -1,135 +0,0 @@
1/*
2 * Copyright (c) 2013 Broadcom Corporation
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
11 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16
17#ifndef _LINUX_BRCMFMAC_PLATFORM_H
18#define _LINUX_BRCMFMAC_PLATFORM_H
19
20/*
21 * Platform specific driver functions and data. Through the platform specific
22 * device data functions can be provided to help the brcmfmac driver to
23 * operate with the device in combination with the used platform.
24 *
25 * Use the platform data in the following (similar) way:
26 *
27 *
28#include <brcmfmac_platform.h>
29
30
31static void brcmfmac_power_on(void)
32{
33}
34
35static void brcmfmac_power_off(void)
36{
37}
38
39static void brcmfmac_reset(void)
40{
41}
42
43static struct brcmfmac_sdio_platform_data brcmfmac_sdio_pdata = {
44 .power_on = brcmfmac_power_on,
45 .power_off = brcmfmac_power_off,
46 .reset = brcmfmac_reset
47};
48
49static struct platform_device brcmfmac_device = {
50 .name = BRCMFMAC_SDIO_PDATA_NAME,
51 .id = PLATFORM_DEVID_NONE,
52 .dev.platform_data = &brcmfmac_sdio_pdata
53};
54
55void __init brcmfmac_init_pdata(void)
56{
57 brcmfmac_sdio_pdata.oob_irq_supported = true;
58 brcmfmac_sdio_pdata.oob_irq_nr = gpio_to_irq(GPIO_BRCMF_SDIO_OOB);
59 brcmfmac_sdio_pdata.oob_irq_flags = IORESOURCE_IRQ |
60 IORESOURCE_IRQ_HIGHLEVEL;
61 platform_device_register(&brcmfmac_device);
62}
63 *
64 *
65 * Note: the brcmfmac can be loaded as module or be statically built-in into
66 * the kernel. If built-in then do note that it uses module_init (and
67 * module_exit) routines which equal device_initcall. So if you intend to
68 * create a module with the platform specific data for the brcmfmac and have
69 * it built-in to the kernel then use a higher initcall then device_initcall
70 * (see init.h). If this is not done then brcmfmac will load without problems
71 * but will not pickup the platform data.
72 *
73 * When the driver does not "detect" platform driver data then it will continue
74 * without reporting anything and just assume there is no data needed. Which is
75 * probably true for most platforms.
76 *
77 * Explanation of the platform_data fields:
78 *
79 * drive_strength: is the preferred drive_strength to be used for the SDIO
80 * pins. If 0 then a default value will be used. This is the target drive
81 * strength, the exact drive strength which will be used depends on the
82 * capabilities of the device.
83 *
84 * oob_irq_supported: does the board have support for OOB interrupts. SDIO
85 * in-band interrupts are relatively slow and for having less overhead on
86 * interrupt processing an out of band interrupt can be used. If the HW
87 * supports this then enable this by setting this field to true and configure
88 * the oob related fields.
89 *
90 * oob_irq_nr, oob_irq_flags: the OOB interrupt information. The values are
91 * used for registering the irq using request_irq function.
92 *
93 * broken_sg_support: flag for broken sg list support of SDIO host controller.
94 * Set this to true if the SDIO host controller has higher align requirement
95 * than 32 bytes for each scatterlist item.
96 *
97 * sd_head_align: alignment requirement for start of data buffer
98 *
99 * sd_sgentry_align: length alignment requirement for each sg entry
100 *
101 * power_on: This function is called by the brcmfmac when the module gets
102 * loaded. This can be particularly useful for low power devices. The platform
103 * spcific routine may for example decide to power up the complete device.
104 * If there is no use-case for this function then provide NULL.
105 *
106 * power_off: This function is called by the brcmfmac when the module gets
107 * unloaded. At this point the device can be powered down or otherwise be reset.
108 * So if an actual power_off is not supported but reset is then reset the device
109 * when this function gets called. This can be particularly useful for low power
110 * devices. If there is no use-case for this function (either power-down or
111 * reset) then provide NULL.
112 *
113 * reset: This function can get called if the device communication broke down.
114 * This functionality is particularly useful in case of SDIO type devices. It is
115 * possible to reset a dongle via sdio data interface, but it requires that
116 * this is fully functional. This function is chip/module specific and this
117 * function should return only after the complete reset has completed.
118 */
119
120#define BRCMFMAC_SDIO_PDATA_NAME "brcmfmac_sdio"
121
122struct brcmfmac_sdio_platform_data {
123 unsigned int drive_strength;
124 bool oob_irq_supported;
125 unsigned int oob_irq_nr;
126 unsigned long oob_irq_flags;
127 bool broken_sg_support;
128 unsigned short sd_head_align;
129 unsigned short sd_sgentry_align;
130 void (*power_on)(void);
131 void (*power_off)(void);
132 void (*reset)(void);
133};
134
135#endif /* _LINUX_BRCMFMAC_PLATFORM_H */
diff --git a/include/linux/platform_data/brcmfmac.h b/include/linux/platform_data/brcmfmac.h
new file mode 100644
index 000000000000..1d30bf278231
--- /dev/null
+++ b/include/linux/platform_data/brcmfmac.h
@@ -0,0 +1,185 @@
1/*
2 * Copyright (c) 201 Broadcom Corporation
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
11 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16
17#ifndef _LINUX_BRCMFMAC_PLATFORM_H
18#define _LINUX_BRCMFMAC_PLATFORM_H
19
20
21#define BRCMFMAC_PDATA_NAME "brcmfmac"
22
23#define BRCMFMAC_COUNTRY_BUF_SZ 4
24
25
26/*
27 * Platform specific driver functions and data. Through the platform specific
28 * device data functions and data can be provided to help the brcmfmac driver to
29 * operate with the device in combination with the used platform.
30 */
31
32
33/**
34 * Note: the brcmfmac can be loaded as module or be statically built-in into
35 * the kernel. If built-in then do note that it uses module_init (and
36 * module_exit) routines which equal device_initcall. So if you intend to
37 * create a module with the platform specific data for the brcmfmac and have
38 * it built-in to the kernel then use a higher initcall then device_initcall
39 * (see init.h). If this is not done then brcmfmac will load without problems
40 * but will not pickup the platform data.
41 *
42 * When the driver does not "detect" platform driver data then it will continue
43 * without reporting anything and just assume there is no data needed. Which is
44 * probably true for most platforms.
45 */
46
47/**
48 * enum brcmf_bus_type - Bus type identifier. Currently SDIO, USB and PCIE are
49 * supported.
50 */
51enum brcmf_bus_type {
52 BRCMF_BUSTYPE_SDIO,
53 BRCMF_BUSTYPE_USB,
54 BRCMF_BUSTYPE_PCIE
55};
56
57
58/**
59 * struct brcmfmac_sdio_pd - SDIO Device specific platform data.
60 *
61 * @txglomsz: SDIO txglom size. Use 0 if default of driver is to be
62 * used.
63 * @drive_strength: is the preferred drive_strength to be used for the SDIO
64 * pins. If 0 then a default value will be used. This is
65 * the target drive strength, the exact drive strength
66 * which will be used depends on the capabilities of the
67 * device.
68 * @oob_irq_supported: does the board have support for OOB interrupts. SDIO
69 * in-band interrupts are relatively slow and for having
70 * less overhead on interrupt processing an out of band
71 * interrupt can be used. If the HW supports this then
72 * enable this by setting this field to true and configure
73 * the oob related fields.
74 * @oob_irq_nr,
75 * @oob_irq_flags: the OOB interrupt information. The values are used for
76 * registering the irq using request_irq function.
77 * @broken_sg_support: flag for broken sg list support of SDIO host controller.
78 * Set this to true if the SDIO host controller has higher
79 * align requirement than 32 bytes for each scatterlist
80 * item.
81 * @sd_head_align: alignment requirement for start of data buffer.
82 * @sd_sgentry_align: length alignment requirement for each sg entry.
83 * @reset: This function can get called if the device communication
84 * broke down. This functionality is particularly useful in
85 * case of SDIO type devices. It is possible to reset a
86 * dongle via sdio data interface, but it requires that
87 * this is fully functional. This function is chip/module
88 * specific and this function should return only after the
89 * complete reset has completed.
90 */
91struct brcmfmac_sdio_pd {
92 int txglomsz;
93 unsigned int drive_strength;
94 bool oob_irq_supported;
95 unsigned int oob_irq_nr;
96 unsigned long oob_irq_flags;
97 bool broken_sg_support;
98 unsigned short sd_head_align;
99 unsigned short sd_sgentry_align;
100 void (*reset)(void);
101};
102
103/**
104 * struct brcmfmac_pd_cc_entry - Struct for translating user space country code
105 * (iso3166) to firmware country code and
106 * revision.
107 *
108 * @iso3166: iso3166 alpha 2 country code string.
109 * @cc: firmware country code string.
110 * @rev: firmware country code revision.
111 */
112struct brcmfmac_pd_cc_entry {
113 char iso3166[BRCMFMAC_COUNTRY_BUF_SZ];
114 char cc[BRCMFMAC_COUNTRY_BUF_SZ];
115 s32 rev;
116};
117
118/**
119 * struct brcmfmac_pd_cc - Struct for translating country codes as set by user
120 * space to a country code and rev which can be used by
121 * firmware.
122 *
123 * @table_size: number of entries in table (> 0)
124 * @table: array of 1 or more elements with translation information.
125 */
126struct brcmfmac_pd_cc {
127 int table_size;
128 struct brcmfmac_pd_cc_entry table[0];
129};
130
131/**
132 * struct brcmfmac_pd_device - Device specific platform data. (id/rev/bus_type)
133 * is the unique identifier of the device.
134 *
135 * @id: ID of the device for which this data is. In case of SDIO
136 * or PCIE this is the chipid as identified by chip.c In
137 * case of USB this is the chipid as identified by the
138 * device query.
139 * @rev: chip revision, see id.
140 * @bus_type: The type of bus. Some chipid/rev exist for different bus
141 * types. Each bus type has its own set of settings.
142 * @feature_disable: Bitmask of features to disable (override), See feature.c
143 * in brcmfmac for details.
144 * @country_codes: If available, pointer to struct for translating country
145 * codes.
146 * @bus: Bus specific (union) device settings. Currently only
147 * SDIO.
148 */
149struct brcmfmac_pd_device {
150 unsigned int id;
151 unsigned int rev;
152 enum brcmf_bus_type bus_type;
153 unsigned int feature_disable;
154 struct brcmfmac_pd_cc *country_codes;
155 union {
156 struct brcmfmac_sdio_pd sdio;
157 } bus;
158};
159
160/**
161 * struct brcmfmac_platform_data - BRCMFMAC specific platform data.
162 *
163 * @power_on: This function is called by the brcmfmac driver when the module
164 * gets loaded. This can be particularly useful for low power
165 * devices. The platform spcific routine may for example decide to
166 * power up the complete device. If there is no use-case for this
167 * function then provide NULL.
168 * @power_off: This function is called by the brcmfmac when the module gets
169 * unloaded. At this point the devices can be powered down or
170 * otherwise be reset. So if an actual power_off is not supported
171 * but reset is supported by the devices then reset the devices
172 * when this function gets called. This can be particularly useful
173 * for low power devices. If there is no use-case for this
174 * function then provide NULL.
175 */
176struct brcmfmac_platform_data {
177 void (*power_on)(void);
178 void (*power_off)(void);
179 char *fw_alternative_path;
180 int device_count;
181 struct brcmfmac_pd_device devices[0];
182};
183
184
185#endif /* _LINUX_BRCMFMAC_PLATFORM_H */
diff --git a/include/linux/platform_data/microread.h b/include/linux/platform_data/microread.h
deleted file mode 100644
index ca13992089b8..000000000000
--- a/include/linux/platform_data/microread.h
+++ /dev/null
@@ -1,35 +0,0 @@
1/*
2 * Driver include for the Inside Secure microread NFC Chip.
3 *
4 * Copyright (C) 2011 Tieto Poland
5 * Copyright (C) 2012 Intel Corporation. All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * version 2 as published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#ifndef _MICROREAD_H
22#define _MICROREAD_H
23
24#include <linux/i2c.h>
25
26#define MICROREAD_DRIVER_NAME "microread"
27
28/* board config platform data for microread */
29struct microread_nfc_platform_data {
30 unsigned int rst_gpio;
31 unsigned int irq_gpio;
32 unsigned int ioh_gpio;
33};
34
35#endif /* _MICROREAD_H */
diff --git a/include/linux/qed/common_hsi.h b/include/linux/qed/common_hsi.h
index 1d1ba2c5ee7a..53ecb37ae563 100644
--- a/include/linux/qed/common_hsi.h
+++ b/include/linux/qed/common_hsi.h
@@ -11,9 +11,11 @@
11 11
12#define CORE_SPQE_PAGE_SIZE_BYTES 4096 12#define CORE_SPQE_PAGE_SIZE_BYTES 4096
13 13
14#define X_FINAL_CLEANUP_AGG_INT 1
15
14#define FW_MAJOR_VERSION 8 16#define FW_MAJOR_VERSION 8
15#define FW_MINOR_VERSION 4 17#define FW_MINOR_VERSION 7
16#define FW_REVISION_VERSION 2 18#define FW_REVISION_VERSION 3
17#define FW_ENGINEERING_VERSION 0 19#define FW_ENGINEERING_VERSION 0
18 20
19/***********************/ 21/***********************/
@@ -152,6 +154,9 @@
152/* number of queues in a PF queue group */ 154/* number of queues in a PF queue group */
153#define QM_PF_QUEUE_GROUP_SIZE 8 155#define QM_PF_QUEUE_GROUP_SIZE 8
154 156
157/* the size of a single queue element in bytes */
158#define QM_PQ_ELEMENT_SIZE 4
159
155/* base number of Tx PQs in the CM PQ representation. 160/* base number of Tx PQs in the CM PQ representation.
156 * should be used when storing PQ IDs in CM PQ registers and context 161 * should be used when storing PQ IDs in CM PQ registers and context
157 */ 162 */
@@ -285,6 +290,16 @@
285#define PXP_NUM_ILT_RECORDS_K2 11000 290#define PXP_NUM_ILT_RECORDS_K2 11000
286#define MAX_NUM_ILT_RECORDS MAX(PXP_NUM_ILT_RECORDS_BB, PXP_NUM_ILT_RECORDS_K2) 291#define MAX_NUM_ILT_RECORDS MAX(PXP_NUM_ILT_RECORDS_BB, PXP_NUM_ILT_RECORDS_K2)
287 292
293#define SDM_COMP_TYPE_NONE 0
294#define SDM_COMP_TYPE_WAKE_THREAD 1
295#define SDM_COMP_TYPE_AGG_INT 2
296#define SDM_COMP_TYPE_CM 3
297#define SDM_COMP_TYPE_LOADER 4
298#define SDM_COMP_TYPE_PXP 5
299#define SDM_COMP_TYPE_INDICATE_ERROR 6
300#define SDM_COMP_TYPE_RELEASE_THREAD 7
301#define SDM_COMP_TYPE_RAM 8
302
288/******************/ 303/******************/
289/* PBF CONSTANTS */ 304/* PBF CONSTANTS */
290/******************/ 305/******************/
@@ -335,7 +350,7 @@ struct event_ring_entry {
335 350
336/* Multi function mode */ 351/* Multi function mode */
337enum mf_mode { 352enum mf_mode {
338 SF, 353 ERROR_MODE /* Unsupported mode */,
339 MF_OVLAN, 354 MF_OVLAN,
340 MF_NPAR, 355 MF_NPAR,
341 MAX_MF_MODE 356 MAX_MF_MODE
@@ -606,4 +621,19 @@ struct status_block {
606#define STATUS_BLOCK_ZERO_PAD3_SHIFT 24 621#define STATUS_BLOCK_ZERO_PAD3_SHIFT 24
607}; 622};
608 623
624struct tunnel_parsing_flags {
625 u8 flags;
626#define TUNNEL_PARSING_FLAGS_TYPE_MASK 0x3
627#define TUNNEL_PARSING_FLAGS_TYPE_SHIFT 0
628#define TUNNEL_PARSING_FLAGS_TENNANT_ID_EXIST_MASK 0x1
629#define TUNNEL_PARSING_FLAGS_TENNANT_ID_EXIST_SHIFT 2
630#define TUNNEL_PARSING_FLAGS_NEXT_PROTOCOL_MASK 0x3
631#define TUNNEL_PARSING_FLAGS_NEXT_PROTOCOL_SHIFT 3
632#define TUNNEL_PARSING_FLAGS_FIRSTHDRIPMATCH_MASK 0x1
633#define TUNNEL_PARSING_FLAGS_FIRSTHDRIPMATCH_SHIFT 5
634#define TUNNEL_PARSING_FLAGS_IPV4_FRAGMENT_MASK 0x1
635#define TUNNEL_PARSING_FLAGS_IPV4_FRAGMENT_SHIFT 6
636#define TUNNEL_PARSING_FLAGS_IPV4_OPTIONS_MASK 0x1
637#define TUNNEL_PARSING_FLAGS_IPV4_OPTIONS_SHIFT 7
638};
609#endif /* __COMMON_HSI__ */ 639#endif /* __COMMON_HSI__ */
diff --git a/include/linux/qed/eth_common.h b/include/linux/qed/eth_common.h
index 320b3373ac1d..092cb0c1afcb 100644
--- a/include/linux/qed/eth_common.h
+++ b/include/linux/qed/eth_common.h
@@ -17,10 +17,8 @@
17#define ETH_MAX_RAMROD_PER_CON 8 17#define ETH_MAX_RAMROD_PER_CON 8
18#define ETH_TX_BD_PAGE_SIZE_BYTES 4096 18#define ETH_TX_BD_PAGE_SIZE_BYTES 4096
19#define ETH_RX_BD_PAGE_SIZE_BYTES 4096 19#define ETH_RX_BD_PAGE_SIZE_BYTES 4096
20#define ETH_RX_SGE_PAGE_SIZE_BYTES 4096
21#define ETH_RX_CQE_PAGE_SIZE_BYTES 4096 20#define ETH_RX_CQE_PAGE_SIZE_BYTES 4096
22#define ETH_RX_NUM_NEXT_PAGE_BDS 2 21#define ETH_RX_NUM_NEXT_PAGE_BDS 2
23#define ETH_RX_NUM_NEXT_PAGE_SGES 2
24 22
25#define ETH_TX_MIN_BDS_PER_NON_LSO_PKT 1 23#define ETH_TX_MIN_BDS_PER_NON_LSO_PKT 1
26#define ETH_TX_MAX_BDS_PER_NON_LSO_PACKET 18 24#define ETH_TX_MAX_BDS_PER_NON_LSO_PACKET 18
@@ -34,7 +32,8 @@
34 32
35#define ETH_NUM_STATISTIC_COUNTERS MAX_NUM_VPORTS 33#define ETH_NUM_STATISTIC_COUNTERS MAX_NUM_VPORTS
36 34
37#define ETH_REG_CQE_PBL_SIZE 3 35/* Maximum number of buffers, used for RX packet placement */
36#define ETH_RX_MAX_BUFF_PER_PKT 5
38 37
39/* num of MAC/VLAN filters */ 38/* num of MAC/VLAN filters */
40#define ETH_NUM_MAC_FILTERS 512 39#define ETH_NUM_MAC_FILTERS 512
@@ -54,9 +53,9 @@
54 53
55/* TPA constants */ 54/* TPA constants */
56#define ETH_TPA_MAX_AGGS_NUM 64 55#define ETH_TPA_MAX_AGGS_NUM 64
57#define ETH_TPA_CQE_START_SGL_SIZE 3 56#define ETH_TPA_CQE_START_LEN_LIST_SIZE ETH_RX_MAX_BUFF_PER_PKT
58#define ETH_TPA_CQE_CONT_SGL_SIZE 6 57#define ETH_TPA_CQE_CONT_LEN_LIST_SIZE 6
59#define ETH_TPA_CQE_END_SGL_SIZE 4 58#define ETH_TPA_CQE_END_LEN_LIST_SIZE 4
60 59
61/* Queue Zone sizes */ 60/* Queue Zone sizes */
62#define TSTORM_QZONE_SIZE 0 61#define TSTORM_QZONE_SIZE 0
@@ -74,18 +73,18 @@ struct coalescing_timeset {
74 73
75struct eth_tx_1st_bd_flags { 74struct eth_tx_1st_bd_flags {
76 u8 bitfields; 75 u8 bitfields;
76#define ETH_TX_1ST_BD_FLAGS_START_BD_MASK 0x1
77#define ETH_TX_1ST_BD_FLAGS_START_BD_SHIFT 0
77#define ETH_TX_1ST_BD_FLAGS_FORCE_VLAN_MODE_MASK 0x1 78#define ETH_TX_1ST_BD_FLAGS_FORCE_VLAN_MODE_MASK 0x1
78#define ETH_TX_1ST_BD_FLAGS_FORCE_VLAN_MODE_SHIFT 0 79#define ETH_TX_1ST_BD_FLAGS_FORCE_VLAN_MODE_SHIFT 1
79#define ETH_TX_1ST_BD_FLAGS_IP_CSUM_MASK 0x1 80#define ETH_TX_1ST_BD_FLAGS_IP_CSUM_MASK 0x1
80#define ETH_TX_1ST_BD_FLAGS_IP_CSUM_SHIFT 1 81#define ETH_TX_1ST_BD_FLAGS_IP_CSUM_SHIFT 2
81#define ETH_TX_1ST_BD_FLAGS_L4_CSUM_MASK 0x1 82#define ETH_TX_1ST_BD_FLAGS_L4_CSUM_MASK 0x1
82#define ETH_TX_1ST_BD_FLAGS_L4_CSUM_SHIFT 2 83#define ETH_TX_1ST_BD_FLAGS_L4_CSUM_SHIFT 3
83#define ETH_TX_1ST_BD_FLAGS_VLAN_INSERTION_MASK 0x1 84#define ETH_TX_1ST_BD_FLAGS_VLAN_INSERTION_MASK 0x1
84#define ETH_TX_1ST_BD_FLAGS_VLAN_INSERTION_SHIFT 3 85#define ETH_TX_1ST_BD_FLAGS_VLAN_INSERTION_SHIFT 4
85#define ETH_TX_1ST_BD_FLAGS_LSO_MASK 0x1 86#define ETH_TX_1ST_BD_FLAGS_LSO_MASK 0x1
86#define ETH_TX_1ST_BD_FLAGS_LSO_SHIFT 4 87#define ETH_TX_1ST_BD_FLAGS_LSO_SHIFT 5
87#define ETH_TX_1ST_BD_FLAGS_START_BD_MASK 0x1
88#define ETH_TX_1ST_BD_FLAGS_START_BD_SHIFT 5
89#define ETH_TX_1ST_BD_FLAGS_TUNN_IP_CSUM_MASK 0x1 88#define ETH_TX_1ST_BD_FLAGS_TUNN_IP_CSUM_MASK 0x1
90#define ETH_TX_1ST_BD_FLAGS_TUNN_IP_CSUM_SHIFT 6 89#define ETH_TX_1ST_BD_FLAGS_TUNN_IP_CSUM_SHIFT 6
91#define ETH_TX_1ST_BD_FLAGS_TUNN_L4_CSUM_MASK 0x1 90#define ETH_TX_1ST_BD_FLAGS_TUNN_L4_CSUM_MASK 0x1
@@ -97,38 +96,44 @@ struct eth_tx_data_1st_bd {
97 __le16 vlan; 96 __le16 vlan;
98 u8 nbds; 97 u8 nbds;
99 struct eth_tx_1st_bd_flags bd_flags; 98 struct eth_tx_1st_bd_flags bd_flags;
100 __le16 fw_use_only; 99 __le16 bitfields;
100#define ETH_TX_DATA_1ST_BD_TUNN_CFG_OVERRIDE_MASK 0x1
101#define ETH_TX_DATA_1ST_BD_TUNN_CFG_OVERRIDE_SHIFT 0
102#define ETH_TX_DATA_1ST_BD_RESERVED0_MASK 0x1
103#define ETH_TX_DATA_1ST_BD_RESERVED0_SHIFT 1
104#define ETH_TX_DATA_1ST_BD_FW_USE_ONLY_MASK 0x3FFF
105#define ETH_TX_DATA_1ST_BD_FW_USE_ONLY_SHIFT 2
101}; 106};
102 107
103/* The parsing information data for the second tx bd of a given packet. */ 108/* The parsing information data for the second tx bd of a given packet. */
104struct eth_tx_data_2nd_bd { 109struct eth_tx_data_2nd_bd {
105 __le16 tunn_ip_size; 110 __le16 tunn_ip_size;
106 __le16 bitfields; 111 __le16 bitfields1;
107#define ETH_TX_DATA_2ND_BD_L4_HDR_START_OFFSET_W_MASK 0x1FFF
108#define ETH_TX_DATA_2ND_BD_L4_HDR_START_OFFSET_W_SHIFT 0
109#define ETH_TX_DATA_2ND_BD_RESERVED0_MASK 0x7
110#define ETH_TX_DATA_2ND_BD_RESERVED0_SHIFT 13
111 __le16 bitfields2;
112#define ETH_TX_DATA_2ND_BD_TUNN_INNER_L2_HDR_SIZE_W_MASK 0xF 112#define ETH_TX_DATA_2ND_BD_TUNN_INNER_L2_HDR_SIZE_W_MASK 0xF
113#define ETH_TX_DATA_2ND_BD_TUNN_INNER_L2_HDR_SIZE_W_SHIFT 0 113#define ETH_TX_DATA_2ND_BD_TUNN_INNER_L2_HDR_SIZE_W_SHIFT 0
114#define ETH_TX_DATA_2ND_BD_TUNN_INNER_ETH_TYPE_MASK 0x3 114#define ETH_TX_DATA_2ND_BD_TUNN_INNER_ETH_TYPE_MASK 0x3
115#define ETH_TX_DATA_2ND_BD_TUNN_INNER_ETH_TYPE_SHIFT 4 115#define ETH_TX_DATA_2ND_BD_TUNN_INNER_ETH_TYPE_SHIFT 4
116#define ETH_TX_DATA_2ND_BD_DEST_PORT_MODE_MASK 0x3 116#define ETH_TX_DATA_2ND_BD_DEST_PORT_MODE_MASK 0x3
117#define ETH_TX_DATA_2ND_BD_DEST_PORT_MODE_SHIFT 6 117#define ETH_TX_DATA_2ND_BD_DEST_PORT_MODE_SHIFT 6
118#define ETH_TX_DATA_2ND_BD_START_BD_MASK 0x1
119#define ETH_TX_DATA_2ND_BD_START_BD_SHIFT 8
118#define ETH_TX_DATA_2ND_BD_TUNN_TYPE_MASK 0x3 120#define ETH_TX_DATA_2ND_BD_TUNN_TYPE_MASK 0x3
119#define ETH_TX_DATA_2ND_BD_TUNN_TYPE_SHIFT 8 121#define ETH_TX_DATA_2ND_BD_TUNN_TYPE_SHIFT 9
120#define ETH_TX_DATA_2ND_BD_TUNN_INNER_IPV6_MASK 0x1 122#define ETH_TX_DATA_2ND_BD_TUNN_INNER_IPV6_MASK 0x1
121#define ETH_TX_DATA_2ND_BD_TUNN_INNER_IPV6_SHIFT 10 123#define ETH_TX_DATA_2ND_BD_TUNN_INNER_IPV6_SHIFT 11
122#define ETH_TX_DATA_2ND_BD_IPV6_EXT_MASK 0x1 124#define ETH_TX_DATA_2ND_BD_IPV6_EXT_MASK 0x1
123#define ETH_TX_DATA_2ND_BD_IPV6_EXT_SHIFT 11 125#define ETH_TX_DATA_2ND_BD_IPV6_EXT_SHIFT 12
124#define ETH_TX_DATA_2ND_BD_TUNN_IPV6_EXT_MASK 0x1 126#define ETH_TX_DATA_2ND_BD_TUNN_IPV6_EXT_MASK 0x1
125#define ETH_TX_DATA_2ND_BD_TUNN_IPV6_EXT_SHIFT 12 127#define ETH_TX_DATA_2ND_BD_TUNN_IPV6_EXT_SHIFT 13
126#define ETH_TX_DATA_2ND_BD_L4_UDP_MASK 0x1 128#define ETH_TX_DATA_2ND_BD_L4_UDP_MASK 0x1
127#define ETH_TX_DATA_2ND_BD_L4_UDP_SHIFT 13 129#define ETH_TX_DATA_2ND_BD_L4_UDP_SHIFT 14
128#define ETH_TX_DATA_2ND_BD_L4_PSEUDO_CSUM_MODE_MASK 0x1 130#define ETH_TX_DATA_2ND_BD_L4_PSEUDO_CSUM_MODE_MASK 0x1
129#define ETH_TX_DATA_2ND_BD_L4_PSEUDO_CSUM_MODE_SHIFT 14 131#define ETH_TX_DATA_2ND_BD_L4_PSEUDO_CSUM_MODE_SHIFT 15
130#define ETH_TX_DATA_2ND_BD_RESERVED1_MASK 0x1 132 __le16 bitfields2;
131#define ETH_TX_DATA_2ND_BD_RESERVED1_SHIFT 15 133#define ETH_TX_DATA_2ND_BD_L4_HDR_START_OFFSET_W_MASK 0x1FFF
134#define ETH_TX_DATA_2ND_BD_L4_HDR_START_OFFSET_W_SHIFT 0
135#define ETH_TX_DATA_2ND_BD_RESERVED0_MASK 0x7
136#define ETH_TX_DATA_2ND_BD_RESERVED0_SHIFT 13
132}; 137};
133 138
134/* Regular ETH Rx FP CQE. */ 139/* Regular ETH Rx FP CQE. */
@@ -145,11 +150,68 @@ struct eth_fast_path_rx_reg_cqe {
145 struct parsing_and_err_flags pars_flags; 150 struct parsing_and_err_flags pars_flags;
146 __le16 vlan_tag; 151 __le16 vlan_tag;
147 __le32 rss_hash; 152 __le32 rss_hash;
148 __le16 len_on_bd; 153 __le16 len_on_first_bd;
149 u8 placement_offset; 154 u8 placement_offset;
150 u8 reserved; 155 struct tunnel_parsing_flags tunnel_pars_flags;
151 __le16 pbl[ETH_REG_CQE_PBL_SIZE]; 156 u8 bd_num;
152 u8 reserved1[10]; 157 u8 reserved[7];
158 u32 fw_debug;
159 u8 reserved1[3];
160 u8 flags;
161#define ETH_FAST_PATH_RX_REG_CQE_VALID_MASK 0x1
162#define ETH_FAST_PATH_RX_REG_CQE_VALID_SHIFT 0
163#define ETH_FAST_PATH_RX_REG_CQE_VALID_TOGGLE_MASK 0x1
164#define ETH_FAST_PATH_RX_REG_CQE_VALID_TOGGLE_SHIFT 1
165#define ETH_FAST_PATH_RX_REG_CQE_RESERVED2_MASK 0x3F
166#define ETH_FAST_PATH_RX_REG_CQE_RESERVED2_SHIFT 2
167};
168
169/* TPA-continue ETH Rx FP CQE. */
170struct eth_fast_path_rx_tpa_cont_cqe {
171 u8 type;
172 u8 tpa_agg_index;
173 __le16 len_list[ETH_TPA_CQE_CONT_LEN_LIST_SIZE];
174 u8 reserved[5];
175 u8 reserved1;
176 __le16 reserved2[ETH_TPA_CQE_CONT_LEN_LIST_SIZE];
177};
178
179/* TPA-end ETH Rx FP CQE. */
180struct eth_fast_path_rx_tpa_end_cqe {
181 u8 type;
182 u8 tpa_agg_index;
183 __le16 total_packet_len;
184 u8 num_of_bds;
185 u8 end_reason;
186 __le16 num_of_coalesced_segs;
187 __le32 ts_delta;
188 __le16 len_list[ETH_TPA_CQE_END_LEN_LIST_SIZE];
189 u8 reserved1[3];
190 u8 reserved2;
191 __le16 reserved3[ETH_TPA_CQE_END_LEN_LIST_SIZE];
192};
193
194/* TPA-start ETH Rx FP CQE. */
195struct eth_fast_path_rx_tpa_start_cqe {
196 u8 type;
197 u8 bitfields;
198#define ETH_FAST_PATH_RX_TPA_START_CQE_RSS_HASH_TYPE_MASK 0x7
199#define ETH_FAST_PATH_RX_TPA_START_CQE_RSS_HASH_TYPE_SHIFT 0
200#define ETH_FAST_PATH_RX_TPA_START_CQE_TC_MASK 0xF
201#define ETH_FAST_PATH_RX_TPA_START_CQE_TC_SHIFT 3
202#define ETH_FAST_PATH_RX_TPA_START_CQE_RESERVED0_MASK 0x1
203#define ETH_FAST_PATH_RX_TPA_START_CQE_RESERVED0_SHIFT 7
204 __le16 seg_len;
205 struct parsing_and_err_flags pars_flags;
206 __le16 vlan_tag;
207 __le32 rss_hash;
208 __le16 len_on_first_bd;
209 u8 placement_offset;
210 struct tunnel_parsing_flags tunnel_pars_flags;
211 u8 tpa_agg_index;
212 u8 header_len;
213 __le16 ext_bd_len_list[ETH_TPA_CQE_START_LEN_LIST_SIZE];
214 u32 fw_debug;
153}; 215};
154 216
155/* The L4 pseudo checksum mode for Ethernet */ 217/* The L4 pseudo checksum mode for Ethernet */
@@ -168,13 +230,26 @@ struct eth_slow_path_rx_cqe {
168 u8 type; 230 u8 type;
169 u8 ramrod_cmd_id; 231 u8 ramrod_cmd_id;
170 u8 error_flag; 232 u8 error_flag;
171 u8 reserved[27]; 233 u8 reserved[25];
172 __le16 echo; 234 __le16 echo;
235 u8 reserved1;
236 u8 flags;
237/* for PMD mode - valid indication */
238#define ETH_SLOW_PATH_RX_CQE_VALID_MASK 0x1
239#define ETH_SLOW_PATH_RX_CQE_VALID_SHIFT 0
240/* for PMD mode - valid toggle indication */
241#define ETH_SLOW_PATH_RX_CQE_VALID_TOGGLE_MASK 0x1
242#define ETH_SLOW_PATH_RX_CQE_VALID_TOGGLE_SHIFT 1
243#define ETH_SLOW_PATH_RX_CQE_RESERVED2_MASK 0x3F
244#define ETH_SLOW_PATH_RX_CQE_RESERVED2_SHIFT 2
173}; 245};
174 246
175/* union for all ETH Rx CQE types */ 247/* union for all ETH Rx CQE types */
176union eth_rx_cqe { 248union eth_rx_cqe {
177 struct eth_fast_path_rx_reg_cqe fast_path_regular; 249 struct eth_fast_path_rx_reg_cqe fast_path_regular;
250 struct eth_fast_path_rx_tpa_start_cqe fast_path_tpa_start;
251 struct eth_fast_path_rx_tpa_cont_cqe fast_path_tpa_cont;
252 struct eth_fast_path_rx_tpa_end_cqe fast_path_tpa_end;
178 struct eth_slow_path_rx_cqe slow_path; 253 struct eth_slow_path_rx_cqe slow_path;
179}; 254};
180 255
@@ -183,15 +258,18 @@ enum eth_rx_cqe_type {
183 ETH_RX_CQE_TYPE_UNUSED, 258 ETH_RX_CQE_TYPE_UNUSED,
184 ETH_RX_CQE_TYPE_REGULAR, 259 ETH_RX_CQE_TYPE_REGULAR,
185 ETH_RX_CQE_TYPE_SLOW_PATH, 260 ETH_RX_CQE_TYPE_SLOW_PATH,
261 ETH_RX_CQE_TYPE_TPA_START,
262 ETH_RX_CQE_TYPE_TPA_CONT,
263 ETH_RX_CQE_TYPE_TPA_END,
186 MAX_ETH_RX_CQE_TYPE 264 MAX_ETH_RX_CQE_TYPE
187}; 265};
188 266
189/* ETH Rx producers data */ 267/* ETH Rx producers data */
190struct eth_rx_prod_data { 268struct eth_rx_prod_data {
191 __le16 bd_prod; 269 __le16 bd_prod;
192 __le16 sge_prod;
193 __le16 cqe_prod; 270 __le16 cqe_prod;
194 __le16 reserved; 271 __le16 reserved;
272 __le16 reserved1;
195}; 273};
196 274
197/* The first tx bd of a given packet */ 275/* The first tx bd of a given packet */
@@ -211,12 +289,17 @@ struct eth_tx_2nd_bd {
211/* The parsing information data for the third tx bd of a given packet. */ 289/* The parsing information data for the third tx bd of a given packet. */
212struct eth_tx_data_3rd_bd { 290struct eth_tx_data_3rd_bd {
213 __le16 lso_mss; 291 __le16 lso_mss;
214 u8 bitfields; 292 __le16 bitfields;
215#define ETH_TX_DATA_3RD_BD_TCP_HDR_LEN_DW_MASK 0xF 293#define ETH_TX_DATA_3RD_BD_TCP_HDR_LEN_DW_MASK 0xF
216#define ETH_TX_DATA_3RD_BD_TCP_HDR_LEN_DW_SHIFT 0 294#define ETH_TX_DATA_3RD_BD_TCP_HDR_LEN_DW_SHIFT 0
217#define ETH_TX_DATA_3RD_BD_HDR_NBD_MASK 0xF 295#define ETH_TX_DATA_3RD_BD_HDR_NBD_MASK 0xF
218#define ETH_TX_DATA_3RD_BD_HDR_NBD_SHIFT 4 296#define ETH_TX_DATA_3RD_BD_HDR_NBD_SHIFT 4
219 u8 resereved0[3]; 297#define ETH_TX_DATA_3RD_BD_START_BD_MASK 0x1
298#define ETH_TX_DATA_3RD_BD_START_BD_SHIFT 8
299#define ETH_TX_DATA_3RD_BD_RESERVED0_MASK 0x7F
300#define ETH_TX_DATA_3RD_BD_RESERVED0_SHIFT 9
301 u8 tunn_l4_hdr_start_offset_w;
302 u8 tunn_hdr_size_w;
220}; 303};
221 304
222/* The third tx bd of a given packet */ 305/* The third tx bd of a given packet */
@@ -226,12 +309,24 @@ struct eth_tx_3rd_bd {
226 struct eth_tx_data_3rd_bd data; 309 struct eth_tx_data_3rd_bd data;
227}; 310};
228 311
312/* Complementary information for the regular tx bd of a given packet. */
313struct eth_tx_data_bd {
314 __le16 reserved0;
315 __le16 bitfields;
316#define ETH_TX_DATA_BD_RESERVED1_MASK 0xFF
317#define ETH_TX_DATA_BD_RESERVED1_SHIFT 0
318#define ETH_TX_DATA_BD_START_BD_MASK 0x1
319#define ETH_TX_DATA_BD_START_BD_SHIFT 8
320#define ETH_TX_DATA_BD_RESERVED2_MASK 0x7F
321#define ETH_TX_DATA_BD_RESERVED2_SHIFT 9
322 __le16 reserved3;
323};
324
229/* The common non-special TX BD ring element */ 325/* The common non-special TX BD ring element */
230struct eth_tx_bd { 326struct eth_tx_bd {
231 struct regpair addr; 327 struct regpair addr;
232 __le16 nbytes; 328 __le16 nbytes;
233 __le16 reserved0; 329 struct eth_tx_data_bd data;
234 __le32 reserved1;
235}; 330};
236 331
237union eth_tx_bd_types { 332union eth_tx_bd_types {
diff --git a/include/linux/qed/qed_chain.h b/include/linux/qed/qed_chain.h
index 41b9049b57e2..5f8fcaaa6504 100644
--- a/include/linux/qed/qed_chain.h
+++ b/include/linux/qed/qed_chain.h
@@ -19,6 +19,10 @@
19/* dma_addr_t manip */ 19/* dma_addr_t manip */
20#define DMA_LO_LE(x) cpu_to_le32(lower_32_bits(x)) 20#define DMA_LO_LE(x) cpu_to_le32(lower_32_bits(x))
21#define DMA_HI_LE(x) cpu_to_le32(upper_32_bits(x)) 21#define DMA_HI_LE(x) cpu_to_le32(upper_32_bits(x))
22#define DMA_REGPAIR_LE(x, val) do { \
23 (x).hi = DMA_HI_LE((val)); \
24 (x).lo = DMA_LO_LE((val)); \
25 } while (0)
22 26
23#define HILO_GEN(hi, lo, type) ((((type)(hi)) << 32) + (lo)) 27#define HILO_GEN(hi, lo, type) ((((type)(hi)) << 32) + (lo))
24#define HILO_DMA(hi, lo) HILO_GEN(hi, lo, dma_addr_t) 28#define HILO_DMA(hi, lo) HILO_GEN(hi, lo, dma_addr_t)
diff --git a/include/linux/qed/qed_eth_if.h b/include/linux/qed/qed_eth_if.h
index 81ab178e31c1..e1d69834a11f 100644
--- a/include/linux/qed/qed_eth_if.h
+++ b/include/linux/qed/qed_eth_if.h
@@ -33,10 +33,20 @@ struct qed_update_vport_params {
33 u8 vport_id; 33 u8 vport_id;
34 u8 update_vport_active_flg; 34 u8 update_vport_active_flg;
35 u8 vport_active_flg; 35 u8 vport_active_flg;
36 u8 update_accept_any_vlan_flg;
37 u8 accept_any_vlan;
36 u8 update_rss_flg; 38 u8 update_rss_flg;
37 struct qed_update_vport_rss_params rss_params; 39 struct qed_update_vport_rss_params rss_params;
38}; 40};
39 41
42struct qed_start_vport_params {
43 bool remove_inner_vlan;
44 bool gro_enable;
45 bool drop_ttl0;
46 u8 vport_id;
47 u16 mtu;
48};
49
40struct qed_stop_rxq_params { 50struct qed_stop_rxq_params {
41 u8 rss_id; 51 u8 rss_id;
42 u8 rx_queue_id; 52 u8 rx_queue_id;
@@ -116,9 +126,7 @@ struct qed_eth_ops {
116 void *cookie); 126 void *cookie);
117 127
118 int (*vport_start)(struct qed_dev *cdev, 128 int (*vport_start)(struct qed_dev *cdev,
119 u8 vport_id, u16 mtu, 129 struct qed_start_vport_params *params);
120 u8 drop_ttl0_flg,
121 u8 inner_vlan_removal_en_flg);
122 130
123 int (*vport_stop)(struct qed_dev *cdev, 131 int (*vport_stop)(struct qed_dev *cdev,
124 u8 vport_id); 132 u8 vport_id);
diff --git a/include/linux/qed/qed_if.h b/include/linux/qed/qed_if.h
index d4a32e878180..1f7599c77cd4 100644
--- a/include/linux/qed/qed_if.h
+++ b/include/linux/qed/qed_if.h
@@ -80,7 +80,7 @@ struct qed_dev_info {
80 u8 num_hwfns; 80 u8 num_hwfns;
81 81
82 u8 hw_mac[ETH_ALEN]; 82 u8 hw_mac[ETH_ALEN];
83 bool is_mf; 83 bool is_mf_default;
84 84
85 /* FW version */ 85 /* FW version */
86 u16 fw_major; 86 u16 fw_major;
@@ -360,6 +360,12 @@ enum DP_MODULE {
360 /* to be added...up to 0x8000000 */ 360 /* to be added...up to 0x8000000 */
361}; 361};
362 362
363enum qed_mf_mode {
364 QED_MF_DEFAULT,
365 QED_MF_OVLAN,
366 QED_MF_NPAR,
367};
368
363struct qed_eth_stats { 369struct qed_eth_stats {
364 u64 no_buff_discards; 370 u64 no_buff_discards;
365 u64 packet_too_big_discard; 371 u64 packet_too_big_discard;
@@ -440,6 +446,12 @@ struct qed_eth_stats {
440#define RX_PI 0 446#define RX_PI 0
441#define TX_PI(tc) (RX_PI + 1 + tc) 447#define TX_PI(tc) (RX_PI + 1 + tc)
442 448
449struct qed_sb_cnt_info {
450 int sb_cnt;
451 int sb_iov_cnt;
452 int sb_free_blk;
453};
454
443static inline u16 qed_sb_update_sb_idx(struct qed_sb_info *sb_info) 455static inline u16 qed_sb_update_sb_idx(struct qed_sb_info *sb_info)
444{ 456{
445 u32 prod = 0; 457 u32 prod = 0;
diff --git a/include/linux/rculist.h b/include/linux/rculist.h
index 14ec1652daf4..17d4f849c65e 100644
--- a/include/linux/rculist.h
+++ b/include/linux/rculist.h
@@ -319,6 +319,27 @@ static inline void list_splice_tail_init_rcu(struct list_head *list,
319}) 319})
320 320
321/** 321/**
322 * list_next_or_null_rcu - get the first element from a list
323 * @head: the head for the list.
324 * @ptr: the list head to take the next element from.
325 * @type: the type of the struct this is embedded in.
326 * @member: the name of the list_head within the struct.
327 *
328 * Note that if the ptr is at the end of the list, NULL is returned.
329 *
330 * This primitive may safely run concurrently with the _rcu list-mutation
331 * primitives such as list_add_rcu() as long as it's guarded by rcu_read_lock().
332 */
333#define list_next_or_null_rcu(head, ptr, type, member) \
334({ \
335 struct list_head *__head = (head); \
336 struct list_head *__ptr = (ptr); \
337 struct list_head *__next = READ_ONCE(__ptr->next); \
338 likely(__next != __head) ? list_entry_rcu(__next, type, \
339 member) : NULL; \
340})
341
342/**
322 * list_for_each_entry_rcu - iterate over rcu list of given type 343 * list_for_each_entry_rcu - iterate over rcu list of given type
323 * @pos: the type * to use as a loop cursor. 344 * @pos: the type * to use as a loop cursor.
324 * @head: the head for your list. 345 * @head: the head for your list.
diff --git a/include/linux/rfkill-gpio.h b/include/linux/rfkill-gpio.h
deleted file mode 100644
index 20bcb55498cd..000000000000
--- a/include/linux/rfkill-gpio.h
+++ /dev/null
@@ -1,37 +0,0 @@
1/*
2 * Copyright (c) 2011, NVIDIA Corporation.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18
19
20#ifndef __RFKILL_GPIO_H
21#define __RFKILL_GPIO_H
22
23#include <linux/types.h>
24#include <linux/rfkill.h>
25
26/**
27 * struct rfkill_gpio_platform_data - platform data for rfkill gpio device.
28 * for unused gpio's, the expected value is -1.
29 * @name: name for the gpio rf kill instance
30 */
31
32struct rfkill_gpio_platform_data {
33 char *name;
34 enum rfkill_type type;
35};
36
37#endif /* __RFKILL_GPIO_H */
diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h
index d9010789b4e8..e6a0031d1b1f 100644
--- a/include/linux/rfkill.h
+++ b/include/linux/rfkill.h
@@ -104,7 +104,8 @@ int __must_check rfkill_register(struct rfkill *rfkill);
104 * 104 *
105 * Pause polling -- say transmitter is off for other reasons. 105 * Pause polling -- say transmitter is off for other reasons.
106 * NOTE: not necessary for suspend/resume -- in that case the 106 * NOTE: not necessary for suspend/resume -- in that case the
107 * core stops polling anyway 107 * core stops polling anyway (but will also correctly handle
108 * the case of polling having been paused before suspend.)
108 */ 109 */
109void rfkill_pause_polling(struct rfkill *rfkill); 110void rfkill_pause_polling(struct rfkill *rfkill);
110 111
@@ -212,6 +213,15 @@ void rfkill_set_states(struct rfkill *rfkill, bool sw, bool hw);
212 * @rfkill: rfkill struct to query 213 * @rfkill: rfkill struct to query
213 */ 214 */
214bool rfkill_blocked(struct rfkill *rfkill); 215bool rfkill_blocked(struct rfkill *rfkill);
216
217/**
218 * rfkill_find_type - Helpper for finding rfkill type by name
219 * @name: the name of the type
220 *
221 * Returns enum rfkill_type that conrresponds the name.
222 */
223enum rfkill_type rfkill_find_type(const char *name);
224
215#else /* !RFKILL */ 225#else /* !RFKILL */
216static inline struct rfkill * __must_check 226static inline struct rfkill * __must_check
217rfkill_alloc(const char *name, 227rfkill_alloc(const char *name,
@@ -268,6 +278,12 @@ static inline bool rfkill_blocked(struct rfkill *rfkill)
268{ 278{
269 return false; 279 return false;
270} 280}
281
282static inline enum rfkill_type rfkill_find_type(const char *name)
283{
284 return RFKILL_TYPE_ALL;
285}
286
271#endif /* RFKILL || RFKILL_MODULE */ 287#endif /* RFKILL || RFKILL_MODULE */
272 288
273 289
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index d3fcd4591ce4..15d0df943466 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -1161,10 +1161,6 @@ static inline void skb_copy_hash(struct sk_buff *to, const struct sk_buff *from)
1161 to->l4_hash = from->l4_hash; 1161 to->l4_hash = from->l4_hash;
1162}; 1162};
1163 1163
1164static inline void skb_sender_cpu_clear(struct sk_buff *skb)
1165{
1166}
1167
1168#ifdef NET_SKBUFF_DATA_USES_OFFSET 1164#ifdef NET_SKBUFF_DATA_USES_OFFSET
1169static inline unsigned char *skb_end_pointer(const struct sk_buff *skb) 1165static inline unsigned char *skb_end_pointer(const struct sk_buff *skb)
1170{ 1166{
@@ -2186,6 +2182,11 @@ static inline int skb_checksum_start_offset(const struct sk_buff *skb)
2186 return skb->csum_start - skb_headroom(skb); 2182 return skb->csum_start - skb_headroom(skb);
2187} 2183}
2188 2184
2185static inline unsigned char *skb_checksum_start(const struct sk_buff *skb)
2186{
2187 return skb->head + skb->csum_start;
2188}
2189
2189static inline int skb_transport_offset(const struct sk_buff *skb) 2190static inline int skb_transport_offset(const struct sk_buff *skb)
2190{ 2191{
2191 return skb_transport_header(skb) - skb->data; 2192 return skb_transport_header(skb) - skb->data;
@@ -2424,6 +2425,10 @@ static inline struct sk_buff *napi_alloc_skb(struct napi_struct *napi,
2424{ 2425{
2425 return __napi_alloc_skb(napi, length, GFP_ATOMIC); 2426 return __napi_alloc_skb(napi, length, GFP_ATOMIC);
2426} 2427}
2428void napi_consume_skb(struct sk_buff *skb, int budget);
2429
2430void __kfree_skb_flush(void);
2431void __kfree_skb_defer(struct sk_buff *skb);
2427 2432
2428/** 2433/**
2429 * __dev_alloc_pages - allocate page for network Rx 2434 * __dev_alloc_pages - allocate page for network Rx
@@ -2646,6 +2651,13 @@ static inline int skb_clone_writable(const struct sk_buff *skb, unsigned int len
2646 skb_headroom(skb) + len <= skb->hdr_len; 2651 skb_headroom(skb) + len <= skb->hdr_len;
2647} 2652}
2648 2653
2654static inline int skb_try_make_writable(struct sk_buff *skb,
2655 unsigned int write_len)
2656{
2657 return skb_cloned(skb) && !skb_clone_writable(skb, write_len) &&
2658 pskb_expand_head(skb, 0, 0, GFP_ATOMIC);
2659}
2660
2649static inline int __skb_cow(struct sk_buff *skb, unsigned int headroom, 2661static inline int __skb_cow(struct sk_buff *skb, unsigned int headroom,
2650 int cloned) 2662 int cloned)
2651{ 2663{
@@ -3574,6 +3586,7 @@ static inline struct sec_path *skb_sec_path(struct sk_buff *skb)
3574struct skb_gso_cb { 3586struct skb_gso_cb {
3575 int mac_offset; 3587 int mac_offset;
3576 int encap_level; 3588 int encap_level;
3589 __wsum csum;
3577 __u16 csum_start; 3590 __u16 csum_start;
3578}; 3591};
3579#define SKB_SGO_CB_OFFSET 32 3592#define SKB_SGO_CB_OFFSET 32
@@ -3600,6 +3613,16 @@ static inline int gso_pskb_expand_head(struct sk_buff *skb, int extra)
3600 return 0; 3613 return 0;
3601} 3614}
3602 3615
3616static inline void gso_reset_checksum(struct sk_buff *skb, __wsum res)
3617{
3618 /* Do not update partial checksums if remote checksum is enabled. */
3619 if (skb->remcsum_offload)
3620 return;
3621
3622 SKB_GSO_CB(skb)->csum = res;
3623 SKB_GSO_CB(skb)->csum_start = skb_checksum_start(skb) - skb->head;
3624}
3625
3603/* Compute the checksum for a gso segment. First compute the checksum value 3626/* Compute the checksum for a gso segment. First compute the checksum value
3604 * from the start of transport header to SKB_GSO_CB(skb)->csum_start, and 3627 * from the start of transport header to SKB_GSO_CB(skb)->csum_start, and
3605 * then add in skb->csum (checksum from csum_start to end of packet). 3628 * then add in skb->csum (checksum from csum_start to end of packet).
@@ -3610,15 +3633,14 @@ static inline int gso_pskb_expand_head(struct sk_buff *skb, int extra)
3610 */ 3633 */
3611static inline __sum16 gso_make_checksum(struct sk_buff *skb, __wsum res) 3634static inline __sum16 gso_make_checksum(struct sk_buff *skb, __wsum res)
3612{ 3635{
3613 int plen = SKB_GSO_CB(skb)->csum_start - skb_headroom(skb) - 3636 unsigned char *csum_start = skb_transport_header(skb);
3614 skb_transport_offset(skb); 3637 int plen = (skb->head + SKB_GSO_CB(skb)->csum_start) - csum_start;
3615 __wsum partial; 3638 __wsum partial = SKB_GSO_CB(skb)->csum;
3616 3639
3617 partial = csum_partial(skb_transport_header(skb), plen, skb->csum); 3640 SKB_GSO_CB(skb)->csum = res;
3618 skb->csum = res; 3641 SKB_GSO_CB(skb)->csum_start = csum_start - skb->head;
3619 SKB_GSO_CB(skb)->csum_start -= plen;
3620 3642
3621 return csum_fold(partial); 3643 return csum_fold(csum_partial(csum_start, plen, partial));
3622} 3644}
3623 3645
3624static inline bool skb_is_gso(const struct sk_buff *skb) 3646static inline bool skb_is_gso(const struct sk_buff *skb)
@@ -3708,5 +3730,30 @@ static inline unsigned int skb_gso_network_seglen(const struct sk_buff *skb)
3708 return hdr_len + skb_gso_transport_seglen(skb); 3730 return hdr_len + skb_gso_transport_seglen(skb);
3709} 3731}
3710 3732
3733/* Local Checksum Offload.
3734 * Compute outer checksum based on the assumption that the
3735 * inner checksum will be offloaded later.
3736 * See Documentation/networking/checksum-offloads.txt for
3737 * explanation of how this works.
3738 * Fill in outer checksum adjustment (e.g. with sum of outer
3739 * pseudo-header) before calling.
3740 * Also ensure that inner checksum is in linear data area.
3741 */
3742static inline __wsum lco_csum(struct sk_buff *skb)
3743{
3744 unsigned char *csum_start = skb_checksum_start(skb);
3745 unsigned char *l4_hdr = skb_transport_header(skb);
3746 __wsum partial;
3747
3748 /* Start with complement of inner checksum adjustment */
3749 partial = ~csum_unfold(*(__force __sum16 *)(csum_start +
3750 skb->csum_offset));
3751
3752 /* Add in checksum of our headers (incl. outer checksum
3753 * adjustment filled in by caller) and return result.
3754 */
3755 return csum_partial(l4_hdr, csum_start - l4_hdr, partial);
3756}
3757
3711#endif /* __KERNEL__ */ 3758#endif /* __KERNEL__ */
3712#endif /* _LINUX_SKBUFF_H */ 3759#endif /* _LINUX_SKBUFF_H */
diff --git a/include/linux/socket.h b/include/linux/socket.h
index 5bf59c8493b7..73bf6c6a833b 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -200,7 +200,9 @@ struct ucred {
200#define AF_ALG 38 /* Algorithm sockets */ 200#define AF_ALG 38 /* Algorithm sockets */
201#define AF_NFC 39 /* NFC sockets */ 201#define AF_NFC 39 /* NFC sockets */
202#define AF_VSOCK 40 /* vSockets */ 202#define AF_VSOCK 40 /* vSockets */
203#define AF_MAX 41 /* For now.. */ 203#define AF_KCM 41 /* Kernel Connection Multiplexor*/
204
205#define AF_MAX 42 /* For now.. */
204 206
205/* Protocol families, same as address families. */ 207/* Protocol families, same as address families. */
206#define PF_UNSPEC AF_UNSPEC 208#define PF_UNSPEC AF_UNSPEC
@@ -246,6 +248,7 @@ struct ucred {
246#define PF_ALG AF_ALG 248#define PF_ALG AF_ALG
247#define PF_NFC AF_NFC 249#define PF_NFC AF_NFC
248#define PF_VSOCK AF_VSOCK 250#define PF_VSOCK AF_VSOCK
251#define PF_KCM AF_KCM
249#define PF_MAX AF_MAX 252#define PF_MAX AF_MAX
250 253
251/* Maximum queue length specifiable by listen. */ 254/* Maximum queue length specifiable by listen. */
@@ -274,6 +277,7 @@ struct ucred {
274#define MSG_MORE 0x8000 /* Sender will send more */ 277#define MSG_MORE 0x8000 /* Sender will send more */
275#define MSG_WAITFORONE 0x10000 /* recvmmsg(): block until 1+ packets avail */ 278#define MSG_WAITFORONE 0x10000 /* recvmmsg(): block until 1+ packets avail */
276#define MSG_SENDPAGE_NOTLAST 0x20000 /* sendpage() internal : not the last page */ 279#define MSG_SENDPAGE_NOTLAST 0x20000 /* sendpage() internal : not the last page */
280#define MSG_BATCH 0x40000 /* sendmmsg(): more messages coming */
277#define MSG_EOF MSG_FIN 281#define MSG_EOF MSG_FIN
278 282
279#define MSG_FASTOPEN 0x20000000 /* Send data in TCP SYN */ 283#define MSG_FASTOPEN 0x20000000 /* Send data in TCP SYN */
@@ -322,6 +326,7 @@ struct ucred {
322#define SOL_CAIF 278 326#define SOL_CAIF 278
323#define SOL_ALG 279 327#define SOL_ALG 279
324#define SOL_NFC 280 328#define SOL_NFC 280
329#define SOL_KCM 281
325 330
326/* IPX options */ 331/* IPX options */
327#define IPX_TYPE 1 332#define IPX_TYPE 1
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
index 881a79d52467..4bcf5a61aada 100644
--- a/include/linux/stmmac.h
+++ b/include/linux/stmmac.h
@@ -90,7 +90,21 @@ struct stmmac_dma_cfg {
90 int pbl; 90 int pbl;
91 int fixed_burst; 91 int fixed_burst;
92 int mixed_burst; 92 int mixed_burst;
93 int burst_len; 93 bool aal;
94};
95
96#define AXI_BLEN 7
97struct stmmac_axi {
98 bool axi_lpi_en;
99 bool axi_xit_frm;
100 u32 axi_wr_osr_lmt;
101 u32 axi_rd_osr_lmt;
102 bool axi_kbbe;
103 bool axi_axi_all;
104 u32 axi_blen[AXI_BLEN];
105 bool axi_fb;
106 bool axi_mb;
107 bool axi_rb;
94}; 108};
95 109
96struct plat_stmmacenet_data { 110struct plat_stmmacenet_data {
@@ -123,5 +137,6 @@ struct plat_stmmacenet_data {
123 int (*init)(struct platform_device *pdev, void *priv); 137 int (*init)(struct platform_device *pdev, void *priv);
124 void (*exit)(struct platform_device *pdev, void *priv); 138 void (*exit)(struct platform_device *pdev, void *priv);
125 void *bsp_priv; 139 void *bsp_priv;
140 struct stmmac_axi *axi;
126}; 141};
127#endif 142#endif
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index b386361ba3e8..7be9b1242354 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -29,9 +29,14 @@ static inline struct tcphdr *tcp_hdr(const struct sk_buff *skb)
29 return (struct tcphdr *)skb_transport_header(skb); 29 return (struct tcphdr *)skb_transport_header(skb);
30} 30}
31 31
32static inline unsigned int __tcp_hdrlen(const struct tcphdr *th)
33{
34 return th->doff * 4;
35}
36
32static inline unsigned int tcp_hdrlen(const struct sk_buff *skb) 37static inline unsigned int tcp_hdrlen(const struct sk_buff *skb)
33{ 38{
34 return tcp_hdr(skb)->doff * 4; 39 return __tcp_hdrlen(tcp_hdr(skb));
35} 40}
36 41
37static inline struct tcphdr *inner_tcp_hdr(const struct sk_buff *skb) 42static inline struct tcphdr *inner_tcp_hdr(const struct sk_buff *skb)
@@ -153,6 +158,9 @@ struct tcp_sock {
153 u32 segs_in; /* RFC4898 tcpEStatsPerfSegsIn 158 u32 segs_in; /* RFC4898 tcpEStatsPerfSegsIn
154 * total number of segments in. 159 * total number of segments in.
155 */ 160 */
161 u32 data_segs_in; /* RFC4898 tcpEStatsPerfDataSegsIn
162 * total number of data segments in.
163 */
156 u32 rcv_nxt; /* What we want to receive next */ 164 u32 rcv_nxt; /* What we want to receive next */
157 u32 copied_seq; /* Head of yet unread data */ 165 u32 copied_seq; /* Head of yet unread data */
158 u32 rcv_wup; /* rcv_nxt on last window update sent */ 166 u32 rcv_wup; /* rcv_nxt on last window update sent */
@@ -160,6 +168,9 @@ struct tcp_sock {
160 u32 segs_out; /* RFC4898 tcpEStatsPerfSegsOut 168 u32 segs_out; /* RFC4898 tcpEStatsPerfSegsOut
161 * The total number of segments sent. 169 * The total number of segments sent.
162 */ 170 */
171 u32 data_segs_out; /* RFC4898 tcpEStatsPerfDataSegsOut
172 * total number of data segments sent.
173 */
163 u64 bytes_acked; /* RFC4898 tcpEStatsAppHCThruOctetsAcked 174 u64 bytes_acked; /* RFC4898 tcpEStatsAppHCThruOctetsAcked
164 * sum(delta(snd_una)), or how many bytes 175 * sum(delta(snd_una)), or how many bytes
165 * were acked. 176 * were acked.
@@ -256,6 +267,7 @@ struct tcp_sock {
256 u32 prr_delivered; /* Number of newly delivered packets to 267 u32 prr_delivered; /* Number of newly delivered packets to
257 * receiver in Recovery. */ 268 * receiver in Recovery. */
258 u32 prr_out; /* Total number of pkts sent during Recovery. */ 269 u32 prr_out; /* Total number of pkts sent during Recovery. */
270 u32 delivered; /* Total data packets delivered incl. rexmits */
259 271
260 u32 rcv_wnd; /* Current receiver window */ 272 u32 rcv_wnd; /* Current receiver window */
261 u32 write_seq; /* Tail(+1) of data held in tcp send buffer */ 273 u32 write_seq; /* Tail(+1) of data held in tcp send buffer */