netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Weongyo Jeong <weongyo.linux@gmail.com>
To: netdev@vger.kernel.org
Subject: [PATCH] net: removes duplicate skb_mark_napi_id() calls.
Date: Wed, 16 Mar 2016 10:04:53 -0700	[thread overview]
Message-ID: <20160316170450.GA30365@jwg> (raw)

Because napi_gro_receive() function calls skb_mark_napi_id() function,
it doesn't need to set it twice.

Signed-off-by: Weongyo Jeong <weongyo.linux@gmail.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c         | 14 ++++++++------
 drivers/net/ethernet/cisco/enic/enic_main.c       |  7 ++++---
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c     |  7 ++++---
 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c |  3 +--
 4 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 82f1913..f6aa24f 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -1112,11 +1112,12 @@ static int bnxt_rx_pkt(struct bnxt *bp, struct bnxt_napi *bnapi, u32 *raw_cons,
 		rc = -ENOMEM;
 		if (likely(skb)) {
 			skb_record_rx_queue(skb, bnapi->index);
-			skb_mark_napi_id(skb, &bnapi->napi);
-			if (bnxt_busy_polling(bnapi))
+			if (bnxt_busy_polling(bnapi)) {
+				skb_mark_napi_id(skb, &bnapi->napi);
 				netif_receive_skb(skb);
-			else
+			} else {
 				napi_gro_receive(&bnapi->napi, skb);
+			}
 			rc = 1;
 		}
 		goto next_rx_no_prod;
@@ -1215,11 +1216,12 @@ static int bnxt_rx_pkt(struct bnxt *bp, struct bnxt_napi *bnapi, u32 *raw_cons,
 	}
 
 	skb_record_rx_queue(skb, bnapi->index);
-	skb_mark_napi_id(skb, &bnapi->napi);
-	if (bnxt_busy_polling(bnapi))
+	if (bnxt_busy_polling(bnapi)) {
+		skb_mark_napi_id(skb, &bnapi->napi);
 		netif_receive_skb(skb);
-	else
+	} else {
 		napi_gro_receive(&bnapi->napi, skb);
+	}
 	rc = 1;
 
 next_rx:
diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c
index b2182d3..1b15323 100644
--- a/drivers/net/ethernet/cisco/enic/enic_main.c
+++ b/drivers/net/ethernet/cisco/enic/enic_main.c
@@ -1186,12 +1186,13 @@ static void enic_rq_indicate_buf(struct vnic_rq *rq,
 		if (vlan_stripped)
 			__vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vlan_tci);
 
-		skb_mark_napi_id(skb, &enic->napi[rq->index]);
 		if (enic_poll_busy_polling(rq) ||
-		    !(netdev->features & NETIF_F_GRO))
+		    !(netdev->features & NETIF_F_GRO)) {
+			skb_mark_napi_id(skb, &enic->napi[rq->index]);
 			netif_receive_skb(skb);
-		else
+		} else {
 			napi_gro_receive(&enic->napi[q_number], skb);
+		}
 		if (enic->rx_coalesce_setting.use_adaptive_rx_coalesce)
 			enic_intr_update_pkt_size(&cq->pkt_size_counter,
 						  bytes_written);
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index c4003a8..18067e1 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -1659,11 +1659,12 @@ static void ixgbe_process_skb_fields(struct ixgbe_ring *rx_ring,
 static void ixgbe_rx_skb(struct ixgbe_q_vector *q_vector,
 			 struct sk_buff *skb)
 {
-	skb_mark_napi_id(skb, &q_vector->napi);
-	if (ixgbe_qv_busy_polling(q_vector))
+	if (ixgbe_qv_busy_polling(q_vector)) {
+		skb_mark_napi_id(skb, &q_vector->napi);
 		netif_receive_skb(skb);
-	else
+	} else {
 		napi_gro_receive(&q_vector->napi, skb);
+	}
 }
 
 /**
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
index 3558f01..a2955fd 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
@@ -447,9 +447,8 @@ static void ixgbevf_rx_skb(struct ixgbevf_q_vector *q_vector,
 			   struct sk_buff *skb)
 {
 #ifdef CONFIG_NET_RX_BUSY_POLL
-	skb_mark_napi_id(skb, &q_vector->napi);
-
 	if (ixgbevf_qv_busy_polling(q_vector)) {
+		skb_mark_napi_id(skb, &q_vector->napi);
 		netif_receive_skb(skb);
 		/* exit early if we busy polled */
 		return;
-- 
2.1.3

             reply	other threads:[~2016-03-16 17:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-16 17:04 Weongyo Jeong [this message]
2016-03-19  2:21 ` [PATCH] net: removes duplicate skb_mark_napi_id() calls David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160316170450.GA30365@jwg \
    --to=weongyo.linux@gmail.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).