mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
Merge d321732352 ("netfilter: nft_payload: sanitize offset and length before calling skb_checksum()") into android14-6.1-lts
Steps on the way to 6.1.116 Change-Id: If62fadaf5fbd6d9663368509dd05b285a930f6d5 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
@@ -313,8 +313,6 @@ extern inline pte_t mk_swap_pte(unsigned long type, unsigned long offset)
|
||||
#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
|
||||
#define __swp_entry_to_pte(x) ((pte_t) { (x).val })
|
||||
|
||||
#define kern_addr_valid(addr) (1)
|
||||
|
||||
#define pte_ERROR(e) \
|
||||
printk("%s:%d: bad pte %016lx.\n", __FILE__, __LINE__, pte_val(e))
|
||||
#define pmd_ERROR(e) \
|
||||
|
||||
@@ -120,8 +120,6 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address,
|
||||
#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
|
||||
#define __swp_entry_to_pte(x) ((pte_t) { (x).val })
|
||||
|
||||
#define kern_addr_valid(addr) (1)
|
||||
|
||||
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
|
||||
#include <asm/hugepage.h>
|
||||
#endif
|
||||
|
||||
@@ -21,8 +21,6 @@
|
||||
#define pgd_none(pgd) (0)
|
||||
#define pgd_bad(pgd) (0)
|
||||
#define pgd_clear(pgdp)
|
||||
#define kern_addr_valid(addr) (1)
|
||||
/* FIXME */
|
||||
/*
|
||||
* PMD_SHIFT determines the size of the area a second-level page table can map
|
||||
* PGDIR_SHIFT determines what a third-level page table entry can map
|
||||
|
||||
@@ -300,10 +300,6 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
|
||||
*/
|
||||
#define MAX_SWAPFILES_CHECK() BUILD_BUG_ON(MAX_SWAPFILES_SHIFT > __SWP_TYPE_BITS)
|
||||
|
||||
/* Needs to be defined here and not in linux/mm.h, as it is arch dependent */
|
||||
/* FIXME: this is not correct */
|
||||
#define kern_addr_valid(addr) (1)
|
||||
|
||||
/*
|
||||
* We provide our own arch_get_unmapped_area to cope with VIPT caches.
|
||||
*/
|
||||
|
||||
@@ -1034,8 +1034,6 @@ static inline pmd_t pmdp_establish(struct vm_area_struct *vma,
|
||||
*/
|
||||
#define MAX_SWAPFILES_CHECK() BUILD_BUG_ON(MAX_SWAPFILES_SHIFT > __SWP_TYPE_BITS)
|
||||
|
||||
extern int kern_addr_valid(unsigned long addr);
|
||||
|
||||
#ifdef CONFIG_ARM64_MTE
|
||||
|
||||
#define __HAVE_ARCH_PREPARE_TO_SWAP
|
||||
|
||||
@@ -875,53 +875,6 @@ void __init paging_init(void)
|
||||
create_idmap();
|
||||
}
|
||||
|
||||
/*
|
||||
* Check whether a kernel address is valid (derived from arch/x86/).
|
||||
*/
|
||||
int kern_addr_valid(unsigned long addr)
|
||||
{
|
||||
pgd_t *pgdp;
|
||||
p4d_t *p4dp;
|
||||
pud_t *pudp, pud;
|
||||
pmd_t *pmdp, pmd;
|
||||
pte_t *ptep, pte;
|
||||
|
||||
addr = arch_kasan_reset_tag(addr);
|
||||
if ((((long)addr) >> VA_BITS) != -1UL)
|
||||
return 0;
|
||||
|
||||
pgdp = pgd_offset_k(addr);
|
||||
if (pgd_none(READ_ONCE(*pgdp)))
|
||||
return 0;
|
||||
|
||||
p4dp = p4d_offset(pgdp, addr);
|
||||
if (p4d_none(READ_ONCE(*p4dp)))
|
||||
return 0;
|
||||
|
||||
pudp = pud_offset(p4dp, addr);
|
||||
pud = READ_ONCE(*pudp);
|
||||
if (pud_none(pud))
|
||||
return 0;
|
||||
|
||||
if (pud_sect(pud))
|
||||
return pfn_valid(pud_pfn(pud));
|
||||
|
||||
pmdp = pmd_offset(pudp, addr);
|
||||
pmd = READ_ONCE(*pmdp);
|
||||
if (pmd_none(pmd))
|
||||
return 0;
|
||||
|
||||
if (pmd_sect(pmd))
|
||||
return pfn_valid(pmd_pfn(pmd));
|
||||
|
||||
ptep = pte_offset_kernel(pmdp, addr);
|
||||
pte = READ_ONCE(*ptep);
|
||||
if (pte_none(pte))
|
||||
return 0;
|
||||
|
||||
return pfn_valid(pte_pfn(pte));
|
||||
}
|
||||
|
||||
#ifdef CONFIG_MEMORY_HOTPLUG
|
||||
static void free_hotplug_page_range(struct page *page, size_t size,
|
||||
struct vmem_altmap *altmap)
|
||||
|
||||
@@ -221,8 +221,7 @@ void __kernel_map_pages(struct page *page, int numpages, int enable)
|
||||
|
||||
/*
|
||||
* This function is used to determine if a linear map page has been marked as
|
||||
* not-valid. Walk the page table and check the PTE_VALID bit. This is based
|
||||
* on kern_addr_valid(), which almost does what we need.
|
||||
* not-valid. Walk the page table and check the PTE_VALID bit.
|
||||
*
|
||||
* Because this is only called on the kernel linear map, p?d_sect() implies
|
||||
* p?d_present(). When debug_pagealloc is enabled, sections mappings are
|
||||
|
||||
@@ -249,9 +249,6 @@ extern void paging_init(void);
|
||||
void update_mmu_cache(struct vm_area_struct *vma, unsigned long address,
|
||||
pte_t *pte);
|
||||
|
||||
/* Needs to be defined here and not in linux/mm.h, as it is arch dependent */
|
||||
#define kern_addr_valid(addr) (1)
|
||||
|
||||
#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
|
||||
remap_pfn_range(vma, vaddr, pfn, size, prot)
|
||||
|
||||
|
||||
@@ -131,13 +131,6 @@ static inline void clear_page(void *page)
|
||||
|
||||
#define page_to_virt(page) __va(page_to_phys(page))
|
||||
|
||||
/*
|
||||
* For port to Hexagon Virtual Machine, MAYBE we check for attempts
|
||||
* to reference reserved HVM space, but in any case, the VM will be
|
||||
* protected.
|
||||
*/
|
||||
#define kern_addr_valid(addr) (1)
|
||||
|
||||
#include <asm/mem-layout.h>
|
||||
#include <asm-generic/memory_model.h>
|
||||
/* XXX Todo: implement assembly-optimized version of getorder. */
|
||||
|
||||
@@ -181,22 +181,6 @@ ia64_phys_addr_valid (unsigned long addr)
|
||||
return (addr & (local_cpu_data->unimpl_pa_mask)) == 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* kern_addr_valid(ADDR) tests if ADDR is pointing to valid kernel
|
||||
* memory. For the return value to be meaningful, ADDR must be >=
|
||||
* PAGE_OFFSET. This operation can be relatively expensive (e.g.,
|
||||
* require a hash-, or multi-level tree-lookup or something of that
|
||||
* sort) but it guarantees to return TRUE only if accessing the page
|
||||
* at that address does not cause an error. Note that there may be
|
||||
* addresses for which kern_addr_valid() returns FALSE even though an
|
||||
* access would not cause an error (e.g., this is typically true for
|
||||
* memory mapped I/O regions.
|
||||
*
|
||||
* XXX Need to implement this for IA-64.
|
||||
*/
|
||||
#define kern_addr_valid(addr) (1)
|
||||
|
||||
|
||||
/*
|
||||
* Now come the defines and routines to manage and access the three-level
|
||||
* page table.
|
||||
|
||||
@@ -425,8 +425,6 @@ static inline void update_mmu_cache_pmd(struct vm_area_struct *vma,
|
||||
__update_tlb(vma, address, (pte_t *)pmdp);
|
||||
}
|
||||
|
||||
#define kern_addr_valid(addr) (1)
|
||||
|
||||
static inline unsigned long pmd_pfn(pmd_t pmd)
|
||||
{
|
||||
return (pmd_val(pmd) & _PFN_MASK) >> _PFN_SHIFT;
|
||||
|
||||
@@ -145,8 +145,6 @@ static inline void update_mmu_cache(struct vm_area_struct *vma,
|
||||
|
||||
#endif /* !__ASSEMBLY__ */
|
||||
|
||||
#define kern_addr_valid(addr) (1)
|
||||
|
||||
/* MMU-specific headers */
|
||||
|
||||
#ifdef CONFIG_SUN3
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
#define pgd_none(pgd) (0)
|
||||
#define pgd_bad(pgd) (0)
|
||||
#define pgd_clear(pgdp)
|
||||
#define kern_addr_valid(addr) (1)
|
||||
#define pmd_offset(a, b) ((void *)0)
|
||||
|
||||
#define PAGE_NONE __pgprot(0)
|
||||
|
||||
@@ -416,9 +416,6 @@ extern unsigned long iopa(unsigned long addr);
|
||||
#define IOMAP_NOCACHE_NONSER 2
|
||||
#define IOMAP_NO_COPYBACK 3
|
||||
|
||||
/* Needs to be defined here and not in linux/mm.h, as it is arch dependent */
|
||||
#define kern_addr_valid(addr) (1)
|
||||
|
||||
void do_page_fault(struct pt_regs *regs, unsigned long address,
|
||||
unsigned long error_code);
|
||||
|
||||
|
||||
@@ -550,8 +550,6 @@ static inline void update_mmu_cache_pmd(struct vm_area_struct *vma,
|
||||
__update_tlb(vma, address, pte);
|
||||
}
|
||||
|
||||
#define kern_addr_valid(addr) (1)
|
||||
|
||||
/*
|
||||
* Allow physical addresses to be fixed up to help 36-bit peripherals.
|
||||
*/
|
||||
|
||||
@@ -249,8 +249,6 @@ static inline unsigned long pmd_page_vaddr(pmd_t pmd)
|
||||
#define __swp_entry_to_pte(swp) ((pte_t) { (swp).val })
|
||||
#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
|
||||
|
||||
#define kern_addr_valid(addr) (1)
|
||||
|
||||
extern void __init paging_init(void);
|
||||
extern void __init mmu_init(void);
|
||||
|
||||
|
||||
@@ -395,8 +395,6 @@ static inline void update_mmu_cache(struct vm_area_struct *vma,
|
||||
#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
|
||||
#define __swp_entry_to_pte(x) ((pte_t) { (x).val })
|
||||
|
||||
#define kern_addr_valid(addr) (1)
|
||||
|
||||
typedef pte_t *pte_addr_t;
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
@@ -23,21 +23,6 @@
|
||||
#include <asm/processor.h>
|
||||
#include <asm/cache.h>
|
||||
|
||||
/*
|
||||
* kern_addr_valid(ADDR) tests if ADDR is pointing to valid kernel
|
||||
* memory. For the return value to be meaningful, ADDR must be >=
|
||||
* PAGE_OFFSET. This operation can be relatively expensive (e.g.,
|
||||
* require a hash-, or multi-level tree-lookup or something of that
|
||||
* sort) but it guarantees to return TRUE only if accessing the page
|
||||
* at that address does not cause an error. Note that there may be
|
||||
* addresses for which kern_addr_valid() returns FALSE even though an
|
||||
* access would not cause an error (e.g., this is typically true for
|
||||
* memory mapped I/O regions.
|
||||
*
|
||||
* XXX Need to implement this for parisc.
|
||||
*/
|
||||
#define kern_addr_valid(addr) (1)
|
||||
|
||||
/* This is for the serialization of PxTLB broadcasts. At least on the N class
|
||||
* systems, only one PxTLB inter processor broadcast can be active at any one
|
||||
* time on the Merced bus. */
|
||||
|
||||
@@ -81,13 +81,6 @@ void poking_init(void);
|
||||
extern unsigned long ioremap_bot;
|
||||
extern const pgprot_t protection_map[16];
|
||||
|
||||
/*
|
||||
* kern_addr_valid is intended to indicate whether an address is a valid
|
||||
* kernel address. Most 32-bit archs define it as always true (like this)
|
||||
* but most 64-bit archs actually perform a test. What should we do here?
|
||||
*/
|
||||
#define kern_addr_valid(addr) (1)
|
||||
|
||||
#ifndef CONFIG_TRANSPARENT_HUGEPAGE
|
||||
#define pmd_large(pmd) 0
|
||||
#endif
|
||||
|
||||
@@ -805,8 +805,6 @@ static inline pmd_t pmdp_establish(struct vm_area_struct *vma,
|
||||
|
||||
#endif /* !CONFIG_MMU */
|
||||
|
||||
#define kern_addr_valid(addr) (1) /* FIXME */
|
||||
|
||||
extern char _start[];
|
||||
extern void *_dtb_early_va;
|
||||
extern uintptr_t _dtb_early_pa;
|
||||
|
||||
@@ -16,8 +16,10 @@
|
||||
#include <asm/pci_io.h>
|
||||
|
||||
#define xlate_dev_mem_ptr xlate_dev_mem_ptr
|
||||
#define kc_xlate_dev_mem_ptr xlate_dev_mem_ptr
|
||||
void *xlate_dev_mem_ptr(phys_addr_t phys);
|
||||
#define unxlate_dev_mem_ptr unxlate_dev_mem_ptr
|
||||
#define kc_unxlate_dev_mem_ptr unxlate_dev_mem_ptr
|
||||
void unxlate_dev_mem_ptr(phys_addr_t phys, void *addr);
|
||||
|
||||
#define IO_SPACE_LIMIT 0
|
||||
|
||||
@@ -1776,8 +1776,6 @@ static inline swp_entry_t __swp_entry(unsigned long type, unsigned long offset)
|
||||
#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
|
||||
#define __swp_entry_to_pte(x) ((pte_t) { (x).val })
|
||||
|
||||
#define kern_addr_valid(addr) (1)
|
||||
|
||||
extern int vmem_add_mapping(unsigned long start, unsigned long size);
|
||||
extern void vmem_remove_mapping(unsigned long start, unsigned long size);
|
||||
extern int __vmem_map_4k_page(unsigned long addr, unsigned long phys, pgprot_t prot, bool alloc);
|
||||
|
||||
@@ -92,8 +92,6 @@ static inline unsigned long phys_addr_mask(void)
|
||||
|
||||
typedef pte_t *pte_addr_t;
|
||||
|
||||
#define kern_addr_valid(addr) (1)
|
||||
|
||||
#define pte_pfn(x) ((unsigned long)(((x).pte_low >> PAGE_SHIFT)))
|
||||
|
||||
struct vm_area_struct;
|
||||
|
||||
@@ -368,12 +368,6 @@ __get_iospace (unsigned long addr)
|
||||
}
|
||||
}
|
||||
|
||||
extern unsigned long *sparc_valid_addr_bitmap;
|
||||
|
||||
/* Needs to be defined here and not in linux/mm.h, as it is arch dependent */
|
||||
#define kern_addr_valid(addr) \
|
||||
(test_bit(__pa((unsigned long)(addr))>>20, sparc_valid_addr_bitmap))
|
||||
|
||||
/*
|
||||
* For sparc32&64, the pfn in io_remap_pfn_range() carries <iospace> in
|
||||
* its high 4 bits. These macros/functions put it there or get it from there.
|
||||
|
||||
@@ -37,8 +37,7 @@
|
||||
|
||||
#include "mm_32.h"
|
||||
|
||||
unsigned long *sparc_valid_addr_bitmap;
|
||||
EXPORT_SYMBOL(sparc_valid_addr_bitmap);
|
||||
static unsigned long *sparc_valid_addr_bitmap;
|
||||
|
||||
unsigned long phys_base;
|
||||
EXPORT_SYMBOL(phys_base);
|
||||
|
||||
@@ -1667,7 +1667,6 @@ bool kern_addr_valid(unsigned long addr)
|
||||
|
||||
return pfn_valid(pte_pfn(*pte));
|
||||
}
|
||||
EXPORT_SYMBOL(kern_addr_valid);
|
||||
|
||||
static unsigned long __ref kernel_map_hugepud(unsigned long vstart,
|
||||
unsigned long vend,
|
||||
|
||||
@@ -298,8 +298,6 @@ extern pte_t *virt_to_pte(struct mm_struct *mm, unsigned long addr);
|
||||
((swp_entry_t) { pte_val(pte_mkuptodate(pte)) })
|
||||
#define __swp_entry_to_pte(x) ((pte_t) { (x).val })
|
||||
|
||||
#define kern_addr_valid(addr) (1)
|
||||
|
||||
/* Clear a kernel PTE and flush it from the TLB */
|
||||
#define kpte_clear_flush(ptep, vaddr) \
|
||||
do { \
|
||||
|
||||
@@ -47,15 +47,6 @@ do { \
|
||||
|
||||
#endif /* !__ASSEMBLY__ */
|
||||
|
||||
/*
|
||||
* kern_addr_valid() is (1) for FLATMEM and (0) for SPARSEMEM
|
||||
*/
|
||||
#ifdef CONFIG_FLATMEM
|
||||
#define kern_addr_valid(addr) (1)
|
||||
#else
|
||||
#define kern_addr_valid(kaddr) (0)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This is used to calculate the .brk reservation for initial pagetables.
|
||||
* Enough space is reserved to allocate pagetables sufficient to cover all
|
||||
|
||||
@@ -240,7 +240,6 @@ static inline void native_pgd_clear(pgd_t *pgd)
|
||||
#define __swp_entry_to_pte(x) (__pte((x).val))
|
||||
#define __swp_entry_to_pmd(x) (__pmd((x).val))
|
||||
|
||||
extern int kern_addr_valid(unsigned long addr);
|
||||
extern void cleanup_highmap(void);
|
||||
|
||||
#define HAVE_ARCH_UNMAPPED_AREA
|
||||
|
||||
@@ -1420,47 +1420,6 @@ void mark_rodata_ro(void)
|
||||
debug_checkwx();
|
||||
}
|
||||
|
||||
int kern_addr_valid(unsigned long addr)
|
||||
{
|
||||
unsigned long above = ((long)addr) >> __VIRTUAL_MASK_SHIFT;
|
||||
pgd_t *pgd;
|
||||
p4d_t *p4d;
|
||||
pud_t *pud;
|
||||
pmd_t *pmd;
|
||||
pte_t *pte;
|
||||
|
||||
if (above != 0 && above != -1UL)
|
||||
return 0;
|
||||
|
||||
pgd = pgd_offset_k(addr);
|
||||
if (pgd_none(*pgd))
|
||||
return 0;
|
||||
|
||||
p4d = p4d_offset(pgd, addr);
|
||||
if (!p4d_present(*p4d))
|
||||
return 0;
|
||||
|
||||
pud = pud_offset(p4d, addr);
|
||||
if (!pud_present(*pud))
|
||||
return 0;
|
||||
|
||||
if (pud_large(*pud))
|
||||
return pfn_valid(pud_pfn(*pud));
|
||||
|
||||
pmd = pmd_offset(pud, addr);
|
||||
if (!pmd_present(*pmd))
|
||||
return 0;
|
||||
|
||||
if (pmd_large(*pmd))
|
||||
return pfn_valid(pmd_pfn(*pmd));
|
||||
|
||||
pte = pte_offset_kernel(pmd, addr);
|
||||
if (pte_none(*pte))
|
||||
return 0;
|
||||
|
||||
return pfn_valid(pte_pfn(*pte));
|
||||
}
|
||||
|
||||
/*
|
||||
* Block size is the minimum amount of memory which can be hotplugged or
|
||||
* hotremoved. It must be power of two and must be equal or larger than
|
||||
|
||||
@@ -386,8 +386,6 @@ ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
|
||||
|
||||
#else
|
||||
|
||||
#define kern_addr_valid(addr) (1)
|
||||
|
||||
extern void update_mmu_cache(struct vm_area_struct * vma,
|
||||
unsigned long address, pte_t *ptep);
|
||||
|
||||
|
||||
@@ -162,6 +162,7 @@ static int mtk_cpu_resources_init(struct platform_device *pdev,
|
||||
struct mtk_cpufreq_data *data;
|
||||
struct device *dev = &pdev->dev;
|
||||
struct resource *res;
|
||||
struct of_phandle_args args;
|
||||
void __iomem *base;
|
||||
int ret, i;
|
||||
int index;
|
||||
@@ -170,11 +171,14 @@ static int mtk_cpu_resources_init(struct platform_device *pdev,
|
||||
if (!data)
|
||||
return -ENOMEM;
|
||||
|
||||
index = of_perf_domain_get_sharing_cpumask(policy->cpu, "performance-domains",
|
||||
"#performance-domain-cells",
|
||||
policy->cpus);
|
||||
if (index < 0)
|
||||
return index;
|
||||
ret = of_perf_domain_get_sharing_cpumask(policy->cpu, "performance-domains",
|
||||
"#performance-domain-cells",
|
||||
policy->cpus, &args);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
index = args.args[0];
|
||||
of_node_put(args.np);
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, index);
|
||||
if (!res) {
|
||||
|
||||
@@ -1496,9 +1496,11 @@ int bnxt_qplib_destroy_qp(struct bnxt_qplib_res *res,
|
||||
u32 tbl_indx;
|
||||
int rc;
|
||||
|
||||
spin_lock_bh(&rcfw->tbl_lock);
|
||||
tbl_indx = map_qp_id_to_tbl_indx(qp->id, rcfw);
|
||||
rcfw->qp_tbl[tbl_indx].qp_id = BNXT_QPLIB_QP_ID_INVALID;
|
||||
rcfw->qp_tbl[tbl_indx].qp_handle = NULL;
|
||||
spin_unlock_bh(&rcfw->tbl_lock);
|
||||
|
||||
RCFW_CMD_PREP(req, DESTROY_QP, cmd_flags);
|
||||
|
||||
@@ -1506,8 +1508,10 @@ int bnxt_qplib_destroy_qp(struct bnxt_qplib_res *res,
|
||||
rc = bnxt_qplib_rcfw_send_message(rcfw, (void *)&req,
|
||||
(void *)&resp, NULL, 0);
|
||||
if (rc) {
|
||||
spin_lock_bh(&rcfw->tbl_lock);
|
||||
rcfw->qp_tbl[tbl_indx].qp_id = qp->id;
|
||||
rcfw->qp_tbl[tbl_indx].qp_handle = qp;
|
||||
spin_unlock_bh(&rcfw->tbl_lock);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
@@ -320,17 +320,21 @@ static int bnxt_qplib_process_qp_event(struct bnxt_qplib_rcfw *rcfw,
|
||||
case CREQ_QP_EVENT_EVENT_QP_ERROR_NOTIFICATION:
|
||||
err_event = (struct creq_qp_error_notification *)qp_event;
|
||||
qp_id = le32_to_cpu(err_event->xid);
|
||||
spin_lock(&rcfw->tbl_lock);
|
||||
tbl_indx = map_qp_id_to_tbl_indx(qp_id, rcfw);
|
||||
qp = rcfw->qp_tbl[tbl_indx].qp_handle;
|
||||
if (!qp) {
|
||||
spin_unlock(&rcfw->tbl_lock);
|
||||
break;
|
||||
}
|
||||
bnxt_qplib_mark_qp_error(qp);
|
||||
rc = rcfw->creq.aeq_handler(rcfw, qp_event, qp);
|
||||
spin_unlock(&rcfw->tbl_lock);
|
||||
dev_dbg(&pdev->dev, "Received QP error notification\n");
|
||||
dev_dbg(&pdev->dev,
|
||||
"qpid 0x%x, req_err=0x%x, resp_err=0x%x\n",
|
||||
qp_id, err_event->req_err_state_reason,
|
||||
err_event->res_err_state_reason);
|
||||
if (!qp)
|
||||
break;
|
||||
bnxt_qplib_mark_qp_error(qp);
|
||||
rc = rcfw->creq.aeq_handler(rcfw, qp_event, qp);
|
||||
break;
|
||||
default:
|
||||
/*
|
||||
@@ -629,6 +633,7 @@ int bnxt_qplib_alloc_rcfw_channel(struct bnxt_qplib_res *res,
|
||||
GFP_KERNEL);
|
||||
if (!rcfw->qp_tbl)
|
||||
goto fail;
|
||||
spin_lock_init(&rcfw->tbl_lock);
|
||||
|
||||
return 0;
|
||||
|
||||
|
||||
@@ -186,6 +186,8 @@ struct bnxt_qplib_rcfw {
|
||||
struct bnxt_qplib_crsqe *crsqe_tbl;
|
||||
int qp_tbl_size;
|
||||
struct bnxt_qplib_qp_node *qp_tbl;
|
||||
/* To synchronize the qp-handle hash table */
|
||||
spinlock_t tbl_lock;
|
||||
u64 oos_prev;
|
||||
u32 init_oos_stats;
|
||||
u32 cmdq_depth;
|
||||
|
||||
@@ -474,6 +474,7 @@ static const struct ib_device_ops c4iw_dev_ops = {
|
||||
.fill_res_cq_entry = c4iw_fill_res_cq_entry,
|
||||
.fill_res_cm_id_entry = c4iw_fill_res_cm_id_entry,
|
||||
.fill_res_mr_entry = c4iw_fill_res_mr_entry,
|
||||
.fill_res_qp_entry = c4iw_fill_res_qp_entry,
|
||||
.get_dev_fw_str = get_dev_fw_str,
|
||||
.get_dma_mr = c4iw_get_dma_mr,
|
||||
.get_hw_stats = c4iw_get_mib,
|
||||
|
||||
@@ -4187,14 +4187,14 @@ static int __mlx5_ib_modify_qp(struct ib_qp *ibqp,
|
||||
MLX5_SET(qpc, qpc, retry_count, attr->retry_cnt);
|
||||
|
||||
if (attr_mask & IB_QP_MAX_QP_RD_ATOMIC && attr->max_rd_atomic)
|
||||
MLX5_SET(qpc, qpc, log_sra_max, ilog2(attr->max_rd_atomic));
|
||||
MLX5_SET(qpc, qpc, log_sra_max, fls(attr->max_rd_atomic - 1));
|
||||
|
||||
if (attr_mask & IB_QP_SQ_PSN)
|
||||
MLX5_SET(qpc, qpc, next_send_psn, attr->sq_psn);
|
||||
|
||||
if (attr_mask & IB_QP_MAX_DEST_RD_ATOMIC && attr->max_dest_rd_atomic)
|
||||
MLX5_SET(qpc, qpc, log_rra_max,
|
||||
ilog2(attr->max_dest_rd_atomic));
|
||||
fls(attr->max_dest_rd_atomic - 1));
|
||||
|
||||
if (attr_mask & (IB_QP_ACCESS_FLAGS | IB_QP_MAX_DEST_RD_ATOMIC)) {
|
||||
err = set_qpc_atomic_flags(qp, attr, attr_mask, qpc);
|
||||
|
||||
@@ -429,27 +429,8 @@ mlxsw_sp1_ipip_rem_addr_unset_gre6(struct mlxsw_sp *mlxsw_sp,
|
||||
WARN_ON_ONCE(1);
|
||||
}
|
||||
|
||||
static const struct mlxsw_sp_ipip_ops mlxsw_sp1_ipip_gre6_ops = {
|
||||
.dev_type = ARPHRD_IP6GRE,
|
||||
.ul_proto = MLXSW_SP_L3_PROTO_IPV6,
|
||||
.inc_parsing_depth = true,
|
||||
.parms_init = mlxsw_sp1_ipip_netdev_parms_init_gre6,
|
||||
.nexthop_update = mlxsw_sp1_ipip_nexthop_update_gre6,
|
||||
.decap_config = mlxsw_sp1_ipip_decap_config_gre6,
|
||||
.can_offload = mlxsw_sp1_ipip_can_offload_gre6,
|
||||
.ol_loopback_config = mlxsw_sp1_ipip_ol_loopback_config_gre6,
|
||||
.ol_netdev_change = mlxsw_sp1_ipip_ol_netdev_change_gre6,
|
||||
.rem_ip_addr_set = mlxsw_sp1_ipip_rem_addr_set_gre6,
|
||||
.rem_ip_addr_unset = mlxsw_sp1_ipip_rem_addr_unset_gre6,
|
||||
};
|
||||
|
||||
const struct mlxsw_sp_ipip_ops *mlxsw_sp1_ipip_ops_arr[] = {
|
||||
[MLXSW_SP_IPIP_TYPE_GRE4] = &mlxsw_sp_ipip_gre4_ops,
|
||||
[MLXSW_SP_IPIP_TYPE_GRE6] = &mlxsw_sp1_ipip_gre6_ops,
|
||||
};
|
||||
|
||||
static struct mlxsw_sp_ipip_parms
|
||||
mlxsw_sp2_ipip_netdev_parms_init_gre6(const struct net_device *ol_dev)
|
||||
mlxsw_sp_ipip_netdev_parms_init_gre6(const struct net_device *ol_dev)
|
||||
{
|
||||
struct __ip6_tnl_parm parms = mlxsw_sp_ipip_netdev_parms6(ol_dev);
|
||||
|
||||
@@ -464,9 +445,9 @@ mlxsw_sp2_ipip_netdev_parms_init_gre6(const struct net_device *ol_dev)
|
||||
}
|
||||
|
||||
static int
|
||||
mlxsw_sp2_ipip_nexthop_update_gre6(struct mlxsw_sp *mlxsw_sp, u32 adj_index,
|
||||
struct mlxsw_sp_ipip_entry *ipip_entry,
|
||||
bool force, char *ratr_pl)
|
||||
mlxsw_sp_ipip_nexthop_update_gre6(struct mlxsw_sp *mlxsw_sp, u32 adj_index,
|
||||
struct mlxsw_sp_ipip_entry *ipip_entry,
|
||||
bool force, char *ratr_pl)
|
||||
{
|
||||
u16 rif_index = mlxsw_sp_ipip_lb_rif_index(ipip_entry->ol_lb);
|
||||
enum mlxsw_reg_ratr_op op;
|
||||
@@ -482,9 +463,9 @@ mlxsw_sp2_ipip_nexthop_update_gre6(struct mlxsw_sp *mlxsw_sp, u32 adj_index,
|
||||
}
|
||||
|
||||
static int
|
||||
mlxsw_sp2_ipip_decap_config_gre6(struct mlxsw_sp *mlxsw_sp,
|
||||
struct mlxsw_sp_ipip_entry *ipip_entry,
|
||||
u32 tunnel_index)
|
||||
mlxsw_sp_ipip_decap_config_gre6(struct mlxsw_sp *mlxsw_sp,
|
||||
struct mlxsw_sp_ipip_entry *ipip_entry,
|
||||
u32 tunnel_index)
|
||||
{
|
||||
u16 rif_index = mlxsw_sp_ipip_lb_rif_index(ipip_entry->ol_lb);
|
||||
u16 ul_rif_id = mlxsw_sp_ipip_lb_ul_rif_id(ipip_entry->ol_lb);
|
||||
@@ -519,8 +500,8 @@ mlxsw_sp2_ipip_decap_config_gre6(struct mlxsw_sp *mlxsw_sp,
|
||||
return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(rtdp), rtdp_pl);
|
||||
}
|
||||
|
||||
static bool mlxsw_sp2_ipip_can_offload_gre6(const struct mlxsw_sp *mlxsw_sp,
|
||||
const struct net_device *ol_dev)
|
||||
static bool mlxsw_sp_ipip_can_offload_gre6(const struct mlxsw_sp *mlxsw_sp,
|
||||
const struct net_device *ol_dev)
|
||||
{
|
||||
struct __ip6_tnl_parm tparm = mlxsw_sp_ipip_netdev_parms6(ol_dev);
|
||||
bool inherit_tos = tparm.flags & IP6_TNL_F_USE_ORIG_TCLASS;
|
||||
@@ -534,8 +515,8 @@ static bool mlxsw_sp2_ipip_can_offload_gre6(const struct mlxsw_sp *mlxsw_sp,
|
||||
}
|
||||
|
||||
static struct mlxsw_sp_rif_ipip_lb_config
|
||||
mlxsw_sp2_ipip_ol_loopback_config_gre6(struct mlxsw_sp *mlxsw_sp,
|
||||
const struct net_device *ol_dev)
|
||||
mlxsw_sp_ipip_ol_loopback_config_gre6(struct mlxsw_sp *mlxsw_sp,
|
||||
const struct net_device *ol_dev)
|
||||
{
|
||||
struct __ip6_tnl_parm parms = mlxsw_sp_ipip_netdev_parms6(ol_dev);
|
||||
enum mlxsw_reg_ritr_loopback_ipip_type lb_ipipt;
|
||||
@@ -553,20 +534,42 @@ mlxsw_sp2_ipip_ol_loopback_config_gre6(struct mlxsw_sp *mlxsw_sp,
|
||||
}
|
||||
|
||||
static int
|
||||
mlxsw_sp2_ipip_ol_netdev_change_gre6(struct mlxsw_sp *mlxsw_sp,
|
||||
struct mlxsw_sp_ipip_entry *ipip_entry,
|
||||
struct netlink_ext_ack *extack)
|
||||
mlxsw_sp_ipip_ol_netdev_change_gre6(struct mlxsw_sp *mlxsw_sp,
|
||||
struct mlxsw_sp_ipip_entry *ipip_entry,
|
||||
struct netlink_ext_ack *extack)
|
||||
{
|
||||
u32 new_kvdl_index, old_kvdl_index = ipip_entry->dip_kvdl_index;
|
||||
struct in6_addr old_addr6 = ipip_entry->parms.daddr.addr6;
|
||||
struct mlxsw_sp_ipip_parms new_parms;
|
||||
int err;
|
||||
|
||||
new_parms = mlxsw_sp2_ipip_netdev_parms_init_gre6(ipip_entry->ol_dev);
|
||||
return mlxsw_sp_ipip_ol_netdev_change_gre(mlxsw_sp, ipip_entry,
|
||||
&new_parms, extack);
|
||||
new_parms = mlxsw_sp_ipip_netdev_parms_init_gre6(ipip_entry->ol_dev);
|
||||
|
||||
err = mlxsw_sp_ipv6_addr_kvdl_index_get(mlxsw_sp,
|
||||
&new_parms.daddr.addr6,
|
||||
&new_kvdl_index);
|
||||
if (err)
|
||||
return err;
|
||||
ipip_entry->dip_kvdl_index = new_kvdl_index;
|
||||
|
||||
err = mlxsw_sp_ipip_ol_netdev_change_gre(mlxsw_sp, ipip_entry,
|
||||
&new_parms, extack);
|
||||
if (err)
|
||||
goto err_change_gre;
|
||||
|
||||
mlxsw_sp_ipv6_addr_put(mlxsw_sp, &old_addr6);
|
||||
|
||||
return 0;
|
||||
|
||||
err_change_gre:
|
||||
ipip_entry->dip_kvdl_index = old_kvdl_index;
|
||||
mlxsw_sp_ipv6_addr_put(mlxsw_sp, &new_parms.daddr.addr6);
|
||||
return err;
|
||||
}
|
||||
|
||||
static int
|
||||
mlxsw_sp2_ipip_rem_addr_set_gre6(struct mlxsw_sp *mlxsw_sp,
|
||||
struct mlxsw_sp_ipip_entry *ipip_entry)
|
||||
mlxsw_sp_ipip_rem_addr_set_gre6(struct mlxsw_sp *mlxsw_sp,
|
||||
struct mlxsw_sp_ipip_entry *ipip_entry)
|
||||
{
|
||||
return mlxsw_sp_ipv6_addr_kvdl_index_get(mlxsw_sp,
|
||||
&ipip_entry->parms.daddr.addr6,
|
||||
@@ -574,24 +577,44 @@ mlxsw_sp2_ipip_rem_addr_set_gre6(struct mlxsw_sp *mlxsw_sp,
|
||||
}
|
||||
|
||||
static void
|
||||
mlxsw_sp2_ipip_rem_addr_unset_gre6(struct mlxsw_sp *mlxsw_sp,
|
||||
const struct mlxsw_sp_ipip_entry *ipip_entry)
|
||||
mlxsw_sp_ipip_rem_addr_unset_gre6(struct mlxsw_sp *mlxsw_sp,
|
||||
const struct mlxsw_sp_ipip_entry *ipip_entry)
|
||||
{
|
||||
mlxsw_sp_ipv6_addr_put(mlxsw_sp, &ipip_entry->parms.daddr.addr6);
|
||||
}
|
||||
|
||||
static const struct mlxsw_sp_ipip_ops mlxsw_sp1_ipip_gre6_ops = {
|
||||
.dev_type = ARPHRD_IP6GRE,
|
||||
.ul_proto = MLXSW_SP_L3_PROTO_IPV6,
|
||||
.inc_parsing_depth = true,
|
||||
.double_rif_entry = true,
|
||||
.parms_init = mlxsw_sp1_ipip_netdev_parms_init_gre6,
|
||||
.nexthop_update = mlxsw_sp1_ipip_nexthop_update_gre6,
|
||||
.decap_config = mlxsw_sp1_ipip_decap_config_gre6,
|
||||
.can_offload = mlxsw_sp1_ipip_can_offload_gre6,
|
||||
.ol_loopback_config = mlxsw_sp1_ipip_ol_loopback_config_gre6,
|
||||
.ol_netdev_change = mlxsw_sp1_ipip_ol_netdev_change_gre6,
|
||||
.rem_ip_addr_set = mlxsw_sp1_ipip_rem_addr_set_gre6,
|
||||
.rem_ip_addr_unset = mlxsw_sp1_ipip_rem_addr_unset_gre6,
|
||||
};
|
||||
|
||||
const struct mlxsw_sp_ipip_ops *mlxsw_sp1_ipip_ops_arr[] = {
|
||||
[MLXSW_SP_IPIP_TYPE_GRE4] = &mlxsw_sp_ipip_gre4_ops,
|
||||
[MLXSW_SP_IPIP_TYPE_GRE6] = &mlxsw_sp1_ipip_gre6_ops,
|
||||
};
|
||||
|
||||
static const struct mlxsw_sp_ipip_ops mlxsw_sp2_ipip_gre6_ops = {
|
||||
.dev_type = ARPHRD_IP6GRE,
|
||||
.ul_proto = MLXSW_SP_L3_PROTO_IPV6,
|
||||
.inc_parsing_depth = true,
|
||||
.parms_init = mlxsw_sp2_ipip_netdev_parms_init_gre6,
|
||||
.nexthop_update = mlxsw_sp2_ipip_nexthop_update_gre6,
|
||||
.decap_config = mlxsw_sp2_ipip_decap_config_gre6,
|
||||
.can_offload = mlxsw_sp2_ipip_can_offload_gre6,
|
||||
.ol_loopback_config = mlxsw_sp2_ipip_ol_loopback_config_gre6,
|
||||
.ol_netdev_change = mlxsw_sp2_ipip_ol_netdev_change_gre6,
|
||||
.rem_ip_addr_set = mlxsw_sp2_ipip_rem_addr_set_gre6,
|
||||
.rem_ip_addr_unset = mlxsw_sp2_ipip_rem_addr_unset_gre6,
|
||||
.parms_init = mlxsw_sp_ipip_netdev_parms_init_gre6,
|
||||
.nexthop_update = mlxsw_sp_ipip_nexthop_update_gre6,
|
||||
.decap_config = mlxsw_sp_ipip_decap_config_gre6,
|
||||
.can_offload = mlxsw_sp_ipip_can_offload_gre6,
|
||||
.ol_loopback_config = mlxsw_sp_ipip_ol_loopback_config_gre6,
|
||||
.ol_netdev_change = mlxsw_sp_ipip_ol_netdev_change_gre6,
|
||||
.rem_ip_addr_set = mlxsw_sp_ipip_rem_addr_set_gre6,
|
||||
.rem_ip_addr_unset = mlxsw_sp_ipip_rem_addr_unset_gre6,
|
||||
};
|
||||
|
||||
const struct mlxsw_sp_ipip_ops *mlxsw_sp2_ipip_ops_arr[] = {
|
||||
|
||||
@@ -49,6 +49,7 @@ struct mlxsw_sp_ipip_ops {
|
||||
int dev_type;
|
||||
enum mlxsw_sp_l3proto ul_proto; /* Underlay. */
|
||||
bool inc_parsing_depth;
|
||||
bool double_rif_entry;
|
||||
|
||||
struct mlxsw_sp_ipip_parms
|
||||
(*parms_init)(const struct net_device *ol_dev);
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "spectrum.h"
|
||||
#include "spectrum_ptp.h"
|
||||
#include "core.h"
|
||||
#include "txheader.h"
|
||||
|
||||
#define MLXSW_SP1_PTP_CLOCK_CYCLES_SHIFT 29
|
||||
#define MLXSW_SP1_PTP_CLOCK_FREQ_KHZ 156257 /* 6.4nSec */
|
||||
@@ -1696,6 +1697,12 @@ int mlxsw_sp_ptp_txhdr_construct(struct mlxsw_core *mlxsw_core,
|
||||
struct sk_buff *skb,
|
||||
const struct mlxsw_tx_info *tx_info)
|
||||
{
|
||||
if (skb_cow_head(skb, MLXSW_TXHDR_LEN)) {
|
||||
this_cpu_inc(mlxsw_sp_port->pcpu_stats->tx_dropped);
|
||||
dev_kfree_skb_any(skb);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
mlxsw_sp_txhdr_construct(skb, tx_info);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -77,6 +77,7 @@ struct mlxsw_sp_rif_params {
|
||||
};
|
||||
u16 vid;
|
||||
bool lag;
|
||||
bool double_entry;
|
||||
};
|
||||
|
||||
struct mlxsw_sp_rif_subport {
|
||||
@@ -1068,6 +1069,7 @@ mlxsw_sp_ipip_ol_ipip_lb_create(struct mlxsw_sp *mlxsw_sp,
|
||||
lb_params = (struct mlxsw_sp_rif_params_ipip_lb) {
|
||||
.common.dev = ol_dev,
|
||||
.common.lag = false,
|
||||
.common.double_entry = ipip_ops->double_rif_entry,
|
||||
.lb_config = ipip_ops->ol_loopback_config(mlxsw_sp, ol_dev),
|
||||
};
|
||||
|
||||
|
||||
@@ -4183,11 +4183,6 @@ static netdev_tx_t stmmac_tso_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||
if (dma_mapping_error(priv->device, des))
|
||||
goto dma_map_err;
|
||||
|
||||
tx_q->tx_skbuff_dma[first_entry].buf = des;
|
||||
tx_q->tx_skbuff_dma[first_entry].len = skb_headlen(skb);
|
||||
tx_q->tx_skbuff_dma[first_entry].map_as_page = false;
|
||||
tx_q->tx_skbuff_dma[first_entry].buf_type = STMMAC_TXBUF_T_SKB;
|
||||
|
||||
if (priv->dma_cap.addr64 <= 32) {
|
||||
first->des0 = cpu_to_le32(des);
|
||||
|
||||
@@ -4206,6 +4201,23 @@ static netdev_tx_t stmmac_tso_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||
|
||||
stmmac_tso_allocator(priv, des, tmp_pay_len, (nfrags == 0), queue);
|
||||
|
||||
/* In case two or more DMA transmit descriptors are allocated for this
|
||||
* non-paged SKB data, the DMA buffer address should be saved to
|
||||
* tx_q->tx_skbuff_dma[].buf corresponding to the last descriptor,
|
||||
* and leave the other tx_q->tx_skbuff_dma[].buf as NULL to guarantee
|
||||
* that stmmac_tx_clean() does not unmap the entire DMA buffer too early
|
||||
* since the tail areas of the DMA buffer can be accessed by DMA engine
|
||||
* sooner or later.
|
||||
* By saving the DMA buffer address to tx_q->tx_skbuff_dma[].buf
|
||||
* corresponding to the last descriptor, stmmac_tx_clean() will unmap
|
||||
* this DMA buffer right after the DMA engine completely finishes the
|
||||
* full buffer transmission.
|
||||
*/
|
||||
tx_q->tx_skbuff_dma[tx_q->cur_tx].buf = des;
|
||||
tx_q->tx_skbuff_dma[tx_q->cur_tx].len = skb_headlen(skb);
|
||||
tx_q->tx_skbuff_dma[tx_q->cur_tx].map_as_page = false;
|
||||
tx_q->tx_skbuff_dma[tx_q->cur_tx].buf_type = STMMAC_TXBUF_T_SKB;
|
||||
|
||||
/* Prepare fragments */
|
||||
for (i = 0; i < nfrags; i++) {
|
||||
const skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
|
||||
|
||||
@@ -1262,20 +1262,24 @@ static int gtp_encap_enable(struct gtp_dev *gtp, struct nlattr *data[])
|
||||
return -EINVAL;
|
||||
|
||||
if (data[IFLA_GTP_FD0]) {
|
||||
u32 fd0 = nla_get_u32(data[IFLA_GTP_FD0]);
|
||||
int fd0 = nla_get_u32(data[IFLA_GTP_FD0]);
|
||||
|
||||
sk0 = gtp_encap_enable_socket(fd0, UDP_ENCAP_GTP0, gtp);
|
||||
if (IS_ERR(sk0))
|
||||
return PTR_ERR(sk0);
|
||||
if (fd0 >= 0) {
|
||||
sk0 = gtp_encap_enable_socket(fd0, UDP_ENCAP_GTP0, gtp);
|
||||
if (IS_ERR(sk0))
|
||||
return PTR_ERR(sk0);
|
||||
}
|
||||
}
|
||||
|
||||
if (data[IFLA_GTP_FD1]) {
|
||||
u32 fd1 = nla_get_u32(data[IFLA_GTP_FD1]);
|
||||
int fd1 = nla_get_u32(data[IFLA_GTP_FD1]);
|
||||
|
||||
sk1u = gtp_encap_enable_socket(fd1, UDP_ENCAP_GTP1U, gtp);
|
||||
if (IS_ERR(sk1u)) {
|
||||
gtp_encap_disable_sock(sk0);
|
||||
return PTR_ERR(sk1u);
|
||||
if (fd1 >= 0) {
|
||||
sk1u = gtp_encap_enable_socket(fd1, UDP_ENCAP_GTP1U, gtp);
|
||||
if (IS_ERR(sk1u)) {
|
||||
gtp_encap_disable_sock(sk0);
|
||||
return PTR_ERR(sk1u);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3694,8 +3694,7 @@ static void macsec_free_netdev(struct net_device *dev)
|
||||
{
|
||||
struct macsec_dev *macsec = macsec_priv(dev);
|
||||
|
||||
if (macsec->secy.tx_sc.md_dst)
|
||||
metadata_dst_free(macsec->secy.tx_sc.md_dst);
|
||||
dst_release(&macsec->secy.tx_sc.md_dst->dst);
|
||||
free_percpu(macsec->stats);
|
||||
free_percpu(macsec->secy.tx_sc.stats);
|
||||
|
||||
|
||||
@@ -1377,10 +1377,12 @@ static ssize_t nsim_nexthop_bucket_activity_write(struct file *file,
|
||||
|
||||
if (pos != 0)
|
||||
return -EINVAL;
|
||||
if (size > sizeof(buf))
|
||||
if (size > sizeof(buf) - 1)
|
||||
return -EINVAL;
|
||||
if (copy_from_user(buf, user_buf, size))
|
||||
return -EFAULT;
|
||||
buf[size] = 0;
|
||||
|
||||
if (sscanf(buf, "%u %hu", &nhid, &bucket_index) != 2)
|
||||
return -EINVAL;
|
||||
|
||||
|
||||
@@ -5224,8 +5224,11 @@ int ath11k_dp_rx_process_mon_status(struct ath11k_base *ab, int mac_id,
|
||||
hal_status == HAL_TLV_STATUS_PPDU_DONE) {
|
||||
rx_mon_stats->status_ppdu_done++;
|
||||
pmon->mon_ppdu_status = DP_PPDU_STATUS_DONE;
|
||||
ath11k_dp_rx_mon_dest_process(ar, mac_id, budget, napi);
|
||||
pmon->mon_ppdu_status = DP_PPDU_STATUS_START;
|
||||
if (!ab->hw_params.full_monitor_mode) {
|
||||
ath11k_dp_rx_mon_dest_process(ar, mac_id,
|
||||
budget, napi);
|
||||
pmon->mon_ppdu_status = DP_PPDU_STATUS_START;
|
||||
}
|
||||
}
|
||||
|
||||
if (ppdu_info->peer_id == HAL_INVALID_PEERID ||
|
||||
|
||||
@@ -27,6 +27,7 @@ source "drivers/net/wireless/broadcom/brcm80211/brcmfmac/Kconfig"
|
||||
config BRCM_TRACING
|
||||
bool "Broadcom device tracing"
|
||||
depends on BRCMSMAC || BRCMFMAC
|
||||
depends on TRACING
|
||||
help
|
||||
If you say Y here, the Broadcom wireless drivers will register
|
||||
with ftrace to dump event information into the trace ringbuffer.
|
||||
|
||||
@@ -3119,6 +3119,7 @@ il_enqueue_hcmd(struct il_priv *il, struct il_host_cmd *cmd)
|
||||
struct il_cmd_meta *out_meta;
|
||||
dma_addr_t phys_addr;
|
||||
unsigned long flags;
|
||||
u8 *out_payload;
|
||||
u32 idx;
|
||||
u16 fix_size;
|
||||
|
||||
@@ -3154,6 +3155,16 @@ il_enqueue_hcmd(struct il_priv *il, struct il_host_cmd *cmd)
|
||||
out_cmd = txq->cmd[idx];
|
||||
out_meta = &txq->meta[idx];
|
||||
|
||||
/* The payload is in the same place in regular and huge
|
||||
* command buffers, but we need to let the compiler know when
|
||||
* we're using a larger payload buffer to avoid "field-
|
||||
* spanning write" warnings at run-time for huge commands.
|
||||
*/
|
||||
if (cmd->flags & CMD_SIZE_HUGE)
|
||||
out_payload = ((struct il_device_cmd_huge *)out_cmd)->cmd.payload;
|
||||
else
|
||||
out_payload = out_cmd->cmd.payload;
|
||||
|
||||
if (WARN_ON(out_meta->flags & CMD_MAPPED)) {
|
||||
spin_unlock_irqrestore(&il->hcmd_lock, flags);
|
||||
return -ENOSPC;
|
||||
@@ -3167,7 +3178,7 @@ il_enqueue_hcmd(struct il_priv *il, struct il_host_cmd *cmd)
|
||||
out_meta->callback = cmd->callback;
|
||||
|
||||
out_cmd->hdr.cmd = cmd->id;
|
||||
memcpy(&out_cmd->cmd.payload, cmd->data, cmd->len);
|
||||
memcpy(out_payload, cmd->data, cmd->len);
|
||||
|
||||
/* At this point, the out_cmd now has all of the incoming cmd
|
||||
* information */
|
||||
|
||||
@@ -560,6 +560,18 @@ struct il_device_cmd {
|
||||
|
||||
#define TFD_MAX_PAYLOAD_SIZE (sizeof(struct il_device_cmd))
|
||||
|
||||
/**
|
||||
* struct il_device_cmd_huge
|
||||
*
|
||||
* For use when sending huge commands.
|
||||
*/
|
||||
struct il_device_cmd_huge {
|
||||
struct il_cmd_header hdr; /* uCode API */
|
||||
union {
|
||||
u8 payload[IL_MAX_CMD_SIZE - sizeof(struct il_cmd_header)];
|
||||
} __packed cmd;
|
||||
} __packed;
|
||||
|
||||
struct il_host_cmd {
|
||||
const void *data;
|
||||
unsigned long reply_page;
|
||||
|
||||
@@ -1348,11 +1348,18 @@ void iwl_mvm_get_acpi_tables(struct iwl_mvm *mvm)
|
||||
|
||||
#endif /* CONFIG_ACPI */
|
||||
|
||||
static void iwl_mvm_disconnect_iterator(void *data, u8 *mac,
|
||||
struct ieee80211_vif *vif)
|
||||
{
|
||||
if (vif->type == NL80211_IFTYPE_STATION)
|
||||
ieee80211_hw_restart_disconnect(vif);
|
||||
}
|
||||
|
||||
void iwl_mvm_send_recovery_cmd(struct iwl_mvm *mvm, u32 flags)
|
||||
{
|
||||
u32 error_log_size = mvm->fw->ucode_capa.error_log_size;
|
||||
u32 status = 0;
|
||||
int ret;
|
||||
u32 resp;
|
||||
|
||||
struct iwl_fw_error_recovery_cmd recovery_cmd = {
|
||||
.flags = cpu_to_le32(flags),
|
||||
@@ -1360,7 +1367,6 @@ void iwl_mvm_send_recovery_cmd(struct iwl_mvm *mvm, u32 flags)
|
||||
};
|
||||
struct iwl_host_cmd host_cmd = {
|
||||
.id = WIDE_ID(SYSTEM_GROUP, FW_ERROR_RECOVERY_CMD),
|
||||
.flags = CMD_WANT_SKB,
|
||||
.data = {&recovery_cmd, },
|
||||
.len = {sizeof(recovery_cmd), },
|
||||
};
|
||||
@@ -1380,7 +1386,7 @@ void iwl_mvm_send_recovery_cmd(struct iwl_mvm *mvm, u32 flags)
|
||||
recovery_cmd.buf_size = cpu_to_le32(error_log_size);
|
||||
}
|
||||
|
||||
ret = iwl_mvm_send_cmd(mvm, &host_cmd);
|
||||
ret = iwl_mvm_send_cmd_status(mvm, &host_cmd, &status);
|
||||
kfree(mvm->error_recovery_buf);
|
||||
mvm->error_recovery_buf = NULL;
|
||||
|
||||
@@ -1391,11 +1397,15 @@ void iwl_mvm_send_recovery_cmd(struct iwl_mvm *mvm, u32 flags)
|
||||
|
||||
/* skb respond is only relevant in ERROR_RECOVERY_UPDATE_DB */
|
||||
if (flags & ERROR_RECOVERY_UPDATE_DB) {
|
||||
resp = le32_to_cpu(*(__le32 *)host_cmd.resp_pkt->data);
|
||||
if (resp)
|
||||
if (status) {
|
||||
IWL_ERR(mvm,
|
||||
"Failed to send recovery cmd blob was invalid %d\n",
|
||||
resp);
|
||||
status);
|
||||
|
||||
ieee80211_iterate_interfaces(mvm->hw, 0,
|
||||
iwl_mvm_disconnect_iterator,
|
||||
mvm);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <linux/memblock.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/uaccess.h>
|
||||
#include <linux/uio.h>
|
||||
#include <asm/io.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/ioport.h>
|
||||
@@ -51,6 +51,20 @@ static struct proc_dir_entry *proc_root_kcore;
|
||||
#define kc_offset_to_vaddr(o) ((o) + PAGE_OFFSET)
|
||||
#endif
|
||||
|
||||
#ifndef kc_xlate_dev_mem_ptr
|
||||
#define kc_xlate_dev_mem_ptr kc_xlate_dev_mem_ptr
|
||||
static inline void *kc_xlate_dev_mem_ptr(phys_addr_t phys)
|
||||
{
|
||||
return __va(phys);
|
||||
}
|
||||
#endif
|
||||
#ifndef kc_unxlate_dev_mem_ptr
|
||||
#define kc_unxlate_dev_mem_ptr kc_unxlate_dev_mem_ptr
|
||||
static inline void kc_unxlate_dev_mem_ptr(phys_addr_t phys, void *virt)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
static LIST_HEAD(kclist_head);
|
||||
static DECLARE_RWSEM(kclist_lock);
|
||||
static int kcore_need_update = 1;
|
||||
@@ -309,9 +323,12 @@ static void append_kcore_note(char *notes, size_t *i, const char *name,
|
||||
}
|
||||
|
||||
static ssize_t
|
||||
read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos)
|
||||
read_kcore_iter(struct kiocb *iocb, struct iov_iter *iter)
|
||||
{
|
||||
struct file *file = iocb->ki_filp;
|
||||
char *buf = file->private_data;
|
||||
loff_t *fpos = &iocb->ki_pos;
|
||||
|
||||
size_t phdrs_offset, notes_offset, data_offset;
|
||||
size_t page_offline_frozen = 1;
|
||||
size_t phdrs_len, notes_len;
|
||||
@@ -319,6 +336,7 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos)
|
||||
size_t tsz;
|
||||
int nphdr;
|
||||
unsigned long start;
|
||||
size_t buflen = iov_iter_count(iter);
|
||||
size_t orig_buflen = buflen;
|
||||
int ret = 0;
|
||||
|
||||
@@ -357,12 +375,11 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos)
|
||||
};
|
||||
|
||||
tsz = min_t(size_t, buflen, sizeof(struct elfhdr) - *fpos);
|
||||
if (copy_to_user(buffer, (char *)&ehdr + *fpos, tsz)) {
|
||||
if (copy_to_iter((char *)&ehdr + *fpos, tsz, iter) != tsz) {
|
||||
ret = -EFAULT;
|
||||
goto out;
|
||||
}
|
||||
|
||||
buffer += tsz;
|
||||
buflen -= tsz;
|
||||
*fpos += tsz;
|
||||
}
|
||||
@@ -399,15 +416,14 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos)
|
||||
}
|
||||
|
||||
tsz = min_t(size_t, buflen, phdrs_offset + phdrs_len - *fpos);
|
||||
if (copy_to_user(buffer, (char *)phdrs + *fpos - phdrs_offset,
|
||||
tsz)) {
|
||||
if (copy_to_iter((char *)phdrs + *fpos - phdrs_offset, tsz,
|
||||
iter) != tsz) {
|
||||
kfree(phdrs);
|
||||
ret = -EFAULT;
|
||||
goto out;
|
||||
}
|
||||
kfree(phdrs);
|
||||
|
||||
buffer += tsz;
|
||||
buflen -= tsz;
|
||||
*fpos += tsz;
|
||||
}
|
||||
@@ -449,14 +465,13 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos)
|
||||
min(vmcoreinfo_size, notes_len - i));
|
||||
|
||||
tsz = min_t(size_t, buflen, notes_offset + notes_len - *fpos);
|
||||
if (copy_to_user(buffer, notes + *fpos - notes_offset, tsz)) {
|
||||
if (copy_to_iter(notes + *fpos - notes_offset, tsz, iter) != tsz) {
|
||||
kfree(notes);
|
||||
ret = -EFAULT;
|
||||
goto out;
|
||||
}
|
||||
kfree(notes);
|
||||
|
||||
buffer += tsz;
|
||||
buflen -= tsz;
|
||||
*fpos += tsz;
|
||||
}
|
||||
@@ -473,6 +488,8 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos)
|
||||
while (buflen) {
|
||||
struct page *page;
|
||||
unsigned long pfn;
|
||||
phys_addr_t phys;
|
||||
void *__start;
|
||||
|
||||
/*
|
||||
* If this is the first iteration or the address is not within
|
||||
@@ -498,7 +515,7 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos)
|
||||
}
|
||||
|
||||
if (!m) {
|
||||
if (clear_user(buffer, tsz)) {
|
||||
if (iov_iter_zero(tsz, iter) != tsz) {
|
||||
ret = -EFAULT;
|
||||
goto out;
|
||||
}
|
||||
@@ -509,20 +526,21 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos)
|
||||
case KCORE_VMALLOC:
|
||||
vread(buf, (char *)start, tsz);
|
||||
/* we have to zero-fill user buffer even if no read */
|
||||
if (copy_to_user(buffer, buf, tsz)) {
|
||||
if (copy_to_iter(buf, tsz, iter) != tsz) {
|
||||
ret = -EFAULT;
|
||||
goto out;
|
||||
}
|
||||
break;
|
||||
case KCORE_USER:
|
||||
/* User page is handled prior to normal kernel page: */
|
||||
if (copy_to_user(buffer, (char *)start, tsz)) {
|
||||
if (copy_to_iter((char *)start, tsz, iter) != tsz) {
|
||||
ret = -EFAULT;
|
||||
goto out;
|
||||
}
|
||||
break;
|
||||
case KCORE_RAM:
|
||||
pfn = __pa(start) >> PAGE_SHIFT;
|
||||
phys = __pa(start);
|
||||
pfn = phys >> PAGE_SHIFT;
|
||||
page = pfn_to_online_page(pfn);
|
||||
|
||||
/*
|
||||
@@ -532,7 +550,7 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos)
|
||||
*/
|
||||
if (!page || PageOffline(page) ||
|
||||
is_page_hwpoison(page) || !pfn_is_ram(pfn)) {
|
||||
if (clear_user(buffer, tsz)) {
|
||||
if (iov_iter_zero(tsz, iter) != tsz) {
|
||||
ret = -EFAULT;
|
||||
goto out;
|
||||
}
|
||||
@@ -541,33 +559,44 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos)
|
||||
fallthrough;
|
||||
case KCORE_VMEMMAP:
|
||||
case KCORE_TEXT:
|
||||
if (kern_addr_valid(start)) {
|
||||
/*
|
||||
* Using bounce buffer to bypass the
|
||||
* hardened user copy kernel text checks.
|
||||
*/
|
||||
if (copy_from_kernel_nofault(buf, (void *)start,
|
||||
tsz)) {
|
||||
if (clear_user(buffer, tsz)) {
|
||||
if (m->type == KCORE_RAM) {
|
||||
__start = kc_xlate_dev_mem_ptr(phys);
|
||||
if (!__start) {
|
||||
ret = -ENOMEM;
|
||||
if (iov_iter_zero(tsz, iter) != tsz)
|
||||
ret = -EFAULT;
|
||||
goto out;
|
||||
}
|
||||
} else {
|
||||
if (copy_to_user(buffer, buf, tsz)) {
|
||||
ret = -EFAULT;
|
||||
goto out;
|
||||
}
|
||||
goto out;
|
||||
}
|
||||
} else {
|
||||
if (clear_user(buffer, tsz)) {
|
||||
__start = (void *)start;
|
||||
}
|
||||
|
||||
/*
|
||||
* Sadly we must use a bounce buffer here to be able to
|
||||
* make use of copy_from_kernel_nofault(), as these
|
||||
* memory regions might not always be mapped on all
|
||||
* architectures.
|
||||
*/
|
||||
ret = copy_from_kernel_nofault(buf, __start, tsz);
|
||||
if (m->type == KCORE_RAM)
|
||||
kc_unxlate_dev_mem_ptr(phys, __start);
|
||||
if (ret) {
|
||||
if (iov_iter_zero(tsz, iter) != tsz) {
|
||||
ret = -EFAULT;
|
||||
goto out;
|
||||
}
|
||||
/*
|
||||
* We know the bounce buffer is safe to copy from, so
|
||||
* use _copy_to_iter() directly.
|
||||
*/
|
||||
} else if (_copy_to_iter(buf, tsz, iter) != tsz) {
|
||||
ret = -EFAULT;
|
||||
goto out;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
pr_warn_once("Unhandled KCORE type: %d\n", m->type);
|
||||
if (clear_user(buffer, tsz)) {
|
||||
if (iov_iter_zero(tsz, iter) != tsz) {
|
||||
ret = -EFAULT;
|
||||
goto out;
|
||||
}
|
||||
@@ -575,7 +604,6 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos)
|
||||
skip:
|
||||
buflen -= tsz;
|
||||
*fpos += tsz;
|
||||
buffer += tsz;
|
||||
start += tsz;
|
||||
tsz = (buflen > PAGE_SIZE ? PAGE_SIZE : buflen);
|
||||
}
|
||||
@@ -619,7 +647,7 @@ static int release_kcore(struct inode *inode, struct file *file)
|
||||
}
|
||||
|
||||
static const struct proc_ops kcore_proc_ops = {
|
||||
.proc_read = read_kcore,
|
||||
.proc_read_iter = read_kcore_iter,
|
||||
.proc_open = open_kcore,
|
||||
.proc_release = release_kcore,
|
||||
.proc_lseek = default_llseek,
|
||||
|
||||
@@ -1123,52 +1123,51 @@ cpufreq_table_set_inefficient(struct cpufreq_policy *policy,
|
||||
}
|
||||
|
||||
static inline int parse_perf_domain(int cpu, const char *list_name,
|
||||
const char *cell_name)
|
||||
const char *cell_name,
|
||||
struct of_phandle_args *args)
|
||||
{
|
||||
struct device_node *cpu_np;
|
||||
struct of_phandle_args args;
|
||||
int ret;
|
||||
|
||||
cpu_np = of_cpu_device_node_get(cpu);
|
||||
struct device_node *cpu_np __free(device_node) = of_cpu_device_node_get(cpu);
|
||||
if (!cpu_np)
|
||||
return -ENODEV;
|
||||
|
||||
ret = of_parse_phandle_with_args(cpu_np, list_name, cell_name, 0,
|
||||
&args);
|
||||
args);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
of_node_put(cpu_np);
|
||||
|
||||
return args.args[0];
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int of_perf_domain_get_sharing_cpumask(int pcpu, const char *list_name,
|
||||
const char *cell_name, struct cpumask *cpumask)
|
||||
const char *cell_name, struct cpumask *cpumask,
|
||||
struct of_phandle_args *pargs)
|
||||
{
|
||||
int target_idx;
|
||||
int cpu, ret;
|
||||
struct of_phandle_args args;
|
||||
|
||||
ret = parse_perf_domain(pcpu, list_name, cell_name);
|
||||
ret = parse_perf_domain(pcpu, list_name, cell_name, pargs);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
target_idx = ret;
|
||||
cpumask_set_cpu(pcpu, cpumask);
|
||||
|
||||
for_each_possible_cpu(cpu) {
|
||||
if (cpu == pcpu)
|
||||
continue;
|
||||
|
||||
ret = parse_perf_domain(cpu, list_name, cell_name);
|
||||
ret = parse_perf_domain(cpu, list_name, cell_name, &args);
|
||||
if (ret < 0)
|
||||
continue;
|
||||
|
||||
if (target_idx == ret)
|
||||
if (pargs->np == args.np && pargs->args_count == args.args_count &&
|
||||
!memcmp(pargs->args, args.args, sizeof(args.args[0]) * args.args_count))
|
||||
cpumask_set_cpu(cpu, cpumask);
|
||||
|
||||
of_node_put(args.np);
|
||||
}
|
||||
|
||||
return target_idx;
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
static inline int cpufreq_boost_trigger_state(int state)
|
||||
@@ -1198,7 +1197,8 @@ cpufreq_table_set_inefficient(struct cpufreq_policy *policy,
|
||||
}
|
||||
|
||||
static inline int of_perf_domain_get_sharing_cpumask(int pcpu, const char *list_name,
|
||||
const char *cell_name, struct cpumask *cpumask)
|
||||
const char *cell_name, struct cpumask *cpumask,
|
||||
struct of_phandle_args *pargs)
|
||||
{
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
@@ -252,7 +252,7 @@ static inline void ip_tunnel_init_flow(struct flowi4 *fl4,
|
||||
memset(fl4, 0, sizeof(*fl4));
|
||||
|
||||
if (oif) {
|
||||
fl4->flowi4_l3mdev = l3mdev_master_upper_ifindex_by_index_rcu(net, oif);
|
||||
fl4->flowi4_l3mdev = l3mdev_master_upper_ifindex_by_index(net, oif);
|
||||
/* Legacy VRF/l3mdev use case */
|
||||
fl4->flowi4_oif = fl4->flowi4_l3mdev ? 0 : oif;
|
||||
}
|
||||
|
||||
@@ -650,7 +650,7 @@ static int trie_get_next_key(struct bpf_map *map, void *_key, void *_next_key)
|
||||
if (!key || key->prefixlen > trie->max_prefixlen)
|
||||
goto find_leftmost;
|
||||
|
||||
node_stack = kmalloc_array(trie->max_prefixlen,
|
||||
node_stack = kmalloc_array(trie->max_prefixlen + 1,
|
||||
sizeof(struct lpm_trie_node *),
|
||||
GFP_ATOMIC | __GFP_NOWARN);
|
||||
if (!node_stack)
|
||||
|
||||
@@ -5723,7 +5723,7 @@ static bool cgroup_check_hierarchy_limits(struct cgroup *parent)
|
||||
{
|
||||
struct cgroup *cgroup;
|
||||
int ret = false;
|
||||
int level = 1;
|
||||
int level = 0;
|
||||
|
||||
lockdep_assert_held(&cgroup_mutex);
|
||||
|
||||
@@ -5731,7 +5731,7 @@ static bool cgroup_check_hierarchy_limits(struct cgroup *parent)
|
||||
if (cgroup->nr_descendants >= cgroup->max_descendants)
|
||||
goto fail;
|
||||
|
||||
if (level > cgroup->max_depth)
|
||||
if (level >= cgroup->max_depth)
|
||||
goto fail;
|
||||
|
||||
level++;
|
||||
|
||||
@@ -196,6 +196,12 @@ struct sk_buff *__hci_cmd_sync_sk(struct hci_dev *hdev, u16 opcode, u32 plen,
|
||||
return ERR_PTR(err);
|
||||
}
|
||||
|
||||
/* If command return a status event skb will be set to NULL as there are
|
||||
* no parameters.
|
||||
*/
|
||||
if (!skb)
|
||||
return ERR_PTR(-ENODATA);
|
||||
|
||||
return skb;
|
||||
}
|
||||
EXPORT_SYMBOL(__hci_cmd_sync_sk);
|
||||
@@ -245,6 +251,11 @@ int __hci_cmd_sync_status_sk(struct hci_dev *hdev, u16 opcode, u32 plen,
|
||||
u8 status;
|
||||
|
||||
skb = __hci_cmd_sync_sk(hdev, opcode, plen, param, event, timeout, sk);
|
||||
|
||||
/* If command return a status event, skb will be set to -ENODATA */
|
||||
if (skb == ERR_PTR(-ENODATA))
|
||||
return 0;
|
||||
|
||||
if (IS_ERR(skb)) {
|
||||
if (!event)
|
||||
bt_dev_err(hdev, "Opcode 0x%4.4x failed: %ld", opcode,
|
||||
@@ -252,13 +263,6 @@ int __hci_cmd_sync_status_sk(struct hci_dev *hdev, u16 opcode, u32 plen,
|
||||
return PTR_ERR(skb);
|
||||
}
|
||||
|
||||
/* If command return a status event skb will be set to NULL as there are
|
||||
* no parameters, in case of failure IS_ERR(skb) would have be set to
|
||||
* the actual error would be found with PTR_ERR(skb).
|
||||
*/
|
||||
if (!skb)
|
||||
return 0;
|
||||
|
||||
status = skb->data[0];
|
||||
|
||||
kfree_skb(skb);
|
||||
|
||||
@@ -3689,6 +3689,9 @@ int skb_csum_hwoffload_help(struct sk_buff *skb,
|
||||
return 0;
|
||||
|
||||
if (features & (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM)) {
|
||||
if (vlan_get_protocol(skb) == htons(ETH_P_IPV6) &&
|
||||
skb_network_header_len(skb) != sizeof(struct ipv6hdr))
|
||||
goto sw_checksum;
|
||||
switch (skb->csum_offset) {
|
||||
case offsetof(struct tcphdr, check):
|
||||
case offsetof(struct udphdr, check):
|
||||
@@ -3696,6 +3699,7 @@ int skb_csum_hwoffload_help(struct sk_buff *skb,
|
||||
}
|
||||
}
|
||||
|
||||
sw_checksum:
|
||||
return skb_checksum_help(skb);
|
||||
}
|
||||
EXPORT_SYMBOL(skb_csum_hwoffload_help);
|
||||
|
||||
@@ -268,12 +268,12 @@ static int nf_reject6_fill_skb_dst(struct sk_buff *skb_in)
|
||||
void nf_send_reset6(struct net *net, struct sock *sk, struct sk_buff *oldskb,
|
||||
int hook)
|
||||
{
|
||||
struct sk_buff *nskb;
|
||||
struct tcphdr _otcph;
|
||||
const struct tcphdr *otcph;
|
||||
unsigned int otcplen, hh_len;
|
||||
const struct ipv6hdr *oip6h = ipv6_hdr(oldskb);
|
||||
struct dst_entry *dst = NULL;
|
||||
const struct tcphdr *otcph;
|
||||
struct sk_buff *nskb;
|
||||
struct tcphdr _otcph;
|
||||
unsigned int otcplen;
|
||||
struct flowi6 fl6;
|
||||
|
||||
if ((!(ipv6_addr_type(&oip6h->saddr) & IPV6_ADDR_UNICAST)) ||
|
||||
@@ -312,9 +312,8 @@ void nf_send_reset6(struct net *net, struct sock *sk, struct sk_buff *oldskb,
|
||||
if (IS_ERR(dst))
|
||||
return;
|
||||
|
||||
hh_len = (dst->dev->hard_header_len + 15)&~15;
|
||||
nskb = alloc_skb(hh_len + 15 + dst->header_len + sizeof(struct ipv6hdr)
|
||||
+ sizeof(struct tcphdr) + dst->trailer_len,
|
||||
nskb = alloc_skb(LL_MAX_HEADER + sizeof(struct ipv6hdr) +
|
||||
sizeof(struct tcphdr) + dst->trailer_len,
|
||||
GFP_ATOMIC);
|
||||
|
||||
if (!nskb) {
|
||||
@@ -327,7 +326,7 @@ void nf_send_reset6(struct net *net, struct sock *sk, struct sk_buff *oldskb,
|
||||
|
||||
nskb->mark = fl6.flowi6_mark;
|
||||
|
||||
skb_reserve(nskb, hh_len + dst->header_len);
|
||||
skb_reserve(nskb, LL_MAX_HEADER);
|
||||
nf_reject_ip6hdr_put(nskb, oldskb, IPPROTO_TCP, ip6_dst_hoplimit(dst));
|
||||
nf_reject_ip6_tcphdr_put(nskb, oldskb, otcph, otcplen);
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ config MAC80211_DEBUGFS
|
||||
|
||||
config MAC80211_MESSAGE_TRACING
|
||||
bool "Trace all mac80211 debug messages"
|
||||
depends on MAC80211
|
||||
depends on MAC80211 && TRACING
|
||||
help
|
||||
Select this option to have mac80211 register the
|
||||
mac80211_msg trace subsystem with tracepoints to
|
||||
|
||||
@@ -976,6 +976,26 @@ void ieee80211_reenable_keys(struct ieee80211_sub_if_data *sdata)
|
||||
mutex_unlock(&sdata->local->key_mtx);
|
||||
}
|
||||
|
||||
static void
|
||||
ieee80211_key_iter(struct ieee80211_hw *hw,
|
||||
struct ieee80211_vif *vif,
|
||||
struct ieee80211_key *key,
|
||||
void (*iter)(struct ieee80211_hw *hw,
|
||||
struct ieee80211_vif *vif,
|
||||
struct ieee80211_sta *sta,
|
||||
struct ieee80211_key_conf *key,
|
||||
void *data),
|
||||
void *iter_data)
|
||||
{
|
||||
/* skip keys of station in removal process */
|
||||
if (key->sta && key->sta->removed)
|
||||
return;
|
||||
if (!(key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE))
|
||||
return;
|
||||
iter(hw, vif, key->sta ? &key->sta->sta : NULL,
|
||||
&key->conf, iter_data);
|
||||
}
|
||||
|
||||
void ieee80211_iter_keys(struct ieee80211_hw *hw,
|
||||
struct ieee80211_vif *vif,
|
||||
void (*iter)(struct ieee80211_hw *hw,
|
||||
@@ -995,16 +1015,13 @@ void ieee80211_iter_keys(struct ieee80211_hw *hw,
|
||||
if (vif) {
|
||||
sdata = vif_to_sdata(vif);
|
||||
list_for_each_entry_safe(key, tmp, &sdata->key_list, list)
|
||||
iter(hw, &sdata->vif,
|
||||
key->sta ? &key->sta->sta : NULL,
|
||||
&key->conf, iter_data);
|
||||
ieee80211_key_iter(hw, vif, key, iter, iter_data);
|
||||
} else {
|
||||
list_for_each_entry(sdata, &local->interfaces, list)
|
||||
list_for_each_entry_safe(key, tmp,
|
||||
&sdata->key_list, list)
|
||||
iter(hw, &sdata->vif,
|
||||
key->sta ? &key->sta->sta : NULL,
|
||||
&key->conf, iter_data);
|
||||
ieee80211_key_iter(hw, &sdata->vif, key,
|
||||
iter, iter_data);
|
||||
}
|
||||
mutex_unlock(&local->key_mtx);
|
||||
}
|
||||
@@ -1022,17 +1039,8 @@ _ieee80211_iter_keys_rcu(struct ieee80211_hw *hw,
|
||||
{
|
||||
struct ieee80211_key *key;
|
||||
|
||||
list_for_each_entry_rcu(key, &sdata->key_list, list) {
|
||||
/* skip keys of station in removal process */
|
||||
if (key->sta && key->sta->removed)
|
||||
continue;
|
||||
if (!(key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE))
|
||||
continue;
|
||||
|
||||
iter(hw, &sdata->vif,
|
||||
key->sta ? &key->sta->sta : NULL,
|
||||
&key->conf, iter_data);
|
||||
}
|
||||
list_for_each_entry_rcu(key, &sdata->key_list, list)
|
||||
ieee80211_key_iter(hw, &sdata->vif, key, iter, iter_data);
|
||||
}
|
||||
|
||||
void ieee80211_iter_keys_rcu(struct ieee80211_hw *hw,
|
||||
|
||||
@@ -777,6 +777,9 @@ static void nft_payload_set_eval(const struct nft_expr *expr,
|
||||
((priv->base != NFT_PAYLOAD_TRANSPORT_HEADER &&
|
||||
priv->base != NFT_PAYLOAD_INNER_HEADER) ||
|
||||
skb->ip_summed != CHECKSUM_PARTIAL)) {
|
||||
if (offset + priv->len > skb->len)
|
||||
goto err;
|
||||
|
||||
fsum = skb_checksum(skb, offset, priv->len, 0);
|
||||
tsum = csum_partial(src, priv->len, 0);
|
||||
|
||||
|
||||
@@ -1268,7 +1268,7 @@ struct xt_table *xt_find_table_lock(struct net *net, u_int8_t af,
|
||||
|
||||
/* and once again: */
|
||||
list_for_each_entry(t, &xt_net->tables[af], list)
|
||||
if (strcmp(t->name, name) == 0)
|
||||
if (strcmp(t->name, name) == 0 && owner == t->me)
|
||||
return t;
|
||||
|
||||
module_put(owner);
|
||||
|
||||
@@ -789,7 +789,7 @@ void qdisc_tree_reduce_backlog(struct Qdisc *sch, int n, int len)
|
||||
drops = max_t(int, n, 0);
|
||||
rcu_read_lock();
|
||||
while ((parentid = sch->parent)) {
|
||||
if (TC_H_MAJ(parentid) == TC_H_MAJ(TC_H_INGRESS))
|
||||
if (parentid == TC_H_ROOT)
|
||||
break;
|
||||
|
||||
if (sch->flags & TCQ_F_NOPARENT)
|
||||
|
||||
@@ -750,8 +750,10 @@ int cs42l51_probe(struct device *dev, struct regmap *regmap)
|
||||
|
||||
cs42l51->reset_gpio = devm_gpiod_get_optional(dev, "reset",
|
||||
GPIOD_OUT_LOW);
|
||||
if (IS_ERR(cs42l51->reset_gpio))
|
||||
return PTR_ERR(cs42l51->reset_gpio);
|
||||
if (IS_ERR(cs42l51->reset_gpio)) {
|
||||
ret = PTR_ERR(cs42l51->reset_gpio);
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (cs42l51->reset_gpio) {
|
||||
dev_dbg(dev, "Release reset gpio\n");
|
||||
@@ -783,6 +785,7 @@ int cs42l51_probe(struct device *dev, struct regmap *regmap)
|
||||
return 0;
|
||||
|
||||
error:
|
||||
gpiod_set_value_cansleep(cs42l51->reset_gpio, 1);
|
||||
regulator_bulk_disable(ARRAY_SIZE(cs42l51->supplies),
|
||||
cs42l51->supplies);
|
||||
return ret;
|
||||
|
||||
@@ -1652,7 +1652,7 @@ TEST_F(hmm2, double_map)
|
||||
|
||||
buffer->fd = -1;
|
||||
buffer->size = size;
|
||||
buffer->mirror = malloc(npages);
|
||||
buffer->mirror = malloc(size);
|
||||
ASSERT_NE(buffer->mirror, NULL);
|
||||
|
||||
/* Reserve a range of addresses. */
|
||||
|
||||
Reference in New Issue
Block a user