-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'wireless-next-2024-01-03' of git://git.kernel.org/pub/scm/…
…linux/kernel/git/wireless/wireless-next Johannes Berg says: ==================== Just a couple of more things over the holidays: - first kunit tests for both cfg80211 and mac80211 - a few multi-link fixes - DSCP mapping update - RCU fix * tag 'wireless-next-2024-01-03' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next: wifi: mac80211: remove redundant ML element check wifi: cfg80211: parse all ML elements in an ML probe response wifi: cfg80211: correct comment about MLD ID wifi: cfg80211: Update the default DSCP-to-UP mapping wifi: cfg80211: tests: add some scanning related tests wifi: mac80211: kunit: extend MFP tests wifi: mac80211: kunit: generalize public action test wifi: mac80211: add kunit tests for public action handling kunit: add a convenience allocation wrapper for SKBs kunit: add parameter generation macro using description from array wifi: mac80211: fix spelling typo in comment wifi: cfg80211: fix RCU dereference in __cfg80211_bss_update ==================== Link: https://lore.kernel.org/r/20240103144423.52269-3-johannes@sipsolutions.net Signed-off-by: Jakub Kicinski <kuba@kernel.org>
- Loading branch information
Showing
16 changed files
with
1,244 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 */ | ||
/* | ||
* KUnit resource management helpers for SKBs (skbuff). | ||
* | ||
* Copyright (C) 2023 Intel Corporation | ||
*/ | ||
|
||
#ifndef _KUNIT_SKBUFF_H | ||
#define _KUNIT_SKBUFF_H | ||
|
||
#include <kunit/resource.h> | ||
#include <linux/skbuff.h> | ||
|
||
static void kunit_action_kfree_skb(void *p) | ||
{ | ||
kfree_skb((struct sk_buff *)p); | ||
} | ||
|
||
/** | ||
* kunit_zalloc_skb() - Allocate and initialize a resource managed skb. | ||
* @test: The test case to which the skb belongs | ||
* @len: size to allocate | ||
* | ||
* Allocate a new struct sk_buff with GFP_KERNEL, zero fill the give length | ||
* and add it as a resource to the kunit test for automatic cleanup. | ||
* | ||
* Returns: newly allocated SKB, or %NULL on error | ||
*/ | ||
static inline struct sk_buff *kunit_zalloc_skb(struct kunit *test, int len, | ||
gfp_t gfp) | ||
{ | ||
struct sk_buff *res = alloc_skb(len, GFP_KERNEL); | ||
|
||
if (!res || skb_pad(res, len)) | ||
return NULL; | ||
|
||
if (kunit_add_action_or_reset(test, kunit_action_kfree_skb, res)) | ||
return NULL; | ||
|
||
return res; | ||
} | ||
|
||
/** | ||
* kunit_kfree_skb() - Like kfree_skb except for allocations managed by KUnit. | ||
* @test: The test case to which the resource belongs. | ||
* @skb: The SKB to free. | ||
*/ | ||
static inline void kunit_kfree_skb(struct kunit *test, struct sk_buff *skb) | ||
{ | ||
if (!skb) | ||
return; | ||
|
||
kunit_release_action(test, kunit_action_kfree_skb, (void *)skb); | ||
} | ||
|
||
#endif /* _KUNIT_SKBUFF_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
mac80211-tests-y += module.o elems.o | ||
mac80211-tests-y += module.o elems.o mfp.o | ||
|
||
obj-$(CONFIG_MAC80211_KUNIT_TEST) += mac80211-tests.o |
Oops, something went wrong.