Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

Pull networking fixes from David Miller:

1) CAN fixes from Martin Kelly (cancel URBs properly in all the CAN usb
drivers).

2) Revert returning -EEXIST from __dev_alloc_name() as this propagates
to userspace and broke some apps. From Johannes Berg.

3) Fix conn memory leaks and crashes in TIPC, from Jon Malloc and Cong
Wang.

4) Gianfar MAC can't do EEE so don't advertise it by default, from
Claudiu Manoil.

5) Relax strict netlink attribute validation, but emit a warning. From
David Ahern.

6) Fix regression in checksum offload of thunderx driver, from Florian
Westphal.

7) Fix UAPI bpf issues on s390, from Hendrik Brueckner.

8) New card support in iwlwifi, from Ihab Zhaika.

9) BBR congestion control bug fixes from Neal Cardwell.

10) Fix port stats in nfp driver, from Pieter Jansen van Vuuren.

11) Fix leaks in qualcomm rmnet, from Subash Abhinov Kasiviswanathan.

12) Fix DMA API handling in sh_eth driver, from Thomas Petazzoni.

13) Fix spurious netpoll warnings in bnxt_en, from Calvin Owens.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (67 commits)
net: mvpp2: fix the RSS table entry offset
tcp: evaluate packet losses upon RTT change
tcp: fix off-by-one bug in RACK
tcp: always evaluate losses in RACK upon undo
tcp: correctly test congestion state in RACK
bnxt_en: Fix sources of spurious netpoll warnings
tcp_bbr: reset long-term bandwidth sampling on loss recovery undo
tcp_bbr: reset full pipe detection on loss recovery undo
tcp_bbr: record "full bw reached" decision in new full_bw_reached bit
sfc: pass valid pointers from efx_enqueue_unwind
gianfar: Disable EEE autoneg by default
tcp: invalidate rate samples during SACK reneging
can: peak/pcie_fd: fix potential bug in restarting tx queue
can: usb_8dev: cancel urb on -EPIPE and -EPROTO
can: kvaser_usb: cancel urb on -EPIPE and -EPROTO
can: esd_usb2: cancel urb on -EPIPE and -EPROTO
can: ems_usb: cancel urb on -EPIPE and -EPROTO
can: mcba_usb: cancel urb on -EPROTO
usbnet: fix alignment for frames with no ethernet header
tcp: use current time in tcp_rcv_space_adjust()
...

+1052 -367
+2
arch/alpha/include/uapi/asm/Kbuild
··· 1 1 # UAPI Header export list 2 2 include include/uapi/asm-generic/Kbuild.asm 3 + 4 + generic-y += bpf_perf_event.h
+1
arch/arc/include/uapi/asm/Kbuild
··· 3 3 4 4 generic-y += auxvec.h 5 5 generic-y += bitsperlong.h 6 + generic-y += bpf_perf_event.h 6 7 generic-y += errno.h 7 8 generic-y += fcntl.h 8 9 generic-y += ioctl.h
+1
arch/arm/include/uapi/asm/Kbuild
··· 7 7 generated-y += unistd-eabi.h 8 8 9 9 generic-y += bitsperlong.h 10 + generic-y += bpf_perf_event.h 10 11 generic-y += errno.h 11 12 generic-y += ioctl.h 12 13 generic-y += ipcbuf.h
+2
arch/arm64/include/asm/perf_event.h
··· 18 18 #define __ASM_PERF_EVENT_H 19 19 20 20 #include <asm/stack_pointer.h> 21 + #include <asm/ptrace.h> 21 22 22 23 #define ARMV8_PMU_MAX_COUNTERS 32 23 24 #define ARMV8_PMU_COUNTER_MASK (ARMV8_PMU_MAX_COUNTERS - 1) ··· 80 79 extern unsigned long perf_instruction_pointer(struct pt_regs *regs); 81 80 extern unsigned long perf_misc_flags(struct pt_regs *regs); 82 81 #define perf_misc_flags(regs) perf_misc_flags(regs) 82 + #define perf_arch_bpf_user_pt_regs(regs) &regs->user_regs 83 83 #endif 84 84 85 85 #define perf_arch_fetch_caller_regs(regs, __ip) { \
+9
arch/arm64/include/uapi/asm/bpf_perf_event.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + #ifndef _UAPI__ASM_BPF_PERF_EVENT_H__ 3 + #define _UAPI__ASM_BPF_PERF_EVENT_H__ 4 + 5 + #include <asm/ptrace.h> 6 + 7 + typedef struct user_pt_regs bpf_user_pt_regs_t; 8 + 9 + #endif /* _UAPI__ASM_BPF_PERF_EVENT_H__ */
+1
arch/blackfin/include/uapi/asm/Kbuild
··· 3 3 4 4 generic-y += auxvec.h 5 5 generic-y += bitsperlong.h 6 + generic-y += bpf_perf_event.h 6 7 generic-y += errno.h 7 8 generic-y += ioctl.h 8 9 generic-y += ipcbuf.h
+1
arch/c6x/include/uapi/asm/Kbuild
··· 3 3 4 4 generic-y += auxvec.h 5 5 generic-y += bitsperlong.h 6 + generic-y += bpf_perf_event.h 6 7 generic-y += errno.h 7 8 generic-y += fcntl.h 8 9 generic-y += ioctl.h
+1
arch/cris/include/uapi/asm/Kbuild
··· 3 3 4 4 generic-y += auxvec.h 5 5 generic-y += bitsperlong.h 6 + generic-y += bpf_perf_event.h 6 7 generic-y += errno.h 7 8 generic-y += fcntl.h 8 9 generic-y += ioctl.h
+2
arch/frv/include/uapi/asm/Kbuild
··· 1 1 # UAPI Header export list 2 2 include include/uapi/asm-generic/Kbuild.asm 3 + 4 + generic-y += bpf_perf_event.h
+1
arch/h8300/include/uapi/asm/Kbuild
··· 2 2 include include/uapi/asm-generic/Kbuild.asm 3 3 4 4 generic-y += auxvec.h 5 + generic-y += bpf_perf_event.h 5 6 generic-y += errno.h 6 7 generic-y += fcntl.h 7 8 generic-y += ioctl.h
+1
arch/hexagon/include/uapi/asm/Kbuild
··· 2 2 include include/uapi/asm-generic/Kbuild.asm 3 3 4 4 generic-y += auxvec.h 5 + generic-y += bpf_perf_event.h 5 6 generic-y += errno.h 6 7 generic-y += fcntl.h 7 8 generic-y += ioctl.h
+1
arch/ia64/include/uapi/asm/Kbuild
··· 1 1 # UAPI Header export list 2 2 include include/uapi/asm-generic/Kbuild.asm 3 3 4 + generic-y += bpf_perf_event.h 4 5 generic-y += kvm_para.h
+1
arch/m32r/include/uapi/asm/Kbuild
··· 1 1 # UAPI Header export list 2 2 include include/uapi/asm-generic/Kbuild.asm 3 3 4 + generic-y += bpf_perf_event.h 4 5 generic-y += kvm_para.h 5 6 generic-y += siginfo.h
+1
arch/m68k/include/uapi/asm/Kbuild
··· 3 3 4 4 generic-y += auxvec.h 5 5 generic-y += bitsperlong.h 6 + generic-y += bpf_perf_event.h 6 7 generic-y += errno.h 7 8 generic-y += ioctl.h 8 9 generic-y += ipcbuf.h
+1
arch/metag/include/uapi/asm/Kbuild
··· 3 3 4 4 generic-y += auxvec.h 5 5 generic-y += bitsperlong.h 6 + generic-y += bpf_perf_event.h 6 7 generic-y += errno.h 7 8 generic-y += fcntl.h 8 9 generic-y += ioctl.h
+1
arch/microblaze/include/uapi/asm/Kbuild
··· 2 2 include include/uapi/asm-generic/Kbuild.asm 3 3 4 4 generic-y += bitsperlong.h 5 + generic-y += bpf_perf_event.h 5 6 generic-y += errno.h 6 7 generic-y += fcntl.h 7 8 generic-y += ioctl.h
+1
arch/mips/include/uapi/asm/Kbuild
··· 1 1 # UAPI Header export list 2 2 include include/uapi/asm-generic/Kbuild.asm 3 3 4 + generic-y += bpf_perf_event.h 4 5 generic-y += ipcbuf.h
+1
arch/mn10300/include/uapi/asm/Kbuild
··· 1 1 # UAPI Header export list 2 2 include include/uapi/asm-generic/Kbuild.asm 3 3 4 + generic-y += bpf_perf_event.h 4 5 generic-y += siginfo.h
+1
arch/nios2/include/uapi/asm/Kbuild
··· 3 3 4 4 generic-y += auxvec.h 5 5 generic-y += bitsperlong.h 6 + generic-y += bpf_perf_event.h 6 7 generic-y += errno.h 7 8 generic-y += fcntl.h 8 9 generic-y += ioctl.h
+1
arch/openrisc/include/uapi/asm/Kbuild
··· 3 3 4 4 generic-y += auxvec.h 5 5 generic-y += bitsperlong.h 6 + generic-y += bpf_perf_event.h 6 7 generic-y += errno.h 7 8 generic-y += fcntl.h 8 9 generic-y += ioctl.h
+1
arch/parisc/include/uapi/asm/Kbuild
··· 2 2 include include/uapi/asm-generic/Kbuild.asm 3 3 4 4 generic-y += auxvec.h 5 + generic-y += bpf_perf_event.h 5 6 generic-y += kvm_para.h 6 7 generic-y += param.h 7 8 generic-y += poll.h
+1
arch/powerpc/include/uapi/asm/Kbuild
··· 1 1 # UAPI Header export list 2 2 include include/uapi/asm-generic/Kbuild.asm 3 3 4 + generic-y += bpf_perf_event.h 4 5 generic-y += param.h 5 6 generic-y += poll.h 6 7 generic-y += resource.h
+1
arch/riscv/include/uapi/asm/Kbuild
··· 3 3 4 4 generic-y += setup.h 5 5 generic-y += unistd.h 6 + generic-y += bpf_perf_event.h 6 7 generic-y += errno.h 7 8 generic-y += fcntl.h 8 9 generic-y += ioctl.h
+1
arch/s390/include/asm/perf_event.h
··· 40 40 extern unsigned long perf_instruction_pointer(struct pt_regs *regs); 41 41 extern unsigned long perf_misc_flags(struct pt_regs *regs); 42 42 #define perf_misc_flags(regs) perf_misc_flags(regs) 43 + #define perf_arch_bpf_user_pt_regs(regs) &regs->user_regs 43 44 44 45 /* Perf pt_regs extension for sample-data-entry indicators */ 45 46 struct perf_sf_sde_regs {
+8 -3
arch/s390/include/asm/ptrace.h
··· 74 74 */ 75 75 struct pt_regs 76 76 { 77 - unsigned long args[1]; 78 - psw_t psw; 79 - unsigned long gprs[NUM_GPRS]; 77 + union { 78 + user_pt_regs user_regs; 79 + struct { 80 + unsigned long args[1]; 81 + psw_t psw; 82 + unsigned long gprs[NUM_GPRS]; 83 + }; 84 + }; 80 85 unsigned long orig_gpr2; 81 86 unsigned int int_code; 82 87 unsigned int int_parm;
+9
arch/s390/include/uapi/asm/bpf_perf_event.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + #ifndef _UAPI__ASM_BPF_PERF_EVENT_H__ 3 + #define _UAPI__ASM_BPF_PERF_EVENT_H__ 4 + 5 + #include <asm/ptrace.h> 6 + 7 + typedef user_pt_regs bpf_user_pt_regs_t; 8 + 9 + #endif /* _UAPI__ASM_BPF_PERF_EVENT_H__ */
+61 -64
arch/s390/include/uapi/asm/ptrace.h
··· 162 162 #define GPR_SIZE 8 163 163 #define CR_SIZE 8 164 164 165 - #define STACK_FRAME_OVERHEAD 160 /* size of minimum stack frame */ 165 + #define STACK_FRAME_OVERHEAD 160 /* size of minimum stack frame */ 166 166 167 167 #endif /* __s390x__ */ 168 168 ··· 179 179 #define ACR_SIZE 4 180 180 181 181 182 - #define PTRACE_OLDSETOPTIONS 21 182 + #define PTRACE_OLDSETOPTIONS 21 183 183 184 184 #ifndef __ASSEMBLY__ 185 185 #include <linux/stddef.h> 186 186 #include <linux/types.h> 187 187 188 - typedef union 189 - { 190 - float f; 191 - double d; 192 - __u64 ui; 188 + typedef union { 189 + float f; 190 + double d; 191 + __u64 ui; 193 192 struct 194 193 { 195 194 __u32 hi; ··· 196 197 } fp; 197 198 } freg_t; 198 199 199 - typedef struct 200 - { 201 - __u32 fpc; 200 + typedef struct { 201 + __u32 fpc; 202 202 __u32 pad; 203 - freg_t fprs[NUM_FPRS]; 203 + freg_t fprs[NUM_FPRS]; 204 204 } s390_fp_regs; 205 205 206 - #define FPC_EXCEPTION_MASK 0xF8000000 207 - #define FPC_FLAGS_MASK 0x00F80000 208 - #define FPC_DXC_MASK 0x0000FF00 209 - #define FPC_RM_MASK 0x00000003 206 + #define FPC_EXCEPTION_MASK 0xF8000000 207 + #define FPC_FLAGS_MASK 0x00F80000 208 + #define FPC_DXC_MASK 0x0000FF00 209 + #define FPC_RM_MASK 0x00000003 210 210 211 211 /* this typedef defines how a Program Status Word looks like */ 212 - typedef struct 213 - { 214 - unsigned long mask; 215 - unsigned long addr; 212 + typedef struct { 213 + unsigned long mask; 214 + unsigned long addr; 216 215 } __attribute__ ((aligned(8))) psw_t; 217 216 218 217 #ifndef __s390x__ ··· 279 282 /* 280 283 * The s390_regs structure is used to define the elf_gregset_t. 281 284 */ 282 - typedef struct 283 - { 285 + typedef struct { 284 286 psw_t psw; 285 287 unsigned long gprs[NUM_GPRS]; 286 288 unsigned int acrs[NUM_ACRS]; ··· 287 291 } s390_regs; 288 292 289 293 /* 294 + * The user_pt_regs structure exports the beginning of 295 + * the in-kernel pt_regs structure to user space. 296 + */ 297 + typedef struct { 298 + unsigned long args[1]; 299 + psw_t psw; 300 + unsigned long gprs[NUM_GPRS]; 301 + } user_pt_regs; 302 + 303 + /* 290 304 * Now for the user space program event recording (trace) definitions. 291 305 * The following structures are used only for the ptrace interface, don't 292 306 * touch or even look at it if you don't want to modify the user-space 293 307 * ptrace interface. In particular stay away from it for in-kernel PER. 294 308 */ 295 - typedef struct 296 - { 309 + typedef struct { 297 310 unsigned long cr[NUM_CR_WORDS]; 298 311 } per_cr_words; 299 312 300 313 #define PER_EM_MASK 0xE8000000UL 301 314 302 - typedef struct 303 - { 315 + typedef struct { 304 316 #ifdef __s390x__ 305 - unsigned : 32; 317 + unsigned : 32; 306 318 #endif /* __s390x__ */ 307 - unsigned em_branching : 1; 319 + unsigned em_branching : 1; 308 320 unsigned em_instruction_fetch : 1; 309 321 /* 310 322 * Switching on storage alteration automatically fixes ··· 321 317 unsigned em_storage_alteration : 1; 322 318 unsigned em_gpr_alt_unused : 1; 323 319 unsigned em_store_real_address : 1; 324 - unsigned : 3; 320 + unsigned : 3; 325 321 unsigned branch_addr_ctl : 1; 326 - unsigned : 1; 322 + unsigned : 1; 327 323 unsigned storage_alt_space_ctl : 1; 328 - unsigned : 21; 324 + unsigned : 21; 329 325 unsigned long starting_addr; 330 326 unsigned long ending_addr; 331 327 } per_cr_bits; 332 328 333 - typedef struct 334 - { 329 + typedef struct { 335 330 unsigned short perc_atmid; 336 331 unsigned long address; 337 332 unsigned char access_id; 338 333 } per_lowcore_words; 339 334 340 - typedef struct 341 - { 342 - unsigned perc_branching : 1; 335 + typedef struct { 336 + unsigned perc_branching : 1; 343 337 unsigned perc_instruction_fetch : 1; 344 338 unsigned perc_storage_alteration : 1; 345 - unsigned perc_gpr_alt_unused : 1; 339 + unsigned perc_gpr_alt_unused : 1; 346 340 unsigned perc_store_real_address : 1; 347 - unsigned : 3; 348 - unsigned atmid_psw_bit_31 : 1; 349 - unsigned atmid_validity_bit : 1; 350 - unsigned atmid_psw_bit_32 : 1; 351 - unsigned atmid_psw_bit_5 : 1; 352 - unsigned atmid_psw_bit_16 : 1; 353 - unsigned atmid_psw_bit_17 : 1; 354 - unsigned si : 2; 341 + unsigned : 3; 342 + unsigned atmid_psw_bit_31 : 1; 343 + unsigned atmid_validity_bit : 1; 344 + unsigned atmid_psw_bit_32 : 1; 345 + unsigned atmid_psw_bit_5 : 1; 346 + unsigned atmid_psw_bit_16 : 1; 347 + unsigned atmid_psw_bit_17 : 1; 348 + unsigned si : 2; 355 349 unsigned long address; 356 - unsigned : 4; 357 - unsigned access_id : 4; 350 + unsigned : 4; 351 + unsigned access_id : 4; 358 352 } per_lowcore_bits; 359 353 360 - typedef struct 361 - { 354 + typedef struct { 362 355 union { 363 356 per_cr_words words; 364 357 per_cr_bits bits; ··· 365 364 * the kernel always sets them to zero. To enable single 366 365 * stepping use ptrace(PTRACE_SINGLESTEP) instead. 367 366 */ 368 - unsigned single_step : 1; 367 + unsigned single_step : 1; 369 368 unsigned instruction_fetch : 1; 370 - unsigned : 30; 369 + unsigned : 30; 371 370 /* 372 371 * These addresses are copied into cr10 & cr11 if single 373 372 * stepping is switched off ··· 377 376 union { 378 377 per_lowcore_words words; 379 378 per_lowcore_bits bits; 380 - } lowcore; 379 + } lowcore; 381 380 } per_struct; 382 381 383 - typedef struct 384 - { 382 + typedef struct { 385 383 unsigned int len; 386 384 unsigned long kernel_addr; 387 385 unsigned long process_addr; ··· 390 390 * S/390 specific non posix ptrace requests. I chose unusual values so 391 391 * they are unlikely to clash with future ptrace definitions. 392 392 */ 393 - #define PTRACE_PEEKUSR_AREA 0x5000 394 - #define PTRACE_POKEUSR_AREA 0x5001 393 + #define PTRACE_PEEKUSR_AREA 0x5000 394 + #define PTRACE_POKEUSR_AREA 0x5001 395 395 #define PTRACE_PEEKTEXT_AREA 0x5002 396 396 #define PTRACE_PEEKDATA_AREA 0x5003 397 397 #define PTRACE_POKETEXT_AREA 0x5004 398 - #define PTRACE_POKEDATA_AREA 0x5005 398 + #define PTRACE_POKEDATA_AREA 0x5005 399 399 #define PTRACE_GET_LAST_BREAK 0x5006 400 400 #define PTRACE_PEEK_SYSTEM_CALL 0x5007 401 401 #define PTRACE_POKE_SYSTEM_CALL 0x5008 ··· 413 413 * PT_PROT definition is loosely based on hppa bsd definition in 414 414 * gdb/hppab-nat.c 415 415 */ 416 - #define PTRACE_PROT 21 416 + #define PTRACE_PROT 21 417 417 418 - typedef enum 419 - { 418 + typedef enum { 420 419 ptprot_set_access_watchpoint, 421 420 ptprot_set_write_watchpoint, 422 421 ptprot_disable_watchpoint 423 422 } ptprot_flags; 424 423 425 - typedef struct 426 - { 424 + typedef struct { 427 425 unsigned long lowaddr; 428 426 unsigned long hiaddr; 429 427 ptprot_flags prot; 430 - } ptprot_area; 428 + } ptprot_area; 431 429 432 430 /* Sequence of bytes for breakpoint illegal instruction. */ 433 431 #define S390_BREAKPOINT {0x0,0x1} ··· 437 439 * The user_regs_struct defines the way the user registers are 438 440 * store on the stack for signal handling. 439 441 */ 440 - struct user_regs_struct 441 - { 442 + struct user_regs_struct { 442 443 psw_t psw; 443 444 unsigned long gprs[NUM_GPRS]; 444 445 unsigned int acrs[NUM_ACRS];
+1
arch/score/include/uapi/asm/Kbuild
··· 1 1 # UAPI Header export list 2 2 include include/uapi/asm-generic/Kbuild.asm 3 3 4 + generic-y += bpf_perf_event.h 4 5 generic-y += siginfo.h
+1
arch/sh/include/uapi/asm/Kbuild
··· 2 2 include include/uapi/asm-generic/Kbuild.asm 3 3 4 4 generic-y += bitsperlong.h 5 + generic-y += bpf_perf_event.h 5 6 generic-y += errno.h 6 7 generic-y += fcntl.h 7 8 generic-y += ioctl.h
+1
arch/sparc/include/uapi/asm/Kbuild
··· 1 1 # UAPI Header export list 2 2 include include/uapi/asm-generic/Kbuild.asm 3 3 4 + generic-y += bpf_perf_event.h 4 5 generic-y += types.h
+1
arch/tile/include/uapi/asm/Kbuild
··· 1 1 # UAPI Header export list 2 2 include include/uapi/asm-generic/Kbuild.asm 3 3 4 + generic-y += bpf_perf_event.h 4 5 generic-y += errno.h 5 6 generic-y += fcntl.h 6 7 generic-y += ioctl.h
+1
arch/unicore32/include/uapi/asm/Kbuild
··· 3 3 4 4 generic-y += auxvec.h 5 5 generic-y += bitsperlong.h 6 + generic-y += bpf_perf_event.h 6 7 generic-y += errno.h 7 8 generic-y += fcntl.h 8 9 generic-y += ioctl.h
+1
arch/x86/include/uapi/asm/Kbuild
··· 1 1 # UAPI Header export list 2 2 include include/uapi/asm-generic/Kbuild.asm 3 3 4 + generic-y += bpf_perf_event.h 4 5 generated-y += unistd_32.h 5 6 generated-y += unistd_64.h 6 7 generated-y += unistd_x32.h
+1
arch/xtensa/include/uapi/asm/Kbuild
··· 2 2 include include/uapi/asm-generic/Kbuild.asm 3 3 4 4 generic-y += bitsperlong.h 5 + generic-y += bpf_perf_event.h 5 6 generic-y += errno.h 6 7 generic-y += fcntl.h 7 8 generic-y += ioctl.h
+3 -6
drivers/net/can/peak_canfd/peak_canfd.c
··· 258 258 /* if this frame is an echo, */ 259 259 if ((rx_msg_flags & PUCAN_MSG_LOOPED_BACK) && 260 260 !(rx_msg_flags & PUCAN_MSG_SELF_RECEIVE)) { 261 - int n; 262 261 unsigned long flags; 263 262 264 263 spin_lock_irqsave(&priv->echo_lock, flags); 265 - n = can_get_echo_skb(priv->ndev, msg->client); 264 + can_get_echo_skb(priv->ndev, msg->client); 266 265 spin_unlock_irqrestore(&priv->echo_lock, flags); 267 266 268 267 /* count bytes of the echo instead of skb */ 269 268 stats->tx_bytes += cf_len; 270 269 stats->tx_packets++; 271 270 272 - if (n) { 273 - /* restart tx queue only if a slot is free */ 274 - netif_wake_queue(priv->ndev); 275 - } 271 + /* restart tx queue (a slot is free) */ 272 + netif_wake_queue(priv->ndev); 276 273 277 274 return 0; 278 275 }
+2
drivers/net/can/usb/ems_usb.c
··· 288 288 289 289 case -ECONNRESET: /* unlink */ 290 290 case -ENOENT: 291 + case -EPIPE: 292 + case -EPROTO: 291 293 case -ESHUTDOWN: 292 294 return; 293 295
+2
drivers/net/can/usb/esd_usb2.c
··· 393 393 break; 394 394 395 395 case -ENOENT: 396 + case -EPIPE: 397 + case -EPROTO: 396 398 case -ESHUTDOWN: 397 399 return; 398 400
+2
drivers/net/can/usb/kvaser_usb.c
··· 1326 1326 case 0: 1327 1327 break; 1328 1328 case -ENOENT: 1329 + case -EPIPE: 1330 + case -EPROTO: 1329 1331 case -ESHUTDOWN: 1330 1332 return; 1331 1333 default:
+1
drivers/net/can/usb/mcba_usb.c
··· 593 593 594 594 case -ENOENT: 595 595 case -EPIPE: 596 + case -EPROTO: 596 597 case -ESHUTDOWN: 597 598 return; 598 599
+2
drivers/net/can/usb/usb_8dev.c
··· 524 524 break; 525 525 526 526 case -ENOENT: 527 + case -EPIPE: 528 + case -EPROTO: 527 529 case -ESHUTDOWN: 528 530 return; 529 531
-1
drivers/net/dsa/bcm_sf2.c
··· 14 14 #include <linux/netdevice.h> 15 15 #include <linux/interrupt.h> 16 16 #include <linux/platform_device.h> 17 - #include <linux/of.h> 18 17 #include <linux/phy.h> 19 18 #include <linux/phy_fixed.h> 20 19 #include <linux/mii.h>
+18 -16
drivers/net/dsa/mv88e6xxx/chip.c
··· 339 339 u16 mask; 340 340 341 341 mv88e6xxx_g1_read(chip, MV88E6XXX_G1_CTL1, &mask); 342 - mask |= GENMASK(chip->g1_irq.nirqs, 0); 342 + mask &= ~GENMASK(chip->g1_irq.nirqs, 0); 343 343 mv88e6xxx_g1_write(chip, MV88E6XXX_G1_CTL1, mask); 344 344 345 345 free_irq(chip->irq, chip); ··· 395 395 return 0; 396 396 397 397 out_disable: 398 - mask |= GENMASK(chip->g1_irq.nirqs, 0); 398 + mask &= ~GENMASK(chip->g1_irq.nirqs, 0); 399 399 mv88e6xxx_g1_write(chip, MV88E6XXX_G1_CTL1, mask); 400 400 401 401 out_mapping: ··· 2177 2177 { }, 2178 2178 }; 2179 2179 2180 + static void mv88e6xxx_mdios_unregister(struct mv88e6xxx_chip *chip) 2181 + 2182 + { 2183 + struct mv88e6xxx_mdio_bus *mdio_bus; 2184 + struct mii_bus *bus; 2185 + 2186 + list_for_each_entry(mdio_bus, &chip->mdios, list) { 2187 + bus = mdio_bus->bus; 2188 + 2189 + mdiobus_unregister(bus); 2190 + } 2191 + } 2192 + 2180 2193 static int mv88e6xxx_mdios_register(struct mv88e6xxx_chip *chip, 2181 2194 struct device_node *np) 2182 2195 { ··· 2214 2201 match = of_match_node(mv88e6xxx_mdio_external_match, child); 2215 2202 if (match) { 2216 2203 err = mv88e6xxx_mdio_register(chip, child, true); 2217 - if (err) 2204 + if (err) { 2205 + mv88e6xxx_mdios_unregister(chip); 2218 2206 return err; 2207 + } 2219 2208 } 2220 2209 } 2221 2210 2222 2211 return 0; 2223 - } 2224 - 2225 - static void mv88e6xxx_mdios_unregister(struct mv88e6xxx_chip *chip) 2226 - 2227 - { 2228 - struct mv88e6xxx_mdio_bus *mdio_bus; 2229 - struct mii_bus *bus; 2230 - 2231 - list_for_each_entry(mdio_bus, &chip->mdios, list) { 2232 - bus = mdio_bus->bus; 2233 - 2234 - mdiobus_unregister(bus); 2235 - } 2236 2212 } 2237 2213 2238 2214 static int mv88e6xxx_get_eeprom_len(struct dsa_switch *ds)
+5 -2
drivers/net/ethernet/arc/emac_rockchip.c
··· 220 220 221 221 /* RMII TX/RX needs always a rate of 25MHz */ 222 222 err = clk_set_rate(priv->macclk, 25000000); 223 - if (err) 223 + if (err) { 224 224 dev_err(dev, 225 225 "failed to change mac clock rate (%d)\n", err); 226 + goto out_clk_disable_macclk; 227 + } 226 228 } 227 229 228 230 err = arc_emac_probe(ndev, interface); ··· 234 232 } 235 233 236 234 return 0; 237 - 235 + out_clk_disable_macclk: 236 + clk_disable_unprepare(priv->macclk); 238 237 out_regulator_disable: 239 238 if (priv->regulator) 240 239 regulator_disable(priv->regulator);
+2 -2
drivers/net/ethernet/broadcom/bnxt/bnxt.c
··· 1883 1883 * here forever if we consistently cannot allocate 1884 1884 * buffers. 1885 1885 */ 1886 - else if (rc == -ENOMEM) 1886 + else if (rc == -ENOMEM && budget) 1887 1887 rx_pkts++; 1888 1888 else if (rc == -EBUSY) /* partial completion */ 1889 1889 break; ··· 1969 1969 cpu_to_le32(RX_CMPL_ERRORS_CRC_ERROR); 1970 1970 1971 1971 rc = bnxt_rx_pkt(bp, bnapi, &raw_cons, &event); 1972 - if (likely(rc == -EIO)) 1972 + if (likely(rc == -EIO) && budget) 1973 1973 rx_pkts++; 1974 1974 else if (rc == -EBUSY) /* partial completion */ 1975 1975 break;
+2
drivers/net/ethernet/cavium/thunder/nicvf_queues.c
··· 1355 1355 1356 1356 /* Offload checksum calculation to HW */ 1357 1357 if (skb->ip_summed == CHECKSUM_PARTIAL) { 1358 + if (ip.v4->version == 4) 1359 + hdr->csum_l3 = 1; /* Enable IP csum calculation */ 1358 1360 hdr->l3_offset = skb_network_offset(skb); 1359 1361 hdr->l4_offset = skb_transport_offset(skb); 1360 1362
+9 -2
drivers/net/ethernet/freescale/gianfar.c
··· 1378 1378 1379 1379 gfar_init_addr_hash_table(priv); 1380 1380 1381 - /* Insert receive time stamps into padding alignment bytes */ 1381 + /* Insert receive time stamps into padding alignment bytes, and 1382 + * plus 2 bytes padding to ensure the cpu alignment. 1383 + */ 1382 1384 if (priv->device_flags & FSL_GIANFAR_DEV_HAS_TIMER) 1383 - priv->padding = 8; 1385 + priv->padding = 8 + DEFAULT_PADDING; 1384 1386 1385 1387 if (dev->features & NETIF_F_IP_CSUM || 1386 1388 priv->device_flags & FSL_GIANFAR_DEV_HAS_TIMER) ··· 1792 1790 GFAR_SUPPORTED_GBIT : 0; 1793 1791 phy_interface_t interface; 1794 1792 struct phy_device *phydev; 1793 + struct ethtool_eee edata; 1795 1794 1796 1795 priv->oldlink = 0; 1797 1796 priv->oldspeed = 0; ··· 1816 1813 1817 1814 /* Add support for flow control, but don't advertise it by default */ 1818 1815 phydev->supported |= (SUPPORTED_Pause | SUPPORTED_Asym_Pause); 1816 + 1817 + /* disable EEE autoneg, EEE not supported by eTSEC */ 1818 + memset(&edata, 0, sizeof(struct ethtool_eee)); 1819 + phy_ethtool_set_eee(phydev, &edata); 1819 1820 1820 1821 return 0; 1821 1822 }
+2 -1
drivers/net/ethernet/marvell/mvmdio.c
··· 344 344 dev->regs + MVMDIO_ERR_INT_MASK); 345 345 346 346 } else if (dev->err_interrupt == -EPROBE_DEFER) { 347 - return -EPROBE_DEFER; 347 + ret = -EPROBE_DEFER; 348 + goto out_mdio; 348 349 } 349 350 350 351 if (pdev->dev.of_node)
+1 -1
drivers/net/ethernet/marvell/mvpp2.c
··· 85 85 86 86 /* RSS Registers */ 87 87 #define MVPP22_RSS_INDEX 0x1500 88 - #define MVPP22_RSS_INDEX_TABLE_ENTRY(idx) ((idx) << 8) 88 + #define MVPP22_RSS_INDEX_TABLE_ENTRY(idx) (idx) 89 89 #define MVPP22_RSS_INDEX_TABLE(idx) ((idx) << 8) 90 90 #define MVPP22_RSS_INDEX_QUEUE(idx) ((idx) << 16) 91 91 #define MVPP22_RSS_TABLE_ENTRY 0x1508
+6 -9
drivers/net/ethernet/netronome/nfp/nfp_net_repr.c
··· 84 84 { 85 85 u8 __iomem *mem = port->eth_stats; 86 86 87 - /* TX and RX stats are flipped as we are returning the stats as seen 88 - * at the switch port corresponding to the phys port. 89 - */ 90 - stats->tx_packets = readq(mem + NFP_MAC_STATS_RX_FRAMES_RECEIVED_OK); 91 - stats->tx_bytes = readq(mem + NFP_MAC_STATS_RX_IN_OCTETS); 92 - stats->tx_dropped = readq(mem + NFP_MAC_STATS_RX_IN_ERRORS); 87 + stats->tx_packets = readq(mem + NFP_MAC_STATS_TX_FRAMES_TRANSMITTED_OK); 88 + stats->tx_bytes = readq(mem + NFP_MAC_STATS_TX_OUT_OCTETS); 89 + stats->tx_dropped = readq(mem + NFP_MAC_STATS_TX_OUT_ERRORS); 93 90 94 - stats->rx_packets = readq(mem + NFP_MAC_STATS_TX_FRAMES_TRANSMITTED_OK); 95 - stats->rx_bytes = readq(mem + NFP_MAC_STATS_TX_OUT_OCTETS); 96 - stats->rx_dropped = readq(mem + NFP_MAC_STATS_TX_OUT_ERRORS); 91 + stats->rx_packets = readq(mem + NFP_MAC_STATS_RX_FRAMES_RECEIVED_OK); 92 + stats->rx_bytes = readq(mem + NFP_MAC_STATS_RX_IN_OCTETS); 93 + stats->rx_dropped = readq(mem + NFP_MAC_STATS_RX_IN_ERRORS); 97 94 } 98 95 99 96 static void
+1
drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c
··· 195 195 err1: 196 196 rmnet_unregister_real_device(real_dev, port); 197 197 err0: 198 + kfree(ep); 198 199 return err; 199 200 } 200 201
+6 -2
drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c
··· 126 126 127 127 if (skb_headroom(skb) < required_headroom) { 128 128 if (pskb_expand_head(skb, required_headroom, 0, GFP_KERNEL)) 129 - return RMNET_MAP_CONSUMED; 129 + goto fail; 130 130 } 131 131 132 132 map_header = rmnet_map_add_map_header(skb, additional_header_len, 0); 133 133 if (!map_header) 134 - return RMNET_MAP_CONSUMED; 134 + goto fail; 135 135 136 136 if (port->egress_data_format & RMNET_EGRESS_FORMAT_MUXING) { 137 137 if (mux_id == 0xff) ··· 143 143 skb->protocol = htons(ETH_P_MAP); 144 144 145 145 return RMNET_MAP_SUCCESS; 146 + 147 + fail: 148 + kfree_skb(skb); 149 + return RMNET_MAP_CONSUMED; 146 150 } 147 151 148 152 static void
+16 -15
drivers/net/ethernet/renesas/sh_eth.c
··· 1149 1149 entry, le32_to_cpu(txdesc->status)); 1150 1150 /* Free the original skb. */ 1151 1151 if (mdp->tx_skbuff[entry]) { 1152 - dma_unmap_single(&ndev->dev, le32_to_cpu(txdesc->addr), 1152 + dma_unmap_single(&mdp->pdev->dev, 1153 + le32_to_cpu(txdesc->addr), 1153 1154 le32_to_cpu(txdesc->len) >> 16, 1154 1155 DMA_TO_DEVICE); 1155 1156 dev_kfree_skb_irq(mdp->tx_skbuff[entry]); ··· 1180 1179 if (mdp->rx_skbuff[i]) { 1181 1180 struct sh_eth_rxdesc *rxdesc = &mdp->rx_ring[i]; 1182 1181 1183 - dma_unmap_single(&ndev->dev, 1182 + dma_unmap_single(&mdp->pdev->dev, 1184 1183 le32_to_cpu(rxdesc->addr), 1185 1184 ALIGN(mdp->rx_buf_sz, 32), 1186 1185 DMA_FROM_DEVICE); 1187 1186 } 1188 1187 } 1189 1188 ringsize = sizeof(struct sh_eth_rxdesc) * mdp->num_rx_ring; 1190 - dma_free_coherent(NULL, ringsize, mdp->rx_ring, 1189 + dma_free_coherent(&mdp->pdev->dev, ringsize, mdp->rx_ring, 1191 1190 mdp->rx_desc_dma); 1192 1191 mdp->rx_ring = NULL; 1193 1192 } ··· 1204 1203 sh_eth_tx_free(ndev, false); 1205 1204 1206 1205 ringsize = sizeof(struct sh_eth_txdesc) * mdp->num_tx_ring; 1207 - dma_free_coherent(NULL, ringsize, mdp->tx_ring, 1206 + dma_free_coherent(&mdp->pdev->dev, ringsize, mdp->tx_ring, 1208 1207 mdp->tx_desc_dma); 1209 1208 mdp->tx_ring = NULL; 1210 1209 } ··· 1246 1245 1247 1246 /* The size of the buffer is a multiple of 32 bytes. */ 1248 1247 buf_len = ALIGN(mdp->rx_buf_sz, 32); 1249 - dma_addr = dma_map_single(&ndev->dev, skb->data, buf_len, 1248 + dma_addr = dma_map_single(&mdp->pdev->dev, skb->data, buf_len, 1250 1249 DMA_FROM_DEVICE); 1251 - if (dma_mapping_error(&ndev->dev, dma_addr)) { 1250 + if (dma_mapping_error(&mdp->pdev->dev, dma_addr)) { 1252 1251 kfree_skb(skb); 1253 1252 break; 1254 1253 } ··· 1324 1323 1325 1324 /* Allocate all Rx descriptors. */ 1326 1325 rx_ringsize = sizeof(struct sh_eth_rxdesc) * mdp->num_rx_ring; 1327 - mdp->rx_ring = dma_alloc_coherent(NULL, rx_ringsize, &mdp->rx_desc_dma, 1328 - GFP_KERNEL); 1326 + mdp->rx_ring = dma_alloc_coherent(&mdp->pdev->dev, rx_ringsize, 1327 + &mdp->rx_desc_dma, GFP_KERNEL); 1329 1328 if (!mdp->rx_ring) 1330 1329 goto ring_free; 1331 1330 ··· 1333 1332 1334 1333 /* Allocate all Tx descriptors. */ 1335 1334 tx_ringsize = sizeof(struct sh_eth_txdesc) * mdp->num_tx_ring; 1336 - mdp->tx_ring = dma_alloc_coherent(NULL, tx_ringsize, &mdp->tx_desc_dma, 1337 - GFP_KERNEL); 1335 + mdp->tx_ring = dma_alloc_coherent(&mdp->pdev->dev, tx_ringsize, 1336 + &mdp->tx_desc_dma, GFP_KERNEL); 1338 1337 if (!mdp->tx_ring) 1339 1338 goto ring_free; 1340 1339 return 0; ··· 1528 1527 mdp->rx_skbuff[entry] = NULL; 1529 1528 if (mdp->cd->rpadir) 1530 1529 skb_reserve(skb, NET_IP_ALIGN); 1531 - dma_unmap_single(&ndev->dev, dma_addr, 1530 + dma_unmap_single(&mdp->pdev->dev, dma_addr, 1532 1531 ALIGN(mdp->rx_buf_sz, 32), 1533 1532 DMA_FROM_DEVICE); 1534 1533 skb_put(skb, pkt_len); ··· 1556 1555 if (skb == NULL) 1557 1556 break; /* Better luck next round. */ 1558 1557 sh_eth_set_receive_align(skb); 1559 - dma_addr = dma_map_single(&ndev->dev, skb->data, 1558 + dma_addr = dma_map_single(&mdp->pdev->dev, skb->data, 1560 1559 buf_len, DMA_FROM_DEVICE); 1561 - if (dma_mapping_error(&ndev->dev, dma_addr)) { 1560 + if (dma_mapping_error(&mdp->pdev->dev, dma_addr)) { 1562 1561 kfree_skb(skb); 1563 1562 break; 1564 1563 } ··· 2442 2441 /* soft swap. */ 2443 2442 if (!mdp->cd->hw_swap) 2444 2443 sh_eth_soft_swap(PTR_ALIGN(skb->data, 4), skb->len + 2); 2445 - dma_addr = dma_map_single(&ndev->dev, skb->data, skb->len, 2444 + dma_addr = dma_map_single(&mdp->pdev->dev, skb->data, skb->len, 2446 2445 DMA_TO_DEVICE); 2447 - if (dma_mapping_error(&ndev->dev, dma_addr)) { 2446 + if (dma_mapping_error(&mdp->pdev->dev, dma_addr)) { 2448 2447 kfree_skb(skb); 2449 2448 return NETDEV_TX_OK; 2450 2449 }
+4 -1
drivers/net/ethernet/sfc/tx.c
··· 77 77 } 78 78 79 79 if (buffer->flags & EFX_TX_BUF_SKB) { 80 + EFX_WARN_ON_PARANOID(!pkts_compl || !bytes_compl); 80 81 (*pkts_compl)++; 81 82 (*bytes_compl) += buffer->skb->len; 82 83 dev_consume_skb_any((struct sk_buff *)buffer->skb); ··· 427 426 static void efx_enqueue_unwind(struct efx_tx_queue *tx_queue) 428 427 { 429 428 struct efx_tx_buffer *buffer; 429 + unsigned int bytes_compl = 0; 430 + unsigned int pkts_compl = 0; 430 431 431 432 /* Work backwards until we hit the original insert pointer value */ 432 433 while (tx_queue->insert_count != tx_queue->write_count) { 433 434 --tx_queue->insert_count; 434 435 buffer = __efx_tx_queue_get_insert_buffer(tx_queue); 435 - efx_dequeue_buffer(tx_queue, buffer, NULL, NULL); 436 + efx_dequeue_buffer(tx_queue, buffer, &pkts_compl, &bytes_compl); 436 437 } 437 438 } 438 439
+2
drivers/net/usb/qmi_wwan.c
··· 261 261 net->hard_header_len = 0; 262 262 net->addr_len = 0; 263 263 net->flags = IFF_POINTOPOINT | IFF_NOARP | IFF_MULTICAST; 264 + set_bit(EVENT_NO_IP_ALIGN, &dev->flags); 264 265 netdev_dbg(net, "mode: raw IP\n"); 265 266 } else if (!net->header_ops) { /* don't bother if already set */ 266 267 ether_setup(net); 268 + clear_bit(EVENT_NO_IP_ALIGN, &dev->flags); 267 269 netdev_dbg(net, "mode: Ethernet\n"); 268 270 } 269 271
+4 -1
drivers/net/usb/usbnet.c
··· 484 484 return -ENOLINK; 485 485 } 486 486 487 - skb = __netdev_alloc_skb_ip_align(dev->net, size, flags); 487 + if (test_bit(EVENT_NO_IP_ALIGN, &dev->flags)) 488 + skb = __netdev_alloc_skb(dev->net, size, flags); 489 + else 490 + skb = __netdev_alloc_skb_ip_align(dev->net, size, flags); 488 491 if (!skb) { 489 492 netif_dbg(dev, rx_err, dev->net, "no rx skb\n"); 490 493 usbnet_defer_kevent (dev, EVENT_RX_MEMORY);
+2 -2
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
··· 2070 2070 return head_pad; 2071 2071 } 2072 2072 2073 - /** 2073 + /* 2074 2074 * struct brcmf_skbuff_cb reserves first two bytes in sk_buff::cb for 2075 2075 * bus layer usage. 2076 2076 */ ··· 4121 4121 sdio_release_host(sdiodev->func[1]); 4122 4122 fail: 4123 4123 brcmf_dbg(TRACE, "failed: dev=%s, err=%d\n", dev_name(dev), err); 4124 - device_release_driver(dev); 4125 4124 device_release_driver(&sdiodev->func[2]->dev); 4125 + device_release_driver(dev); 4126 4126 } 4127 4127 4128 4128 struct brcmf_sdio *brcmf_sdio_probe(struct brcmf_sdio_dev *sdiodev)
+4
drivers/net/wireless/intel/iwlwifi/fw/api/txq.h
··· 68 68 * @IWL_MVM_DQA_CMD_QUEUE: a queue reserved for sending HCMDs to the FW 69 69 * @IWL_MVM_DQA_AUX_QUEUE: a queue reserved for aux frames 70 70 * @IWL_MVM_DQA_P2P_DEVICE_QUEUE: a queue reserved for P2P device frames 71 + * @IWL_MVM_DQA_INJECT_MONITOR_QUEUE: a queue reserved for injection using 72 + * monitor mode. Note this queue is the same as the queue for P2P device 73 + * but we can't have active monitor mode along with P2P device anyway. 71 74 * @IWL_MVM_DQA_GCAST_QUEUE: a queue reserved for P2P GO/SoftAP GCAST frames 72 75 * @IWL_MVM_DQA_BSS_CLIENT_QUEUE: a queue reserved for BSS activity, to ensure 73 76 * that we are never left without the possibility to connect to an AP. ··· 90 87 IWL_MVM_DQA_CMD_QUEUE = 0, 91 88 IWL_MVM_DQA_AUX_QUEUE = 1, 92 89 IWL_MVM_DQA_P2P_DEVICE_QUEUE = 2, 90 + IWL_MVM_DQA_INJECT_MONITOR_QUEUE = 2, 93 91 IWL_MVM_DQA_GCAST_QUEUE = 3, 94 92 IWL_MVM_DQA_BSS_CLIENT_QUEUE = 4, 95 93 IWL_MVM_DQA_MIN_MGMT_QUEUE = 5,
-2
drivers/net/wireless/intel/iwlwifi/fw/dbg.h
··· 209 209 210 210 static inline void iwl_fw_dump_conf_clear(struct iwl_fw_runtime *fwrt) 211 211 { 212 - iwl_fw_dbg_stop_recording(fwrt); 213 - 214 212 fwrt->dump.conf = FW_DBG_INVALID; 215 213 } 216 214
+3 -1
drivers/net/wireless/intel/iwlwifi/iwl-trans.h
··· 117 117 #define FH_RSCSR_FRAME_INVALID 0x55550000 118 118 #define FH_RSCSR_FRAME_ALIGN 0x40 119 119 #define FH_RSCSR_RPA_EN BIT(25) 120 + #define FH_RSCSR_RADA_EN BIT(26) 120 121 #define FH_RSCSR_RXQ_POS 16 121 122 #define FH_RSCSR_RXQ_MASK 0x3F0000 122 123 ··· 129 128 * 31: flag flush RB request 130 129 * 30: flag ignore TC (terminal counter) request 131 130 * 29: flag fast IRQ request 132 - * 28-26: Reserved 131 + * 28-27: Reserved 132 + * 26: RADA enabled 133 133 * 25: Offload enabled 134 134 * 24: RPF enabled 135 135 * 23: RSS enabled
+1 -1
drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c
··· 787 787 u32 action) 788 788 { 789 789 struct iwl_mac_ctx_cmd cmd = {}; 790 - u32 tfd_queue_msk = 0; 790 + u32 tfd_queue_msk = BIT(mvm->snif_queue); 791 791 int ret; 792 792 793 793 WARN_ON(vif->type != NL80211_IFTYPE_MONITOR);
+3
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
··· 972 972 973 973 /* Tx queues */ 974 974 u16 aux_queue; 975 + u16 snif_queue; 975 976 u16 probe_queue; 976 977 u16 p2p_dev_queue; 977 978 ··· 1061 1060 * @IWL_MVM_STATUS_ROC_AUX_RUNNING: AUX remain-on-channel is running 1062 1061 * @IWL_MVM_STATUS_D3_RECONFIG: D3 reconfiguration is being done 1063 1062 * @IWL_MVM_STATUS_FIRMWARE_RUNNING: firmware is running 1063 + * @IWL_MVM_STATUS_NEED_FLUSH_P2P: need to flush P2P bcast STA 1064 1064 */ 1065 1065 enum iwl_mvm_status { 1066 1066 IWL_MVM_STATUS_HW_RFKILL, ··· 1073 1071 IWL_MVM_STATUS_ROC_AUX_RUNNING, 1074 1072 IWL_MVM_STATUS_D3_RECONFIG, 1075 1073 IWL_MVM_STATUS_FIRMWARE_RUNNING, 1074 + IWL_MVM_STATUS_NEED_FLUSH_P2P, 1076 1075 }; 1077 1076 1078 1077 /* Keep track of completed init configuration */
+1
drivers/net/wireless/intel/iwlwifi/mvm/ops.c
··· 624 624 mvm->fw_restart = iwlwifi_mod_params.fw_restart ? -1 : 0; 625 625 626 626 mvm->aux_queue = IWL_MVM_DQA_AUX_QUEUE; 627 + mvm->snif_queue = IWL_MVM_DQA_INJECT_MONITOR_QUEUE; 627 628 mvm->probe_queue = IWL_MVM_DQA_AP_PROBE_RESP_QUEUE; 628 629 mvm->p2p_dev_queue = IWL_MVM_DQA_P2P_DEVICE_QUEUE; 629 630
+14 -4
drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
··· 213 213 struct ieee80211_rx_status *rx_status) 214 214 { 215 215 int energy_a, energy_b, max_energy; 216 + u32 rate_flags = le32_to_cpu(desc->rate_n_flags); 216 217 217 218 energy_a = desc->energy_a; 218 219 energy_a = energy_a ? -energy_a : S8_MIN; ··· 225 224 energy_a, energy_b, max_energy); 226 225 227 226 rx_status->signal = max_energy; 228 - rx_status->chains = 0; /* TODO: phy info */ 227 + rx_status->chains = 228 + (rate_flags & RATE_MCS_ANT_AB_MSK) >> RATE_MCS_ANT_POS; 229 229 rx_status->chain_signal[0] = energy_a; 230 230 rx_status->chain_signal[1] = energy_b; 231 231 rx_status->chain_signal[2] = S8_MIN; ··· 234 232 235 233 static int iwl_mvm_rx_crypto(struct iwl_mvm *mvm, struct ieee80211_hdr *hdr, 236 234 struct ieee80211_rx_status *stats, 237 - struct iwl_rx_mpdu_desc *desc, int queue, 238 - u8 *crypt_len) 235 + struct iwl_rx_mpdu_desc *desc, u32 pkt_flags, 236 + int queue, u8 *crypt_len) 239 237 { 240 238 u16 status = le16_to_cpu(desc->status); 241 239 ··· 255 253 return -1; 256 254 257 255 stats->flag |= RX_FLAG_DECRYPTED; 256 + if (pkt_flags & FH_RSCSR_RADA_EN) 257 + stats->flag |= RX_FLAG_MIC_STRIPPED; 258 258 *crypt_len = IEEE80211_CCMP_HDR_LEN; 259 259 return 0; 260 260 case IWL_RX_MPDU_STATUS_SEC_TKIP: ··· 274 270 if ((status & IWL_RX_MPDU_STATUS_SEC_MASK) == 275 271 IWL_RX_MPDU_STATUS_SEC_WEP) 276 272 *crypt_len = IEEE80211_WEP_IV_LEN; 273 + 274 + if (pkt_flags & FH_RSCSR_RADA_EN) 275 + stats->flag |= RX_FLAG_ICV_STRIPPED; 276 + 277 277 return 0; 278 278 case IWL_RX_MPDU_STATUS_SEC_EXT_ENC: 279 279 if (!(status & IWL_RX_MPDU_STATUS_MIC_OK)) ··· 856 848 857 849 rx_status = IEEE80211_SKB_RXCB(skb); 858 850 859 - if (iwl_mvm_rx_crypto(mvm, hdr, rx_status, desc, queue, &crypt_len)) { 851 + if (iwl_mvm_rx_crypto(mvm, hdr, rx_status, desc, 852 + le32_to_cpu(pkt->len_n_flags), queue, 853 + &crypt_len)) { 860 854 kfree_skb(skb); 861 855 return; 862 856 }
+40 -13
drivers/net/wireless/intel/iwlwifi/mvm/sta.c
··· 1709 1709 sta->sta_id = IWL_MVM_INVALID_STA; 1710 1710 } 1711 1711 1712 - static void iwl_mvm_enable_aux_queue(struct iwl_mvm *mvm) 1712 + static void iwl_mvm_enable_aux_snif_queue(struct iwl_mvm *mvm, u16 *queue, 1713 + u8 sta_id, u8 fifo) 1713 1714 { 1714 1715 unsigned int wdg_timeout = iwlmvm_mod_params.tfd_q_hang_detect ? 1715 1716 mvm->cfg->base_params->wd_timeout : 1716 1717 IWL_WATCHDOG_DISABLED; 1717 1718 1718 1719 if (iwl_mvm_has_new_tx_api(mvm)) { 1719 - int queue = iwl_mvm_tvqm_enable_txq(mvm, mvm->aux_queue, 1720 - mvm->aux_sta.sta_id, 1721 - IWL_MAX_TID_COUNT, 1722 - wdg_timeout); 1723 - mvm->aux_queue = queue; 1720 + int tvqm_queue = 1721 + iwl_mvm_tvqm_enable_txq(mvm, *queue, sta_id, 1722 + IWL_MAX_TID_COUNT, 1723 + wdg_timeout); 1724 + *queue = tvqm_queue; 1724 1725 } else { 1725 1726 struct iwl_trans_txq_scd_cfg cfg = { 1726 - .fifo = IWL_MVM_TX_FIFO_MCAST, 1727 - .sta_id = mvm->aux_sta.sta_id, 1727 + .fifo = fifo, 1728 + .sta_id = sta_id, 1728 1729 .tid = IWL_MAX_TID_COUNT, 1729 1730 .aggregate = false, 1730 1731 .frame_limit = IWL_FRAME_LIMIT, 1731 1732 }; 1732 1733 1733 - iwl_mvm_enable_txq(mvm, mvm->aux_queue, mvm->aux_queue, 0, &cfg, 1734 - wdg_timeout); 1734 + iwl_mvm_enable_txq(mvm, *queue, *queue, 0, &cfg, wdg_timeout); 1735 1735 } 1736 1736 } 1737 1737 ··· 1750 1750 1751 1751 /* Map Aux queue to fifo - needs to happen before adding Aux station */ 1752 1752 if (!iwl_mvm_has_new_tx_api(mvm)) 1753 - iwl_mvm_enable_aux_queue(mvm); 1753 + iwl_mvm_enable_aux_snif_queue(mvm, &mvm->aux_queue, 1754 + mvm->aux_sta.sta_id, 1755 + IWL_MVM_TX_FIFO_MCAST); 1754 1756 1755 1757 ret = iwl_mvm_add_int_sta_common(mvm, &mvm->aux_sta, NULL, 1756 1758 MAC_INDEX_AUX, 0); ··· 1766 1764 * to firmware so enable queue here - after the station was added 1767 1765 */ 1768 1766 if (iwl_mvm_has_new_tx_api(mvm)) 1769 - iwl_mvm_enable_aux_queue(mvm); 1767 + iwl_mvm_enable_aux_snif_queue(mvm, &mvm->aux_queue, 1768 + mvm->aux_sta.sta_id, 1769 + IWL_MVM_TX_FIFO_MCAST); 1770 1770 1771 1771 return 0; 1772 1772 } ··· 1776 1772 int iwl_mvm_add_snif_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif) 1777 1773 { 1778 1774 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); 1775 + int ret; 1779 1776 1780 1777 lockdep_assert_held(&mvm->mutex); 1781 - return iwl_mvm_add_int_sta_common(mvm, &mvm->snif_sta, vif->addr, 1778 + 1779 + /* Map snif queue to fifo - must happen before adding snif station */ 1780 + if (!iwl_mvm_has_new_tx_api(mvm)) 1781 + iwl_mvm_enable_aux_snif_queue(mvm, &mvm->snif_queue, 1782 + mvm->snif_sta.sta_id, 1783 + IWL_MVM_TX_FIFO_BE); 1784 + 1785 + ret = iwl_mvm_add_int_sta_common(mvm, &mvm->snif_sta, vif->addr, 1782 1786 mvmvif->id, 0); 1787 + if (ret) 1788 + return ret; 1789 + 1790 + /* 1791 + * For 22000 firmware and on we cannot add queue to a station unknown 1792 + * to firmware so enable queue here - after the station was added 1793 + */ 1794 + if (iwl_mvm_has_new_tx_api(mvm)) 1795 + iwl_mvm_enable_aux_snif_queue(mvm, &mvm->snif_queue, 1796 + mvm->snif_sta.sta_id, 1797 + IWL_MVM_TX_FIFO_BE); 1798 + 1799 + return 0; 1783 1800 } 1784 1801 1785 1802 int iwl_mvm_rm_snif_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif) ··· 1809 1784 1810 1785 lockdep_assert_held(&mvm->mutex); 1811 1786 1787 + iwl_mvm_disable_txq(mvm, mvm->snif_queue, mvm->snif_queue, 1788 + IWL_MAX_TID_COUNT, 0); 1812 1789 ret = iwl_mvm_rm_sta_common(mvm, mvm->snif_sta.sta_id); 1813 1790 if (ret) 1814 1791 IWL_WARN(mvm, "Failed sending remove station\n");
+22 -2
drivers/net/wireless/intel/iwlwifi/mvm/time-event.c
··· 132 132 * executed, and a new time event means a new command. 133 133 */ 134 134 iwl_mvm_flush_sta(mvm, &mvm->aux_sta, true, CMD_ASYNC); 135 + 136 + /* Do the same for the P2P device queue (STA) */ 137 + if (test_and_clear_bit(IWL_MVM_STATUS_NEED_FLUSH_P2P, &mvm->status)) { 138 + struct iwl_mvm_vif *mvmvif; 139 + 140 + /* 141 + * NB: access to this pointer would be racy, but the flush bit 142 + * can only be set when we had a P2P-Device VIF, and we have a 143 + * flush of this work in iwl_mvm_prepare_mac_removal() so it's 144 + * not really racy. 145 + */ 146 + 147 + if (!WARN_ON(!mvm->p2p_device_vif)) { 148 + mvmvif = iwl_mvm_vif_from_mac80211(mvm->p2p_device_vif); 149 + iwl_mvm_flush_sta(mvm, &mvmvif->bcast_sta, true, 150 + CMD_ASYNC); 151 + } 152 + } 135 153 } 136 154 137 155 static void iwl_mvm_roc_finished(struct iwl_mvm *mvm) ··· 873 855 874 856 mvmvif = iwl_mvm_vif_from_mac80211(te_data->vif); 875 857 876 - if (te_data->vif->type == NL80211_IFTYPE_P2P_DEVICE) 858 + if (te_data->vif->type == NL80211_IFTYPE_P2P_DEVICE) { 877 859 iwl_mvm_remove_time_event(mvm, mvmvif, te_data); 878 - else 860 + set_bit(IWL_MVM_STATUS_NEED_FLUSH_P2P, &mvm->status); 861 + } else { 879 862 iwl_mvm_remove_aux_roc_te(mvm, mvmvif, te_data); 863 + } 880 864 881 865 iwl_mvm_roc_finished(mvm); 882 866 }
+2 -1
drivers/net/wireless/intel/iwlwifi/mvm/tx.c
··· 657 657 if (ap_sta_id != IWL_MVM_INVALID_STA) 658 658 sta_id = ap_sta_id; 659 659 } else if (info.control.vif->type == NL80211_IFTYPE_MONITOR) { 660 - queue = mvm->aux_queue; 660 + queue = mvm->snif_queue; 661 + sta_id = mvm->snif_sta.sta_id; 661 662 } 662 663 } 663 664
+12 -1
drivers/net/wireless/intel/iwlwifi/mvm/utils.c
··· 1134 1134 unsigned int default_timeout = 1135 1135 cmd_q ? IWL_DEF_WD_TIMEOUT : mvm->cfg->base_params->wd_timeout; 1136 1136 1137 - if (!iwl_fw_dbg_trigger_enabled(mvm->fw, FW_DBG_TRIGGER_TXQ_TIMERS)) 1137 + if (!iwl_fw_dbg_trigger_enabled(mvm->fw, FW_DBG_TRIGGER_TXQ_TIMERS)) { 1138 + /* 1139 + * We can't know when the station is asleep or awake, so we 1140 + * must disable the queue hang detection. 1141 + */ 1142 + if (fw_has_capa(&mvm->fw->ucode_capa, 1143 + IWL_UCODE_TLV_CAPA_STA_PM_NOTIF) && 1144 + vif && vif->type == NL80211_IFTYPE_AP) 1145 + return IWL_WATCHDOG_DISABLED; 1138 1146 return iwlmvm_mod_params.tfd_q_hang_detect ? 1139 1147 default_timeout : IWL_WATCHDOG_DISABLED; 1148 + } 1140 1149 1141 1150 trigger = iwl_fw_dbg_get_trigger(mvm->fw, FW_DBG_TRIGGER_TXQ_TIMERS); 1142 1151 txq_timer = (void *)trigger->data; ··· 1172 1163 return le32_to_cpu(txq_timer->p2p_go); 1173 1164 case NL80211_IFTYPE_P2P_DEVICE: 1174 1165 return le32_to_cpu(txq_timer->p2p_device); 1166 + case NL80211_IFTYPE_MONITOR: 1167 + return default_timeout; 1175 1168 default: 1176 1169 WARN_ON(1); 1177 1170 return mvm->cfg->base_params->wd_timeout;
+2
drivers/net/wireless/intel/iwlwifi/pcie/drv.c
··· 553 553 {IWL_PCI_DEVICE(0x271B, 0x0014, iwl9160_2ac_cfg)}, 554 554 {IWL_PCI_DEVICE(0x271B, 0x0210, iwl9160_2ac_cfg)}, 555 555 {IWL_PCI_DEVICE(0x271B, 0x0214, iwl9260_2ac_cfg)}, 556 + {IWL_PCI_DEVICE(0x271C, 0x0214, iwl9260_2ac_cfg)}, 556 557 {IWL_PCI_DEVICE(0x2720, 0x0034, iwl9560_2ac_cfg)}, 557 558 {IWL_PCI_DEVICE(0x2720, 0x0038, iwl9560_2ac_cfg)}, 558 559 {IWL_PCI_DEVICE(0x2720, 0x003C, iwl9560_2ac_cfg)}, ··· 665 664 {IWL_PCI_DEVICE(0x2720, 0x0310, iwla000_2ac_cfg_hr_cdb)}, 666 665 {IWL_PCI_DEVICE(0x40C0, 0x0000, iwla000_2ax_cfg_hr)}, 667 666 {IWL_PCI_DEVICE(0x40C0, 0x0A10, iwla000_2ax_cfg_hr)}, 667 + {IWL_PCI_DEVICE(0xA0F0, 0x0000, iwla000_2ax_cfg_hr)}, 668 668 669 669 #endif /* CONFIG_IWLMVM */ 670 670
+6
drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c
··· 49 49 * 50 50 *****************************************************************************/ 51 51 #include "iwl-trans.h" 52 + #include "iwl-prph.h" 52 53 #include "iwl-context-info.h" 53 54 #include "internal.h" 54 55 ··· 156 155 return; 157 156 158 157 trans_pcie->is_down = true; 158 + 159 + /* Stop dbgc before stopping device */ 160 + iwl_write_prph(trans, DBGC_IN_SAMPLE, 0); 161 + udelay(100); 162 + iwl_write_prph(trans, DBGC_OUT_CTRL, 0); 159 163 160 164 /* tell the device to stop sending interrupts */ 161 165 iwl_disable_interrupts(trans);
+10
drivers/net/wireless/intel/iwlwifi/pcie/trans.c
··· 166 166 print_hex_dump(KERN_ERR, prefix, DUMP_PREFIX_OFFSET, 32, 167 167 4, buf, i, 0); 168 168 } 169 + goto out; 169 170 170 171 err_read: 171 172 print_hex_dump(KERN_ERR, prefix, DUMP_PREFIX_OFFSET, 32, 4, buf, i, 0); ··· 1226 1225 return; 1227 1226 1228 1227 trans_pcie->is_down = true; 1228 + 1229 + /* Stop dbgc before stopping device */ 1230 + if (trans->cfg->device_family == IWL_DEVICE_FAMILY_7000) { 1231 + iwl_set_bits_prph(trans, MON_BUFF_SAMPLE_CTL, 0x100); 1232 + } else { 1233 + iwl_write_prph(trans, DBGC_IN_SAMPLE, 0); 1234 + udelay(100); 1235 + iwl_write_prph(trans, DBGC_OUT_CTRL, 0); 1236 + } 1229 1237 1230 1238 /* tell the device to stop sending interrupts */ 1231 1239 iwl_disable_interrupts(trans);
+1 -1
drivers/net/xen-netback/interface.c
··· 186 186 /* Obtain the queue to be used to transmit this packet */ 187 187 index = skb_get_queue_mapping(skb); 188 188 if (index >= num_queues) { 189 - pr_warn_ratelimited("Invalid queue %hu for packet on interface %s\n.", 189 + pr_warn_ratelimited("Invalid queue %hu for packet on interface %s\n", 190 190 index, vif->dev->name); 191 191 index %= num_queues; 192 192 }
+2 -6
drivers/staging/lustre/lnet/lnet/lib-socket.c
··· 71 71 } 72 72 73 73 sock_filp = sock_alloc_file(sock, 0, NULL); 74 - if (IS_ERR(sock_filp)) { 75 - sock_release(sock); 76 - rc = PTR_ERR(sock_filp); 77 - goto out; 78 - } 74 + if (IS_ERR(sock_filp)) 75 + return PTR_ERR(sock_filp); 79 76 80 77 rc = kernel_sock_unlocked_ioctl(sock_filp, cmd, arg); 81 78 82 79 fput(sock_filp); 83 - out: 84 80 return rc; 85 81 } 86 82
+5 -1
include/linux/perf_event.h
··· 15 15 #define _LINUX_PERF_EVENT_H 16 16 17 17 #include <uapi/linux/perf_event.h> 18 + #include <uapi/linux/bpf_perf_event.h> 18 19 19 20 /* 20 21 * Kernel-internal data types and definitions: ··· 788 787 }; 789 788 790 789 struct bpf_perf_event_data_kern { 791 - struct pt_regs *regs; 790 + bpf_user_pt_regs_t *regs; 792 791 struct perf_sample_data *data; 793 792 struct perf_event *event; 794 793 }; ··· 1177 1176 # define perf_misc_flags(regs) \ 1178 1177 (user_mode(regs) ? PERF_RECORD_MISC_USER : PERF_RECORD_MISC_KERNEL) 1179 1178 # define perf_instruction_pointer(regs) instruction_pointer(regs) 1179 + #endif 1180 + #ifndef perf_arch_bpf_user_pt_regs 1181 + # define perf_arch_bpf_user_pt_regs(regs) regs 1180 1182 #endif 1181 1183 1182 1184 static inline bool has_branch_stack(struct perf_event *event)
-38
include/linux/rculist_nulls.h
··· 101 101 } 102 102 103 103 /** 104 - * hlist_nulls_add_tail_rcu 105 - * @n: the element to add to the hash list. 106 - * @h: the list to add to. 107 - * 108 - * Description: 109 - * Adds the specified element to the end of the specified hlist_nulls, 110 - * while permitting racing traversals. NOTE: tail insertion requires 111 - * list traversal. 112 - * 113 - * The caller must take whatever precautions are necessary 114 - * (such as holding appropriate locks) to avoid racing 115 - * with another list-mutation primitive, such as hlist_nulls_add_head_rcu() 116 - * or hlist_nulls_del_rcu(), running on this same list. 117 - * However, it is perfectly legal to run concurrently with 118 - * the _rcu list-traversal primitives, such as 119 - * hlist_nulls_for_each_entry_rcu(), used to prevent memory-consistency 120 - * problems on Alpha CPUs. Regardless of the type of CPU, the 121 - * list-traversal primitive must be guarded by rcu_read_lock(). 122 - */ 123 - static inline void hlist_nulls_add_tail_rcu(struct hlist_nulls_node *n, 124 - struct hlist_nulls_head *h) 125 - { 126 - struct hlist_nulls_node *i, *last = NULL; 127 - 128 - for (i = hlist_nulls_first_rcu(h); !is_a_nulls(i); 129 - i = hlist_nulls_next_rcu(i)) 130 - last = i; 131 - 132 - if (last) { 133 - n->next = last->next; 134 - n->pprev = &last->next; 135 - rcu_assign_pointer(hlist_nulls_next_rcu(last), n); 136 - } else { 137 - hlist_nulls_add_head_rcu(n, h); 138 - } 139 - } 140 - 141 - /** 142 104 * hlist_nulls_for_each_entry_rcu - iterate over rcu list of given type 143 105 * @tpos: the type * to use as a loop cursor. 144 106 * @pos: the &struct hlist_nulls_node to use as a loop cursor.
+2 -1
include/linux/tcp.h
··· 224 224 rate_app_limited:1, /* rate_{delivered,interval_us} limited? */ 225 225 fastopen_connect:1, /* FASTOPEN_CONNECT sockopt */ 226 226 fastopen_no_cookie:1, /* Allow send/recv SYN+data without a cookie */ 227 - unused:3; 227 + is_sack_reneg:1, /* in recovery from loss with SACK reneg? */ 228 + unused:2; 228 229 u8 nonagle : 4,/* Disable Nagle algorithm? */ 229 230 thin_lto : 1,/* Use linear timeouts for thin streams */ 230 231 unused1 : 1,
+1
include/linux/usb/usbnet.h
··· 82 82 # define EVENT_RX_KILL 10 83 83 # define EVENT_LINK_CHANGE 11 84 84 # define EVENT_SET_RX_MODE 12 85 + # define EVENT_NO_IP_ALIGN 13 85 86 }; 86 87 87 88 static inline struct usb_driver *driver_of(struct usb_interface *intf)
+12 -1
include/net/red.h
··· 168 168 v->qcount = -1; 169 169 } 170 170 171 + static inline bool red_check_params(u32 qth_min, u32 qth_max, u8 Wlog) 172 + { 173 + if (fls(qth_min) + Wlog > 32) 174 + return false; 175 + if (fls(qth_max) + Wlog > 32) 176 + return false; 177 + if (qth_max < qth_min) 178 + return false; 179 + return true; 180 + } 181 + 171 182 static inline void red_set_parms(struct red_parms *p, 172 183 u32 qth_min, u32 qth_max, u8 Wlog, u8 Plog, 173 184 u8 Scell_log, u8 *stab, u32 max_P) ··· 190 179 p->qth_max = qth_max << Wlog; 191 180 p->Wlog = Wlog; 192 181 p->Plog = Plog; 193 - if (delta < 0) 182 + if (delta <= 0) 194 183 delta = 1; 195 184 p->qth_delta = delta; 196 185 if (!max_P) {
+1 -5
include/net/sock.h
··· 685 685 686 686 static inline void __sk_nulls_add_node_rcu(struct sock *sk, struct hlist_nulls_head *list) 687 687 { 688 - if (IS_ENABLED(CONFIG_IPV6) && sk->sk_reuseport && 689 - sk->sk_family == AF_INET6) 690 - hlist_nulls_add_tail_rcu(&sk->sk_nulls_node, list); 691 - else 692 - hlist_nulls_add_head_rcu(&sk->sk_nulls_node, list); 688 + hlist_nulls_add_head_rcu(&sk->sk_nulls_node, list); 693 689 } 694 690 695 691 static inline void sk_nulls_add_node_rcu(struct sock *sk, struct hlist_nulls_head *list)
+1 -1
include/net/tcp.h
··· 1055 1055 void tcp_rate_skb_delivered(struct sock *sk, struct sk_buff *skb, 1056 1056 struct rate_sample *rs); 1057 1057 void tcp_rate_gen(struct sock *sk, u32 delivered, u32 lost, 1058 - struct rate_sample *rs); 1058 + bool is_sack_reneg, struct rate_sample *rs); 1059 1059 void tcp_rate_check_app_limited(struct sock *sk); 1060 1060 1061 1061 /* These functions determine how the current flow behaves in respect of SACK
+9
include/uapi/asm-generic/bpf_perf_event.h
··· 1 + #ifndef _UAPI__ASM_GENERIC_BPF_PERF_EVENT_H__ 2 + #define _UAPI__ASM_GENERIC_BPF_PERF_EVENT_H__ 3 + 4 + #include <linux/ptrace.h> 5 + 6 + /* Export kernel pt_regs structure */ 7 + typedef struct pt_regs bpf_user_pt_regs_t; 8 + 9 + #endif /* _UAPI__ASM_GENERIC_BPF_PERF_EVENT_H__ */
+2 -3
include/uapi/linux/bpf_perf_event.h
··· 8 8 #ifndef _UAPI__LINUX_BPF_PERF_EVENT_H__ 9 9 #define _UAPI__LINUX_BPF_PERF_EVENT_H__ 10 10 11 - #include <linux/types.h> 12 - #include <linux/ptrace.h> 11 + #include <asm/bpf_perf_event.h> 13 12 14 13 struct bpf_perf_event_data { 15 - struct pt_regs regs; 14 + bpf_user_pt_regs_t regs; 16 15 __u64 sample_period; 17 16 }; 18 17
+1 -1
kernel/events/core.c
··· 7990 7990 { 7991 7991 struct bpf_perf_event_data_kern ctx = { 7992 7992 .data = data, 7993 - .regs = regs, 7994 7993 .event = event, 7995 7994 }; 7996 7995 int ret = 0; 7997 7996 7997 + ctx.regs = perf_arch_bpf_user_pt_regs(regs); 7998 7998 preempt_disable(); 7999 7999 if (unlikely(__this_cpu_inc_return(bpf_prog_active) != 1)) 8000 8000 goto out;
+16 -6
lib/nlattr.c
··· 15 15 #include <linux/types.h> 16 16 #include <net/netlink.h> 17 17 18 - /* for these data types attribute length must be exactly given size */ 18 + /* For these data types, attribute length should be exactly the given 19 + * size. However, to maintain compatibility with broken commands, if the 20 + * attribute length does not match the expected size a warning is emitted 21 + * to the user that the command is sending invalid data and needs to be fixed. 22 + */ 19 23 static const u8 nla_attr_len[NLA_TYPE_MAX+1] = { 20 24 [NLA_U8] = sizeof(u8), 21 25 [NLA_U16] = sizeof(u16), ··· 32 28 }; 33 29 34 30 static const u8 nla_attr_minlen[NLA_TYPE_MAX+1] = { 31 + [NLA_U8] = sizeof(u8), 32 + [NLA_U16] = sizeof(u16), 33 + [NLA_U32] = sizeof(u32), 34 + [NLA_U64] = sizeof(u64), 35 35 [NLA_MSECS] = sizeof(u64), 36 36 [NLA_NESTED] = NLA_HDRLEN, 37 + [NLA_S8] = sizeof(s8), 38 + [NLA_S16] = sizeof(s16), 39 + [NLA_S32] = sizeof(s32), 40 + [NLA_S64] = sizeof(s64), 37 41 }; 38 42 39 43 static int validate_nla_bitfield32(const struct nlattr *nla, ··· 81 69 82 70 BUG_ON(pt->type > NLA_TYPE_MAX); 83 71 84 - /* for data types NLA_U* and NLA_S* require exact length */ 85 - if (nla_attr_len[pt->type]) { 86 - if (attrlen != nla_attr_len[pt->type]) 87 - return -ERANGE; 88 - return 0; 72 + if (nla_attr_len[pt->type] && attrlen != nla_attr_len[pt->type]) { 73 + pr_warn_ratelimited("netlink: '%s': attribute type %d has an invalid length.\n", 74 + current->comm, type); 89 75 } 90 76 91 77 switch (pt->type) {
-1
net/9p/trans_fd.c
··· 839 839 if (IS_ERR(file)) { 840 840 pr_err("%s (%d): failed to map fd\n", 841 841 __func__, task_pid_nr(current)); 842 - sock_release(csocket); 843 842 kfree(p); 844 843 return PTR_ERR(file); 845 844 }
+1 -1
net/core/dev.c
··· 1106 1106 * when the name is long and there isn't enough space left 1107 1107 * for the digits, or if all bits are used. 1108 1108 */ 1109 - return p ? -ENFILE : -EEXIST; 1109 + return -ENFILE; 1110 1110 } 1111 1111 1112 1112 static int dev_alloc_name_ns(struct net *net,
+5
net/dccp/proto.c
··· 259 259 { 260 260 struct inet_connection_sock *icsk = inet_csk(sk); 261 261 struct inet_sock *inet = inet_sk(sk); 262 + struct dccp_sock *dp = dccp_sk(sk); 262 263 int err = 0; 263 264 const int old_state = sk->sk_state; 264 265 ··· 279 278 sk->sk_err = ECONNRESET; 280 279 281 280 dccp_clear_xmit_timers(sk); 281 + ccid_hc_rx_delete(dp->dccps_hc_rx_ccid, sk); 282 + ccid_hc_tx_delete(dp->dccps_hc_tx_ccid, sk); 283 + dp->dccps_hc_rx_ccid = NULL; 284 + dp->dccps_hc_tx_ccid = NULL; 282 285 283 286 __skb_queue_purge(&sk->sk_receive_queue); 284 287 __skb_queue_purge(&sk->sk_write_queue);
+3 -3
net/ipv4/inet_timewait_sock.c
··· 93 93 } 94 94 95 95 /* 96 - * Enter the time wait state. 96 + * Enter the time wait state. This is called with locally disabled BH. 97 97 * Essentially we whip up a timewait bucket, copy the relevant info into it 98 98 * from the SK, and mess with hash chains and list linkage. 99 99 */ ··· 111 111 */ 112 112 bhead = &hashinfo->bhash[inet_bhashfn(twsk_net(tw), inet->inet_num, 113 113 hashinfo->bhash_size)]; 114 - spin_lock_bh(&bhead->lock); 114 + spin_lock(&bhead->lock); 115 115 tw->tw_tb = icsk->icsk_bind_hash; 116 116 WARN_ON(!icsk->icsk_bind_hash); 117 117 inet_twsk_add_bind_node(tw, &tw->tw_tb->owners); ··· 137 137 if (__sk_nulls_del_node_init_rcu(sk)) 138 138 sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1); 139 139 140 - spin_unlock_bh(lock); 140 + spin_unlock(lock); 141 141 } 142 142 EXPORT_SYMBOL_GPL(__inet_twsk_hashdance); 143 143
+1
net/ipv4/tcp.c
··· 2412 2412 tp->snd_cwnd_cnt = 0; 2413 2413 tp->window_clamp = 0; 2414 2414 tcp_set_ca_state(sk, TCP_CA_Open); 2415 + tp->is_sack_reneg = 0; 2415 2416 tcp_clear_retrans(tp); 2416 2417 inet_csk_delack_init(sk); 2417 2418 /* Initialize rcv_mss to TCP_MIN_MSS to avoid division by 0
+10 -2
net/ipv4/tcp_bbr.c
··· 110 110 u32 lt_last_lost; /* LT intvl start: tp->lost */ 111 111 u32 pacing_gain:10, /* current gain for setting pacing rate */ 112 112 cwnd_gain:10, /* current gain for setting cwnd */ 113 - full_bw_cnt:3, /* number of rounds without large bw gains */ 113 + full_bw_reached:1, /* reached full bw in Startup? */ 114 + full_bw_cnt:2, /* number of rounds without large bw gains */ 114 115 cycle_idx:3, /* current index in pacing_gain cycle array */ 115 116 has_seen_rtt:1, /* have we seen an RTT sample yet? */ 116 117 unused_b:5; ··· 181 180 { 182 181 const struct bbr *bbr = inet_csk_ca(sk); 183 182 184 - return bbr->full_bw_cnt >= bbr_full_bw_cnt; 183 + return bbr->full_bw_reached; 185 184 } 186 185 187 186 /* Return the windowed max recent bandwidth sample, in pkts/uS << BW_SCALE. */ ··· 718 717 return; 719 718 } 720 719 ++bbr->full_bw_cnt; 720 + bbr->full_bw_reached = bbr->full_bw_cnt >= bbr_full_bw_cnt; 721 721 } 722 722 723 723 /* If pipe is probably full, drain the queue and then enter steady-state. */ ··· 852 850 bbr->restore_cwnd = 0; 853 851 bbr->round_start = 0; 854 852 bbr->idle_restart = 0; 853 + bbr->full_bw_reached = 0; 855 854 bbr->full_bw = 0; 856 855 bbr->full_bw_cnt = 0; 857 856 bbr->cycle_mstamp = 0; ··· 874 871 */ 875 872 static u32 bbr_undo_cwnd(struct sock *sk) 876 873 { 874 + struct bbr *bbr = inet_csk_ca(sk); 875 + 876 + bbr->full_bw = 0; /* spurious slow-down; reset full pipe detection */ 877 + bbr->full_bw_cnt = 0; 878 + bbr_reset_lt_bw_sampling(sk); 877 879 return tcp_sk(sk)->snd_cwnd; 878 880 } 879 881
+10 -2
net/ipv4/tcp_input.c
··· 579 579 int time; 580 580 int copied; 581 581 582 + tcp_mstamp_refresh(tp); 582 583 time = tcp_stamp_us_delta(tp->tcp_mstamp, tp->rcvq_space.time); 583 584 if (time < (tp->rcv_rtt_est.rtt_us >> 3) || tp->rcv_rtt_est.rtt_us == 0) 584 585 return; ··· 1942 1941 if (is_reneg) { 1943 1942 NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPSACKRENEGING); 1944 1943 tp->sacked_out = 0; 1944 + /* Mark SACK reneging until we recover from this loss event. */ 1945 + tp->is_sack_reneg = 1; 1945 1946 } 1946 1947 tcp_clear_all_retrans_hints(tp); 1947 1948 ··· 2329 2326 } 2330 2327 tp->snd_cwnd_stamp = tcp_jiffies32; 2331 2328 tp->undo_marker = 0; 2329 + tp->rack.advanced = 1; /* Force RACK to re-exam losses */ 2332 2330 } 2333 2331 2334 2332 static inline bool tcp_may_undo(const struct tcp_sock *tp) ··· 2368 2364 return true; 2369 2365 } 2370 2366 tcp_set_ca_state(sk, TCP_CA_Open); 2367 + tp->is_sack_reneg = 0; 2371 2368 return false; 2372 2369 } 2373 2370 ··· 2402 2397 NET_INC_STATS(sock_net(sk), 2403 2398 LINUX_MIB_TCPSPURIOUSRTOS); 2404 2399 inet_csk(sk)->icsk_retransmits = 0; 2405 - if (frto_undo || tcp_is_sack(tp)) 2400 + if (frto_undo || tcp_is_sack(tp)) { 2406 2401 tcp_set_ca_state(sk, TCP_CA_Open); 2402 + tp->is_sack_reneg = 0; 2403 + } 2407 2404 return true; 2408 2405 } 2409 2406 return false; ··· 3502 3495 struct tcp_sacktag_state sack_state; 3503 3496 struct rate_sample rs = { .prior_delivered = 0 }; 3504 3497 u32 prior_snd_una = tp->snd_una; 3498 + bool is_sack_reneg = tp->is_sack_reneg; 3505 3499 u32 ack_seq = TCP_SKB_CB(skb)->seq; 3506 3500 u32 ack = TCP_SKB_CB(skb)->ack_seq; 3507 3501 bool is_dupack = false; ··· 3619 3611 3620 3612 delivered = tp->delivered - delivered; /* freshly ACKed or SACKed */ 3621 3613 lost = tp->lost - lost; /* freshly marked lost */ 3622 - tcp_rate_gen(sk, delivered, lost, sack_state.rate); 3614 + tcp_rate_gen(sk, delivered, lost, is_sack_reneg, sack_state.rate); 3623 3615 tcp_cong_control(sk, ack, delivered, flag, sack_state.rate); 3624 3616 tcp_xmit_recovery(sk, rexmit); 3625 3617 return 1;
+7 -3
net/ipv4/tcp_rate.c
··· 106 106 107 107 /* Update the connection delivery information and generate a rate sample. */ 108 108 void tcp_rate_gen(struct sock *sk, u32 delivered, u32 lost, 109 - struct rate_sample *rs) 109 + bool is_sack_reneg, struct rate_sample *rs) 110 110 { 111 111 struct tcp_sock *tp = tcp_sk(sk); 112 112 u32 snd_us, ack_us; ··· 124 124 125 125 rs->acked_sacked = delivered; /* freshly ACKed or SACKed */ 126 126 rs->losses = lost; /* freshly marked lost */ 127 - /* Return an invalid sample if no timing information is available. */ 128 - if (!rs->prior_mstamp) { 127 + /* Return an invalid sample if no timing information is available or 128 + * in recovery from loss with SACK reneging. Rate samples taken during 129 + * a SACK reneging event may overestimate bw by including packets that 130 + * were SACKed before the reneg. 131 + */ 132 + if (!rs->prior_mstamp || is_sack_reneg) { 129 133 rs->delivered = -1; 130 134 rs->interval_us = -1; 131 135 return;
+13 -15
net/ipv4/tcp_recovery.c
··· 55 55 * to queuing or delayed ACKs. 56 56 */ 57 57 reo_wnd = 1000; 58 - if ((tp->rack.reord || !tp->lost_out) && min_rtt != ~0U) { 58 + if ((tp->rack.reord || inet_csk(sk)->icsk_ca_state < TCP_CA_Recovery) && 59 + min_rtt != ~0U) { 59 60 reo_wnd = max((min_rtt >> 2) * tp->rack.reo_wnd_steps, reo_wnd); 60 61 reo_wnd = min(reo_wnd, tp->srtt_us >> 3); 61 62 } ··· 80 79 */ 81 80 remaining = tp->rack.rtt_us + reo_wnd - 82 81 tcp_stamp_us_delta(tp->tcp_mstamp, skb->skb_mstamp); 83 - if (remaining < 0) { 82 + if (remaining <= 0) { 84 83 tcp_rack_mark_skb_lost(sk, skb); 85 84 list_del_init(&skb->tcp_tsorted_anchor); 86 85 } else { 87 - /* Record maximum wait time (+1 to avoid 0) */ 88 - *reo_timeout = max_t(u32, *reo_timeout, 1 + remaining); 86 + /* Record maximum wait time */ 87 + *reo_timeout = max_t(u32, *reo_timeout, remaining); 89 88 } 90 89 } 91 90 } ··· 117 116 { 118 117 u32 rtt_us; 119 118 120 - if (tp->rack.mstamp && 121 - !tcp_rack_sent_after(xmit_time, tp->rack.mstamp, 122 - end_seq, tp->rack.end_seq)) 123 - return; 124 - 125 119 rtt_us = tcp_stamp_us_delta(tp->tcp_mstamp, xmit_time); 126 - if (sacked & TCPCB_RETRANS) { 120 + if (rtt_us < tcp_min_rtt(tp) && (sacked & TCPCB_RETRANS)) { 127 121 /* If the sacked packet was retransmitted, it's ambiguous 128 122 * whether the retransmission or the original (or the prior 129 123 * retransmission) was sacked. ··· 129 133 * so it's at least one RTT (i.e., retransmission is at least 130 134 * an RTT later). 131 135 */ 132 - if (rtt_us < tcp_min_rtt(tp)) 133 - return; 136 + return; 134 137 } 135 - tp->rack.rtt_us = rtt_us; 136 - tp->rack.mstamp = xmit_time; 137 - tp->rack.end_seq = end_seq; 138 138 tp->rack.advanced = 1; 139 + tp->rack.rtt_us = rtt_us; 140 + if (tcp_rack_sent_after(xmit_time, tp->rack.mstamp, 141 + end_seq, tp->rack.end_seq)) { 142 + tp->rack.mstamp = xmit_time; 143 + tp->rack.end_seq = end_seq; 144 + } 139 145 } 140 146 141 147 /* We have waited long enough to accommodate reordering. Mark the expired
+1 -1
net/ipv6/ip6_tunnel.c
··· 904 904 if (t->parms.collect_md) { 905 905 tun_dst = ipv6_tun_rx_dst(skb, 0, 0, 0); 906 906 if (!tun_dst) 907 - return 0; 907 + goto drop; 908 908 } 909 909 ret = __ip6_tnl_rcv(t, skb, tpi, tun_dst, dscp_ecn_decapsulate, 910 910 log_ecn_error);
+22 -44
net/kcm/kcmsock.c
··· 1625 1625 }; 1626 1626 1627 1627 /* Clone a kcm socket. */ 1628 - static int kcm_clone(struct socket *osock, struct kcm_clone *info, 1629 - struct socket **newsockp) 1628 + static struct file *kcm_clone(struct socket *osock) 1630 1629 { 1631 1630 struct socket *newsock; 1632 1631 struct sock *newsk; 1633 - struct file *newfile; 1634 - int err, newfd; 1635 1632 1636 - err = -ENFILE; 1637 1633 newsock = sock_alloc(); 1638 1634 if (!newsock) 1639 - goto out; 1635 + return ERR_PTR(-ENFILE); 1640 1636 1641 1637 newsock->type = osock->type; 1642 1638 newsock->ops = osock->ops; 1643 1639 1644 1640 __module_get(newsock->ops->owner); 1645 1641 1646 - newfd = get_unused_fd_flags(0); 1647 - if (unlikely(newfd < 0)) { 1648 - err = newfd; 1649 - goto out_fd_fail; 1650 - } 1651 - 1652 - newfile = sock_alloc_file(newsock, 0, osock->sk->sk_prot_creator->name); 1653 - if (IS_ERR(newfile)) { 1654 - err = PTR_ERR(newfile); 1655 - goto out_sock_alloc_fail; 1656 - } 1657 - 1658 1642 newsk = sk_alloc(sock_net(osock->sk), PF_KCM, GFP_KERNEL, 1659 1643 &kcm_proto, true); 1660 1644 if (!newsk) { 1661 - err = -ENOMEM; 1662 - goto out_sk_alloc_fail; 1645 + sock_release(newsock); 1646 + return ERR_PTR(-ENOMEM); 1663 1647 } 1664 - 1665 1648 sock_init_data(newsock, newsk); 1666 1649 init_kcm_sock(kcm_sk(newsk), kcm_sk(osock->sk)->mux); 1667 1650 1668 - fd_install(newfd, newfile); 1669 - *newsockp = newsock; 1670 - info->fd = newfd; 1671 - 1672 - return 0; 1673 - 1674 - out_sk_alloc_fail: 1675 - fput(newfile); 1676 - out_sock_alloc_fail: 1677 - put_unused_fd(newfd); 1678 - out_fd_fail: 1679 - sock_release(newsock); 1680 - out: 1681 - return err; 1651 + return sock_alloc_file(newsock, 0, osock->sk->sk_prot_creator->name); 1682 1652 } 1683 1653 1684 1654 static int kcm_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) ··· 1678 1708 } 1679 1709 case SIOCKCMCLONE: { 1680 1710 struct kcm_clone info; 1681 - struct socket *newsock = NULL; 1711 + struct file *file; 1682 1712 1683 - err = kcm_clone(sock, &info, &newsock); 1684 - if (!err) { 1685 - if (copy_to_user((void __user *)arg, &info, 1686 - sizeof(info))) { 1687 - err = -EFAULT; 1688 - sys_close(info.fd); 1689 - } 1713 + info.fd = get_unused_fd_flags(0); 1714 + if (unlikely(info.fd < 0)) 1715 + return info.fd; 1716 + 1717 + file = kcm_clone(sock); 1718 + if (IS_ERR(file)) { 1719 + put_unused_fd(info.fd); 1720 + return PTR_ERR(file); 1690 1721 } 1691 - 1722 + if (copy_to_user((void __user *)arg, &info, 1723 + sizeof(info))) { 1724 + put_unused_fd(info.fd); 1725 + fput(file); 1726 + return -EFAULT; 1727 + } 1728 + fd_install(info.fd, file); 1729 + err = 0; 1692 1730 break; 1693 1731 } 1694 1732 default:
+1 -1
net/rds/rdma.c
··· 183 183 long i; 184 184 int ret; 185 185 186 - if (rs->rs_bound_addr == 0) { 186 + if (rs->rs_bound_addr == 0 || !rs->rs_transport) { 187 187 ret = -ENOTCONN; /* XXX not a great errno */ 188 188 goto out; 189 189 }
+3
net/sched/sch_choke.c
··· 369 369 370 370 ctl = nla_data(tb[TCA_CHOKE_PARMS]); 371 371 372 + if (!red_check_params(ctl->qth_min, ctl->qth_max, ctl->Wlog)) 373 + return -EINVAL; 374 + 372 375 if (ctl->limit > CHOKE_MAX_QUEUE) 373 376 return -EINVAL; 374 377
+3
net/sched/sch_generic.c
··· 26 26 #include <linux/list.h> 27 27 #include <linux/slab.h> 28 28 #include <linux/if_vlan.h> 29 + #include <linux/if_macvlan.h> 29 30 #include <net/sch_generic.h> 30 31 #include <net/pkt_sched.h> 31 32 #include <net/dst.h> ··· 278 277 279 278 if (is_vlan_dev(dev)) 280 279 dev = vlan_dev_real_dev(dev); 280 + else if (netif_is_macvlan(dev)) 281 + dev = macvlan_dev_real_dev(dev); 281 282 res = netdev_get_tx_queue(dev, 0)->trans_start; 282 283 for (i = 1; i < dev->num_tx_queues; i++) { 283 284 val = netdev_get_tx_queue(dev, i)->trans_start;
+3
net/sched/sch_gred.c
··· 356 356 struct gred_sched *table = qdisc_priv(sch); 357 357 struct gred_sched_data *q = table->tab[dp]; 358 358 359 + if (!red_check_params(ctl->qth_min, ctl->qth_max, ctl->Wlog)) 360 + return -EINVAL; 361 + 359 362 if (!q) { 360 363 table->tab[dp] = q = *prealloc; 361 364 *prealloc = NULL;
+2
net/sched/sch_red.c
··· 212 212 max_P = tb[TCA_RED_MAX_P] ? nla_get_u32(tb[TCA_RED_MAX_P]) : 0; 213 213 214 214 ctl = nla_data(tb[TCA_RED_PARMS]); 215 + if (!red_check_params(ctl->qth_min, ctl->qth_max, ctl->Wlog)) 216 + return -EINVAL; 215 217 216 218 if (ctl->limit > 0) { 217 219 child = fifo_create_dflt(sch, &bfifo_qdisc_ops, ctl->limit);
+3
net/sched/sch_sfq.c
··· 639 639 if (ctl->divisor && 640 640 (!is_power_of_2(ctl->divisor) || ctl->divisor > 65536)) 641 641 return -EINVAL; 642 + if (ctl_v1 && !red_check_params(ctl_v1->qth_min, ctl_v1->qth_max, 643 + ctl_v1->Wlog)) 644 + return -EINVAL; 642 645 if (ctl_v1 && ctl_v1->qth_min) { 643 646 p = kmalloc(sizeof(*p), GFP_KERNEL); 644 647 if (!p)
-1
net/sctp/socket.c
··· 5080 5080 *newfile = sock_alloc_file(newsock, 0, NULL); 5081 5081 if (IS_ERR(*newfile)) { 5082 5082 put_unused_fd(retval); 5083 - sock_release(newsock); 5084 5083 retval = PTR_ERR(*newfile); 5085 5084 *newfile = NULL; 5086 5085 return retval;
+45 -67
net/socket.c
··· 406 406 name.len = strlen(name.name); 407 407 } 408 408 path.dentry = d_alloc_pseudo(sock_mnt->mnt_sb, &name); 409 - if (unlikely(!path.dentry)) 409 + if (unlikely(!path.dentry)) { 410 + sock_release(sock); 410 411 return ERR_PTR(-ENOMEM); 412 + } 411 413 path.mnt = mntget(sock_mnt); 412 414 413 415 d_instantiate(path.dentry, SOCK_INODE(sock)); ··· 417 415 file = alloc_file(&path, FMODE_READ | FMODE_WRITE, 418 416 &socket_file_ops); 419 417 if (IS_ERR(file)) { 420 - /* drop dentry, keep inode */ 418 + /* drop dentry, keep inode for a bit */ 421 419 ihold(d_inode(path.dentry)); 422 420 path_put(&path); 421 + /* ... and now kill it properly */ 422 + sock_release(sock); 423 423 return file; 424 424 } 425 425 ··· 1334 1330 1335 1331 retval = sock_create(family, type, protocol, &sock); 1336 1332 if (retval < 0) 1337 - goto out; 1333 + return retval; 1338 1334 1339 - retval = sock_map_fd(sock, flags & (O_CLOEXEC | O_NONBLOCK)); 1340 - if (retval < 0) 1341 - goto out_release; 1342 - 1343 - out: 1344 - /* It may be already another descriptor 8) Not kernel problem. */ 1345 - return retval; 1346 - 1347 - out_release: 1348 - sock_release(sock); 1349 - return retval; 1335 + return sock_map_fd(sock, flags & (O_CLOEXEC | O_NONBLOCK)); 1350 1336 } 1351 1337 1352 1338 /* ··· 1360 1366 flags = (flags & ~SOCK_NONBLOCK) | O_NONBLOCK; 1361 1367 1362 1368 /* 1369 + * reserve descriptors and make sure we won't fail 1370 + * to return them to userland. 1371 + */ 1372 + fd1 = get_unused_fd_flags(flags); 1373 + if (unlikely(fd1 < 0)) 1374 + return fd1; 1375 + 1376 + fd2 = get_unused_fd_flags(flags); 1377 + if (unlikely(fd2 < 0)) { 1378 + put_unused_fd(fd1); 1379 + return fd2; 1380 + } 1381 + 1382 + err = put_user(fd1, &usockvec[0]); 1383 + if (err) 1384 + goto out; 1385 + 1386 + err = put_user(fd2, &usockvec[1]); 1387 + if (err) 1388 + goto out; 1389 + 1390 + /* 1363 1391 * Obtain the first socket and check if the underlying protocol 1364 1392 * supports the socketpair call. 1365 1393 */ 1366 1394 1367 1395 err = sock_create(family, type, protocol, &sock1); 1368 - if (err < 0) 1396 + if (unlikely(err < 0)) 1369 1397 goto out; 1370 1398 1371 1399 err = sock_create(family, type, protocol, &sock2); 1372 - if (err < 0) 1373 - goto out_release_1; 1374 - 1375 - err = sock1->ops->socketpair(sock1, sock2); 1376 - if (err < 0) 1377 - goto out_release_both; 1378 - 1379 - fd1 = get_unused_fd_flags(flags); 1380 - if (unlikely(fd1 < 0)) { 1381 - err = fd1; 1382 - goto out_release_both; 1400 + if (unlikely(err < 0)) { 1401 + sock_release(sock1); 1402 + goto out; 1383 1403 } 1384 1404 1385 - fd2 = get_unused_fd_flags(flags); 1386 - if (unlikely(fd2 < 0)) { 1387 - err = fd2; 1388 - goto out_put_unused_1; 1405 + err = sock1->ops->socketpair(sock1, sock2); 1406 + if (unlikely(err < 0)) { 1407 + sock_release(sock2); 1408 + sock_release(sock1); 1409 + goto out; 1389 1410 } 1390 1411 1391 1412 newfile1 = sock_alloc_file(sock1, flags, NULL); 1392 1413 if (IS_ERR(newfile1)) { 1393 1414 err = PTR_ERR(newfile1); 1394 - goto out_put_unused_both; 1415 + sock_release(sock2); 1416 + goto out; 1395 1417 } 1396 1418 1397 1419 newfile2 = sock_alloc_file(sock2, flags, NULL); 1398 1420 if (IS_ERR(newfile2)) { 1399 1421 err = PTR_ERR(newfile2); 1400 - goto out_fput_1; 1422 + fput(newfile1); 1423 + goto out; 1401 1424 } 1402 - 1403 - err = put_user(fd1, &usockvec[0]); 1404 - if (err) 1405 - goto out_fput_both; 1406 - 1407 - err = put_user(fd2, &usockvec[1]); 1408 - if (err) 1409 - goto out_fput_both; 1410 1425 1411 1426 audit_fd_pair(fd1, fd2); 1412 1427 1413 1428 fd_install(fd1, newfile1); 1414 1429 fd_install(fd2, newfile2); 1415 - /* fd1 and fd2 may be already another descriptors. 1416 - * Not kernel problem. 1417 - */ 1418 - 1419 1430 return 0; 1420 1431 1421 - out_fput_both: 1422 - fput(newfile2); 1423 - fput(newfile1); 1424 - put_unused_fd(fd2); 1425 - put_unused_fd(fd1); 1426 - goto out; 1427 - 1428 - out_fput_1: 1429 - fput(newfile1); 1430 - put_unused_fd(fd2); 1431 - put_unused_fd(fd1); 1432 - sock_release(sock2); 1433 - goto out; 1434 - 1435 - out_put_unused_both: 1436 - put_unused_fd(fd2); 1437 - out_put_unused_1: 1438 - put_unused_fd(fd1); 1439 - out_release_both: 1440 - sock_release(sock2); 1441 - out_release_1: 1442 - sock_release(sock1); 1443 1432 out: 1433 + put_unused_fd(fd2); 1434 + put_unused_fd(fd1); 1444 1435 return err; 1445 1436 } 1446 1437 ··· 1541 1562 if (IS_ERR(newfile)) { 1542 1563 err = PTR_ERR(newfile); 1543 1564 put_unused_fd(newfd); 1544 - sock_release(newsock); 1545 1565 goto out_put; 1546 1566 } 1547 1567
+2 -1
net/tipc/server.c
··· 314 314 newcon->usr_data = s->tipc_conn_new(newcon->conid); 315 315 if (!newcon->usr_data) { 316 316 sock_release(newsock); 317 + conn_put(newcon); 317 318 return -ENOMEM; 318 319 } 319 320 ··· 512 511 s = con->server; 513 512 scbr = s->tipc_conn_new(*conid); 514 513 if (!scbr) { 515 - tipc_close_conn(con); 514 + conn_put(con); 516 515 return false; 517 516 } 518 517
+1 -1
net/vmw_vsock/hyperv_transport.c
··· 487 487 488 488 lock_sock(sk); 489 489 490 - sk->sk_state = SS_DISCONNECTING; 490 + sk->sk_state = TCP_CLOSING; 491 491 vsock_remove_sock(vsk); 492 492 493 493 release_sock(sk);
+9
tools/arch/arm64/include/uapi/asm/bpf_perf_event.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + #ifndef _UAPI__ASM_BPF_PERF_EVENT_H__ 3 + #define _UAPI__ASM_BPF_PERF_EVENT_H__ 4 + 5 + #include <asm/ptrace.h> 6 + 7 + typedef struct user_pt_regs bpf_user_pt_regs_t; 8 + 9 + #endif /* _UAPI__ASM_BPF_PERF_EVENT_H__ */
+9
tools/arch/s390/include/uapi/asm/bpf_perf_event.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + #ifndef _UAPI__ASM_BPF_PERF_EVENT_H__ 3 + #define _UAPI__ASM_BPF_PERF_EVENT_H__ 4 + 5 + #include <asm/ptrace.h> 6 + 7 + typedef user_pt_regs bpf_user_pt_regs_t; 8 + 9 + #endif /* _UAPI__ASM_BPF_PERF_EVENT_H__ */
+457
tools/arch/s390/include/uapi/asm/ptrace.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 2 + /* 3 + * S390 version 4 + * Copyright IBM Corp. 1999, 2000 5 + * Author(s): Denis Joseph Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com) 6 + */ 7 + 8 + #ifndef _UAPI_S390_PTRACE_H 9 + #define _UAPI_S390_PTRACE_H 10 + 11 + /* 12 + * Offsets in the user_regs_struct. They are used for the ptrace 13 + * system call and in entry.S 14 + */ 15 + #ifndef __s390x__ 16 + 17 + #define PT_PSWMASK 0x00 18 + #define PT_PSWADDR 0x04 19 + #define PT_GPR0 0x08 20 + #define PT_GPR1 0x0C 21 + #define PT_GPR2 0x10 22 + #define PT_GPR3 0x14 23 + #define PT_GPR4 0x18 24 + #define PT_GPR5 0x1C 25 + #define PT_GPR6 0x20 26 + #define PT_GPR7 0x24 27 + #define PT_GPR8 0x28 28 + #define PT_GPR9 0x2C 29 + #define PT_GPR10 0x30 30 + #define PT_GPR11 0x34 31 + #define PT_GPR12 0x38 32 + #define PT_GPR13 0x3C 33 + #define PT_GPR14 0x40 34 + #define PT_GPR15 0x44 35 + #define PT_ACR0 0x48 36 + #define PT_ACR1 0x4C 37 + #define PT_ACR2 0x50 38 + #define PT_ACR3 0x54 39 + #define PT_ACR4 0x58 40 + #define PT_ACR5 0x5C 41 + #define PT_ACR6 0x60 42 + #define PT_ACR7 0x64 43 + #define PT_ACR8 0x68 44 + #define PT_ACR9 0x6C 45 + #define PT_ACR10 0x70 46 + #define PT_ACR11 0x74 47 + #define PT_ACR12 0x78 48 + #define PT_ACR13 0x7C 49 + #define PT_ACR14 0x80 50 + #define PT_ACR15 0x84 51 + #define PT_ORIGGPR2 0x88 52 + #define PT_FPC 0x90 53 + /* 54 + * A nasty fact of life that the ptrace api 55 + * only supports passing of longs. 56 + */ 57 + #define PT_FPR0_HI 0x98 58 + #define PT_FPR0_LO 0x9C 59 + #define PT_FPR1_HI 0xA0 60 + #define PT_FPR1_LO 0xA4 61 + #define PT_FPR2_HI 0xA8 62 + #define PT_FPR2_LO 0xAC 63 + #define PT_FPR3_HI 0xB0 64 + #define PT_FPR3_LO 0xB4 65 + #define PT_FPR4_HI 0xB8 66 + #define PT_FPR4_LO 0xBC 67 + #define PT_FPR5_HI 0xC0 68 + #define PT_FPR5_LO 0xC4 69 + #define PT_FPR6_HI 0xC8 70 + #define PT_FPR6_LO 0xCC 71 + #define PT_FPR7_HI 0xD0 72 + #define PT_FPR7_LO 0xD4 73 + #define PT_FPR8_HI 0xD8 74 + #define PT_FPR8_LO 0XDC 75 + #define PT_FPR9_HI 0xE0 76 + #define PT_FPR9_LO 0xE4 77 + #define PT_FPR10_HI 0xE8 78 + #define PT_FPR10_LO 0xEC 79 + #define PT_FPR11_HI 0xF0 80 + #define PT_FPR11_LO 0xF4 81 + #define PT_FPR12_HI 0xF8 82 + #define PT_FPR12_LO 0xFC 83 + #define PT_FPR13_HI 0x100 84 + #define PT_FPR13_LO 0x104 85 + #define PT_FPR14_HI 0x108 86 + #define PT_FPR14_LO 0x10C 87 + #define PT_FPR15_HI 0x110 88 + #define PT_FPR15_LO 0x114 89 + #define PT_CR_9 0x118 90 + #define PT_CR_10 0x11C 91 + #define PT_CR_11 0x120 92 + #define PT_IEEE_IP 0x13C 93 + #define PT_LASTOFF PT_IEEE_IP 94 + #define PT_ENDREGS 0x140-1 95 + 96 + #define GPR_SIZE 4 97 + #define CR_SIZE 4 98 + 99 + #define STACK_FRAME_OVERHEAD 96 /* size of minimum stack frame */ 100 + 101 + #else /* __s390x__ */ 102 + 103 + #define PT_PSWMASK 0x00 104 + #define PT_PSWADDR 0x08 105 + #define PT_GPR0 0x10 106 + #define PT_GPR1 0x18 107 + #define PT_GPR2 0x20 108 + #define PT_GPR3 0x28 109 + #define PT_GPR4 0x30 110 + #define PT_GPR5 0x38 111 + #define PT_GPR6 0x40 112 + #define PT_GPR7 0x48 113 + #define PT_GPR8 0x50 114 + #define PT_GPR9 0x58 115 + #define PT_GPR10 0x60 116 + #define PT_GPR11 0x68 117 + #define PT_GPR12 0x70 118 + #define PT_GPR13 0x78 119 + #define PT_GPR14 0x80 120 + #define PT_GPR15 0x88 121 + #define PT_ACR0 0x90 122 + #define PT_ACR1 0x94 123 + #define PT_ACR2 0x98 124 + #define PT_ACR3 0x9C 125 + #define PT_ACR4 0xA0 126 + #define PT_ACR5 0xA4 127 + #define PT_ACR6 0xA8 128 + #define PT_ACR7 0xAC 129 + #define PT_ACR8 0xB0 130 + #define PT_ACR9 0xB4 131 + #define PT_ACR10 0xB8 132 + #define PT_ACR11 0xBC 133 + #define PT_ACR12 0xC0 134 + #define PT_ACR13 0xC4 135 + #define PT_ACR14 0xC8 136 + #define PT_ACR15 0xCC 137 + #define PT_ORIGGPR2 0xD0 138 + #define PT_FPC 0xD8 139 + #define PT_FPR0 0xE0 140 + #define PT_FPR1 0xE8 141 + #define PT_FPR2 0xF0 142 + #define PT_FPR3 0xF8 143 + #define PT_FPR4 0x100 144 + #define PT_FPR5 0x108 145 + #define PT_FPR6 0x110 146 + #define PT_FPR7 0x118 147 + #define PT_FPR8 0x120 148 + #define PT_FPR9 0x128 149 + #define PT_FPR10 0x130 150 + #define PT_FPR11 0x138 151 + #define PT_FPR12 0x140 152 + #define PT_FPR13 0x148 153 + #define PT_FPR14 0x150 154 + #define PT_FPR15 0x158 155 + #define PT_CR_9 0x160 156 + #define PT_CR_10 0x168 157 + #define PT_CR_11 0x170 158 + #define PT_IEEE_IP 0x1A8 159 + #define PT_LASTOFF PT_IEEE_IP 160 + #define PT_ENDREGS 0x1B0-1 161 + 162 + #define GPR_SIZE 8 163 + #define CR_SIZE 8 164 + 165 + #define STACK_FRAME_OVERHEAD 160 /* size of minimum stack frame */ 166 + 167 + #endif /* __s390x__ */ 168 + 169 + #define NUM_GPRS 16 170 + #define NUM_FPRS 16 171 + #define NUM_CRS 16 172 + #define NUM_ACRS 16 173 + 174 + #define NUM_CR_WORDS 3 175 + 176 + #define FPR_SIZE 8 177 + #define FPC_SIZE 4 178 + #define FPC_PAD_SIZE 4 /* gcc insists on aligning the fpregs */ 179 + #define ACR_SIZE 4 180 + 181 + 182 + #define PTRACE_OLDSETOPTIONS 21 183 + 184 + #ifndef __ASSEMBLY__ 185 + #include <linux/stddef.h> 186 + #include <linux/types.h> 187 + 188 + typedef union { 189 + float f; 190 + double d; 191 + __u64 ui; 192 + struct 193 + { 194 + __u32 hi; 195 + __u32 lo; 196 + } fp; 197 + } freg_t; 198 + 199 + typedef struct { 200 + __u32 fpc; 201 + __u32 pad; 202 + freg_t fprs[NUM_FPRS]; 203 + } s390_fp_regs; 204 + 205 + #define FPC_EXCEPTION_MASK 0xF8000000 206 + #define FPC_FLAGS_MASK 0x00F80000 207 + #define FPC_DXC_MASK 0x0000FF00 208 + #define FPC_RM_MASK 0x00000003 209 + 210 + /* this typedef defines how a Program Status Word looks like */ 211 + typedef struct { 212 + unsigned long mask; 213 + unsigned long addr; 214 + } __attribute__ ((aligned(8))) psw_t; 215 + 216 + #ifndef __s390x__ 217 + 218 + #define PSW_MASK_PER 0x40000000UL 219 + #define PSW_MASK_DAT 0x04000000UL 220 + #define PSW_MASK_IO 0x02000000UL 221 + #define PSW_MASK_EXT 0x01000000UL 222 + #define PSW_MASK_KEY 0x00F00000UL 223 + #define PSW_MASK_BASE 0x00080000UL /* always one */ 224 + #define PSW_MASK_MCHECK 0x00040000UL 225 + #define PSW_MASK_WAIT 0x00020000UL 226 + #define PSW_MASK_PSTATE 0x00010000UL 227 + #define PSW_MASK_ASC 0x0000C000UL 228 + #define PSW_MASK_CC 0x00003000UL 229 + #define PSW_MASK_PM 0x00000F00UL 230 + #define PSW_MASK_RI 0x00000000UL 231 + #define PSW_MASK_EA 0x00000000UL 232 + #define PSW_MASK_BA 0x00000000UL 233 + 234 + #define PSW_MASK_USER 0x0000FF00UL 235 + 236 + #define PSW_ADDR_AMODE 0x80000000UL 237 + #define PSW_ADDR_INSN 0x7FFFFFFFUL 238 + 239 + #define PSW_DEFAULT_KEY (((unsigned long) PAGE_DEFAULT_ACC) << 20) 240 + 241 + #define PSW_ASC_PRIMARY 0x00000000UL 242 + #define PSW_ASC_ACCREG 0x00004000UL 243 + #define PSW_ASC_SECONDARY 0x00008000UL 244 + #define PSW_ASC_HOME 0x0000C000UL 245 + 246 + #else /* __s390x__ */ 247 + 248 + #define PSW_MASK_PER 0x4000000000000000UL 249 + #define PSW_MASK_DAT 0x0400000000000000UL 250 + #define PSW_MASK_IO 0x0200000000000000UL 251 + #define PSW_MASK_EXT 0x0100000000000000UL 252 + #define PSW_MASK_BASE 0x0000000000000000UL 253 + #define PSW_MASK_KEY 0x00F0000000000000UL 254 + #define PSW_MASK_MCHECK 0x0004000000000000UL 255 + #define PSW_MASK_WAIT 0x0002000000000000UL 256 + #define PSW_MASK_PSTATE 0x0001000000000000UL 257 + #define PSW_MASK_ASC 0x0000C00000000000UL 258 + #define PSW_MASK_CC 0x0000300000000000UL 259 + #define PSW_MASK_PM 0x00000F0000000000UL 260 + #define PSW_MASK_RI 0x0000008000000000UL 261 + #define PSW_MASK_EA 0x0000000100000000UL 262 + #define PSW_MASK_BA 0x0000000080000000UL 263 + 264 + #define PSW_MASK_USER 0x0000FF0180000000UL 265 + 266 + #define PSW_ADDR_AMODE 0x0000000000000000UL 267 + #define PSW_ADDR_INSN 0xFFFFFFFFFFFFFFFFUL 268 + 269 + #define PSW_DEFAULT_KEY (((unsigned long) PAGE_DEFAULT_ACC) << 52) 270 + 271 + #define PSW_ASC_PRIMARY 0x0000000000000000UL 272 + #define PSW_ASC_ACCREG 0x0000400000000000UL 273 + #define PSW_ASC_SECONDARY 0x0000800000000000UL 274 + #define PSW_ASC_HOME 0x0000C00000000000UL 275 + 276 + #endif /* __s390x__ */ 277 + 278 + 279 + /* 280 + * The s390_regs structure is used to define the elf_gregset_t. 281 + */ 282 + typedef struct { 283 + psw_t psw; 284 + unsigned long gprs[NUM_GPRS]; 285 + unsigned int acrs[NUM_ACRS]; 286 + unsigned long orig_gpr2; 287 + } s390_regs; 288 + 289 + /* 290 + * The user_pt_regs structure exports the beginning of 291 + * the in-kernel pt_regs structure to user space. 292 + */ 293 + typedef struct { 294 + unsigned long args[1]; 295 + psw_t psw; 296 + unsigned long gprs[NUM_GPRS]; 297 + } user_pt_regs; 298 + 299 + /* 300 + * Now for the user space program event recording (trace) definitions. 301 + * The following structures are used only for the ptrace interface, don't 302 + * touch or even look at it if you don't want to modify the user-space 303 + * ptrace interface. In particular stay away from it for in-kernel PER. 304 + */ 305 + typedef struct { 306 + unsigned long cr[NUM_CR_WORDS]; 307 + } per_cr_words; 308 + 309 + #define PER_EM_MASK 0xE8000000UL 310 + 311 + typedef struct { 312 + #ifdef __s390x__ 313 + unsigned : 32; 314 + #endif /* __s390x__ */ 315 + unsigned em_branching : 1; 316 + unsigned em_instruction_fetch : 1; 317 + /* 318 + * Switching on storage alteration automatically fixes 319 + * the storage alteration event bit in the users std. 320 + */ 321 + unsigned em_storage_alteration : 1; 322 + unsigned em_gpr_alt_unused : 1; 323 + unsigned em_store_real_address : 1; 324 + unsigned : 3; 325 + unsigned branch_addr_ctl : 1; 326 + unsigned : 1; 327 + unsigned storage_alt_space_ctl : 1; 328 + unsigned : 21; 329 + unsigned long starting_addr; 330 + unsigned long ending_addr; 331 + } per_cr_bits; 332 + 333 + typedef struct { 334 + unsigned short perc_atmid; 335 + unsigned long address; 336 + unsigned char access_id; 337 + } per_lowcore_words; 338 + 339 + typedef struct { 340 + unsigned perc_branching : 1; 341 + unsigned perc_instruction_fetch : 1; 342 + unsigned perc_storage_alteration : 1; 343 + unsigned perc_gpr_alt_unused : 1; 344 + unsigned perc_store_real_address : 1; 345 + unsigned : 3; 346 + unsigned atmid_psw_bit_31 : 1; 347 + unsigned atmid_validity_bit : 1; 348 + unsigned atmid_psw_bit_32 : 1; 349 + unsigned atmid_psw_bit_5 : 1; 350 + unsigned atmid_psw_bit_16 : 1; 351 + unsigned atmid_psw_bit_17 : 1; 352 + unsigned si : 2; 353 + unsigned long address; 354 + unsigned : 4; 355 + unsigned access_id : 4; 356 + } per_lowcore_bits; 357 + 358 + typedef struct { 359 + union { 360 + per_cr_words words; 361 + per_cr_bits bits; 362 + } control_regs; 363 + /* 364 + * The single_step and instruction_fetch bits are obsolete, 365 + * the kernel always sets them to zero. To enable single 366 + * stepping use ptrace(PTRACE_SINGLESTEP) instead. 367 + */ 368 + unsigned single_step : 1; 369 + unsigned instruction_fetch : 1; 370 + unsigned : 30; 371 + /* 372 + * These addresses are copied into cr10 & cr11 if single 373 + * stepping is switched off 374 + */ 375 + unsigned long starting_addr; 376 + unsigned long ending_addr; 377 + union { 378 + per_lowcore_words words; 379 + per_lowcore_bits bits; 380 + } lowcore; 381 + } per_struct; 382 + 383 + typedef struct { 384 + unsigned int len; 385 + unsigned long kernel_addr; 386 + unsigned long process_addr; 387 + } ptrace_area; 388 + 389 + /* 390 + * S/390 specific non posix ptrace requests. I chose unusual values so 391 + * they are unlikely to clash with future ptrace definitions. 392 + */ 393 + #define PTRACE_PEEKUSR_AREA 0x5000 394 + #define PTRACE_POKEUSR_AREA 0x5001 395 + #define PTRACE_PEEKTEXT_AREA 0x5002 396 + #define PTRACE_PEEKDATA_AREA 0x5003 397 + #define PTRACE_POKETEXT_AREA 0x5004 398 + #define PTRACE_POKEDATA_AREA 0x5005 399 + #define PTRACE_GET_LAST_BREAK 0x5006 400 + #define PTRACE_PEEK_SYSTEM_CALL 0x5007 401 + #define PTRACE_POKE_SYSTEM_CALL 0x5008 402 + #define PTRACE_ENABLE_TE 0x5009 403 + #define PTRACE_DISABLE_TE 0x5010 404 + #define PTRACE_TE_ABORT_RAND 0x5011 405 + 406 + /* 407 + * The numbers chosen here are somewhat arbitrary but absolutely MUST 408 + * not overlap with any of the number assigned in <linux/ptrace.h>. 409 + */ 410 + #define PTRACE_SINGLEBLOCK 12 /* resume execution until next branch */ 411 + 412 + /* 413 + * PT_PROT definition is loosely based on hppa bsd definition in 414 + * gdb/hppab-nat.c 415 + */ 416 + #define PTRACE_PROT 21 417 + 418 + typedef enum { 419 + ptprot_set_access_watchpoint, 420 + ptprot_set_write_watchpoint, 421 + ptprot_disable_watchpoint 422 + } ptprot_flags; 423 + 424 + typedef struct { 425 + unsigned long lowaddr; 426 + unsigned long hiaddr; 427 + ptprot_flags prot; 428 + } ptprot_area; 429 + 430 + /* Sequence of bytes for breakpoint illegal instruction. */ 431 + #define S390_BREAKPOINT {0x0,0x1} 432 + #define S390_BREAKPOINT_U16 ((__u16)0x0001) 433 + #define S390_SYSCALL_OPCODE ((__u16)0x0a00) 434 + #define S390_SYSCALL_SIZE 2 435 + 436 + /* 437 + * The user_regs_struct defines the way the user registers are 438 + * store on the stack for signal handling. 439 + */ 440 + struct user_regs_struct { 441 + psw_t psw; 442 + unsigned long gprs[NUM_GPRS]; 443 + unsigned int acrs[NUM_ACRS]; 444 + unsigned long orig_gpr2; 445 + s390_fp_regs fp_regs; 446 + /* 447 + * These per registers are in here so that gdb can modify them 448 + * itself as there is no "official" ptrace interface for hardware 449 + * watchpoints. This is the way intel does it. 450 + */ 451 + per_struct per_info; 452 + unsigned long ieee_instruction_pointer; /* obsolete, always 0 */ 453 + }; 454 + 455 + #endif /* __ASSEMBLY__ */ 456 + 457 + #endif /* _UAPI_S390_PTRACE_H */
+9
tools/include/uapi/asm-generic/bpf_perf_event.h
··· 1 + #ifndef _UAPI__ASM_GENERIC_BPF_PERF_EVENT_H__ 2 + #define _UAPI__ASM_GENERIC_BPF_PERF_EVENT_H__ 3 + 4 + #include <linux/ptrace.h> 5 + 6 + /* Export kernel pt_regs structure */ 7 + typedef struct pt_regs bpf_user_pt_regs_t; 8 + 9 + #endif /* _UAPI__ASM_GENERIC_BPF_PERF_EVENT_H__ */
+3 -3
tools/include/uapi/linux/bpf_perf_event.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 1 2 /* Copyright (c) 2016 Facebook 2 3 * 3 4 * This program is free software; you can redistribute it and/or ··· 8 7 #ifndef _UAPI__LINUX_BPF_PERF_EVENT_H__ 9 8 #define _UAPI__LINUX_BPF_PERF_EVENT_H__ 10 9 11 - #include <linux/types.h> 12 - #include <linux/ptrace.h> 10 + #include <asm/bpf_perf_event.h> 13 11 14 12 struct bpf_perf_event_data { 15 - struct pt_regs regs; 13 + bpf_user_pt_regs_t regs; 16 14 __u64 sample_period; 17 15 }; 18 16
+1
tools/perf/arch/s390/Makefile
··· 2 2 PERF_HAVE_DWARF_REGS := 1 3 3 endif 4 4 HAVE_KVM_STAT_SUPPORT := 1 5 + PERF_HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET := 1
+29 -3
tools/perf/arch/s390/util/dwarf-regs.c
··· 2 2 /* 3 3 * Mapping of DWARF debug register numbers into register names. 4 4 * 5 - * Copyright IBM Corp. 2010 6 - * Author(s): Heiko Carstens <heiko.carstens@de.ibm.com>, 5 + * Copyright IBM Corp. 2010, 2017 6 + * Author(s): Heiko Carstens <heiko.carstens@de.ibm.com>, 7 + * Hendrik Brueckner <brueckner@linux.vnet.ibm.com> 7 8 * 8 9 */ 9 10 11 + #include <errno.h> 10 12 #include <stddef.h> 11 - #include <dwarf-regs.h> 13 + #include <stdlib.h> 12 14 #include <linux/kernel.h> 15 + #include <asm/ptrace.h> 16 + #include <string.h> 17 + #include <dwarf-regs.h> 13 18 #include "dwarf-regs-table.h" 14 19 15 20 const char *get_arch_regstr(unsigned int n) 16 21 { 17 22 return (n >= ARRAY_SIZE(s390_dwarf_regs)) ? NULL : s390_dwarf_regs[n]; 23 + } 24 + 25 + /* 26 + * Convert the register name into an offset to struct pt_regs (kernel). 27 + * This is required by the BPF prologue generator. The BPF 28 + * program is called in the BPF overflow handler in the perf 29 + * core. 30 + */ 31 + int regs_query_register_offset(const char *name) 32 + { 33 + unsigned long gpr; 34 + 35 + if (!name || strncmp(name, "%r", 2)) 36 + return -EINVAL; 37 + 38 + errno = 0; 39 + gpr = strtoul(name + 2, NULL, 10); 40 + if (errno || gpr >= 16) 41 + return -EINVAL; 42 + 43 + return offsetof(user_pt_regs, gprs) + 8 * gpr; 18 44 }
+1
tools/perf/check-headers.sh
··· 30 30 arch/powerpc/include/uapi/asm/kvm.h 31 31 arch/s390/include/uapi/asm/kvm.h 32 32 arch/s390/include/uapi/asm/kvm_perf.h 33 + arch/s390/include/uapi/asm/ptrace.h 33 34 arch/s390/include/uapi/asm/sie.h 34 35 arch/arm/include/uapi/asm/kvm.h 35 36 arch/arm64/include/uapi/asm/kvm.h
+13 -1
tools/testing/selftests/bpf/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 + 3 + ifeq ($(srctree),) 4 + srctree := $(patsubst %/,%,$(dir $(CURDIR))) 5 + srctree := $(patsubst %/,%,$(dir $(srctree))) 6 + srctree := $(patsubst %/,%,$(dir $(srctree))) 7 + srctree := $(patsubst %/,%,$(dir $(srctree))) 8 + endif 9 + include $(srctree)/tools/scripts/Makefile.arch 10 + 11 + $(call detected_var,SRCARCH) 12 + 2 13 LIBDIR := ../../../lib 3 14 BPFDIR := $(LIBDIR)/bpf 4 15 APIDIR := ../../../include/uapi 16 + ASMDIR:= ../../../arch/$(ARCH)/include/uapi 5 17 GENDIR := ../../../../include/generated 6 18 GENHDR := $(GENDIR)/autoconf.h 7 19 ··· 21 9 GENFLAGS := -DHAVE_GENHDR 22 10 endif 23 11 24 - CFLAGS += -Wall -O2 -I$(APIDIR) -I$(LIBDIR) -I$(GENDIR) $(GENFLAGS) -I../../../include 12 + CFLAGS += -Wall -O2 -I$(APIDIR) -I$(ASMDIR) -I$(LIBDIR) -I$(GENDIR) $(GENFLAGS) -I../../../include 25 13 LDLIBS += -lcap -lelf 26 14 27 15 TEST_GEN_PROGS = test_verifier test_tag test_maps test_lru_map test_lpm_map test_progs \