mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
Merge e5d523f1ae ("ubsan: disable UBSAN_DIV_ZERO for clang") into android-mainline
Steps on the way to 5.19-rc7 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: Ia66519ba92fa41f05a5e507e597119f8a00f67d7
This commit is contained in:
@@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
title: Qualcomm Atheros ath9k wireless devices Generic Binding
|
||||
|
||||
maintainers:
|
||||
- Kalle Valo <kvalo@codeaurora.org>
|
||||
- Toke Høiland-Jørgensen <toke@toke.dk>
|
||||
|
||||
description: |
|
||||
This node provides properties for configuring the ath9k wireless device.
|
||||
|
||||
@@ -9,7 +9,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
title: Qualcomm Technologies ath11k wireless devices Generic Binding
|
||||
|
||||
maintainers:
|
||||
- Kalle Valo <kvalo@codeaurora.org>
|
||||
- Kalle Valo <kvalo@kernel.org>
|
||||
|
||||
description: |
|
||||
These are dt entries for Qualcomm Technologies, Inc. IEEE 802.11ax
|
||||
|
||||
@@ -25,12 +25,12 @@ properties:
|
||||
- qcom,sc7280-lpass-cpu
|
||||
|
||||
reg:
|
||||
minItems: 2
|
||||
minItems: 1
|
||||
maxItems: 6
|
||||
description: LPAIF core registers
|
||||
|
||||
reg-names:
|
||||
minItems: 2
|
||||
minItems: 1
|
||||
maxItems: 6
|
||||
|
||||
clocks:
|
||||
@@ -42,12 +42,12 @@ properties:
|
||||
maxItems: 10
|
||||
|
||||
interrupts:
|
||||
minItems: 2
|
||||
minItems: 1
|
||||
maxItems: 4
|
||||
description: LPAIF DMA buffer interrupt
|
||||
|
||||
interrupt-names:
|
||||
minItems: 2
|
||||
minItems: 1
|
||||
maxItems: 4
|
||||
|
||||
qcom,adsp:
|
||||
|
||||
@@ -1085,7 +1085,7 @@ cipso_cache_enable - BOOLEAN
|
||||
cipso_cache_bucket_size - INTEGER
|
||||
The CIPSO label cache consists of a fixed size hash table with each
|
||||
hash bucket containing a number of cache entries. This variable limits
|
||||
the number of entries in each hash bucket; the larger the value the
|
||||
the number of entries in each hash bucket; the larger the value is, the
|
||||
more CIPSO label mappings that can be cached. When the number of
|
||||
entries in a given hash bucket reaches this limit adding new entries
|
||||
causes the oldest entry in the bucket to be removed to make room.
|
||||
@@ -1179,7 +1179,7 @@ ip_autobind_reuse - BOOLEAN
|
||||
option should only be set by experts.
|
||||
Default: 0
|
||||
|
||||
ip_dynaddr - BOOLEAN
|
||||
ip_dynaddr - INTEGER
|
||||
If set non-zero, enables support for dynamic addresses.
|
||||
If set to a non-zero value larger than 1, a kernel log
|
||||
message will be printed when dynamic address rewriting
|
||||
|
||||
@@ -10,7 +10,7 @@ AC97
|
||||
====
|
||||
|
||||
AC97 is a five wire interface commonly found on many PC sound cards. It is
|
||||
now also popular in many portable devices. This DAI has a reset line and time
|
||||
now also popular in many portable devices. This DAI has a RESET line and time
|
||||
multiplexes its data on its SDATA_OUT (playback) and SDATA_IN (capture) lines.
|
||||
The bit clock (BCLK) is always driven by the CODEC (usually 12.288MHz) and the
|
||||
frame (FRAME) (usually 48kHz) is always driven by the controller. Each AC97
|
||||
|
||||
@@ -1038,6 +1038,7 @@ F: arch/arm64/boot/dts/amd/
|
||||
|
||||
AMD XGBE DRIVER
|
||||
M: Tom Lendacky <thomas.lendacky@amd.com>
|
||||
M: "Shyam Sundar S K" <Shyam-sundar.S-k@amd.com>
|
||||
L: netdev@vger.kernel.org
|
||||
S: Supported
|
||||
F: arch/arm64/boot/dts/amd/amd-seattle-xgbe*.dtsi
|
||||
|
||||
@@ -112,19 +112,6 @@ static __always_inline void set_domain(unsigned int val)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CPU_USE_DOMAINS
|
||||
#define modify_domain(dom,type) \
|
||||
do { \
|
||||
unsigned int domain = get_domain(); \
|
||||
domain &= ~domain_mask(dom); \
|
||||
domain = domain | domain_val(dom, type); \
|
||||
set_domain(domain); \
|
||||
} while (0)
|
||||
|
||||
#else
|
||||
static inline void modify_domain(unsigned dom, unsigned type) { }
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Generate the T (user) versions of the LDR/STR and related
|
||||
* instructions (inline assembly)
|
||||
|
||||
@@ -27,6 +27,7 @@ enum {
|
||||
MT_HIGH_VECTORS,
|
||||
MT_MEMORY_RWX,
|
||||
MT_MEMORY_RW,
|
||||
MT_MEMORY_RO,
|
||||
MT_ROM,
|
||||
MT_MEMORY_RWX_NONCACHED,
|
||||
MT_MEMORY_RW_DTCM,
|
||||
|
||||
@@ -163,5 +163,31 @@ static inline unsigned long user_stack_pointer(struct pt_regs *regs)
|
||||
((current_stack_pointer | (THREAD_SIZE - 1)) - 7) - 1; \
|
||||
})
|
||||
|
||||
|
||||
/*
|
||||
* Update ITSTATE after normal execution of an IT block instruction.
|
||||
*
|
||||
* The 8 IT state bits are split into two parts in CPSR:
|
||||
* ITSTATE<1:0> are in CPSR<26:25>
|
||||
* ITSTATE<7:2> are in CPSR<15:10>
|
||||
*/
|
||||
static inline unsigned long it_advance(unsigned long cpsr)
|
||||
{
|
||||
if ((cpsr & 0x06000400) == 0) {
|
||||
/* ITSTATE<2:0> == 0 means end of IT block, so clear IT state */
|
||||
cpsr &= ~PSR_IT_MASK;
|
||||
} else {
|
||||
/* We need to shift left ITSTATE<4:0> */
|
||||
const unsigned long mask = 0x06001c00; /* Mask ITSTATE<4:0> */
|
||||
unsigned long it = cpsr & mask;
|
||||
it <<= 1;
|
||||
it |= it >> (27 - 10); /* Carry ITSTATE<2> to correct place */
|
||||
it &= mask;
|
||||
cpsr &= ~mask;
|
||||
cpsr |= it;
|
||||
}
|
||||
return cpsr;
|
||||
}
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif
|
||||
|
||||
@@ -302,6 +302,7 @@ local_restart:
|
||||
b ret_fast_syscall
|
||||
#endif
|
||||
ENDPROC(vector_swi)
|
||||
.ltorg
|
||||
|
||||
/*
|
||||
* This is the really slow path. We're going to be doing
|
||||
|
||||
@@ -631,7 +631,11 @@ config CPU_USE_DOMAINS
|
||||
bool
|
||||
help
|
||||
This option enables or disables the use of domain switching
|
||||
via the set_fs() function.
|
||||
using the DACR (domain access control register) to protect memory
|
||||
domains from each other. In Linux we use three domains: kernel, user
|
||||
and IO. The domains are used to protect userspace from kernelspace
|
||||
and to handle IO-space as a special type of memory by assigning
|
||||
manager or client roles to running code (such as a process).
|
||||
|
||||
config CPU_V7M_NUM_IRQ
|
||||
int "Number of external interrupts connected to the NVIC"
|
||||
|
||||
@@ -935,6 +935,9 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
|
||||
if (type == TYPE_LDST)
|
||||
do_alignment_finish_ldst(addr, instr, regs, offset);
|
||||
|
||||
if (thumb_mode(regs))
|
||||
regs->ARM_cpsr = it_advance(regs->ARM_cpsr);
|
||||
|
||||
return 0;
|
||||
|
||||
bad_or_fault:
|
||||
|
||||
@@ -296,6 +296,13 @@ static struct mem_type mem_types[] __ro_after_init = {
|
||||
.prot_sect = PMD_TYPE_SECT | PMD_SECT_AP_WRITE,
|
||||
.domain = DOMAIN_KERNEL,
|
||||
},
|
||||
[MT_MEMORY_RO] = {
|
||||
.prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY |
|
||||
L_PTE_XN | L_PTE_RDONLY,
|
||||
.prot_l1 = PMD_TYPE_TABLE,
|
||||
.prot_sect = PMD_TYPE_SECT,
|
||||
.domain = DOMAIN_KERNEL,
|
||||
},
|
||||
[MT_ROM] = {
|
||||
.prot_sect = PMD_TYPE_SECT,
|
||||
.domain = DOMAIN_KERNEL,
|
||||
@@ -489,6 +496,7 @@ static void __init build_mem_type_table(void)
|
||||
|
||||
/* Also setup NX memory mapping */
|
||||
mem_types[MT_MEMORY_RW].prot_sect |= PMD_SECT_XN;
|
||||
mem_types[MT_MEMORY_RO].prot_sect |= PMD_SECT_XN;
|
||||
}
|
||||
if (cpu_arch >= CPU_ARCH_ARMv7 && (cr & CR_TRE)) {
|
||||
/*
|
||||
@@ -568,6 +576,7 @@ static void __init build_mem_type_table(void)
|
||||
mem_types[MT_ROM].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE;
|
||||
mem_types[MT_MINICLEAN].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE;
|
||||
mem_types[MT_CACHECLEAN].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE;
|
||||
mem_types[MT_MEMORY_RO].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE;
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -587,6 +596,8 @@ static void __init build_mem_type_table(void)
|
||||
mem_types[MT_MEMORY_RWX].prot_pte |= L_PTE_SHARED;
|
||||
mem_types[MT_MEMORY_RW].prot_sect |= PMD_SECT_S;
|
||||
mem_types[MT_MEMORY_RW].prot_pte |= L_PTE_SHARED;
|
||||
mem_types[MT_MEMORY_RO].prot_sect |= PMD_SECT_S;
|
||||
mem_types[MT_MEMORY_RO].prot_pte |= L_PTE_SHARED;
|
||||
mem_types[MT_MEMORY_DMA_READY].prot_pte |= L_PTE_SHARED;
|
||||
mem_types[MT_MEMORY_RWX_NONCACHED].prot_sect |= PMD_SECT_S;
|
||||
mem_types[MT_MEMORY_RWX_NONCACHED].prot_pte |= L_PTE_SHARED;
|
||||
@@ -647,6 +658,8 @@ static void __init build_mem_type_table(void)
|
||||
mem_types[MT_MEMORY_RWX].prot_pte |= kern_pgprot;
|
||||
mem_types[MT_MEMORY_RW].prot_sect |= ecc_mask | cp->pmd;
|
||||
mem_types[MT_MEMORY_RW].prot_pte |= kern_pgprot;
|
||||
mem_types[MT_MEMORY_RO].prot_sect |= ecc_mask | cp->pmd;
|
||||
mem_types[MT_MEMORY_RO].prot_pte |= kern_pgprot;
|
||||
mem_types[MT_MEMORY_DMA_READY].prot_pte |= kern_pgprot;
|
||||
mem_types[MT_MEMORY_RWX_NONCACHED].prot_sect |= ecc_mask;
|
||||
mem_types[MT_ROM].prot_sect |= cp->pmd;
|
||||
@@ -1360,7 +1373,7 @@ static void __init devicemaps_init(const struct machine_desc *mdesc)
|
||||
map.pfn = __phys_to_pfn(__atags_pointer & SECTION_MASK);
|
||||
map.virtual = FDT_FIXED_BASE;
|
||||
map.length = FDT_FIXED_SIZE;
|
||||
map.type = MT_ROM;
|
||||
map.type = MT_MEMORY_RO;
|
||||
create_mapping(&map);
|
||||
}
|
||||
|
||||
|
||||
@@ -108,8 +108,7 @@ static unsigned int spectre_v2_install_workaround(unsigned int method)
|
||||
#else
|
||||
static unsigned int spectre_v2_install_workaround(unsigned int method)
|
||||
{
|
||||
pr_info("CPU%u: Spectre V2: workarounds disabled by configuration\n",
|
||||
smp_processor_id());
|
||||
pr_info_once("Spectre V2: workarounds disabled by configuration\n");
|
||||
|
||||
return SPECTRE_VULNERABLE;
|
||||
}
|
||||
@@ -209,10 +208,10 @@ static int spectre_bhb_install_workaround(int method)
|
||||
return SPECTRE_VULNERABLE;
|
||||
|
||||
spectre_bhb_method = method;
|
||||
}
|
||||
|
||||
pr_info("CPU%u: Spectre BHB: using %s workaround\n",
|
||||
smp_processor_id(), spectre_bhb_method_name(method));
|
||||
pr_info("CPU%u: Spectre BHB: enabling %s workaround for all CPUs\n",
|
||||
smp_processor_id(), spectre_bhb_method_name(method));
|
||||
}
|
||||
|
||||
return SPECTRE_MITIGATED;
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <linux/types.h>
|
||||
#include <linux/stddef.h>
|
||||
#include <asm/probes.h>
|
||||
#include <asm/ptrace.h>
|
||||
#include <asm/kprobes.h>
|
||||
|
||||
void __init arm_probes_decode_init(void);
|
||||
@@ -35,31 +36,6 @@ void __init find_str_pc_offset(void);
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Update ITSTATE after normal execution of an IT block instruction.
|
||||
*
|
||||
* The 8 IT state bits are split into two parts in CPSR:
|
||||
* ITSTATE<1:0> are in CPSR<26:25>
|
||||
* ITSTATE<7:2> are in CPSR<15:10>
|
||||
*/
|
||||
static inline unsigned long it_advance(unsigned long cpsr)
|
||||
{
|
||||
if ((cpsr & 0x06000400) == 0) {
|
||||
/* ITSTATE<2:0> == 0 means end of IT block, so clear IT state */
|
||||
cpsr &= ~PSR_IT_MASK;
|
||||
} else {
|
||||
/* We need to shift left ITSTATE<4:0> */
|
||||
const unsigned long mask = 0x06001c00; /* Mask ITSTATE<4:0> */
|
||||
unsigned long it = cpsr & mask;
|
||||
it <<= 1;
|
||||
it |= it >> (27 - 10); /* Carry ITSTATE<2> to correct place */
|
||||
it &= mask;
|
||||
cpsr &= ~mask;
|
||||
cpsr |= it;
|
||||
}
|
||||
return cpsr;
|
||||
}
|
||||
|
||||
static inline void __kprobes bx_write_pc(long pcv, struct pt_regs *regs)
|
||||
{
|
||||
long cpsr = regs->ARM_cpsr;
|
||||
|
||||
@@ -102,8 +102,8 @@ extern unsigned long uml_physmem;
|
||||
* casting is the right thing, but 32-bit UML can't have 64-bit virtual
|
||||
* addresses
|
||||
*/
|
||||
#define __pa(virt) to_phys((void *) (unsigned long) (virt))
|
||||
#define __va(phys) to_virt((unsigned long) (phys))
|
||||
#define __pa(virt) uml_to_phys((void *) (unsigned long) (virt))
|
||||
#define __va(phys) uml_to_virt((unsigned long) (phys))
|
||||
|
||||
#define phys_to_pfn(p) ((p) >> PAGE_SHIFT)
|
||||
#define pfn_to_phys(pfn) PFN_PHYS(pfn)
|
||||
|
||||
@@ -9,12 +9,12 @@
|
||||
extern int phys_mapping(unsigned long phys, unsigned long long *offset_out);
|
||||
|
||||
extern unsigned long uml_physmem;
|
||||
static inline unsigned long to_phys(void *virt)
|
||||
static inline unsigned long uml_to_phys(void *virt)
|
||||
{
|
||||
return(((unsigned long) virt) - uml_physmem);
|
||||
}
|
||||
|
||||
static inline void *to_virt(unsigned long phys)
|
||||
static inline void *uml_to_virt(unsigned long phys)
|
||||
{
|
||||
return((void *) uml_physmem + phys);
|
||||
}
|
||||
|
||||
@@ -251,7 +251,7 @@ static int userspace_tramp(void *stack)
|
||||
signal(SIGTERM, SIG_DFL);
|
||||
signal(SIGWINCH, SIG_IGN);
|
||||
|
||||
fd = phys_mapping(to_phys(__syscall_stub_start), &offset);
|
||||
fd = phys_mapping(uml_to_phys(__syscall_stub_start), &offset);
|
||||
addr = mmap64((void *) STUB_CODE, UM_KERN_PAGE_SIZE,
|
||||
PROT_EXEC, MAP_FIXED | MAP_PRIVATE, fd, offset);
|
||||
if (addr == MAP_FAILED) {
|
||||
@@ -261,7 +261,7 @@ static int userspace_tramp(void *stack)
|
||||
}
|
||||
|
||||
if (stack != NULL) {
|
||||
fd = phys_mapping(to_phys(stack), &offset);
|
||||
fd = phys_mapping(uml_to_phys(stack), &offset);
|
||||
addr = mmap((void *) STUB_DATA,
|
||||
UM_KERN_PAGE_SIZE, PROT_READ | PROT_WRITE,
|
||||
MAP_FIXED | MAP_SHARED, fd, offset);
|
||||
@@ -534,7 +534,7 @@ int copy_context_skas0(unsigned long new_stack, int pid)
|
||||
struct stub_data *data = (struct stub_data *) current_stack;
|
||||
struct stub_data *child_data = (struct stub_data *) new_stack;
|
||||
unsigned long long new_offset;
|
||||
int new_fd = phys_mapping(to_phys((void *)new_stack), &new_offset);
|
||||
int new_fd = phys_mapping(uml_to_phys((void *)new_stack), &new_offset);
|
||||
|
||||
/*
|
||||
* prepare offset and fd of child's stack as argument for parent's
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include <asm/cpufeatures.h>
|
||||
#include <asm/msr-index.h>
|
||||
#include <asm/unwind_hints.h>
|
||||
#include <asm/percpu.h>
|
||||
|
||||
#define RETPOLINE_THUNK_SIZE 32
|
||||
|
||||
@@ -280,7 +281,7 @@ static inline void indirect_branch_prediction_barrier(void)
|
||||
|
||||
/* The Intel SPEC CTRL MSR base value cache */
|
||||
extern u64 x86_spec_ctrl_base;
|
||||
extern u64 x86_spec_ctrl_current;
|
||||
DECLARE_PER_CPU(u64, x86_spec_ctrl_current);
|
||||
extern void write_spec_ctrl_current(u64 val, bool force);
|
||||
extern u64 spec_ctrl_current(void);
|
||||
|
||||
|
||||
@@ -493,13 +493,8 @@ static int amba_device_try_add(struct amba_device *dev, struct resource *parent)
|
||||
goto skip_probe;
|
||||
|
||||
ret = amba_read_periphid(dev);
|
||||
if (ret) {
|
||||
if (ret != -EPROBE_DEFER) {
|
||||
amba_device_put(dev);
|
||||
goto err_out;
|
||||
}
|
||||
if (ret)
|
||||
goto err_release;
|
||||
}
|
||||
|
||||
skip_probe:
|
||||
ret = device_add(&dev->dev);
|
||||
@@ -546,6 +541,7 @@ static int amba_deferred_retry(void)
|
||||
continue;
|
||||
|
||||
list_del_init(&ddev->node);
|
||||
amba_device_put(ddev->dev);
|
||||
kfree(ddev);
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ config DRM_AMD_DC
|
||||
bool "AMD DC - Enable new display engine"
|
||||
default y
|
||||
select SND_HDA_COMPONENT if SND_HDA_CORE
|
||||
select DRM_AMD_DC_DCN if (X86 || PPC64) && !(KCOV_INSTRUMENT_ALL && KCOV_ENABLE_COMPARISONS)
|
||||
select DRM_AMD_DC_DCN if X86 && !(KCOV_INSTRUMENT_ALL && KCOV_ENABLE_COMPARISONS)
|
||||
help
|
||||
Choose this option if you want to use the new display engine
|
||||
support for AMDGPU. This adds required support for Vega and
|
||||
|
||||
@@ -379,7 +379,7 @@ static void aq_pci_shutdown(struct pci_dev *pdev)
|
||||
}
|
||||
}
|
||||
|
||||
static int aq_suspend_common(struct device *dev, bool deep)
|
||||
static int aq_suspend_common(struct device *dev)
|
||||
{
|
||||
struct aq_nic_s *nic = pci_get_drvdata(to_pci_dev(dev));
|
||||
|
||||
@@ -392,17 +392,15 @@ static int aq_suspend_common(struct device *dev, bool deep)
|
||||
if (netif_running(nic->ndev))
|
||||
aq_nic_stop(nic);
|
||||
|
||||
if (deep) {
|
||||
aq_nic_deinit(nic, !nic->aq_hw->aq_nic_cfg->wol);
|
||||
aq_nic_set_power(nic);
|
||||
}
|
||||
aq_nic_deinit(nic, !nic->aq_hw->aq_nic_cfg->wol);
|
||||
aq_nic_set_power(nic);
|
||||
|
||||
rtnl_unlock();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int atl_resume_common(struct device *dev, bool deep)
|
||||
static int atl_resume_common(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pdev = to_pci_dev(dev);
|
||||
struct aq_nic_s *nic;
|
||||
@@ -415,11 +413,6 @@ static int atl_resume_common(struct device *dev, bool deep)
|
||||
pci_set_power_state(pdev, PCI_D0);
|
||||
pci_restore_state(pdev);
|
||||
|
||||
if (deep) {
|
||||
/* Reinitialize Nic/Vecs objects */
|
||||
aq_nic_deinit(nic, !nic->aq_hw->aq_nic_cfg->wol);
|
||||
}
|
||||
|
||||
if (netif_running(nic->ndev)) {
|
||||
ret = aq_nic_init(nic);
|
||||
if (ret)
|
||||
@@ -444,22 +437,22 @@ err_exit:
|
||||
|
||||
static int aq_pm_freeze(struct device *dev)
|
||||
{
|
||||
return aq_suspend_common(dev, true);
|
||||
return aq_suspend_common(dev);
|
||||
}
|
||||
|
||||
static int aq_pm_suspend_poweroff(struct device *dev)
|
||||
{
|
||||
return aq_suspend_common(dev, true);
|
||||
return aq_suspend_common(dev);
|
||||
}
|
||||
|
||||
static int aq_pm_thaw(struct device *dev)
|
||||
{
|
||||
return atl_resume_common(dev, true);
|
||||
return atl_resume_common(dev);
|
||||
}
|
||||
|
||||
static int aq_pm_resume_restore(struct device *dev)
|
||||
{
|
||||
return atl_resume_common(dev, true);
|
||||
return atl_resume_common(dev);
|
||||
}
|
||||
|
||||
static const struct dev_pm_ops aq_pm_ops = {
|
||||
|
||||
@@ -7790,7 +7790,7 @@ hwrm_dbg_qcaps_exit:
|
||||
|
||||
static int bnxt_hwrm_queue_qportcfg(struct bnxt *bp);
|
||||
|
||||
static int bnxt_hwrm_func_qcaps(struct bnxt *bp)
|
||||
int bnxt_hwrm_func_qcaps(struct bnxt *bp)
|
||||
{
|
||||
int rc;
|
||||
|
||||
@@ -10065,7 +10065,8 @@ static int bnxt_hwrm_if_change(struct bnxt *bp, bool up)
|
||||
|
||||
if (flags & FUNC_DRV_IF_CHANGE_RESP_FLAGS_RESC_CHANGE)
|
||||
resc_reinit = true;
|
||||
if (flags & FUNC_DRV_IF_CHANGE_RESP_FLAGS_HOT_FW_RESET_DONE)
|
||||
if (flags & FUNC_DRV_IF_CHANGE_RESP_FLAGS_HOT_FW_RESET_DONE ||
|
||||
test_bit(BNXT_STATE_FW_RESET_DET, &bp->state))
|
||||
fw_reset = true;
|
||||
else
|
||||
bnxt_remap_fw_health_regs(bp);
|
||||
|
||||
@@ -2314,6 +2314,7 @@ int bnxt_cancel_reservations(struct bnxt *bp, bool fw_reset);
|
||||
int bnxt_hwrm_alloc_wol_fltr(struct bnxt *bp);
|
||||
int bnxt_hwrm_free_wol_fltr(struct bnxt *bp);
|
||||
int bnxt_hwrm_func_resc_qcaps(struct bnxt *bp, bool all);
|
||||
int bnxt_hwrm_func_qcaps(struct bnxt *bp);
|
||||
int bnxt_hwrm_fw_set_time(struct bnxt *);
|
||||
int bnxt_open_nic(struct bnxt *, bool, bool);
|
||||
int bnxt_half_open_nic(struct bnxt *bp);
|
||||
|
||||
@@ -979,9 +979,11 @@ static int bnxt_dl_info_get(struct devlink *dl, struct devlink_info_req *req,
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
rc = bnxt_dl_livepatch_info_put(bp, req, BNXT_FW_SRT_PATCH);
|
||||
if (rc)
|
||||
return rc;
|
||||
if (BNXT_CHIP_P5(bp)) {
|
||||
rc = bnxt_dl_livepatch_info_put(bp, req, BNXT_FW_SRT_PATCH);
|
||||
if (rc)
|
||||
return rc;
|
||||
}
|
||||
return bnxt_dl_livepatch_info_put(bp, req, BNXT_FW_CRT_PATCH);
|
||||
|
||||
}
|
||||
|
||||
@@ -76,14 +76,23 @@ static int bnxt_refclk_read(struct bnxt *bp, struct ptp_system_timestamp *sts,
|
||||
u64 *ns)
|
||||
{
|
||||
struct bnxt_ptp_cfg *ptp = bp->ptp_cfg;
|
||||
u32 high_before, high_now, low;
|
||||
|
||||
if (test_bit(BNXT_STATE_IN_FW_RESET, &bp->state))
|
||||
return -EIO;
|
||||
|
||||
high_before = readl(bp->bar0 + ptp->refclk_mapped_regs[1]);
|
||||
ptp_read_system_prets(sts);
|
||||
*ns = readl(bp->bar0 + ptp->refclk_mapped_regs[0]);
|
||||
low = readl(bp->bar0 + ptp->refclk_mapped_regs[0]);
|
||||
ptp_read_system_postts(sts);
|
||||
*ns |= (u64)readl(bp->bar0 + ptp->refclk_mapped_regs[1]) << 32;
|
||||
high_now = readl(bp->bar0 + ptp->refclk_mapped_regs[1]);
|
||||
if (high_now != high_before) {
|
||||
ptp_read_system_prets(sts);
|
||||
low = readl(bp->bar0 + ptp->refclk_mapped_regs[0]);
|
||||
ptp_read_system_postts(sts);
|
||||
}
|
||||
*ns = ((u64)high_now << 32) | low;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -823,8 +823,10 @@ static int bnxt_sriov_enable(struct bnxt *bp, int *num_vfs)
|
||||
goto err_out2;
|
||||
|
||||
rc = pci_enable_sriov(bp->pdev, *num_vfs);
|
||||
if (rc)
|
||||
if (rc) {
|
||||
bnxt_ulp_sriov_cfg(bp, 0);
|
||||
goto err_out2;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -832,6 +834,9 @@ err_out2:
|
||||
/* Free the resources reserved for various VF's */
|
||||
bnxt_hwrm_func_vf_resource_free(bp, *num_vfs);
|
||||
|
||||
/* Restore the max resources */
|
||||
bnxt_hwrm_func_qcaps(bp);
|
||||
|
||||
err_out1:
|
||||
bnxt_free_vf_resources(bp);
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ struct bnxt_sw_tx_bd *bnxt_xmit_bd(struct bnxt *bp,
|
||||
struct xdp_buff *xdp)
|
||||
{
|
||||
struct skb_shared_info *sinfo;
|
||||
struct bnxt_sw_tx_bd *tx_buf, *first_buf;
|
||||
struct bnxt_sw_tx_bd *tx_buf;
|
||||
struct tx_bd *txbd;
|
||||
int num_frags = 0;
|
||||
u32 flags;
|
||||
@@ -43,13 +43,14 @@ struct bnxt_sw_tx_bd *bnxt_xmit_bd(struct bnxt *bp,
|
||||
/* fill up the first buffer */
|
||||
prod = txr->tx_prod;
|
||||
tx_buf = &txr->tx_buf_ring[prod];
|
||||
first_buf = tx_buf;
|
||||
tx_buf->nr_frags = num_frags;
|
||||
if (xdp)
|
||||
tx_buf->page = virt_to_head_page(xdp->data);
|
||||
|
||||
txbd = &txr->tx_desc_ring[TX_RING(prod)][TX_IDX(prod)];
|
||||
flags = ((len) << TX_BD_LEN_SHIFT) | ((num_frags + 1) << TX_BD_FLAGS_BD_CNT_SHIFT);
|
||||
flags = (len << TX_BD_LEN_SHIFT) |
|
||||
((num_frags + 1) << TX_BD_FLAGS_BD_CNT_SHIFT) |
|
||||
bnxt_lhint_arr[len >> 9];
|
||||
txbd->tx_bd_len_flags_type = cpu_to_le32(flags);
|
||||
txbd->tx_bd_opaque = prod;
|
||||
txbd->tx_bd_haddr = cpu_to_le64(mapping);
|
||||
@@ -82,7 +83,6 @@ struct bnxt_sw_tx_bd *bnxt_xmit_bd(struct bnxt *bp,
|
||||
|
||||
flags = frag_len << TX_BD_LEN_SHIFT;
|
||||
txbd->tx_bd_len_flags_type = cpu_to_le32(flags);
|
||||
txbd->tx_bd_opaque = prod;
|
||||
txbd->tx_bd_haddr = cpu_to_le64(frag_mapping);
|
||||
|
||||
len = frag_len;
|
||||
@@ -96,7 +96,7 @@ struct bnxt_sw_tx_bd *bnxt_xmit_bd(struct bnxt *bp,
|
||||
prod = NEXT_TX(prod);
|
||||
txr->tx_prod = prod;
|
||||
|
||||
return first_buf;
|
||||
return tx_buf;
|
||||
}
|
||||
|
||||
static void __bnxt_xmit_xdp(struct bnxt *bp, struct bnxt_tx_ring_info *txr,
|
||||
|
||||
@@ -1392,7 +1392,7 @@ static void chtls_pass_accept_request(struct sock *sk,
|
||||
th_ecn = tcph->ece && tcph->cwr;
|
||||
if (th_ecn) {
|
||||
ect = !INET_ECN_is_not_ect(ip_dsfield);
|
||||
ecn_ok = sock_net(sk)->ipv4.sysctl_tcp_ecn;
|
||||
ecn_ok = READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_ecn);
|
||||
if ((!ect && ecn_ok) || tcp_ca_needs_ecn(sk))
|
||||
inet_rsk(oreq)->ecn_ok = 1;
|
||||
}
|
||||
|
||||
@@ -1764,6 +1764,19 @@ cleanup_clk:
|
||||
return rc;
|
||||
}
|
||||
|
||||
static bool ftgmac100_has_child_node(struct device_node *np, const char *name)
|
||||
{
|
||||
struct device_node *child_np = of_get_child_by_name(np, name);
|
||||
bool ret = false;
|
||||
|
||||
if (child_np) {
|
||||
ret = true;
|
||||
of_node_put(child_np);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int ftgmac100_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct resource *res;
|
||||
@@ -1883,7 +1896,7 @@ static int ftgmac100_probe(struct platform_device *pdev)
|
||||
|
||||
/* Display what we found */
|
||||
phy_attached_info(phy);
|
||||
} else if (np && !of_get_child_by_name(np, "mdio")) {
|
||||
} else if (np && !ftgmac100_has_child_node(np, "mdio")) {
|
||||
/* Support legacy ASPEED devicetree descriptions that decribe a
|
||||
* MAC with an embedded MDIO controller but have no "mdio"
|
||||
* child node. Automatically scan the MDIO bus for available
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#define _ICE_DEVIDS_H_
|
||||
|
||||
/* Device IDs */
|
||||
#define ICE_DEV_ID_E822_SI_DFLT 0x1888
|
||||
/* Intel(R) Ethernet Connection E823-L for backplane */
|
||||
#define ICE_DEV_ID_E823L_BACKPLANE 0x124C
|
||||
/* Intel(R) Ethernet Connection E823-L for SFP */
|
||||
|
||||
@@ -814,6 +814,8 @@ void ice_devlink_destroy_vf_port(struct ice_vf *vf)
|
||||
devlink_port_unregister(devlink_port);
|
||||
}
|
||||
|
||||
#define ICE_DEVLINK_READ_BLK_SIZE (1024 * 1024)
|
||||
|
||||
/**
|
||||
* ice_devlink_nvm_snapshot - Capture a snapshot of the NVM flash contents
|
||||
* @devlink: the devlink instance
|
||||
@@ -840,8 +842,9 @@ static int ice_devlink_nvm_snapshot(struct devlink *devlink,
|
||||
struct ice_pf *pf = devlink_priv(devlink);
|
||||
struct device *dev = ice_pf_to_dev(pf);
|
||||
struct ice_hw *hw = &pf->hw;
|
||||
void *nvm_data;
|
||||
u32 nvm_size;
|
||||
u8 *nvm_data, *tmp, i;
|
||||
u32 nvm_size, left;
|
||||
s8 num_blks;
|
||||
int status;
|
||||
|
||||
nvm_size = hw->flash.flash_size;
|
||||
@@ -849,26 +852,44 @@ static int ice_devlink_nvm_snapshot(struct devlink *devlink,
|
||||
if (!nvm_data)
|
||||
return -ENOMEM;
|
||||
|
||||
status = ice_acquire_nvm(hw, ICE_RES_READ);
|
||||
if (status) {
|
||||
dev_dbg(dev, "ice_acquire_nvm failed, err %d aq_err %d\n",
|
||||
status, hw->adminq.sq_last_status);
|
||||
NL_SET_ERR_MSG_MOD(extack, "Failed to acquire NVM semaphore");
|
||||
vfree(nvm_data);
|
||||
return status;
|
||||
}
|
||||
|
||||
status = ice_read_flat_nvm(hw, 0, &nvm_size, nvm_data, false);
|
||||
if (status) {
|
||||
dev_dbg(dev, "ice_read_flat_nvm failed after reading %u bytes, err %d aq_err %d\n",
|
||||
nvm_size, status, hw->adminq.sq_last_status);
|
||||
NL_SET_ERR_MSG_MOD(extack, "Failed to read NVM contents");
|
||||
num_blks = DIV_ROUND_UP(nvm_size, ICE_DEVLINK_READ_BLK_SIZE);
|
||||
tmp = nvm_data;
|
||||
left = nvm_size;
|
||||
|
||||
/* Some systems take longer to read the NVM than others which causes the
|
||||
* FW to reclaim the NVM lock before the entire NVM has been read. Fix
|
||||
* this by breaking the reads of the NVM into smaller chunks that will
|
||||
* probably not take as long. This has some overhead since we are
|
||||
* increasing the number of AQ commands, but it should always work
|
||||
*/
|
||||
for (i = 0; i < num_blks; i++) {
|
||||
u32 read_sz = min_t(u32, ICE_DEVLINK_READ_BLK_SIZE, left);
|
||||
|
||||
status = ice_acquire_nvm(hw, ICE_RES_READ);
|
||||
if (status) {
|
||||
dev_dbg(dev, "ice_acquire_nvm failed, err %d aq_err %d\n",
|
||||
status, hw->adminq.sq_last_status);
|
||||
NL_SET_ERR_MSG_MOD(extack, "Failed to acquire NVM semaphore");
|
||||
vfree(nvm_data);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
status = ice_read_flat_nvm(hw, i * ICE_DEVLINK_READ_BLK_SIZE,
|
||||
&read_sz, tmp, false);
|
||||
if (status) {
|
||||
dev_dbg(dev, "ice_read_flat_nvm failed after reading %u bytes, err %d aq_err %d\n",
|
||||
read_sz, status, hw->adminq.sq_last_status);
|
||||
NL_SET_ERR_MSG_MOD(extack, "Failed to read NVM contents");
|
||||
ice_release_nvm(hw);
|
||||
vfree(nvm_data);
|
||||
return -EIO;
|
||||
}
|
||||
ice_release_nvm(hw);
|
||||
vfree(nvm_data);
|
||||
return status;
|
||||
}
|
||||
|
||||
ice_release_nvm(hw);
|
||||
tmp += read_sz;
|
||||
left -= read_sz;
|
||||
}
|
||||
|
||||
*data = nvm_data;
|
||||
|
||||
|
||||
@@ -736,7 +736,87 @@ static int ice_finalize_update(struct pldmfw *context)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct pldmfw_ops ice_fwu_ops = {
|
||||
struct ice_pldm_pci_record_id {
|
||||
u32 vendor;
|
||||
u32 device;
|
||||
u32 subsystem_vendor;
|
||||
u32 subsystem_device;
|
||||
};
|
||||
|
||||
/**
|
||||
* ice_op_pci_match_record - Check if a PCI device matches the record
|
||||
* @context: PLDM fw update structure
|
||||
* @record: list of records extracted from the PLDM image
|
||||
*
|
||||
* Determine if the PCI device associated with this device matches the record
|
||||
* data provided.
|
||||
*
|
||||
* Searches the descriptor TLVs and extracts the relevant descriptor data into
|
||||
* a pldm_pci_record_id. This is then compared against the PCI device ID
|
||||
* information.
|
||||
*
|
||||
* Returns: true if the device matches the record, false otherwise.
|
||||
*/
|
||||
static bool
|
||||
ice_op_pci_match_record(struct pldmfw *context, struct pldmfw_record *record)
|
||||
{
|
||||
struct pci_dev *pdev = to_pci_dev(context->dev);
|
||||
struct ice_pldm_pci_record_id id = {
|
||||
.vendor = PCI_ANY_ID,
|
||||
.device = PCI_ANY_ID,
|
||||
.subsystem_vendor = PCI_ANY_ID,
|
||||
.subsystem_device = PCI_ANY_ID,
|
||||
};
|
||||
struct pldmfw_desc_tlv *desc;
|
||||
|
||||
list_for_each_entry(desc, &record->descs, entry) {
|
||||
u16 value;
|
||||
int *ptr;
|
||||
|
||||
switch (desc->type) {
|
||||
case PLDM_DESC_ID_PCI_VENDOR_ID:
|
||||
ptr = &id.vendor;
|
||||
break;
|
||||
case PLDM_DESC_ID_PCI_DEVICE_ID:
|
||||
ptr = &id.device;
|
||||
break;
|
||||
case PLDM_DESC_ID_PCI_SUBVENDOR_ID:
|
||||
ptr = &id.subsystem_vendor;
|
||||
break;
|
||||
case PLDM_DESC_ID_PCI_SUBDEV_ID:
|
||||
ptr = &id.subsystem_device;
|
||||
break;
|
||||
default:
|
||||
/* Skip unrelated TLVs */
|
||||
continue;
|
||||
}
|
||||
|
||||
value = get_unaligned_le16(desc->data);
|
||||
/* A value of zero for one of the descriptors is sometimes
|
||||
* used when the record should ignore this field when matching
|
||||
* device. For example if the record applies to any subsystem
|
||||
* device or vendor.
|
||||
*/
|
||||
if (value)
|
||||
*ptr = value;
|
||||
else
|
||||
*ptr = PCI_ANY_ID;
|
||||
}
|
||||
|
||||
/* the E822 device can have a generic device ID so check for that */
|
||||
if ((id.vendor == PCI_ANY_ID || id.vendor == pdev->vendor) &&
|
||||
(id.device == PCI_ANY_ID || id.device == pdev->device ||
|
||||
id.device == ICE_DEV_ID_E822_SI_DFLT) &&
|
||||
(id.subsystem_vendor == PCI_ANY_ID ||
|
||||
id.subsystem_vendor == pdev->subsystem_vendor) &&
|
||||
(id.subsystem_device == PCI_ANY_ID ||
|
||||
id.subsystem_device == pdev->subsystem_device))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static const struct pldmfw_ops ice_fwu_ops_e810 = {
|
||||
.match_record = &pldmfw_op_pci_match_record,
|
||||
.send_package_data = &ice_send_package_data,
|
||||
.send_component_table = &ice_send_component_table,
|
||||
@@ -744,6 +824,14 @@ static const struct pldmfw_ops ice_fwu_ops = {
|
||||
.finalize_update = &ice_finalize_update,
|
||||
};
|
||||
|
||||
static const struct pldmfw_ops ice_fwu_ops_e822 = {
|
||||
.match_record = &ice_op_pci_match_record,
|
||||
.send_package_data = &ice_send_package_data,
|
||||
.send_component_table = &ice_send_component_table,
|
||||
.flash_component = &ice_flash_component,
|
||||
.finalize_update = &ice_finalize_update,
|
||||
};
|
||||
|
||||
/**
|
||||
* ice_get_pending_updates - Check if the component has a pending update
|
||||
* @pf: the PF driver structure
|
||||
@@ -921,7 +1009,11 @@ int ice_devlink_flash_update(struct devlink *devlink,
|
||||
|
||||
memset(&priv, 0, sizeof(priv));
|
||||
|
||||
priv.context.ops = &ice_fwu_ops;
|
||||
/* the E822 device needs a slightly different ops */
|
||||
if (hw->mac_type == ICE_MAC_GENERIC)
|
||||
priv.context.ops = &ice_fwu_ops_e822;
|
||||
else
|
||||
priv.context.ops = &ice_fwu_ops_e810;
|
||||
priv.context.dev = dev;
|
||||
priv.extack = extack;
|
||||
priv.pf = pf;
|
||||
|
||||
@@ -5413,6 +5413,7 @@ static const struct pci_device_id ice_pci_tbl[] = {
|
||||
{ PCI_VDEVICE(INTEL, ICE_DEV_ID_E823L_10G_BASE_T), 0 },
|
||||
{ PCI_VDEVICE(INTEL, ICE_DEV_ID_E823L_1GBE), 0 },
|
||||
{ PCI_VDEVICE(INTEL, ICE_DEV_ID_E823L_QSFP), 0 },
|
||||
{ PCI_VDEVICE(INTEL, ICE_DEV_ID_E822_SI_DFLT), 0 },
|
||||
/* required last entry */
|
||||
{ 0, }
|
||||
};
|
||||
|
||||
@@ -588,6 +588,7 @@ err_router_lib_init:
|
||||
|
||||
void prestera_router_fini(struct prestera_switch *sw)
|
||||
{
|
||||
unregister_fib_notifier(&init_net, &sw->router->fib_nb);
|
||||
unregister_inetaddr_notifier(&sw->router->inetaddr_nb);
|
||||
unregister_inetaddr_validator_notifier(&sw->router->inetaddr_valid_nb);
|
||||
rhashtable_destroy(&sw->router->kern_fib_cache_ht);
|
||||
|
||||
@@ -76,6 +76,7 @@ struct mlx5_tc_ct_priv {
|
||||
struct mlx5_ct_fs *fs;
|
||||
struct mlx5_ct_fs_ops *fs_ops;
|
||||
spinlock_t ht_lock; /* protects ft entries */
|
||||
struct workqueue_struct *wq;
|
||||
|
||||
struct mlx5_tc_ct_debugfs debugfs;
|
||||
};
|
||||
@@ -941,14 +942,11 @@ static void mlx5_tc_ct_entry_del_work(struct work_struct *work)
|
||||
static void
|
||||
__mlx5_tc_ct_entry_put(struct mlx5_ct_entry *entry)
|
||||
{
|
||||
struct mlx5e_priv *priv;
|
||||
|
||||
if (!refcount_dec_and_test(&entry->refcnt))
|
||||
return;
|
||||
|
||||
priv = netdev_priv(entry->ct_priv->netdev);
|
||||
INIT_WORK(&entry->work, mlx5_tc_ct_entry_del_work);
|
||||
queue_work(priv->wq, &entry->work);
|
||||
queue_work(entry->ct_priv->wq, &entry->work);
|
||||
}
|
||||
|
||||
static struct mlx5_ct_counter *
|
||||
@@ -1759,19 +1757,16 @@ mlx5_tc_ct_flush_ft_entry(void *ptr, void *arg)
|
||||
static void
|
||||
mlx5_tc_ct_del_ft_cb(struct mlx5_tc_ct_priv *ct_priv, struct mlx5_ct_ft *ft)
|
||||
{
|
||||
struct mlx5e_priv *priv;
|
||||
|
||||
if (!refcount_dec_and_test(&ft->refcount))
|
||||
return;
|
||||
|
||||
flush_workqueue(ct_priv->wq);
|
||||
nf_flow_table_offload_del_cb(ft->nf_ft,
|
||||
mlx5_tc_ct_block_flow_offload, ft);
|
||||
rhashtable_remove_fast(&ct_priv->zone_ht, &ft->node, zone_params);
|
||||
rhashtable_free_and_destroy(&ft->ct_entries_ht,
|
||||
mlx5_tc_ct_flush_ft_entry,
|
||||
ct_priv);
|
||||
priv = netdev_priv(ct_priv->netdev);
|
||||
flush_workqueue(priv->wq);
|
||||
mlx5_tc_ct_free_pre_ct_tables(ft);
|
||||
mapping_remove(ct_priv->zone_mapping, ft->zone_restore_id);
|
||||
kfree(ft);
|
||||
@@ -2176,6 +2171,12 @@ mlx5_tc_ct_init(struct mlx5e_priv *priv, struct mlx5_fs_chains *chains,
|
||||
if (rhashtable_init(&ct_priv->ct_tuples_nat_ht, &tuples_nat_ht_params))
|
||||
goto err_ct_tuples_nat_ht;
|
||||
|
||||
ct_priv->wq = alloc_ordered_workqueue("mlx5e_ct_priv_wq", 0);
|
||||
if (!ct_priv->wq) {
|
||||
err = -ENOMEM;
|
||||
goto err_wq;
|
||||
}
|
||||
|
||||
err = mlx5_tc_ct_fs_init(ct_priv);
|
||||
if (err)
|
||||
goto err_init_fs;
|
||||
@@ -2184,6 +2185,8 @@ mlx5_tc_ct_init(struct mlx5e_priv *priv, struct mlx5_fs_chains *chains,
|
||||
return ct_priv;
|
||||
|
||||
err_init_fs:
|
||||
destroy_workqueue(ct_priv->wq);
|
||||
err_wq:
|
||||
rhashtable_destroy(&ct_priv->ct_tuples_nat_ht);
|
||||
err_ct_tuples_nat_ht:
|
||||
rhashtable_destroy(&ct_priv->ct_tuples_ht);
|
||||
@@ -2213,6 +2216,7 @@ mlx5_tc_ct_clean(struct mlx5_tc_ct_priv *ct_priv)
|
||||
if (!ct_priv)
|
||||
return;
|
||||
|
||||
destroy_workqueue(ct_priv->wq);
|
||||
mlx5_ct_tc_remove_dbgfs(ct_priv);
|
||||
chains = ct_priv->chains;
|
||||
|
||||
|
||||
@@ -231,8 +231,7 @@ mlx5e_set_ktls_rx_priv_ctx(struct tls_context *tls_ctx,
|
||||
struct mlx5e_ktls_offload_context_rx **ctx =
|
||||
__tls_driver_ctx(tls_ctx, TLS_OFFLOAD_CTX_DIR_RX);
|
||||
|
||||
BUILD_BUG_ON(sizeof(struct mlx5e_ktls_offload_context_rx *) >
|
||||
TLS_OFFLOAD_CONTEXT_SIZE_RX);
|
||||
BUILD_BUG_ON(sizeof(priv_rx) > TLS_DRIVER_STATE_SIZE_RX);
|
||||
|
||||
*ctx = priv_rx;
|
||||
}
|
||||
|
||||
@@ -68,8 +68,7 @@ mlx5e_set_ktls_tx_priv_ctx(struct tls_context *tls_ctx,
|
||||
struct mlx5e_ktls_offload_context_tx **ctx =
|
||||
__tls_driver_ctx(tls_ctx, TLS_OFFLOAD_CTX_DIR_TX);
|
||||
|
||||
BUILD_BUG_ON(sizeof(struct mlx5e_ktls_offload_context_tx *) >
|
||||
TLS_OFFLOAD_CONTEXT_SIZE_TX);
|
||||
BUILD_BUG_ON(sizeof(priv_tx) > TLS_DRIVER_STATE_SIZE_TX);
|
||||
|
||||
*ctx = priv_tx;
|
||||
}
|
||||
|
||||
@@ -688,7 +688,7 @@ static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(vnic_env)
|
||||
u32 in[MLX5_ST_SZ_DW(query_vnic_env_in)] = {};
|
||||
struct mlx5_core_dev *mdev = priv->mdev;
|
||||
|
||||
if (!MLX5_CAP_GEN(priv->mdev, nic_receive_steering_discard))
|
||||
if (!mlx5e_stats_grp_vnic_env_num_stats(priv))
|
||||
return;
|
||||
|
||||
MLX5_SET(query_vnic_env_in, in, opcode, MLX5_CMD_OP_QUERY_VNIC_ENV);
|
||||
|
||||
@@ -3793,7 +3793,7 @@ static bool is_lag_dev(struct mlx5e_priv *priv,
|
||||
|
||||
static bool is_multiport_eligible(struct mlx5e_priv *priv, struct net_device *out_dev)
|
||||
{
|
||||
if (mlx5e_eswitch_uplink_rep(out_dev) &&
|
||||
if (same_hw_reps(priv, out_dev) &&
|
||||
MLX5_CAP_PORT_SELECTION(priv->mdev, port_select_flow_table) &&
|
||||
MLX5_CAP_GEN(priv->mdev, create_lag_when_not_master_up))
|
||||
return true;
|
||||
|
||||
@@ -341,6 +341,26 @@ static void mlx5e_tx_check_stop(struct mlx5e_txqsq *sq)
|
||||
}
|
||||
}
|
||||
|
||||
static void mlx5e_tx_flush(struct mlx5e_txqsq *sq)
|
||||
{
|
||||
struct mlx5e_tx_wqe_info *wi;
|
||||
struct mlx5e_tx_wqe *wqe;
|
||||
u16 pi;
|
||||
|
||||
/* Must not be called when a MPWQE session is active but empty. */
|
||||
mlx5e_tx_mpwqe_ensure_complete(sq);
|
||||
|
||||
pi = mlx5_wq_cyc_ctr2ix(&sq->wq, sq->pc);
|
||||
wi = &sq->db.wqe_info[pi];
|
||||
|
||||
*wi = (struct mlx5e_tx_wqe_info) {
|
||||
.num_wqebbs = 1,
|
||||
};
|
||||
|
||||
wqe = mlx5e_post_nop(&sq->wq, sq->sqn, &sq->pc);
|
||||
mlx5e_notify_hw(&sq->wq, sq->pc, sq->uar_map, &wqe->ctrl);
|
||||
}
|
||||
|
||||
static inline void
|
||||
mlx5e_txwqe_complete(struct mlx5e_txqsq *sq, struct sk_buff *skb,
|
||||
const struct mlx5e_tx_attr *attr,
|
||||
@@ -459,6 +479,7 @@ mlx5e_sq_xmit_wqe(struct mlx5e_txqsq *sq, struct sk_buff *skb,
|
||||
err_drop:
|
||||
stats->dropped++;
|
||||
dev_kfree_skb_any(skb);
|
||||
mlx5e_tx_flush(sq);
|
||||
}
|
||||
|
||||
static bool mlx5e_tx_skb_supports_mpwqe(struct sk_buff *skb, struct mlx5e_tx_attr *attr)
|
||||
@@ -560,6 +581,13 @@ mlx5e_sq_xmit_mpwqe(struct mlx5e_txqsq *sq, struct sk_buff *skb,
|
||||
struct mlx5_wqe_ctrl_seg *cseg;
|
||||
struct mlx5e_xmit_data txd;
|
||||
|
||||
txd.data = skb->data;
|
||||
txd.len = skb->len;
|
||||
|
||||
txd.dma_addr = dma_map_single(sq->pdev, txd.data, txd.len, DMA_TO_DEVICE);
|
||||
if (unlikely(dma_mapping_error(sq->pdev, txd.dma_addr)))
|
||||
goto err_unmap;
|
||||
|
||||
if (!mlx5e_tx_mpwqe_session_is_active(sq)) {
|
||||
mlx5e_tx_mpwqe_session_start(sq, eseg);
|
||||
} else if (!mlx5e_tx_mpwqe_same_eseg(sq, eseg)) {
|
||||
@@ -569,18 +597,9 @@ mlx5e_sq_xmit_mpwqe(struct mlx5e_txqsq *sq, struct sk_buff *skb,
|
||||
|
||||
sq->stats->xmit_more += xmit_more;
|
||||
|
||||
txd.data = skb->data;
|
||||
txd.len = skb->len;
|
||||
|
||||
txd.dma_addr = dma_map_single(sq->pdev, txd.data, txd.len, DMA_TO_DEVICE);
|
||||
if (unlikely(dma_mapping_error(sq->pdev, txd.dma_addr)))
|
||||
goto err_unmap;
|
||||
mlx5e_dma_push(sq, txd.dma_addr, txd.len, MLX5E_DMA_MAP_SINGLE);
|
||||
|
||||
mlx5e_skb_fifo_push(&sq->db.skb_fifo, skb);
|
||||
|
||||
mlx5e_tx_mpwqe_add_dseg(sq, &txd);
|
||||
|
||||
mlx5e_tx_skb_update_hwts_flags(skb);
|
||||
|
||||
if (unlikely(mlx5e_tx_mpwqe_is_full(&sq->mpwqe, sq->max_sq_mpw_wqebbs))) {
|
||||
@@ -602,6 +621,7 @@ err_unmap:
|
||||
mlx5e_dma_unmap_wqe_err(sq, 1);
|
||||
sq->stats->dropped++;
|
||||
dev_kfree_skb_any(skb);
|
||||
mlx5e_tx_flush(sq);
|
||||
}
|
||||
|
||||
void mlx5e_tx_mpwqe_ensure_complete(struct mlx5e_txqsq *sq)
|
||||
@@ -1006,5 +1026,6 @@ void mlx5i_sq_xmit(struct mlx5e_txqsq *sq, struct sk_buff *skb,
|
||||
err_drop:
|
||||
stats->dropped++;
|
||||
dev_kfree_skb_any(skb);
|
||||
mlx5e_tx_flush(sq);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "mlx5_core.h"
|
||||
#include "eswitch.h"
|
||||
#include "fs_core.h"
|
||||
#include "fs_ft_pool.h"
|
||||
#include "esw/qos.h"
|
||||
|
||||
enum {
|
||||
@@ -95,8 +96,7 @@ static int esw_create_legacy_fdb_table(struct mlx5_eswitch *esw)
|
||||
if (!flow_group_in)
|
||||
return -ENOMEM;
|
||||
|
||||
table_size = BIT(MLX5_CAP_ESW_FLOWTABLE_FDB(dev, log_max_ft_size));
|
||||
ft_attr.max_fte = table_size;
|
||||
ft_attr.max_fte = POOL_NEXT_SIZE;
|
||||
ft_attr.prio = LEGACY_FDB_PRIO;
|
||||
fdb = mlx5_create_flow_table(root_ns, &ft_attr);
|
||||
if (IS_ERR(fdb)) {
|
||||
@@ -105,6 +105,7 @@ static int esw_create_legacy_fdb_table(struct mlx5_eswitch *esw)
|
||||
goto out;
|
||||
}
|
||||
esw->fdb_table.legacy.fdb = fdb;
|
||||
table_size = fdb->max_fte;
|
||||
|
||||
/* Addresses group : Full match unicast/multicast addresses */
|
||||
MLX5_SET(create_flow_group_in, flow_group_in, match_criteria_enable,
|
||||
|
||||
@@ -44,7 +44,7 @@ static int port_sel_mode_show(struct seq_file *file, void *priv)
|
||||
ldev = dev->priv.lag;
|
||||
mutex_lock(&ldev->lock);
|
||||
if (__mlx5_lag_is_active(ldev))
|
||||
mode = mlx5_get_str_port_sel_mode(ldev);
|
||||
mode = mlx5_get_str_port_sel_mode(ldev->mode, ldev->mode_flags);
|
||||
else
|
||||
ret = -EINVAL;
|
||||
mutex_unlock(&ldev->lock);
|
||||
@@ -72,6 +72,7 @@ static int state_show(struct seq_file *file, void *priv)
|
||||
static int flags_show(struct seq_file *file, void *priv)
|
||||
{
|
||||
struct mlx5_core_dev *dev = file->private;
|
||||
bool fdb_sel_mode_native;
|
||||
struct mlx5_lag *ldev;
|
||||
bool shared_fdb;
|
||||
bool lag_active;
|
||||
@@ -79,14 +80,21 @@ static int flags_show(struct seq_file *file, void *priv)
|
||||
ldev = dev->priv.lag;
|
||||
mutex_lock(&ldev->lock);
|
||||
lag_active = __mlx5_lag_is_active(ldev);
|
||||
if (lag_active)
|
||||
shared_fdb = test_bit(MLX5_LAG_MODE_FLAG_SHARED_FDB, &ldev->mode_flags);
|
||||
if (!lag_active)
|
||||
goto unlock;
|
||||
|
||||
shared_fdb = test_bit(MLX5_LAG_MODE_FLAG_SHARED_FDB, &ldev->mode_flags);
|
||||
fdb_sel_mode_native = test_bit(MLX5_LAG_MODE_FLAG_FDB_SEL_MODE_NATIVE,
|
||||
&ldev->mode_flags);
|
||||
|
||||
unlock:
|
||||
mutex_unlock(&ldev->lock);
|
||||
if (!lag_active)
|
||||
return -EINVAL;
|
||||
|
||||
seq_printf(file, "%s:%s\n", "shared_fdb", shared_fdb ? "on" : "off");
|
||||
seq_printf(file, "%s:%s\n", "fdb_selection_mode",
|
||||
fdb_sel_mode_native ? "native" : "affinity");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -68,14 +68,15 @@ static int get_port_sel_mode(enum mlx5_lag_mode mode, unsigned long flags)
|
||||
static int mlx5_cmd_create_lag(struct mlx5_core_dev *dev, u8 *ports, int mode,
|
||||
unsigned long flags)
|
||||
{
|
||||
bool shared_fdb = test_bit(MLX5_LAG_MODE_FLAG_SHARED_FDB, &flags);
|
||||
bool fdb_sel_mode = test_bit(MLX5_LAG_MODE_FLAG_FDB_SEL_MODE_NATIVE,
|
||||
&flags);
|
||||
int port_sel_mode = get_port_sel_mode(mode, flags);
|
||||
u32 in[MLX5_ST_SZ_DW(create_lag_in)] = {};
|
||||
void *lag_ctx;
|
||||
|
||||
lag_ctx = MLX5_ADDR_OF(create_lag_in, in, ctx);
|
||||
MLX5_SET(create_lag_in, in, opcode, MLX5_CMD_OP_CREATE_LAG);
|
||||
MLX5_SET(lagc, lag_ctx, fdb_selection_mode, shared_fdb);
|
||||
MLX5_SET(lagc, lag_ctx, fdb_selection_mode, fdb_sel_mode);
|
||||
if (port_sel_mode == MLX5_LAG_PORT_SELECT_MODE_QUEUE_AFFINITY) {
|
||||
MLX5_SET(lagc, lag_ctx, tx_remap_affinity_1, ports[0]);
|
||||
MLX5_SET(lagc, lag_ctx, tx_remap_affinity_2, ports[1]);
|
||||
@@ -471,8 +472,13 @@ static int mlx5_lag_set_flags(struct mlx5_lag *ldev, enum mlx5_lag_mode mode,
|
||||
bool roce_lag = mode == MLX5_LAG_MODE_ROCE;
|
||||
|
||||
*flags = 0;
|
||||
if (shared_fdb)
|
||||
if (shared_fdb) {
|
||||
set_bit(MLX5_LAG_MODE_FLAG_SHARED_FDB, flags);
|
||||
set_bit(MLX5_LAG_MODE_FLAG_FDB_SEL_MODE_NATIVE, flags);
|
||||
}
|
||||
|
||||
if (mode == MLX5_LAG_MODE_MPESW)
|
||||
set_bit(MLX5_LAG_MODE_FLAG_FDB_SEL_MODE_NATIVE, flags);
|
||||
|
||||
if (roce_lag)
|
||||
return mlx5_lag_set_port_sel_mode_roce(ldev, flags);
|
||||
@@ -481,9 +487,9 @@ static int mlx5_lag_set_flags(struct mlx5_lag *ldev, enum mlx5_lag_mode mode,
|
||||
return 0;
|
||||
}
|
||||
|
||||
char *mlx5_get_str_port_sel_mode(struct mlx5_lag *ldev)
|
||||
char *mlx5_get_str_port_sel_mode(enum mlx5_lag_mode mode, unsigned long flags)
|
||||
{
|
||||
int port_sel_mode = get_port_sel_mode(ldev->mode, ldev->mode_flags);
|
||||
int port_sel_mode = get_port_sel_mode(mode, flags);
|
||||
|
||||
switch (port_sel_mode) {
|
||||
case MLX5_LAG_PORT_SELECT_MODE_QUEUE_AFFINITY: return "queue_affinity";
|
||||
@@ -507,7 +513,7 @@ static int mlx5_create_lag(struct mlx5_lag *ldev,
|
||||
if (tracker)
|
||||
mlx5_lag_print_mapping(dev0, ldev, tracker, flags);
|
||||
mlx5_core_info(dev0, "shared_fdb:%d mode:%s\n",
|
||||
shared_fdb, mlx5_get_str_port_sel_mode(ldev));
|
||||
shared_fdb, mlx5_get_str_port_sel_mode(mode, flags));
|
||||
|
||||
err = mlx5_cmd_create_lag(dev0, ldev->v2p_map, mode, flags);
|
||||
if (err) {
|
||||
|
||||
@@ -24,6 +24,7 @@ enum {
|
||||
enum {
|
||||
MLX5_LAG_MODE_FLAG_HASH_BASED,
|
||||
MLX5_LAG_MODE_FLAG_SHARED_FDB,
|
||||
MLX5_LAG_MODE_FLAG_FDB_SEL_MODE_NATIVE,
|
||||
};
|
||||
|
||||
enum mlx5_lag_mode {
|
||||
@@ -114,7 +115,7 @@ bool mlx5_shared_fdb_supported(struct mlx5_lag *ldev);
|
||||
void mlx5_lag_del_mpesw_rule(struct mlx5_core_dev *dev);
|
||||
int mlx5_lag_add_mpesw_rule(struct mlx5_core_dev *dev);
|
||||
|
||||
char *mlx5_get_str_port_sel_mode(struct mlx5_lag *ldev);
|
||||
char *mlx5_get_str_port_sel_mode(enum mlx5_lag_mode mode, unsigned long flags);
|
||||
void mlx5_infer_tx_enabled(struct lag_tracker *tracker, u8 num_ports,
|
||||
u8 *ports, int *num_enabled);
|
||||
|
||||
|
||||
@@ -41,7 +41,6 @@ void mlx5_lag_del_mpesw_rule(struct mlx5_core_dev *dev)
|
||||
int mlx5_lag_add_mpesw_rule(struct mlx5_core_dev *dev)
|
||||
{
|
||||
struct mlx5_lag *ldev = dev->priv.lag;
|
||||
bool shared_fdb;
|
||||
int err = 0;
|
||||
|
||||
if (!ldev)
|
||||
@@ -55,8 +54,8 @@ int mlx5_lag_add_mpesw_rule(struct mlx5_core_dev *dev)
|
||||
err = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
shared_fdb = mlx5_shared_fdb_supported(ldev);
|
||||
err = mlx5_activate_lag(ldev, NULL, MLX5_LAG_MODE_MPESW, shared_fdb);
|
||||
|
||||
err = mlx5_activate_lag(ldev, NULL, MLX5_LAG_MODE_MPESW, false);
|
||||
if (err)
|
||||
mlx5_core_warn(dev, "Failed to create LAG in MPESW mode (%d)\n", err);
|
||||
|
||||
|
||||
@@ -94,19 +94,18 @@ static void ocelot_fdma_activate_chan(struct ocelot *ocelot, dma_addr_t dma,
|
||||
ocelot_fdma_writel(ocelot, MSCC_FDMA_CH_ACTIVATE, BIT(chan));
|
||||
}
|
||||
|
||||
static u32 ocelot_fdma_read_ch_safe(struct ocelot *ocelot)
|
||||
{
|
||||
return ocelot_fdma_readl(ocelot, MSCC_FDMA_CH_SAFE);
|
||||
}
|
||||
|
||||
static int ocelot_fdma_wait_chan_safe(struct ocelot *ocelot, int chan)
|
||||
{
|
||||
unsigned long timeout;
|
||||
u32 safe;
|
||||
|
||||
timeout = jiffies + usecs_to_jiffies(OCELOT_FDMA_CH_SAFE_TIMEOUT_US);
|
||||
do {
|
||||
safe = ocelot_fdma_readl(ocelot, MSCC_FDMA_CH_SAFE);
|
||||
if (safe & BIT(chan))
|
||||
return 0;
|
||||
} while (time_after(jiffies, timeout));
|
||||
|
||||
return -ETIMEDOUT;
|
||||
return readx_poll_timeout_atomic(ocelot_fdma_read_ch_safe, ocelot, safe,
|
||||
safe & BIT(chan), 0,
|
||||
OCELOT_FDMA_CH_SAFE_TIMEOUT_US);
|
||||
}
|
||||
|
||||
static void ocelot_fdma_dcb_set_data(struct ocelot_fdma_dcb *dcb,
|
||||
|
||||
@@ -447,7 +447,8 @@ void nfp_tun_unlink_and_update_nn_entries(struct nfp_app *app,
|
||||
|
||||
static void
|
||||
nfp_tun_write_neigh(struct net_device *netdev, struct nfp_app *app,
|
||||
void *flow, struct neighbour *neigh, bool is_ipv6)
|
||||
void *flow, struct neighbour *neigh, bool is_ipv6,
|
||||
bool override)
|
||||
{
|
||||
bool neigh_invalid = !(neigh->nud_state & NUD_VALID) || neigh->dead;
|
||||
size_t neigh_size = is_ipv6 ? sizeof(struct nfp_tun_neigh_v6) :
|
||||
@@ -546,6 +547,13 @@ nfp_tun_write_neigh(struct net_device *netdev, struct nfp_app *app,
|
||||
if (nn_entry->flow)
|
||||
list_del(&nn_entry->list_head);
|
||||
kfree(nn_entry);
|
||||
} else if (nn_entry && !neigh_invalid && override) {
|
||||
mtype = is_ipv6 ? NFP_FLOWER_CMSG_TYPE_TUN_NEIGH_V6 :
|
||||
NFP_FLOWER_CMSG_TYPE_TUN_NEIGH;
|
||||
nfp_tun_link_predt_entries(app, nn_entry);
|
||||
nfp_flower_xmit_tun_conf(app, mtype, neigh_size,
|
||||
nn_entry->payload,
|
||||
GFP_ATOMIC);
|
||||
}
|
||||
|
||||
spin_unlock_bh(&priv->predt_lock);
|
||||
@@ -610,7 +618,7 @@ nfp_tun_neigh_event_handler(struct notifier_block *nb, unsigned long event,
|
||||
|
||||
dst_release(dst);
|
||||
}
|
||||
nfp_tun_write_neigh(n->dev, app, &flow6, n, true);
|
||||
nfp_tun_write_neigh(n->dev, app, &flow6, n, true, false);
|
||||
#else
|
||||
return NOTIFY_DONE;
|
||||
#endif /* CONFIG_IPV6 */
|
||||
@@ -633,7 +641,7 @@ nfp_tun_neigh_event_handler(struct notifier_block *nb, unsigned long event,
|
||||
|
||||
ip_rt_put(rt);
|
||||
}
|
||||
nfp_tun_write_neigh(n->dev, app, &flow4, n, false);
|
||||
nfp_tun_write_neigh(n->dev, app, &flow4, n, false, false);
|
||||
}
|
||||
#else
|
||||
return NOTIFY_DONE;
|
||||
@@ -676,7 +684,7 @@ void nfp_tunnel_request_route_v4(struct nfp_app *app, struct sk_buff *skb)
|
||||
ip_rt_put(rt);
|
||||
if (!n)
|
||||
goto fail_rcu_unlock;
|
||||
nfp_tun_write_neigh(n->dev, app, &flow, n, false);
|
||||
nfp_tun_write_neigh(n->dev, app, &flow, n, false, true);
|
||||
neigh_release(n);
|
||||
rcu_read_unlock();
|
||||
return;
|
||||
@@ -718,7 +726,7 @@ void nfp_tunnel_request_route_v6(struct nfp_app *app, struct sk_buff *skb)
|
||||
if (!n)
|
||||
goto fail_rcu_unlock;
|
||||
|
||||
nfp_tun_write_neigh(n->dev, app, &flow, n, true);
|
||||
nfp_tun_write_neigh(n->dev, app, &flow, n, true, true);
|
||||
neigh_release(n);
|
||||
rcu_read_unlock();
|
||||
return;
|
||||
|
||||
@@ -125,17 +125,18 @@ nfp_nfdk_tx_csum(struct nfp_net_dp *dp, struct nfp_net_r_vector *r_vec,
|
||||
|
||||
static int
|
||||
nfp_nfdk_tx_maybe_close_block(struct nfp_net_tx_ring *tx_ring,
|
||||
unsigned int nr_frags, struct sk_buff *skb)
|
||||
struct sk_buff *skb)
|
||||
{
|
||||
unsigned int n_descs, wr_p, nop_slots;
|
||||
const skb_frag_t *frag, *fend;
|
||||
struct nfp_nfdk_tx_desc *txd;
|
||||
unsigned int nr_frags;
|
||||
unsigned int wr_idx;
|
||||
int err;
|
||||
|
||||
recount_descs:
|
||||
n_descs = nfp_nfdk_headlen_to_segs(skb_headlen(skb));
|
||||
|
||||
nr_frags = skb_shinfo(skb)->nr_frags;
|
||||
frag = skb_shinfo(skb)->frags;
|
||||
fend = frag + nr_frags;
|
||||
for (; frag < fend; frag++)
|
||||
@@ -281,10 +282,13 @@ netdev_tx_t nfp_nfdk_tx(struct sk_buff *skb, struct net_device *netdev)
|
||||
if (unlikely((int)metadata < 0))
|
||||
goto err_flush;
|
||||
|
||||
nr_frags = skb_shinfo(skb)->nr_frags;
|
||||
if (nfp_nfdk_tx_maybe_close_block(tx_ring, nr_frags, skb))
|
||||
if (nfp_nfdk_tx_maybe_close_block(tx_ring, skb))
|
||||
goto err_flush;
|
||||
|
||||
/* nr_frags will change after skb_linearize so we get nr_frags after
|
||||
* nfp_nfdk_tx_maybe_close_block function
|
||||
*/
|
||||
nr_frags = skb_shinfo(skb)->nr_frags;
|
||||
/* DMA map all */
|
||||
wr_idx = D_IDX(tx_ring, tx_ring->wr_p);
|
||||
txd = &tx_ring->ktxds[wr_idx];
|
||||
@@ -310,7 +314,16 @@ netdev_tx_t nfp_nfdk_tx(struct sk_buff *skb, struct net_device *netdev)
|
||||
|
||||
/* FIELD_PREP() implicitly truncates to chunk */
|
||||
dma_len -= 1;
|
||||
dlen_type = FIELD_PREP(NFDK_DESC_TX_DMA_LEN_HEAD, dma_len) |
|
||||
|
||||
/* We will do our best to pass as much data as we can in descriptor
|
||||
* and we need to make sure the first descriptor includes whole head
|
||||
* since there is limitation in firmware side. Sometimes the value of
|
||||
* dma_len bitwise and NFDK_DESC_TX_DMA_LEN_HEAD will less than
|
||||
* headlen.
|
||||
*/
|
||||
dlen_type = FIELD_PREP(NFDK_DESC_TX_DMA_LEN_HEAD,
|
||||
dma_len > NFDK_DESC_TX_DMA_LEN_HEAD ?
|
||||
NFDK_DESC_TX_DMA_LEN_HEAD : dma_len) |
|
||||
FIELD_PREP(NFDK_DESC_TX_TYPE_HEAD, type);
|
||||
|
||||
txd->dma_len_type = cpu_to_le16(dlen_type);
|
||||
@@ -925,7 +938,9 @@ nfp_nfdk_tx_xdp_buf(struct nfp_net_dp *dp, struct nfp_net_rx_ring *rx_ring,
|
||||
|
||||
/* FIELD_PREP() implicitly truncates to chunk */
|
||||
dma_len -= 1;
|
||||
dlen_type = FIELD_PREP(NFDK_DESC_TX_DMA_LEN_HEAD, dma_len) |
|
||||
dlen_type = FIELD_PREP(NFDK_DESC_TX_DMA_LEN_HEAD,
|
||||
dma_len > NFDK_DESC_TX_DMA_LEN_HEAD ?
|
||||
NFDK_DESC_TX_DMA_LEN_HEAD : dma_len) |
|
||||
FIELD_PREP(NFDK_DESC_TX_TYPE_HEAD, type);
|
||||
|
||||
txd->dma_len_type = cpu_to_le16(dlen_type);
|
||||
@@ -1303,7 +1318,7 @@ nfp_nfdk_ctrl_tx_one(struct nfp_net *nn, struct nfp_net_r_vector *r_vec,
|
||||
skb_push(skb, 4));
|
||||
}
|
||||
|
||||
if (nfp_nfdk_tx_maybe_close_block(tx_ring, 0, skb))
|
||||
if (nfp_nfdk_tx_maybe_close_block(tx_ring, skb))
|
||||
goto err_free;
|
||||
|
||||
/* DMA map all */
|
||||
@@ -1328,7 +1343,9 @@ nfp_nfdk_ctrl_tx_one(struct nfp_net *nn, struct nfp_net_r_vector *r_vec,
|
||||
txbuf++;
|
||||
|
||||
dma_len -= 1;
|
||||
dlen_type = FIELD_PREP(NFDK_DESC_TX_DMA_LEN_HEAD, dma_len) |
|
||||
dlen_type = FIELD_PREP(NFDK_DESC_TX_DMA_LEN_HEAD,
|
||||
dma_len > NFDK_DESC_TX_DMA_LEN_HEAD ?
|
||||
NFDK_DESC_TX_DMA_LEN_HEAD : dma_len) |
|
||||
FIELD_PREP(NFDK_DESC_TX_TYPE_HEAD, type);
|
||||
|
||||
txd->dma_len_type = cpu_to_le16(dlen_type);
|
||||
|
||||
@@ -1932,7 +1932,10 @@ static int efx_ef10_try_update_nic_stats_vf(struct efx_nic *efx)
|
||||
|
||||
efx_update_sw_stats(efx, stats);
|
||||
out:
|
||||
/* releasing a DMA coherent buffer with BH disabled can panic */
|
||||
spin_unlock_bh(&efx->stats_lock);
|
||||
efx_nic_free_buffer(efx, &stats_buf);
|
||||
spin_lock_bh(&efx->stats_lock);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
@@ -408,8 +408,9 @@ fail1:
|
||||
static int efx_ef10_pci_sriov_disable(struct efx_nic *efx, bool force)
|
||||
{
|
||||
struct pci_dev *dev = efx->pci_dev;
|
||||
struct efx_ef10_nic_data *nic_data = efx->nic_data;
|
||||
unsigned int vfs_assigned = pci_vfs_assigned(dev);
|
||||
int rc = 0;
|
||||
int i, rc = 0;
|
||||
|
||||
if (vfs_assigned && !force) {
|
||||
netif_info(efx, drv, efx->net_dev, "VFs are assigned to guests; "
|
||||
@@ -417,10 +418,13 @@ static int efx_ef10_pci_sriov_disable(struct efx_nic *efx, bool force)
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
if (!vfs_assigned)
|
||||
if (!vfs_assigned) {
|
||||
for (i = 0; i < efx->vf_count; i++)
|
||||
nic_data->vf[i].pci_dev = NULL;
|
||||
pci_disable_sriov(dev);
|
||||
else
|
||||
} else {
|
||||
rc = -EBUSY;
|
||||
}
|
||||
|
||||
efx_ef10_sriov_free_vf_vswitching(efx);
|
||||
efx->vf_count = 0;
|
||||
|
||||
@@ -361,6 +361,7 @@ bypass_clk_reset_gpio:
|
||||
data->fix_mac_speed = tegra_eqos_fix_speed;
|
||||
data->init = tegra_eqos_init;
|
||||
data->bsp_priv = eqos;
|
||||
data->sph_disable = 1;
|
||||
|
||||
err = tegra_eqos_init(pdev, eqos);
|
||||
if (err < 0)
|
||||
|
||||
@@ -273,7 +273,8 @@ static int ingenic_mac_probe(struct platform_device *pdev)
|
||||
mac->tx_delay = tx_delay_ps * 1000;
|
||||
} else {
|
||||
dev_err(&pdev->dev, "Invalid TX clock delay: %dps\n", tx_delay_ps);
|
||||
return -EINVAL;
|
||||
ret = -EINVAL;
|
||||
goto err_remove_config_dt;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -283,7 +284,8 @@ static int ingenic_mac_probe(struct platform_device *pdev)
|
||||
mac->rx_delay = rx_delay_ps * 1000;
|
||||
} else {
|
||||
dev_err(&pdev->dev, "Invalid RX clock delay: %dps\n", rx_delay_ps);
|
||||
return -EINVAL;
|
||||
ret = -EINVAL;
|
||||
goto err_remove_config_dt;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -545,43 +545,24 @@ static int try_next_permutation(struct happy_meal *hp, void __iomem *tregs)
|
||||
|
||||
static void display_link_mode(struct happy_meal *hp, void __iomem *tregs)
|
||||
{
|
||||
printk(KERN_INFO "%s: Link is up using ", hp->dev->name);
|
||||
if (hp->tcvr_type == external)
|
||||
printk("external ");
|
||||
else
|
||||
printk("internal ");
|
||||
printk("transceiver at ");
|
||||
hp->sw_lpa = happy_meal_tcvr_read(hp, tregs, MII_LPA);
|
||||
if (hp->sw_lpa & (LPA_100HALF | LPA_100FULL)) {
|
||||
if (hp->sw_lpa & LPA_100FULL)
|
||||
printk("100Mb/s, Full Duplex.\n");
|
||||
else
|
||||
printk("100Mb/s, Half Duplex.\n");
|
||||
} else {
|
||||
if (hp->sw_lpa & LPA_10FULL)
|
||||
printk("10Mb/s, Full Duplex.\n");
|
||||
else
|
||||
printk("10Mb/s, Half Duplex.\n");
|
||||
}
|
||||
|
||||
netdev_info(hp->dev,
|
||||
"Link is up using %s transceiver at %dMb/s, %s Duplex.\n",
|
||||
hp->tcvr_type == external ? "external" : "internal",
|
||||
hp->sw_lpa & (LPA_100HALF | LPA_100FULL) ? 100 : 10,
|
||||
hp->sw_lpa & (LPA_100FULL | LPA_10FULL) ? "Full" : "Half");
|
||||
}
|
||||
|
||||
static void display_forced_link_mode(struct happy_meal *hp, void __iomem *tregs)
|
||||
{
|
||||
printk(KERN_INFO "%s: Link has been forced up using ", hp->dev->name);
|
||||
if (hp->tcvr_type == external)
|
||||
printk("external ");
|
||||
else
|
||||
printk("internal ");
|
||||
printk("transceiver at ");
|
||||
hp->sw_bmcr = happy_meal_tcvr_read(hp, tregs, MII_BMCR);
|
||||
if (hp->sw_bmcr & BMCR_SPEED100)
|
||||
printk("100Mb/s, ");
|
||||
else
|
||||
printk("10Mb/s, ");
|
||||
if (hp->sw_bmcr & BMCR_FULLDPLX)
|
||||
printk("Full Duplex.\n");
|
||||
else
|
||||
printk("Half Duplex.\n");
|
||||
|
||||
netdev_info(hp->dev,
|
||||
"Link has been forced up using %s transceiver at %dMb/s, %s Duplex.\n",
|
||||
hp->tcvr_type == external ? "external" : "internal",
|
||||
hp->sw_bmcr & BMCR_SPEED100 ? 100 : 10,
|
||||
hp->sw_bmcr & BMCR_FULLDPLX ? "Full" : "Half");
|
||||
}
|
||||
|
||||
static int set_happy_link_modes(struct happy_meal *hp, void __iomem *tregs)
|
||||
|
||||
@@ -2467,7 +2467,6 @@ static int am65_cpsw_nuss_register_devlink(struct am65_cpsw_common *common)
|
||||
port->port_id, ret);
|
||||
goto dl_port_unreg;
|
||||
}
|
||||
devlink_port_type_eth_set(dl_port, port->ndev);
|
||||
}
|
||||
devlink_register(common->devlink);
|
||||
return ret;
|
||||
@@ -2511,6 +2510,7 @@ static void am65_cpsw_unregister_devlink(struct am65_cpsw_common *common)
|
||||
static int am65_cpsw_nuss_register_ndevs(struct am65_cpsw_common *common)
|
||||
{
|
||||
struct device *dev = common->dev;
|
||||
struct devlink_port *dl_port;
|
||||
struct am65_cpsw_port *port;
|
||||
int ret = 0, i;
|
||||
|
||||
@@ -2527,6 +2527,10 @@ static int am65_cpsw_nuss_register_ndevs(struct am65_cpsw_common *common)
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = am65_cpsw_nuss_register_devlink(common);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
for (i = 0; i < common->port_num; i++) {
|
||||
port = &common->ports[i];
|
||||
|
||||
@@ -2539,25 +2543,24 @@ static int am65_cpsw_nuss_register_ndevs(struct am65_cpsw_common *common)
|
||||
i, ret);
|
||||
goto err_cleanup_ndev;
|
||||
}
|
||||
|
||||
dl_port = &port->devlink_port;
|
||||
devlink_port_type_eth_set(dl_port, port->ndev);
|
||||
}
|
||||
|
||||
ret = am65_cpsw_register_notifiers(common);
|
||||
if (ret)
|
||||
goto err_cleanup_ndev;
|
||||
|
||||
ret = am65_cpsw_nuss_register_devlink(common);
|
||||
if (ret)
|
||||
goto clean_unregister_notifiers;
|
||||
|
||||
/* can't auto unregister ndev using devm_add_action() due to
|
||||
* devres release sequence in DD core for DMA
|
||||
*/
|
||||
|
||||
return 0;
|
||||
clean_unregister_notifiers:
|
||||
am65_cpsw_unregister_notifiers(common);
|
||||
|
||||
err_cleanup_ndev:
|
||||
am65_cpsw_nuss_cleanup_ndev(common);
|
||||
am65_cpsw_unregister_devlink(common);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -2156,7 +2156,7 @@ static inline void rtl_rx_vlan_tag(struct rx_desc *desc, struct sk_buff *skb)
|
||||
}
|
||||
|
||||
static int r8152_tx_csum(struct r8152 *tp, struct tx_desc *desc,
|
||||
struct sk_buff *skb, u32 len, u32 transport_offset)
|
||||
struct sk_buff *skb, u32 len)
|
||||
{
|
||||
u32 mss = skb_shinfo(skb)->gso_size;
|
||||
u32 opts1, opts2 = 0;
|
||||
@@ -2167,6 +2167,8 @@ static int r8152_tx_csum(struct r8152 *tp, struct tx_desc *desc,
|
||||
opts1 = len | TX_FS | TX_LS;
|
||||
|
||||
if (mss) {
|
||||
u32 transport_offset = (u32)skb_transport_offset(skb);
|
||||
|
||||
if (transport_offset > GTTCPHO_MAX) {
|
||||
netif_warn(tp, tx_err, tp->netdev,
|
||||
"Invalid transport offset 0x%x for TSO\n",
|
||||
@@ -2197,6 +2199,7 @@ static int r8152_tx_csum(struct r8152 *tp, struct tx_desc *desc,
|
||||
opts1 |= transport_offset << GTTCPHO_SHIFT;
|
||||
opts2 |= min(mss, MSS_MAX) << MSS_SHIFT;
|
||||
} else if (skb->ip_summed == CHECKSUM_PARTIAL) {
|
||||
u32 transport_offset = (u32)skb_transport_offset(skb);
|
||||
u8 ip_protocol;
|
||||
|
||||
if (transport_offset > TCPHO_MAX) {
|
||||
@@ -2260,7 +2263,6 @@ static int r8152_tx_agg_fill(struct r8152 *tp, struct tx_agg *agg)
|
||||
struct tx_desc *tx_desc;
|
||||
struct sk_buff *skb;
|
||||
unsigned int len;
|
||||
u32 offset;
|
||||
|
||||
skb = __skb_dequeue(&skb_head);
|
||||
if (!skb)
|
||||
@@ -2276,9 +2278,7 @@ static int r8152_tx_agg_fill(struct r8152 *tp, struct tx_agg *agg)
|
||||
tx_data = tx_agg_align(tx_data);
|
||||
tx_desc = (struct tx_desc *)tx_data;
|
||||
|
||||
offset = (u32)skb_transport_offset(skb);
|
||||
|
||||
if (r8152_tx_csum(tp, tx_desc, skb, skb->len, offset)) {
|
||||
if (r8152_tx_csum(tp, tx_desc, skb, skb->len)) {
|
||||
r8152_csum_workaround(tp, skb, &skb_head);
|
||||
continue;
|
||||
}
|
||||
@@ -2759,9 +2759,9 @@ rtl8152_features_check(struct sk_buff *skb, struct net_device *dev,
|
||||
{
|
||||
u32 mss = skb_shinfo(skb)->gso_size;
|
||||
int max_offset = mss ? GTTCPHO_MAX : TCPHO_MAX;
|
||||
int offset = skb_transport_offset(skb);
|
||||
|
||||
if ((mss || skb->ip_summed == CHECKSUM_PARTIAL) && offset > max_offset)
|
||||
if ((mss || skb->ip_summed == CHECKSUM_PARTIAL) &&
|
||||
skb_transport_offset(skb) > max_offset)
|
||||
features &= ~(NETIF_F_CSUM_MASK | NETIF_F_GSO_MASK);
|
||||
else if ((skb->len + sizeof(struct tx_desc)) > agg_buf_sz)
|
||||
features &= ~NETIF_F_GSO_MASK;
|
||||
|
||||
@@ -3822,7 +3822,8 @@ ath11k_wmi_obss_color_collision_event(struct ath11k_base *ab, struct sk_buff *sk
|
||||
|
||||
switch (ev->evt_type) {
|
||||
case WMI_BSS_COLOR_COLLISION_DETECTION:
|
||||
ieeee80211_obss_color_collision_notify(arvif->vif, ev->obss_color_bitmap);
|
||||
ieeee80211_obss_color_collision_notify(arvif->vif, ev->obss_color_bitmap,
|
||||
GFP_KERNEL);
|
||||
ath11k_dbg(ab, ATH11K_DBG_WMI,
|
||||
"OBSS color collision detected vdev:%d, event:%d, bitmap:%08llx\n",
|
||||
ev->vdev_id, ev->evt_type, ev->obss_color_bitmap);
|
||||
|
||||
@@ -4912,6 +4912,8 @@ static int hwsim_virtio_probe(struct virtio_device *vdev)
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
virtio_device_ready(vdev);
|
||||
|
||||
err = fill_vq(hwsim_vqs[HWSIM_VQ_RX]);
|
||||
if (err)
|
||||
goto out_remove;
|
||||
|
||||
@@ -1233,9 +1233,6 @@ struct rtw_chip_info {
|
||||
const struct wiphy_wowlan_support *wowlan_stub;
|
||||
const u8 max_sched_scan_ssids;
|
||||
|
||||
/* for 8821c set channel */
|
||||
u32 ch_param[3];
|
||||
|
||||
/* coex paras */
|
||||
u32 coex_para_ver;
|
||||
u8 bt_desired_ver;
|
||||
@@ -1937,6 +1934,9 @@ struct rtw_hal {
|
||||
|
||||
enum rtw_sar_bands sar_band;
|
||||
struct rtw_sar sar;
|
||||
|
||||
/* for 8821c set channel */
|
||||
u32 ch_param[3];
|
||||
};
|
||||
|
||||
struct rtw_path_div {
|
||||
|
||||
@@ -125,6 +125,7 @@ static void rtw8821c_phy_bf_init(struct rtw_dev *rtwdev)
|
||||
|
||||
static void rtw8821c_phy_set_param(struct rtw_dev *rtwdev)
|
||||
{
|
||||
struct rtw_hal *hal = &rtwdev->hal;
|
||||
u8 crystal_cap, val;
|
||||
|
||||
/* power on BB/RF domain */
|
||||
@@ -159,9 +160,9 @@ static void rtw8821c_phy_set_param(struct rtw_dev *rtwdev)
|
||||
|
||||
/* post init after header files config */
|
||||
rtw_write32_set(rtwdev, REG_RXPSEL, BIT_RX_PSEL_RST);
|
||||
rtwdev->chip->ch_param[0] = rtw_read32_mask(rtwdev, REG_TXSF2, MASKDWORD);
|
||||
rtwdev->chip->ch_param[1] = rtw_read32_mask(rtwdev, REG_TXSF6, MASKDWORD);
|
||||
rtwdev->chip->ch_param[2] = rtw_read32_mask(rtwdev, REG_TXFILTER, MASKDWORD);
|
||||
hal->ch_param[0] = rtw_read32_mask(rtwdev, REG_TXSF2, MASKDWORD);
|
||||
hal->ch_param[1] = rtw_read32_mask(rtwdev, REG_TXSF6, MASKDWORD);
|
||||
hal->ch_param[2] = rtw_read32_mask(rtwdev, REG_TXFILTER, MASKDWORD);
|
||||
|
||||
rtw_phy_init(rtwdev);
|
||||
rtwdev->dm_info.cck_pd_default = rtw_read8(rtwdev, REG_CSRATIO) & 0x1f;
|
||||
@@ -351,6 +352,7 @@ static void rtw8821c_set_channel_rxdfir(struct rtw_dev *rtwdev, u8 bw)
|
||||
static void rtw8821c_set_channel_bb(struct rtw_dev *rtwdev, u8 channel, u8 bw,
|
||||
u8 primary_ch_idx)
|
||||
{
|
||||
struct rtw_hal *hal = &rtwdev->hal;
|
||||
u32 val32;
|
||||
|
||||
if (channel <= 14) {
|
||||
@@ -367,11 +369,11 @@ static void rtw8821c_set_channel_bb(struct rtw_dev *rtwdev, u8 channel, u8 bw,
|
||||
rtw_write32_mask(rtwdev, REG_TXFILTER, MASKDWORD, 0x00003667);
|
||||
} else {
|
||||
rtw_write32_mask(rtwdev, REG_TXSF2, MASKDWORD,
|
||||
rtwdev->chip->ch_param[0]);
|
||||
hal->ch_param[0]);
|
||||
rtw_write32_mask(rtwdev, REG_TXSF6, MASKLWORD,
|
||||
rtwdev->chip->ch_param[1] & MASKLWORD);
|
||||
hal->ch_param[1] & MASKLWORD);
|
||||
rtw_write32_mask(rtwdev, REG_TXFILTER, MASKDWORD,
|
||||
rtwdev->chip->ch_param[2]);
|
||||
hal->ch_param[2]);
|
||||
}
|
||||
} else if (channel > 35) {
|
||||
rtw_write32_mask(rtwdev, REG_ENTXCCK, BIT(18), 0x1);
|
||||
|
||||
@@ -495,6 +495,7 @@ void xenvif_rx_action(struct xenvif_queue *queue)
|
||||
queue->rx_copy.completed = &completed_skbs;
|
||||
|
||||
while (xenvif_rx_ring_slots_available(queue) &&
|
||||
!skb_queue_empty(&queue->rx_queue) &&
|
||||
work_done < RX_BATCH_SIZE) {
|
||||
xenvif_rx_skb(queue);
|
||||
work_done++;
|
||||
|
||||
@@ -1918,7 +1918,6 @@ void cifs_put_smb_ses(struct cifs_ses *ses)
|
||||
list_del_init(&ses->smb_ses_list);
|
||||
spin_unlock(&cifs_tcp_ses_lock);
|
||||
|
||||
spin_lock(&ses->chan_lock);
|
||||
chan_count = ses->chan_count;
|
||||
|
||||
/* close any extra channels */
|
||||
@@ -1934,7 +1933,6 @@ void cifs_put_smb_ses(struct cifs_ses *ses)
|
||||
ses->chans[i].server = NULL;
|
||||
}
|
||||
}
|
||||
spin_unlock(&ses->chan_lock);
|
||||
|
||||
sesInfoFree(ses);
|
||||
cifs_put_tcp_session(server, 0);
|
||||
|
||||
@@ -474,6 +474,14 @@ cifs_ses_add_channel(struct cifs_sb_info *cifs_sb, struct cifs_ses *ses,
|
||||
|
||||
out:
|
||||
if (rc && chan->server) {
|
||||
/*
|
||||
* we should avoid race with these delayed works before we
|
||||
* remove this channel
|
||||
*/
|
||||
cancel_delayed_work_sync(&chan->server->echo);
|
||||
cancel_delayed_work_sync(&chan->server->resolve);
|
||||
cancel_delayed_work_sync(&chan->server->reconnect);
|
||||
|
||||
spin_lock(&ses->chan_lock);
|
||||
/* we rely on all bits beyond chan_count to be clear */
|
||||
cifs_chan_clear_need_reconnect(ses, chan->server);
|
||||
@@ -484,10 +492,9 @@ out:
|
||||
*/
|
||||
WARN_ON(ses->chan_count < 1);
|
||||
spin_unlock(&ses->chan_lock);
|
||||
}
|
||||
|
||||
if (rc && chan->server)
|
||||
cifs_put_tcp_session(chan->server, 0);
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -571,10 +571,6 @@ assemble_neg_contexts(struct smb2_negotiate_req *req,
|
||||
*total_len += ctxt_len;
|
||||
pneg_ctxt += ctxt_len;
|
||||
|
||||
build_posix_ctxt((struct smb2_posix_neg_context *)pneg_ctxt);
|
||||
*total_len += sizeof(struct smb2_posix_neg_context);
|
||||
pneg_ctxt += sizeof(struct smb2_posix_neg_context);
|
||||
|
||||
/*
|
||||
* secondary channels don't have the hostname field populated
|
||||
* use the hostname field in the primary channel instead
|
||||
@@ -586,9 +582,14 @@ assemble_neg_contexts(struct smb2_negotiate_req *req,
|
||||
hostname);
|
||||
*total_len += ctxt_len;
|
||||
pneg_ctxt += ctxt_len;
|
||||
neg_context_count = 4;
|
||||
} else /* second channels do not have a hostname */
|
||||
neg_context_count = 3;
|
||||
} else
|
||||
neg_context_count = 2;
|
||||
|
||||
build_posix_ctxt((struct smb2_posix_neg_context *)pneg_ctxt);
|
||||
*total_len += sizeof(struct smb2_posix_neg_context);
|
||||
pneg_ctxt += sizeof(struct smb2_posix_neg_context);
|
||||
neg_context_count++;
|
||||
|
||||
if (server->compress_algorithm) {
|
||||
build_compression_ctxt((struct smb2_compression_capabilities_context *)
|
||||
|
||||
@@ -176,7 +176,7 @@ nlm_delete_file(struct nlm_file *file)
|
||||
}
|
||||
}
|
||||
|
||||
static int nlm_unlock_files(struct nlm_file *file)
|
||||
static int nlm_unlock_files(struct nlm_file *file, fl_owner_t owner)
|
||||
{
|
||||
struct file_lock lock;
|
||||
|
||||
@@ -184,6 +184,7 @@ static int nlm_unlock_files(struct nlm_file *file)
|
||||
lock.fl_type = F_UNLCK;
|
||||
lock.fl_start = 0;
|
||||
lock.fl_end = OFFSET_MAX;
|
||||
lock.fl_owner = owner;
|
||||
if (file->f_file[O_RDONLY] &&
|
||||
vfs_lock_file(file->f_file[O_RDONLY], F_SETLK, &lock, NULL))
|
||||
goto out_err;
|
||||
@@ -225,7 +226,7 @@ again:
|
||||
if (match(lockhost, host)) {
|
||||
|
||||
spin_unlock(&flctx->flc_lock);
|
||||
if (nlm_unlock_files(file))
|
||||
if (nlm_unlock_files(file, fl->fl_owner))
|
||||
return 1;
|
||||
goto again;
|
||||
}
|
||||
@@ -282,11 +283,10 @@ nlm_file_inuse(struct nlm_file *file)
|
||||
|
||||
static void nlm_close_files(struct nlm_file *file)
|
||||
{
|
||||
struct file *f;
|
||||
|
||||
for (f = file->f_file[0]; f <= file->f_file[1]; f++)
|
||||
if (f)
|
||||
nlmsvc_ops->fclose(f);
|
||||
if (file->f_file[O_RDONLY])
|
||||
nlmsvc_ops->fclose(file->f_file[O_RDONLY]);
|
||||
if (file->f_file[O_WRONLY])
|
||||
nlmsvc_ops->fclose(file->f_file[O_WRONLY]);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -470,6 +470,15 @@ nfsd4_decode_fattr4(struct nfsd4_compoundargs *argp, u32 *bmval, u32 bmlen,
|
||||
return nfserr_bad_xdr;
|
||||
}
|
||||
}
|
||||
if (bmval[1] & FATTR4_WORD1_TIME_CREATE) {
|
||||
struct timespec64 ts;
|
||||
|
||||
/* No Linux filesystem supports setting this attribute. */
|
||||
bmval[1] &= ~FATTR4_WORD1_TIME_CREATE;
|
||||
status = nfsd4_decode_nfstime4(argp, &ts);
|
||||
if (status)
|
||||
return status;
|
||||
}
|
||||
if (bmval[1] & FATTR4_WORD1_TIME_MODIFY_SET) {
|
||||
u32 set_it;
|
||||
|
||||
|
||||
@@ -465,7 +465,8 @@ static inline bool nfsd_attrs_supported(u32 minorversion, const u32 *bmval)
|
||||
(FATTR4_WORD0_SIZE | FATTR4_WORD0_ACL)
|
||||
#define NFSD_WRITEABLE_ATTRS_WORD1 \
|
||||
(FATTR4_WORD1_MODE | FATTR4_WORD1_OWNER | FATTR4_WORD1_OWNER_GROUP \
|
||||
| FATTR4_WORD1_TIME_ACCESS_SET | FATTR4_WORD1_TIME_MODIFY_SET)
|
||||
| FATTR4_WORD1_TIME_ACCESS_SET | FATTR4_WORD1_TIME_CREATE \
|
||||
| FATTR4_WORD1_TIME_MODIFY_SET)
|
||||
#ifdef CONFIG_NFSD_V4_SECURITY_LABEL
|
||||
#define MAYBE_FATTR4_WORD2_SECURITY_LABEL \
|
||||
FATTR4_WORD2_SECURITY_LABEL
|
||||
|
||||
@@ -547,7 +547,7 @@ int vfs_dedupe_file_range(struct file *file, struct file_dedupe_range *same)
|
||||
else if (deduped < 0)
|
||||
info->status = deduped;
|
||||
else
|
||||
info->bytes_deduped = deduped;
|
||||
info->bytes_deduped = len;
|
||||
|
||||
next_fdput:
|
||||
fdput(dst_fd);
|
||||
|
||||
@@ -452,6 +452,12 @@ static inline int kexec_crash_loaded(void) { return 0; }
|
||||
#define kexec_in_progress false
|
||||
#endif /* CONFIG_KEXEC_CORE */
|
||||
|
||||
#ifdef CONFIG_KEXEC_SIG
|
||||
void set_kexec_sig_enforced(void);
|
||||
#else
|
||||
static inline void set_kexec_sig_enforced(void) {}
|
||||
#endif
|
||||
|
||||
#endif /* !defined(__ASSEBMLY__) */
|
||||
|
||||
#endif /* LINUX_KEXEC_H */
|
||||
|
||||
@@ -8462,11 +8462,12 @@ int cfg80211_bss_color_notify(struct net_device *dev, gfp_t gfp,
|
||||
* cfg80211_obss_color_collision_notify - notify about bss color collision
|
||||
* @dev: network device
|
||||
* @color_bitmap: representations of the colors that the local BSS is aware of
|
||||
* @gfp: allocation flags
|
||||
*/
|
||||
static inline int cfg80211_obss_color_collision_notify(struct net_device *dev,
|
||||
u64 color_bitmap)
|
||||
u64 color_bitmap, gfp_t gfp)
|
||||
{
|
||||
return cfg80211_bss_color_notify(dev, GFP_KERNEL,
|
||||
return cfg80211_bss_color_notify(dev, gfp,
|
||||
NL80211_CMD_OBSS_COLOR_COLLISION,
|
||||
0, color_bitmap);
|
||||
}
|
||||
|
||||
@@ -6960,10 +6960,11 @@ ieee80211_get_unsol_bcast_probe_resp_tmpl(struct ieee80211_hw *hw,
|
||||
* @vif: &struct ieee80211_vif pointer from the add_interface callback.
|
||||
* @color_bitmap: a 64 bit bitmap representing the colors that the local BSS is
|
||||
* aware of.
|
||||
* @gfp: allocation flags
|
||||
*/
|
||||
void
|
||||
ieeee80211_obss_color_collision_notify(struct ieee80211_vif *vif,
|
||||
u64 color_bitmap);
|
||||
u64 color_bitmap, gfp_t gfp);
|
||||
|
||||
/**
|
||||
* ieee80211_is_tx_data - check if frame is a data frame
|
||||
|
||||
@@ -657,18 +657,22 @@ static inline void nft_set_ext_prepare(struct nft_set_ext_tmpl *tmpl)
|
||||
tmpl->len = sizeof(struct nft_set_ext);
|
||||
}
|
||||
|
||||
static inline void nft_set_ext_add_length(struct nft_set_ext_tmpl *tmpl, u8 id,
|
||||
unsigned int len)
|
||||
static inline int nft_set_ext_add_length(struct nft_set_ext_tmpl *tmpl, u8 id,
|
||||
unsigned int len)
|
||||
{
|
||||
tmpl->len = ALIGN(tmpl->len, nft_set_ext_types[id].align);
|
||||
BUG_ON(tmpl->len > U8_MAX);
|
||||
if (tmpl->len > U8_MAX)
|
||||
return -EINVAL;
|
||||
|
||||
tmpl->offset[id] = tmpl->len;
|
||||
tmpl->len += nft_set_ext_types[id].len + len;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void nft_set_ext_add(struct nft_set_ext_tmpl *tmpl, u8 id)
|
||||
static inline int nft_set_ext_add(struct nft_set_ext_tmpl *tmpl, u8 id)
|
||||
{
|
||||
nft_set_ext_add_length(tmpl, id, 0);
|
||||
return nft_set_ext_add_length(tmpl, id, 0);
|
||||
}
|
||||
|
||||
static inline void nft_set_ext_init(struct nft_set_ext *ext,
|
||||
|
||||
@@ -75,7 +75,7 @@ static inline bool raw_sk_bound_dev_eq(struct net *net, int bound_dev_if,
|
||||
int dif, int sdif)
|
||||
{
|
||||
#if IS_ENABLED(CONFIG_NET_L3_MASTER_DEV)
|
||||
return inet_bound_dev_eq(!!net->ipv4.sysctl_raw_l3mdev_accept,
|
||||
return inet_bound_dev_eq(READ_ONCE(net->ipv4.sysctl_raw_l3mdev_accept),
|
||||
bound_dev_if, dif, sdif);
|
||||
#else
|
||||
return inet_bound_dev_eq(true, bound_dev_if, dif, sdif);
|
||||
|
||||
@@ -1529,7 +1529,7 @@ void __sk_mem_reclaim(struct sock *sk, int amount);
|
||||
/* sysctl_mem values are in pages, we convert them in SK_MEM_QUANTUM units */
|
||||
static inline long sk_prot_mem_limits(const struct sock *sk, int index)
|
||||
{
|
||||
long val = sk->sk_prot->sysctl_mem[index];
|
||||
long val = READ_ONCE(sk->sk_prot->sysctl_mem[index]);
|
||||
|
||||
#if PAGE_SIZE > SK_MEM_QUANTUM
|
||||
val <<= PAGE_SHIFT - SK_MEM_QUANTUM_SHIFT;
|
||||
|
||||
@@ -704,7 +704,7 @@ int tls_sw_fallback_init(struct sock *sk,
|
||||
struct tls_crypto_info *crypto_info);
|
||||
|
||||
#ifdef CONFIG_TLS_DEVICE
|
||||
void tls_device_init(void);
|
||||
int tls_device_init(void);
|
||||
void tls_device_cleanup(void);
|
||||
void tls_device_sk_destruct(struct sock *sk);
|
||||
int tls_set_device_offload(struct sock *sk, struct tls_context *ctx);
|
||||
@@ -724,7 +724,7 @@ static inline bool tls_is_sk_rx_device_offloaded(struct sock *sk)
|
||||
return tls_get_ctx(sk)->rx_conf == TLS_HW;
|
||||
}
|
||||
#else
|
||||
static inline void tls_device_init(void) {}
|
||||
static inline int tls_device_init(void) { return 0; }
|
||||
static inline void tls_device_cleanup(void) {}
|
||||
|
||||
static inline int
|
||||
|
||||
@@ -98,7 +98,7 @@ TRACE_EVENT(sock_exceed_buf_limit,
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__array(char, name, 32)
|
||||
__field(long *, sysctl_mem)
|
||||
__array(long, sysctl_mem, 3)
|
||||
__field(long, allocated)
|
||||
__field(int, sysctl_rmem)
|
||||
__field(int, rmem_alloc)
|
||||
@@ -110,7 +110,9 @@ TRACE_EVENT(sock_exceed_buf_limit,
|
||||
|
||||
TP_fast_assign(
|
||||
strncpy(__entry->name, prot->name, 32);
|
||||
__entry->sysctl_mem = prot->sysctl_mem;
|
||||
__entry->sysctl_mem[0] = READ_ONCE(prot->sysctl_mem[0]);
|
||||
__entry->sysctl_mem[1] = READ_ONCE(prot->sysctl_mem[1]);
|
||||
__entry->sysctl_mem[2] = READ_ONCE(prot->sysctl_mem[2]);
|
||||
__entry->allocated = allocated;
|
||||
__entry->sysctl_rmem = sk_get_rmem0(sk, prot);
|
||||
__entry->rmem_alloc = atomic_read(&sk->sk_rmem_alloc);
|
||||
|
||||
@@ -5222,22 +5222,25 @@ union bpf_attr {
|
||||
* Return
|
||||
* Nothing. Always succeeds.
|
||||
*
|
||||
* long bpf_dynptr_read(void *dst, u32 len, struct bpf_dynptr *src, u32 offset)
|
||||
* long bpf_dynptr_read(void *dst, u32 len, struct bpf_dynptr *src, u32 offset, u64 flags)
|
||||
* Description
|
||||
* Read *len* bytes from *src* into *dst*, starting from *offset*
|
||||
* into *src*.
|
||||
* *flags* is currently unused.
|
||||
* Return
|
||||
* 0 on success, -E2BIG if *offset* + *len* exceeds the length
|
||||
* of *src*'s data, -EINVAL if *src* is an invalid dynptr.
|
||||
* of *src*'s data, -EINVAL if *src* is an invalid dynptr or if
|
||||
* *flags* is not 0.
|
||||
*
|
||||
* long bpf_dynptr_write(struct bpf_dynptr *dst, u32 offset, void *src, u32 len)
|
||||
* long bpf_dynptr_write(struct bpf_dynptr *dst, u32 offset, void *src, u32 len, u64 flags)
|
||||
* Description
|
||||
* Write *len* bytes from *src* into *dst*, starting from *offset*
|
||||
* into *dst*.
|
||||
* *flags* is currently unused.
|
||||
* Return
|
||||
* 0 on success, -E2BIG if *offset* + *len* exceeds the length
|
||||
* of *dst*'s data, -EINVAL if *dst* is an invalid dynptr or if *dst*
|
||||
* is a read-only dynptr.
|
||||
* is a read-only dynptr or if *flags* is not 0.
|
||||
*
|
||||
* void *bpf_dynptr_data(struct bpf_dynptr *ptr, u32 offset, u32 len)
|
||||
* Description
|
||||
|
||||
@@ -68,11 +68,13 @@ void *bpf_internal_load_pointer_neg_helper(const struct sk_buff *skb, int k, uns
|
||||
{
|
||||
u8 *ptr = NULL;
|
||||
|
||||
if (k >= SKF_NET_OFF)
|
||||
if (k >= SKF_NET_OFF) {
|
||||
ptr = skb_network_header(skb) + k - SKF_NET_OFF;
|
||||
else if (k >= SKF_LL_OFF)
|
||||
} else if (k >= SKF_LL_OFF) {
|
||||
if (unlikely(!skb_mac_header_was_set(skb)))
|
||||
return NULL;
|
||||
ptr = skb_mac_header(skb) + k - SKF_LL_OFF;
|
||||
|
||||
}
|
||||
if (ptr >= skb->head && ptr + size <= skb_tail_pointer(skb))
|
||||
return ptr;
|
||||
|
||||
|
||||
@@ -1497,11 +1497,12 @@ const struct bpf_func_proto bpf_dynptr_from_mem_proto = {
|
||||
.arg4_type = ARG_PTR_TO_DYNPTR | DYNPTR_TYPE_LOCAL | MEM_UNINIT,
|
||||
};
|
||||
|
||||
BPF_CALL_4(bpf_dynptr_read, void *, dst, u32, len, struct bpf_dynptr_kern *, src, u32, offset)
|
||||
BPF_CALL_5(bpf_dynptr_read, void *, dst, u32, len, struct bpf_dynptr_kern *, src,
|
||||
u32, offset, u64, flags)
|
||||
{
|
||||
int err;
|
||||
|
||||
if (!src->data)
|
||||
if (!src->data || flags)
|
||||
return -EINVAL;
|
||||
|
||||
err = bpf_dynptr_check_off_len(src, offset, len);
|
||||
@@ -1521,13 +1522,15 @@ const struct bpf_func_proto bpf_dynptr_read_proto = {
|
||||
.arg2_type = ARG_CONST_SIZE_OR_ZERO,
|
||||
.arg3_type = ARG_PTR_TO_DYNPTR,
|
||||
.arg4_type = ARG_ANYTHING,
|
||||
.arg5_type = ARG_ANYTHING,
|
||||
};
|
||||
|
||||
BPF_CALL_4(bpf_dynptr_write, struct bpf_dynptr_kern *, dst, u32, offset, void *, src, u32, len)
|
||||
BPF_CALL_5(bpf_dynptr_write, struct bpf_dynptr_kern *, dst, u32, offset, void *, src,
|
||||
u32, len, u64, flags)
|
||||
{
|
||||
int err;
|
||||
|
||||
if (!dst->data || bpf_dynptr_is_rdonly(dst))
|
||||
if (!dst->data || flags || bpf_dynptr_is_rdonly(dst))
|
||||
return -EINVAL;
|
||||
|
||||
err = bpf_dynptr_check_off_len(dst, offset, len);
|
||||
@@ -1547,6 +1550,7 @@ const struct bpf_func_proto bpf_dynptr_write_proto = {
|
||||
.arg2_type = ARG_ANYTHING,
|
||||
.arg3_type = ARG_PTR_TO_MEM | MEM_RDONLY,
|
||||
.arg4_type = ARG_CONST_SIZE_OR_ZERO,
|
||||
.arg5_type = ARG_ANYTHING,
|
||||
};
|
||||
|
||||
BPF_CALL_3(bpf_dynptr_data, struct bpf_dynptr_kern *, ptr, u32, offset, u32, len)
|
||||
|
||||
@@ -29,6 +29,15 @@
|
||||
#include <linux/vmalloc.h>
|
||||
#include "kexec_internal.h"
|
||||
|
||||
#ifdef CONFIG_KEXEC_SIG
|
||||
static bool sig_enforce = IS_ENABLED(CONFIG_KEXEC_SIG_FORCE);
|
||||
|
||||
void set_kexec_sig_enforced(void)
|
||||
{
|
||||
sig_enforce = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int kexec_calculate_store_digests(struct kimage *image);
|
||||
|
||||
/*
|
||||
@@ -159,7 +168,7 @@ kimage_validate_signature(struct kimage *image)
|
||||
image->kernel_buf_len);
|
||||
if (ret) {
|
||||
|
||||
if (IS_ENABLED(CONFIG_KEXEC_SIG_FORCE)) {
|
||||
if (sig_enforce) {
|
||||
pr_notice("Enforced kernel signature verification failed (%d).\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -446,14 +446,14 @@ static int do_proc_dointvec_conv(bool *negp, unsigned long *lvalp,
|
||||
if (*negp) {
|
||||
if (*lvalp > (unsigned long) INT_MAX + 1)
|
||||
return -EINVAL;
|
||||
*valp = -*lvalp;
|
||||
WRITE_ONCE(*valp, -*lvalp);
|
||||
} else {
|
||||
if (*lvalp > (unsigned long) INT_MAX)
|
||||
return -EINVAL;
|
||||
*valp = *lvalp;
|
||||
WRITE_ONCE(*valp, *lvalp);
|
||||
}
|
||||
} else {
|
||||
int val = *valp;
|
||||
int val = READ_ONCE(*valp);
|
||||
if (val < 0) {
|
||||
*negp = true;
|
||||
*lvalp = -(unsigned long)val;
|
||||
@@ -472,9 +472,9 @@ static int do_proc_douintvec_conv(unsigned long *lvalp,
|
||||
if (write) {
|
||||
if (*lvalp > UINT_MAX)
|
||||
return -EINVAL;
|
||||
*valp = *lvalp;
|
||||
WRITE_ONCE(*valp, *lvalp);
|
||||
} else {
|
||||
unsigned int val = *valp;
|
||||
unsigned int val = READ_ONCE(*valp);
|
||||
*lvalp = (unsigned long)val;
|
||||
}
|
||||
return 0;
|
||||
@@ -857,7 +857,7 @@ static int do_proc_dointvec_minmax_conv(bool *negp, unsigned long *lvalp,
|
||||
if ((param->min && *param->min > tmp) ||
|
||||
(param->max && *param->max < tmp))
|
||||
return -EINVAL;
|
||||
*valp = tmp;
|
||||
WRITE_ONCE(*valp, tmp);
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -923,7 +923,7 @@ static int do_proc_douintvec_minmax_conv(unsigned long *lvalp,
|
||||
(param->max && *param->max < tmp))
|
||||
return -ERANGE;
|
||||
|
||||
*valp = tmp;
|
||||
WRITE_ONCE(*valp, tmp);
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -1007,13 +1007,13 @@ int proc_dou8vec_minmax(struct ctl_table *table, int write,
|
||||
|
||||
tmp.maxlen = sizeof(val);
|
||||
tmp.data = &val;
|
||||
val = *data;
|
||||
val = READ_ONCE(*data);
|
||||
res = do_proc_douintvec(&tmp, write, buffer, lenp, ppos,
|
||||
do_proc_douintvec_minmax_conv, ¶m);
|
||||
if (res)
|
||||
return res;
|
||||
if (write)
|
||||
*data = val;
|
||||
WRITE_ONCE(*data, val);
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(proc_dou8vec_minmax);
|
||||
@@ -1090,9 +1090,9 @@ static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table,
|
||||
err = -EINVAL;
|
||||
break;
|
||||
}
|
||||
*i = val;
|
||||
WRITE_ONCE(*i, val);
|
||||
} else {
|
||||
val = convdiv * (*i) / convmul;
|
||||
val = convdiv * READ_ONCE(*i) / convmul;
|
||||
if (!first)
|
||||
proc_put_char(&buffer, &left, '\t');
|
||||
proc_put_long(&buffer, &left, val, false);
|
||||
@@ -1173,9 +1173,12 @@ static int do_proc_dointvec_jiffies_conv(bool *negp, unsigned long *lvalp,
|
||||
if (write) {
|
||||
if (*lvalp > INT_MAX / HZ)
|
||||
return 1;
|
||||
*valp = *negp ? -(*lvalp*HZ) : (*lvalp*HZ);
|
||||
if (*negp)
|
||||
WRITE_ONCE(*valp, -*lvalp * HZ);
|
||||
else
|
||||
WRITE_ONCE(*valp, *lvalp * HZ);
|
||||
} else {
|
||||
int val = *valp;
|
||||
int val = READ_ONCE(*valp);
|
||||
unsigned long lval;
|
||||
if (val < 0) {
|
||||
*negp = true;
|
||||
@@ -1221,9 +1224,9 @@ static int do_proc_dointvec_ms_jiffies_conv(bool *negp, unsigned long *lvalp,
|
||||
|
||||
if (jif > INT_MAX)
|
||||
return 1;
|
||||
*valp = (int)jif;
|
||||
WRITE_ONCE(*valp, (int)jif);
|
||||
} else {
|
||||
int val = *valp;
|
||||
int val = READ_ONCE(*valp);
|
||||
unsigned long lval;
|
||||
if (val < 0) {
|
||||
*negp = true;
|
||||
@@ -1291,8 +1294,8 @@ int proc_dointvec_userhz_jiffies(struct ctl_table *table, int write,
|
||||
* @ppos: the current position in the file
|
||||
*
|
||||
* Reads/writes up to table->maxlen/sizeof(unsigned int) integer
|
||||
* values from/to the user buffer, treated as an ASCII string.
|
||||
* The values read are assumed to be in 1/1000 seconds, and
|
||||
* values from/to the user buffer, treated as an ASCII string.
|
||||
* The values read are assumed to be in 1/1000 seconds, and
|
||||
* are converted into jiffies.
|
||||
*
|
||||
* Returns 0 on success.
|
||||
|
||||
@@ -84,6 +84,9 @@ config UBSAN_SHIFT
|
||||
config UBSAN_DIV_ZERO
|
||||
bool "Perform checking for integer divide-by-zero"
|
||||
depends on $(cc-option,-fsanitize=integer-divide-by-zero)
|
||||
# https://github.com/ClangBuiltLinux/linux/issues/1657
|
||||
# https://github.com/llvm/llvm-project/issues/56289
|
||||
depends on !CC_IS_CLANG
|
||||
help
|
||||
This option enables -fsanitize=integer-divide-by-zero which checks
|
||||
for integer division by zero. This is effectively redundant with the
|
||||
|
||||
@@ -182,10 +182,14 @@ static int vlan_newlink(struct net *src_net, struct net_device *dev,
|
||||
else if (dev->mtu > max_mtu)
|
||||
return -EINVAL;
|
||||
|
||||
/* Note: If this initial vlan_changelink() fails, we need
|
||||
* to call vlan_dev_free_egress_priority() to free memory.
|
||||
*/
|
||||
err = vlan_changelink(dev, tb, data, extack);
|
||||
if (err)
|
||||
return err;
|
||||
err = register_vlan_dev(dev, extack);
|
||||
|
||||
if (!err)
|
||||
err = register_vlan_dev(dev, extack);
|
||||
|
||||
if (err)
|
||||
vlan_dev_free_egress_priority(dev);
|
||||
return err;
|
||||
|
||||
@@ -4870,7 +4870,10 @@ static u32 netif_receive_generic_xdp(struct sk_buff *skb,
|
||||
}
|
||||
|
||||
/* When doing generic XDP we have to bypass the qdisc layer and the
|
||||
* network taps in order to match in-driver-XDP behavior.
|
||||
* network taps in order to match in-driver-XDP behavior. This also means
|
||||
* that XDP packets are able to starve other packets going through a qdisc,
|
||||
* and DDOS attacks will be more effective. In-driver-XDP use dedicated TX
|
||||
* queues, so they do not have this starvation issue.
|
||||
*/
|
||||
void generic_xdp_tx(struct sk_buff *skb, struct bpf_prog *xdp_prog)
|
||||
{
|
||||
@@ -4882,7 +4885,7 @@ void generic_xdp_tx(struct sk_buff *skb, struct bpf_prog *xdp_prog)
|
||||
txq = netdev_core_pick_tx(dev, skb, NULL);
|
||||
cpu = smp_processor_id();
|
||||
HARD_TX_LOCK(dev, txq, cpu);
|
||||
if (!netif_xmit_stopped(txq)) {
|
||||
if (!netif_xmit_frozen_or_drv_stopped(txq)) {
|
||||
rc = netdev_start_xmit(skb, dev, txq, 0);
|
||||
if (dev_xmit_complete(rc))
|
||||
free_skb = false;
|
||||
@@ -4890,6 +4893,7 @@ void generic_xdp_tx(struct sk_buff *skb, struct bpf_prog *xdp_prog)
|
||||
HARD_TX_UNLOCK(dev, txq);
|
||||
if (free_skb) {
|
||||
trace_xdp_exception(dev, xdp_prog, XDP_TX);
|
||||
dev_core_stats_tx_dropped_inc(dev);
|
||||
kfree_skb(skb);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6158,7 +6158,6 @@ static int bpf_push_seg6_encap(struct sk_buff *skb, u32 type, void *hdr, u32 len
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
ipv6_hdr(skb)->payload_len = htons(skb->len - sizeof(struct ipv6hdr));
|
||||
skb_set_transport_header(skb, sizeof(struct ipv6hdr));
|
||||
|
||||
return seg6_lookup_nexthop(skb, NULL, 0);
|
||||
|
||||
@@ -1246,7 +1246,7 @@ static int inet_sk_reselect_saddr(struct sock *sk)
|
||||
if (new_saddr == old_saddr)
|
||||
return 0;
|
||||
|
||||
if (sock_net(sk)->ipv4.sysctl_ip_dynaddr > 1) {
|
||||
if (READ_ONCE(sock_net(sk)->ipv4.sysctl_ip_dynaddr) > 1) {
|
||||
pr_info("%s(): shifting inet->saddr from %pI4 to %pI4\n",
|
||||
__func__, &old_saddr, &new_saddr);
|
||||
}
|
||||
@@ -1301,7 +1301,7 @@ int inet_sk_rebuild_header(struct sock *sk)
|
||||
* Other protocols have to map its equivalent state to TCP_SYN_SENT.
|
||||
* DCCP maps its DCCP_REQUESTING state to TCP_SYN_SENT. -acme
|
||||
*/
|
||||
if (!sock_net(sk)->ipv4.sysctl_ip_dynaddr ||
|
||||
if (!READ_ONCE(sock_net(sk)->ipv4.sysctl_ip_dynaddr) ||
|
||||
sk->sk_state != TCP_SYN_SENT ||
|
||||
(sk->sk_userlocks & SOCK_BINDADDR_LOCK) ||
|
||||
(err = inet_sk_reselect_saddr(sk)) != 0)
|
||||
|
||||
@@ -239,7 +239,7 @@ static int cipso_v4_cache_check(const unsigned char *key,
|
||||
struct cipso_v4_map_cache_entry *prev_entry = NULL;
|
||||
u32 hash;
|
||||
|
||||
if (!cipso_v4_cache_enabled)
|
||||
if (!READ_ONCE(cipso_v4_cache_enabled))
|
||||
return -ENOENT;
|
||||
|
||||
hash = cipso_v4_map_cache_hash(key, key_len);
|
||||
@@ -296,13 +296,14 @@ static int cipso_v4_cache_check(const unsigned char *key,
|
||||
int cipso_v4_cache_add(const unsigned char *cipso_ptr,
|
||||
const struct netlbl_lsm_secattr *secattr)
|
||||
{
|
||||
int bkt_size = READ_ONCE(cipso_v4_cache_bucketsize);
|
||||
int ret_val = -EPERM;
|
||||
u32 bkt;
|
||||
struct cipso_v4_map_cache_entry *entry = NULL;
|
||||
struct cipso_v4_map_cache_entry *old_entry = NULL;
|
||||
u32 cipso_ptr_len;
|
||||
|
||||
if (!cipso_v4_cache_enabled || cipso_v4_cache_bucketsize <= 0)
|
||||
if (!READ_ONCE(cipso_v4_cache_enabled) || bkt_size <= 0)
|
||||
return 0;
|
||||
|
||||
cipso_ptr_len = cipso_ptr[1];
|
||||
@@ -322,7 +323,7 @@ int cipso_v4_cache_add(const unsigned char *cipso_ptr,
|
||||
|
||||
bkt = entry->hash & (CIPSO_V4_CACHE_BUCKETS - 1);
|
||||
spin_lock_bh(&cipso_v4_cache[bkt].lock);
|
||||
if (cipso_v4_cache[bkt].size < cipso_v4_cache_bucketsize) {
|
||||
if (cipso_v4_cache[bkt].size < bkt_size) {
|
||||
list_add(&entry->list, &cipso_v4_cache[bkt].list);
|
||||
cipso_v4_cache[bkt].size += 1;
|
||||
} else {
|
||||
@@ -1199,7 +1200,8 @@ static int cipso_v4_gentag_rbm(const struct cipso_v4_doi *doi_def,
|
||||
/* This will send packets using the "optimized" format when
|
||||
* possible as specified in section 3.4.2.6 of the
|
||||
* CIPSO draft. */
|
||||
if (cipso_v4_rbm_optfmt && ret_val > 0 && ret_val <= 10)
|
||||
if (READ_ONCE(cipso_v4_rbm_optfmt) && ret_val > 0 &&
|
||||
ret_val <= 10)
|
||||
tag_len = 14;
|
||||
else
|
||||
tag_len = 4 + ret_val;
|
||||
@@ -1603,7 +1605,7 @@ int cipso_v4_validate(const struct sk_buff *skb, unsigned char **option)
|
||||
* all the CIPSO validations here but it doesn't
|
||||
* really specify _exactly_ what we need to validate
|
||||
* ... so, just make it a sysctl tunable. */
|
||||
if (cipso_v4_rbm_strictvalid) {
|
||||
if (READ_ONCE(cipso_v4_rbm_strictvalid)) {
|
||||
if (cipso_v4_map_lvl_valid(doi_def,
|
||||
tag[3]) < 0) {
|
||||
err_offset = opt_iter + 3;
|
||||
|
||||
@@ -1230,7 +1230,7 @@ static int fib_check_nh_nongw(struct net *net, struct fib_nh *nh,
|
||||
|
||||
nh->fib_nh_dev = in_dev->dev;
|
||||
dev_hold_track(nh->fib_nh_dev, &nh->fib_nh_dev_tracker, GFP_ATOMIC);
|
||||
nh->fib_nh_scope = RT_SCOPE_HOST;
|
||||
nh->fib_nh_scope = RT_SCOPE_LINK;
|
||||
if (!netif_carrier_ok(nh->fib_nh_dev))
|
||||
nh->fib_nh_flags |= RTNH_F_LINKDOWN;
|
||||
err = 0;
|
||||
@@ -1811,7 +1811,7 @@ int fib_dump_info(struct sk_buff *skb, u32 portid, u32 seq, int event,
|
||||
goto nla_put_failure;
|
||||
if (nexthop_is_blackhole(fi->nh))
|
||||
rtm->rtm_type = RTN_BLACKHOLE;
|
||||
if (!fi->fib_net->ipv4.sysctl_nexthop_compat_mode)
|
||||
if (!READ_ONCE(fi->fib_net->ipv4.sysctl_nexthop_compat_mode))
|
||||
goto offload;
|
||||
}
|
||||
|
||||
|
||||
@@ -498,7 +498,7 @@ static void tnode_free(struct key_vector *tn)
|
||||
tn = container_of(head, struct tnode, rcu)->kv;
|
||||
}
|
||||
|
||||
if (tnode_free_size >= sysctl_fib_sync_mem) {
|
||||
if (tnode_free_size >= READ_ONCE(sysctl_fib_sync_mem)) {
|
||||
tnode_free_size = 0;
|
||||
synchronize_rcu();
|
||||
}
|
||||
|
||||
@@ -253,11 +253,12 @@ bool icmp_global_allow(void)
|
||||
spin_lock(&icmp_global.lock);
|
||||
delta = min_t(u32, now - icmp_global.stamp, HZ);
|
||||
if (delta >= HZ / 50) {
|
||||
incr = sysctl_icmp_msgs_per_sec * delta / HZ ;
|
||||
incr = READ_ONCE(sysctl_icmp_msgs_per_sec) * delta / HZ;
|
||||
if (incr)
|
||||
WRITE_ONCE(icmp_global.stamp, now);
|
||||
}
|
||||
credit = min_t(u32, icmp_global.credit + incr, sysctl_icmp_msgs_burst);
|
||||
credit = min_t(u32, icmp_global.credit + incr,
|
||||
READ_ONCE(sysctl_icmp_msgs_burst));
|
||||
if (credit) {
|
||||
/* We want to use a credit of one in average, but need to randomize
|
||||
* it for security reasons.
|
||||
@@ -281,7 +282,7 @@ static bool icmpv4_mask_allow(struct net *net, int type, int code)
|
||||
return true;
|
||||
|
||||
/* Limit if icmp type is enabled in ratemask. */
|
||||
if (!((1 << type) & net->ipv4.sysctl_icmp_ratemask))
|
||||
if (!((1 << type) & READ_ONCE(net->ipv4.sysctl_icmp_ratemask)))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
@@ -319,7 +320,8 @@ static bool icmpv4_xrlim_allow(struct net *net, struct rtable *rt,
|
||||
|
||||
vif = l3mdev_master_ifindex(dst->dev);
|
||||
peer = inet_getpeer_v4(net->ipv4.peers, fl4->daddr, vif, 1);
|
||||
rc = inet_peer_xrlim_allow(peer, net->ipv4.sysctl_icmp_ratelimit);
|
||||
rc = inet_peer_xrlim_allow(peer,
|
||||
READ_ONCE(net->ipv4.sysctl_icmp_ratelimit));
|
||||
if (peer)
|
||||
inet_putpeer(peer);
|
||||
out:
|
||||
@@ -692,7 +694,7 @@ void __icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info,
|
||||
|
||||
rcu_read_lock();
|
||||
if (rt_is_input_route(rt) &&
|
||||
net->ipv4.sysctl_icmp_errors_use_inbound_ifaddr)
|
||||
READ_ONCE(net->ipv4.sysctl_icmp_errors_use_inbound_ifaddr))
|
||||
dev = dev_get_by_index_rcu(net, inet_iif(skb_in));
|
||||
|
||||
if (dev)
|
||||
@@ -932,7 +934,7 @@ static enum skb_drop_reason icmp_unreach(struct sk_buff *skb)
|
||||
* get the other vendor to fix their kit.
|
||||
*/
|
||||
|
||||
if (!net->ipv4.sysctl_icmp_ignore_bogus_error_responses &&
|
||||
if (!READ_ONCE(net->ipv4.sysctl_icmp_ignore_bogus_error_responses) &&
|
||||
inet_addr_type_dev_table(net, skb->dev, iph->daddr) == RTN_BROADCAST) {
|
||||
net_warn_ratelimited("%pI4 sent an invalid ICMP type %u, code %u error to a broadcast: %pI4 on %s\n",
|
||||
&ip_hdr(skb)->saddr,
|
||||
@@ -992,7 +994,7 @@ static enum skb_drop_reason icmp_echo(struct sk_buff *skb)
|
||||
|
||||
net = dev_net(skb_dst(skb)->dev);
|
||||
/* should there be an ICMP stat for ignored echos? */
|
||||
if (net->ipv4.sysctl_icmp_echo_ignore_all)
|
||||
if (READ_ONCE(net->ipv4.sysctl_icmp_echo_ignore_all))
|
||||
return SKB_NOT_DROPPED_YET;
|
||||
|
||||
icmp_param.data.icmph = *icmp_hdr(skb);
|
||||
@@ -1027,7 +1029,7 @@ bool icmp_build_probe(struct sk_buff *skb, struct icmphdr *icmphdr)
|
||||
u16 ident_len;
|
||||
u8 status;
|
||||
|
||||
if (!net->ipv4.sysctl_icmp_echo_enable_probe)
|
||||
if (!READ_ONCE(net->ipv4.sysctl_icmp_echo_enable_probe))
|
||||
return false;
|
||||
|
||||
/* We currently only support probing interfaces on the proxy node
|
||||
@@ -1248,7 +1250,7 @@ int icmp_rcv(struct sk_buff *skb)
|
||||
*/
|
||||
if ((icmph->type == ICMP_ECHO ||
|
||||
icmph->type == ICMP_TIMESTAMP) &&
|
||||
net->ipv4.sysctl_icmp_echo_ignore_broadcasts) {
|
||||
READ_ONCE(net->ipv4.sysctl_icmp_echo_ignore_broadcasts)) {
|
||||
reason = SKB_DROP_REASON_INVALID_PROTO;
|
||||
goto error;
|
||||
}
|
||||
|
||||
@@ -156,7 +156,8 @@ struct inet_timewait_sock *inet_twsk_alloc(const struct sock *sk,
|
||||
{
|
||||
struct inet_timewait_sock *tw;
|
||||
|
||||
if (refcount_read(&dr->tw_refcount) - 1 >= dr->sysctl_max_tw_buckets)
|
||||
if (refcount_read(&dr->tw_refcount) - 1 >=
|
||||
READ_ONCE(dr->sysctl_max_tw_buckets))
|
||||
return NULL;
|
||||
|
||||
tw = kmem_cache_alloc(sk->sk_prot_creator->twsk_prot->twsk_slab,
|
||||
|
||||
@@ -141,16 +141,20 @@ static void inet_peer_gc(struct inet_peer_base *base,
|
||||
struct inet_peer *gc_stack[],
|
||||
unsigned int gc_cnt)
|
||||
{
|
||||
int peer_threshold, peer_maxttl, peer_minttl;
|
||||
struct inet_peer *p;
|
||||
__u32 delta, ttl;
|
||||
int i;
|
||||
|
||||
if (base->total >= inet_peer_threshold)
|
||||
peer_threshold = READ_ONCE(inet_peer_threshold);
|
||||
peer_maxttl = READ_ONCE(inet_peer_maxttl);
|
||||
peer_minttl = READ_ONCE(inet_peer_minttl);
|
||||
|
||||
if (base->total >= peer_threshold)
|
||||
ttl = 0; /* be aggressive */
|
||||
else
|
||||
ttl = inet_peer_maxttl
|
||||
- (inet_peer_maxttl - inet_peer_minttl) / HZ *
|
||||
base->total / inet_peer_threshold * HZ;
|
||||
ttl = peer_maxttl - (peer_maxttl - peer_minttl) / HZ *
|
||||
base->total / peer_threshold * HZ;
|
||||
for (i = 0; i < gc_cnt; i++) {
|
||||
p = gc_stack[i];
|
||||
|
||||
|
||||
@@ -1858,7 +1858,7 @@ static void __remove_nexthop_fib(struct net *net, struct nexthop *nh)
|
||||
/* __ip6_del_rt does a release, so do a hold here */
|
||||
fib6_info_hold(f6i);
|
||||
ipv6_stub->ip6_del_rt(net, f6i,
|
||||
!net->ipv4.sysctl_nexthop_compat_mode);
|
||||
!READ_ONCE(net->ipv4.sysctl_nexthop_compat_mode));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2361,7 +2361,8 @@ out:
|
||||
if (!rc) {
|
||||
nh_base_seq_inc(net);
|
||||
nexthop_notify(RTM_NEWNEXTHOP, new_nh, &cfg->nlinfo);
|
||||
if (replace_notify && net->ipv4.sysctl_nexthop_compat_mode)
|
||||
if (replace_notify &&
|
||||
READ_ONCE(net->ipv4.sysctl_nexthop_compat_mode))
|
||||
nexthop_replace_notify(net, new_nh, &cfg->nlinfo);
|
||||
}
|
||||
|
||||
|
||||
@@ -273,7 +273,7 @@ bool cookie_ecn_ok(const struct tcp_options_received *tcp_opt,
|
||||
if (!ecn_ok)
|
||||
return false;
|
||||
|
||||
if (net->ipv4.sysctl_tcp_ecn)
|
||||
if (READ_ONCE(net->ipv4.sysctl_tcp_ecn))
|
||||
return true;
|
||||
|
||||
return dst_feature(dst, RTAX_FEATURE_ECN);
|
||||
|
||||
@@ -599,6 +599,8 @@ static struct ctl_table ipv4_net_table[] = {
|
||||
.maxlen = sizeof(u8),
|
||||
.mode = 0644,
|
||||
.proc_handler = proc_dou8vec_minmax,
|
||||
.extra1 = SYSCTL_ZERO,
|
||||
.extra2 = SYSCTL_ONE
|
||||
},
|
||||
{
|
||||
.procname = "icmp_echo_enable_probe",
|
||||
@@ -615,6 +617,8 @@ static struct ctl_table ipv4_net_table[] = {
|
||||
.maxlen = sizeof(u8),
|
||||
.mode = 0644,
|
||||
.proc_handler = proc_dou8vec_minmax,
|
||||
.extra1 = SYSCTL_ZERO,
|
||||
.extra2 = SYSCTL_ONE
|
||||
},
|
||||
{
|
||||
.procname = "icmp_ignore_bogus_error_responses",
|
||||
@@ -622,6 +626,8 @@ static struct ctl_table ipv4_net_table[] = {
|
||||
.maxlen = sizeof(u8),
|
||||
.mode = 0644,
|
||||
.proc_handler = proc_dou8vec_minmax,
|
||||
.extra1 = SYSCTL_ZERO,
|
||||
.extra2 = SYSCTL_ONE
|
||||
},
|
||||
{
|
||||
.procname = "icmp_errors_use_inbound_ifaddr",
|
||||
@@ -629,6 +635,8 @@ static struct ctl_table ipv4_net_table[] = {
|
||||
.maxlen = sizeof(u8),
|
||||
.mode = 0644,
|
||||
.proc_handler = proc_dou8vec_minmax,
|
||||
.extra1 = SYSCTL_ZERO,
|
||||
.extra2 = SYSCTL_ONE
|
||||
},
|
||||
{
|
||||
.procname = "icmp_ratelimit",
|
||||
@@ -668,6 +676,8 @@ static struct ctl_table ipv4_net_table[] = {
|
||||
.maxlen = sizeof(u8),
|
||||
.mode = 0644,
|
||||
.proc_handler = proc_dou8vec_minmax,
|
||||
.extra1 = SYSCTL_ZERO,
|
||||
.extra2 = SYSCTL_TWO,
|
||||
},
|
||||
{
|
||||
.procname = "tcp_ecn_fallback",
|
||||
@@ -675,6 +685,8 @@ static struct ctl_table ipv4_net_table[] = {
|
||||
.maxlen = sizeof(u8),
|
||||
.mode = 0644,
|
||||
.proc_handler = proc_dou8vec_minmax,
|
||||
.extra1 = SYSCTL_ZERO,
|
||||
.extra2 = SYSCTL_ONE,
|
||||
},
|
||||
{
|
||||
.procname = "ip_dynaddr",
|
||||
|
||||
@@ -2715,7 +2715,8 @@ static void tcp_orphan_update(struct timer_list *unused)
|
||||
|
||||
static bool tcp_too_many_orphans(int shift)
|
||||
{
|
||||
return READ_ONCE(tcp_orphan_cache) << shift > sysctl_tcp_max_orphans;
|
||||
return READ_ONCE(tcp_orphan_cache) << shift >
|
||||
READ_ONCE(sysctl_tcp_max_orphans);
|
||||
}
|
||||
|
||||
bool tcp_check_oom(struct sock *sk, int shift)
|
||||
|
||||
@@ -6730,7 +6730,7 @@ static void tcp_ecn_create_request(struct request_sock *req,
|
||||
|
||||
ect = !INET_ECN_is_not_ect(TCP_SKB_CB(skb)->ip_dsfield);
|
||||
ecn_ok_dst = dst_feature(dst, DST_FEATURE_ECN_MASK);
|
||||
ecn_ok = net->ipv4.sysctl_tcp_ecn || ecn_ok_dst;
|
||||
ecn_ok = READ_ONCE(net->ipv4.sysctl_tcp_ecn) || ecn_ok_dst;
|
||||
|
||||
if (((!ect || th->res1) && ecn_ok) || tcp_ca_needs_ecn(listen_sk) ||
|
||||
(ecn_ok_dst & DST_FEATURE_ECN_CA) ||
|
||||
|
||||
@@ -324,7 +324,7 @@ static void tcp_ecn_send_syn(struct sock *sk, struct sk_buff *skb)
|
||||
{
|
||||
struct tcp_sock *tp = tcp_sk(sk);
|
||||
bool bpf_needs_ecn = tcp_bpf_ca_needs_ecn(sk);
|
||||
bool use_ecn = sock_net(sk)->ipv4.sysctl_tcp_ecn == 1 ||
|
||||
bool use_ecn = READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_ecn) == 1 ||
|
||||
tcp_ca_needs_ecn(sk) || bpf_needs_ecn;
|
||||
|
||||
if (!use_ecn) {
|
||||
@@ -346,7 +346,7 @@ static void tcp_ecn_send_syn(struct sock *sk, struct sk_buff *skb)
|
||||
|
||||
static void tcp_ecn_clear_syn(struct sock *sk, struct sk_buff *skb)
|
||||
{
|
||||
if (sock_net(sk)->ipv4.sysctl_tcp_ecn_fallback)
|
||||
if (READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_ecn_fallback))
|
||||
/* tp->ecn_flags are cleared at a later point in time when
|
||||
* SYN ACK is ultimatively being received.
|
||||
*/
|
||||
|
||||
@@ -925,7 +925,7 @@ static int icmpv6_rcv(struct sk_buff *skb)
|
||||
break;
|
||||
case ICMPV6_EXT_ECHO_REQUEST:
|
||||
if (!net->ipv6.sysctl.icmpv6_echo_ignore_all &&
|
||||
net->ipv4.sysctl_icmp_echo_enable_probe)
|
||||
READ_ONCE(net->ipv4.sysctl_icmp_echo_enable_probe))
|
||||
icmpv6_echo_reply(skb);
|
||||
break;
|
||||
|
||||
|
||||
@@ -5718,7 +5718,7 @@ static int rt6_fill_node(struct net *net, struct sk_buff *skb,
|
||||
if (nexthop_is_blackhole(rt->nh))
|
||||
rtm->rtm_type = RTN_BLACKHOLE;
|
||||
|
||||
if (net->ipv4.sysctl_nexthop_compat_mode &&
|
||||
if (READ_ONCE(net->ipv4.sysctl_nexthop_compat_mode) &&
|
||||
rt6_fill_node_nexthop(skb, rt->nh, &nh_flags) < 0)
|
||||
goto nla_put_failure;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user