summaryrefslogtreecommitdiff
path: root/net/rmnet_data
diff options
context:
space:
mode:
authorHarout Hedeshian <harouth@codeaurora.org>2015-05-21 07:35:04 -0600
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-22 11:05:36 -0700
commitea9757ee26e5c76583e6807674cb041ffbc8e18f (patch)
tree97d76e3f8a61c8c8b825952040c9e01708cfd541 /net/rmnet_data
parenta08bd73374ea8188a9b5ca0f835d9c83559d3bde (diff)
net: rmnet_data: use netif_tx_lock when sending MAP ACK message
The initial implementation of MAP command would grab the global tx lock on the physical transport interface directly. It seems grabbing the lock on its own is not enough to serialize access to the underlying device's ndo_start_xmit() function. In addition to grabbing the lock the transmit queue must be placed in frozen state. The fix is to use the standard netif_tx_lock/unlock APIs as provided by the core framework rather than manually grabbing the spinlocks. Additionally, the null check has been optimized with an unlikely(). A new LOGD() message was added for further debugging of MAP ACK sending. CRs-Fixed: 841068 Change-Id: Ia76396f3075f25cdf6bf7278bba0ec78433b2934 Signed-off-by: Harout Hedeshian <harouth@codeaurora.org>
Diffstat (limited to 'net/rmnet_data')
-rw-r--r--net/rmnet_data/rmnet_map_command.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/net/rmnet_data/rmnet_map_command.c b/net/rmnet_data/rmnet_map_command.c
index bf66bf0edc6d..44be88a61671 100644
--- a/net/rmnet_data/rmnet_map_command.c
+++ b/net/rmnet_data/rmnet_map_command.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -114,22 +114,20 @@ static uint8_t rmnet_map_do_flow_control(struct sk_buff *skb,
static void rmnet_map_send_ack(struct sk_buff *skb,
unsigned char type)
{
- struct net_device *dev;
struct rmnet_map_control_command_s *cmd;
- unsigned long flags;
int xmit_status;
- if (!skb)
+ if (unlikely(!skb))
BUG();
- dev = skb->dev;
-
cmd = RMNET_MAP_GET_CMD_START(skb);
cmd->cmd_type = type & 0x03;
- spin_lock_irqsave(&(skb->dev->tx_global_lock), flags);
+ netif_tx_lock(skb->dev);
xmit_status = skb->dev->netdev_ops->ndo_start_xmit(skb, skb->dev);
- spin_unlock_irqrestore(&(skb->dev->tx_global_lock), flags);
+ netif_tx_unlock(skb->dev);
+
+ LOGD("MAP command ACK=%hhu sent with rc: %d", type & 0x03, xmit_status);
}
/**