lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210929155334.12454-161-shenjian15@huawei.com>
Date:   Wed, 29 Sep 2021 23:53:27 +0800
From:   Jian Shen <shenjian15@...wei.com>
To:     <davem@...emloft.net>, <kuba@...nel.org>, <andrew@...n.ch>,
        <hkallweit1@...il.com>
CC:     <netdev@...r.kernel.org>, <linuxarm@...neuler.org>
Subject: [RFCv2 net-next 160/167] test_bpf: change the prototype of features

Changes the type of "features" of struct skb_segment_test
to "u64", for it is initialized in the variable definition
stage, avoid compile issue when change the type of
"netdev_features_t" to "unsigned long *".

Signed-off-by: Jian Shen <shenjian15@...wei.com>
---
 lib/test_bpf.c | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/lib/test_bpf.c b/lib/test_bpf.c
index 0018d51b93b0..68c1cebdb300 100644
--- a/lib/test_bpf.c
+++ b/lib/test_bpf.c
@@ -8876,30 +8876,31 @@ static __init struct sk_buff *build_test_skb_linear_no_head_frag(void)
 struct skb_segment_test {
 	const char *descr;
 	struct sk_buff *(*build_skb)(void);
-	netdev_features_t features;
+	u64 features[NETDEV_FEATURE_DWORDS];
 };
 
 static struct skb_segment_test skb_segment_tests[] __initconst = {
 	{
 		.descr = "gso_with_rx_frags",
 		.build_skb = build_test_skb,
-		.features = NETIF_F_SG | NETIF_F_GSO_PARTIAL | NETIF_F_IP_CSUM |
-			    NETIF_F_IPV6_CSUM | NETIF_F_RXCSUM
+		.features = { NETIF_F_SG | NETIF_F_GSO_PARTIAL | NETIF_F_IP_CSUM |
+			      NETIF_F_IPV6_CSUM | NETIF_F_RXCSUM }
 	},
 	{
 		.descr = "gso_linear_no_head_frag",
 		.build_skb = build_test_skb_linear_no_head_frag,
-		.features = NETIF_F_SG | NETIF_F_FRAGLIST |
-			    NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_GSO |
-			    NETIF_F_LLTX_BIT | NETIF_F_GRO |
-			    NETIF_F_IPV6_CSUM | NETIF_F_RXCSUM |
-			    NETIF_F_HW_VLAN_STAG_TX_BIT
+		.features = { NETIF_F_SG | NETIF_F_FRAGLIST |
+			      NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_GSO |
+			      NETIF_F_LLTX_BIT | NETIF_F_GRO |
+			      NETIF_F_IPV6_CSUM | NETIF_F_RXCSUM |
+			      NETIF_F_HW_VLAN_STAG_TX_BIT }
 	}
 };
 
 static __init int test_skb_segment_single(const struct skb_segment_test *test)
 {
 	struct sk_buff *skb, *segs;
+	netdev_features_t features;
 	int ret = -1;
 
 	skb = test->build_skb();
@@ -8908,7 +8909,9 @@ static __init int test_skb_segment_single(const struct skb_segment_test *test)
 		goto done;
 	}
 
-	segs = skb_segment(skb, test->features);
+	netdev_feature_zero(&features);
+	netdev_feature_set_bits(test->features[0], &features);
+	segs = skb_segment(skb, features);
 	if (!IS_ERR(segs)) {
 		kfree_skb_list(segs);
 		ret = 0;
-- 
2.33.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ