public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber•org>
To: kys@microsoft•com, haiyangz@microsoft•com, sthemmin@microsoft•com
Cc: devel@linuxdriverproject•org, netdev@vger•kernel.org
Subject: [PATCH net 7/9] hv_netvsc: don't need full irqsave for request_lock
Date: Thu,  1 Mar 2018 10:27:54 -0800	[thread overview]
Message-ID: <20180301182756.23027-8-sthemmin@microsoft.com> (raw)
In-Reply-To: <20180301182756.23027-1-sthemmin@microsoft.com>

Since the driver incoming handling is done with NAPI.
This path is run in softirq (not hardirq) therefore don't
need to do full local irq save/restore.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft•com>
---
 drivers/net/hyperv/rndis_filter.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c
index 1cba767c6453..3ce11361634f 100644
--- a/drivers/net/hyperv/rndis_filter.c
+++ b/drivers/net/hyperv/rndis_filter.c
@@ -92,7 +92,6 @@ static struct rndis_request *get_rndis_request(struct rndis_device *dev,
 	struct rndis_request *request;
 	struct rndis_message *rndis_msg;
 	struct rndis_set_request *set;
-	unsigned long flags;
 
 	request = kzalloc(sizeof(struct rndis_request), GFP_KERNEL);
 	if (!request)
@@ -115,9 +114,9 @@ static struct rndis_request *get_rndis_request(struct rndis_device *dev,
 	set->req_id = atomic_inc_return(&dev->new_req_id);
 
 	/* Add to the request list */
-	spin_lock_irqsave(&dev->request_lock, flags);
+	spin_lock_bh(&dev->request_lock);
 	list_add_tail(&request->list_ent, &dev->req_list);
-	spin_unlock_irqrestore(&dev->request_lock, flags);
+	spin_unlock_bh(&dev->request_lock);
 
 	return request;
 }
@@ -125,11 +124,9 @@ static struct rndis_request *get_rndis_request(struct rndis_device *dev,
 static void put_rndis_request(struct rndis_device *dev,
 			    struct rndis_request *req)
 {
-	unsigned long flags;
-
-	spin_lock_irqsave(&dev->request_lock, flags);
+	spin_lock_bh(&dev->request_lock);
 	list_del(&req->list_ent);
-	spin_unlock_irqrestore(&dev->request_lock, flags);
+	spin_unlock_bh(&dev->request_lock);
 
 	kfree(req);
 }
@@ -269,10 +266,9 @@ static void rndis_filter_receive_response(struct rndis_device *dev,
 {
 	struct rndis_request *request = NULL;
 	bool found = false;
-	unsigned long flags;
 	struct net_device *ndev = dev->ndev;
 
-	spin_lock_irqsave(&dev->request_lock, flags);
+	spin_lock_bh(&dev->request_lock);
 	list_for_each_entry(request, &dev->req_list, list_ent) {
 		/*
 		 * All request/response message contains RequestId as the 1st
@@ -284,7 +280,7 @@ static void rndis_filter_receive_response(struct rndis_device *dev,
 			break;
 		}
 	}
-	spin_unlock_irqrestore(&dev->request_lock, flags);
+	spin_unlock_bh(&dev->request_lock);
 
 	if (found) {
 		if (resp->msg_len <=
-- 
2.16.1

  parent reply	other threads:[~2018-03-01 18:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-01 18:27 [PATCH net 0/9] hv_netvsc: minor bug fixes Stephen Hemminger
2018-03-01 18:27 ` [PATCH net 1/9] hv_netvsc: avoid retry on send during shutdown Stephen Hemminger
2018-03-01 18:27 ` [PATCH net 2/9] hv_netvsc: only wake transmit queue if link is up Stephen Hemminger
2018-03-01 18:27 ` [PATCH net 3/9] hv_netvsc: fix error unwind handling if vmbus_open fails Stephen Hemminger
2018-03-01 18:27 ` [PATCH net 4/9] hv_netvsc: cancel subchannel setup before halting device Stephen Hemminger
2018-03-01 18:27 ` [PATCH net 5/9] hv_netvsc: fix race in napi poll when rescheduling Stephen Hemminger
2018-03-01 18:27 ` [PATCH net 6/9] hv_netvsc: use napi_schedule_irqoff Stephen Hemminger
2018-03-01 18:27 ` Stephen Hemminger [this message]
2018-03-01 18:27 ` [PATCH net 8/9] hv_netvsc: propagate rx filters to VF Stephen Hemminger
2018-03-01 21:56   ` Jakub Kicinski
2018-03-01 23:46   ` Stephen Hemminger
2018-03-01 18:27 ` [PATCH net 9/9] hv_netvsc: defer queue selection " Stephen Hemminger

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=20180301182756.23027-8-sthemmin@microsoft.com \
    --to=stephen@networkplumber$(echo .)org \
    --cc=devel@linuxdriverproject$(echo .)org \
    --cc=haiyangz@microsoft$(echo .)com \
    --cc=kys@microsoft$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=sthemmin@microsoft$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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