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]
Date:   Thu,  1 Mar 2018 10:27:54 -0800
From:   Stephen Hemminger <stephen@...workplumber.org>
To:     kys@...rosoft.com, haiyangz@...rosoft.com, sthemmin@...rosoft.com
Cc:     devel@...uxdriverproject.org, netdev@...r.kernel.org
Subject: [PATCH net 7/9] hv_netvsc: don't need full irqsave for request_lock

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@...rosoft.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ