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: <20220918094336.28958-53-shenjian15@huawei.com>
Date:   Sun, 18 Sep 2022 09:43:33 +0000
From:   Jian Shen <shenjian15@...wei.com>
To:     <davem@...emloft.net>, <kuba@...nel.org>, <ecree.xilinx@...il.com>,
        <andrew@...n.ch>, <hkallweit1@...il.com>,
        <alexandr.lobakin@...el.com>, <saeed@...nel.org>, <leon@...nel.org>
CC:     <netdev@...r.kernel.org>, <linuxarm@...wei.com>
Subject: [RFCv8 PATCH net-next 52/55] net: gve: adjust the prototype of gve_rx(), gve_clean_rx_done() and gve_rx_complete_skb()

The function  gve_rx(), gve_clean_rx_done() and
gve_rx_complete_skb() using netdev_features_t as parameters.

For the prototype of netdev_features_t will be extended to be
larger than 8 bytes, so change the prototype of the function,
change the prototype of input features to 'netdev_features_t *'.

Signed-off-by: Jian Shen <shenjian15@...wei.com>
---
 drivers/net/ethernet/google/gve/gve_rx.c     | 10 +++++-----
 drivers/net/ethernet/google/gve/gve_rx_dqo.c |  8 ++++----
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/google/gve/gve_rx.c b/drivers/net/ethernet/google/gve/gve_rx.c
index 5f479566011c..ce46739b6826 100644
--- a/drivers/net/ethernet/google/gve/gve_rx.c
+++ b/drivers/net/ethernet/google/gve/gve_rx.c
@@ -534,7 +534,7 @@ static struct sk_buff *gve_rx_skb(struct gve_priv *priv, struct gve_rx_ring *rx,
 	return skb;
 }
 
-static bool gve_rx(struct gve_rx_ring *rx, netdev_features_t feat,
+static bool gve_rx(struct gve_rx_ring *rx, const netdev_features_t *feat,
 		   u64 *packet_size_bytes, u32 *work_done)
 {
 	struct gve_rx_slot_page_info *page_info;
@@ -592,7 +592,7 @@ static bool gve_rx(struct gve_rx_ring *rx, netdev_features_t feat,
 		desc = &rx->desc.desc_ring[idx];
 	}
 
-	if (likely(netdev_feature_test(NETIF_F_RXCSUM_BIT, feat))) {
+	if (likely(netdev_feature_test(NETIF_F_RXCSUM_BIT, *feat))) {
 		/* NIC passes up the partial sum */
 		if (first_desc->csum)
 			skb->ip_summed = CHECKSUM_COMPLETE;
@@ -602,7 +602,7 @@ static bool gve_rx(struct gve_rx_ring *rx, netdev_features_t feat,
 	}
 
 	/* parse flags & pass relevant info up */
-	if (likely(netdev_feature_test(NETIF_F_RXHASH_BIT, feat)) &&
+	if (likely(netdev_feature_test(NETIF_F_RXHASH_BIT, *feat)) &&
 	    gve_needs_rss(first_desc->flags_seq))
 		skb_set_hash(skb, be32_to_cpu(first_desc->rss_hash),
 			     gve_rss_type(first_desc->flags_seq));
@@ -702,7 +702,7 @@ static bool gve_rx_refill_buffers(struct gve_priv *priv, struct gve_rx_ring *rx)
 }
 
 static int gve_clean_rx_done(struct gve_rx_ring *rx, int budget,
-			     netdev_features_t feat)
+			     const netdev_features_t *feat)
 {
 	u32 work_done = 0, total_packet_cnt = 0, ok_packet_cnt = 0;
 	struct gve_priv *priv = rx->gve;
@@ -783,7 +783,7 @@ int gve_rx_poll(struct gve_notify_block *block, int budget)
 		budget = INT_MAX;
 
 	if (budget > 0)
-		work_done = gve_clean_rx_done(rx, budget, feat);
+		work_done = gve_clean_rx_done(rx, budget, &feat);
 
 	return work_done;
 }
diff --git a/drivers/net/ethernet/google/gve/gve_rx_dqo.c b/drivers/net/ethernet/google/gve/gve_rx_dqo.c
index edff4d162236..e5ce1d261b03 100644
--- a/drivers/net/ethernet/google/gve/gve_rx_dqo.c
+++ b/drivers/net/ethernet/google/gve/gve_rx_dqo.c
@@ -629,7 +629,7 @@ static int gve_rx_complete_rsc(struct sk_buff *skb,
 /* Returns 0 if skb is completed successfully, -1 otherwise. */
 static int gve_rx_complete_skb(struct gve_rx_ring *rx, struct napi_struct *napi,
 			       const struct gve_rx_compl_desc_dqo *desc,
-			       netdev_features_t feat)
+			       const netdev_features_t *feat)
 {
 	struct gve_ptype ptype =
 		rx->gve->ptype_lut_dqo->ptypes[desc->packet_type];
@@ -637,10 +637,10 @@ static int gve_rx_complete_skb(struct gve_rx_ring *rx, struct napi_struct *napi,
 
 	skb_record_rx_queue(rx->ctx.skb_head, rx->q_num);
 
-	if (netdev_feature_test(NETIF_F_RXHASH_BIT, feat))
+	if (netdev_feature_test(NETIF_F_RXHASH_BIT, *feat))
 		gve_rx_skb_hash(rx->ctx.skb_head, desc, ptype);
 
-	if (netdev_feature_test(NETIF_F_RXCSUM_BIT, feat))
+	if (netdev_feature_test(NETIF_F_RXCSUM_BIT, *feat))
 		gve_rx_skb_csum(rx->ctx.skb_head, desc, ptype);
 
 	/* RSC packets must set gso_size otherwise the TCP stack will complain
@@ -732,7 +732,7 @@ int gve_rx_poll_dqo(struct gve_notify_block *block, int budget)
 			pkt_bytes += ETH_HLEN;
 
 		/* gve_rx_complete_skb() will consume skb if successful */
-		if (gve_rx_complete_skb(rx, napi, compl_desc, feat) != 0) {
+		if (gve_rx_complete_skb(rx, napi, compl_desc, &feat) != 0) {
 			gve_rx_free_skb(rx);
 			u64_stats_update_begin(&rx->statss);
 			rx->rx_desc_err_dropped_pkt++;
-- 
2.33.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ