diff mbox series

[RFCv8,net-next,52/55] net: gve: adjust the prototype of gve_rx(), gve_clean_rx_done() and gve_rx_complete_skb()

Message ID 20220918094336.28958-53-shenjian15@huawei.com (mailing list archive)
State RFC
Delegated to: Netdev Maintainers
Headers show
Series net: extend the type of netdev_features_t to bitmap | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next, async
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Series has a cover letter
netdev/patch_count fail Series longer than 15 patches (and no cover letter)
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers warning 5 maintainers not CCed: edumazet@google.com awogbemila@google.com pabeni@redhat.com jeroendb@google.com csully@google.com
netdev/build_clang fail Errors and warnings before: 55 this patch: 55
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn fail Errors and warnings before: 8 this patch: 8
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 68 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

shenjian (K) Sept. 18, 2022, 9:43 a.m. UTC
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@huawei.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 mbox series

Patch

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++;