* [PATCH v1 32/49] wireless: ath9k: prepare for enabling irq in complete()
From: Ming Lei @ 2013-08-17 16:24 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA, Oliver Neukum, Alan Stern,
Ming Lei, Luis R. Rodriguez, John W. Linville,
linux-wireless-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1376756714-25479-1-git-send-email-ming.lei-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
Complete() will be run with interrupt enabled, so change to
spin_lock_irqsave().
Cc: "Luis R. Rodriguez" <mcgrof-A+ZNKFmMK5xy9aJCnZT0Uw@public.gmane.org>
Cc: "John W. Linville" <linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Signed-off-by: Ming Lei <ming.lei-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
---
drivers/net/wireless/ath/ath9k/hif_usb.c | 29 ++++++++++++++-----------
drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | 9 ++++----
drivers/net/wireless/ath/ath9k/wmi.c | 11 +++++-----
3 files changed, 27 insertions(+), 22 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c
index 6d5d716..5efc1f0 100644
--- a/drivers/net/wireless/ath/ath9k/hif_usb.c
+++ b/drivers/net/wireless/ath/ath9k/hif_usb.c
@@ -136,6 +136,7 @@ static void hif_usb_mgmt_cb(struct urb *urb)
struct cmd_buf *cmd = (struct cmd_buf *)urb->context;
struct hif_device_usb *hif_dev;
bool txok = true;
+ unsigned long flags;
if (!cmd || !cmd->skb || !cmd->hif_dev)
return;
@@ -155,14 +156,14 @@ static void hif_usb_mgmt_cb(struct urb *urb)
* If the URBs are being flushed, no need to complete
* this packet.
*/
- spin_lock(&hif_dev->tx.tx_lock);
+ spin_lock_irqsave(&hif_dev->tx.tx_lock, flags);
if (hif_dev->tx.flags & HIF_USB_TX_FLUSH) {
- spin_unlock(&hif_dev->tx.tx_lock);
+ spin_unlock_irqrestore(&hif_dev->tx.tx_lock, flags);
dev_kfree_skb_any(cmd->skb);
kfree(cmd);
return;
}
- spin_unlock(&hif_dev->tx.tx_lock);
+ spin_unlock_irqrestore(&hif_dev->tx.tx_lock, flags);
break;
default:
@@ -253,6 +254,7 @@ static void hif_usb_tx_cb(struct urb *urb)
struct tx_buf *tx_buf = (struct tx_buf *) urb->context;
struct hif_device_usb *hif_dev;
bool txok = true;
+ unsigned long flags;
if (!tx_buf || !tx_buf->hif_dev)
return;
@@ -272,13 +274,13 @@ static void hif_usb_tx_cb(struct urb *urb)
* If the URBs are being flushed, no need to add this
* URB to the free list.
*/
- spin_lock(&hif_dev->tx.tx_lock);
+ spin_lock_irqsave(&hif_dev->tx.tx_lock, flags);
if (hif_dev->tx.flags & HIF_USB_TX_FLUSH) {
- spin_unlock(&hif_dev->tx.tx_lock);
+ spin_unlock_irqrestore(&hif_dev->tx.tx_lock, flags);
ath9k_skb_queue_purge(hif_dev, &tx_buf->skb_queue);
return;
}
- spin_unlock(&hif_dev->tx.tx_lock);
+ spin_unlock_irqrestore(&hif_dev->tx.tx_lock, flags);
break;
default:
@@ -293,13 +295,13 @@ static void hif_usb_tx_cb(struct urb *urb)
__skb_queue_head_init(&tx_buf->skb_queue);
/* Add this TX buffer to the free list */
- spin_lock(&hif_dev->tx.tx_lock);
+ spin_lock_irqsave(&hif_dev->tx.tx_lock, flags);
list_move_tail(&tx_buf->list, &hif_dev->tx.tx_buf);
hif_dev->tx.tx_buf_cnt++;
if (!(hif_dev->tx.flags & HIF_USB_TX_STOP))
__hif_usb_tx(hif_dev); /* Check for pending SKBs */
TX_STAT_INC(buf_completed);
- spin_unlock(&hif_dev->tx.tx_lock);
+ spin_unlock_irqrestore(&hif_dev->tx.tx_lock, flags);
}
/* TX lock has to be taken */
@@ -530,8 +532,9 @@ static void ath9k_hif_usb_rx_stream(struct hif_device_usb *hif_dev,
int rx_remain_len, rx_pkt_len;
u16 pool_index = 0;
u8 *ptr;
+ unsigned long flags;
- spin_lock(&hif_dev->rx_lock);
+ spin_lock_irqsave(&hif_dev->rx_lock, flags);
rx_remain_len = hif_dev->rx_remain_len;
rx_pkt_len = hif_dev->rx_transfer_len;
@@ -559,7 +562,7 @@ static void ath9k_hif_usb_rx_stream(struct hif_device_usb *hif_dev,
}
}
- spin_unlock(&hif_dev->rx_lock);
+ spin_unlock_irqrestore(&hif_dev->rx_lock, flags);
while (index < len) {
u16 pkt_len;
@@ -585,7 +588,7 @@ static void ath9k_hif_usb_rx_stream(struct hif_device_usb *hif_dev,
index = index + 4 + pkt_len + pad_len;
if (index > MAX_RX_BUF_SIZE) {
- spin_lock(&hif_dev->rx_lock);
+ spin_lock_irqsave(&hif_dev->rx_lock, flags);
hif_dev->rx_remain_len = index - MAX_RX_BUF_SIZE;
hif_dev->rx_transfer_len =
MAX_RX_BUF_SIZE - chk_idx - 4;
@@ -595,7 +598,7 @@ static void ath9k_hif_usb_rx_stream(struct hif_device_usb *hif_dev,
if (!nskb) {
dev_err(&hif_dev->udev->dev,
"ath9k_htc: RX memory allocation error\n");
- spin_unlock(&hif_dev->rx_lock);
+ spin_unlock_irqrestore(&hif_dev->rx_lock, flags);
goto err;
}
skb_reserve(nskb, 32);
@@ -606,7 +609,7 @@ static void ath9k_hif_usb_rx_stream(struct hif_device_usb *hif_dev,
/* Record the buffer pointer */
hif_dev->remain_skb = nskb;
- spin_unlock(&hif_dev->rx_lock);
+ spin_unlock_irqrestore(&hif_dev->rx_lock, flags);
} else {
nskb = __dev_alloc_skb(pkt_len + 32, GFP_ATOMIC);
if (!nskb) {
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
index e602c95..a6f34f8 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
@@ -1156,25 +1156,26 @@ void ath9k_htc_rxep(void *drv_priv, struct sk_buff *skb,
struct ath_hw *ah = priv->ah;
struct ath_common *common = ath9k_hw_common(ah);
struct ath9k_htc_rxbuf *rxbuf = NULL, *tmp_buf = NULL;
+ unsigned long flags;
- spin_lock(&priv->rx.rxbuflock);
+ spin_lock_irqsave(&priv->rx.rxbuflock, flags);
list_for_each_entry(tmp_buf, &priv->rx.rxbuf, list) {
if (!tmp_buf->in_process) {
rxbuf = tmp_buf;
break;
}
}
- spin_unlock(&priv->rx.rxbuflock);
+ spin_unlock_irqrestore(&priv->rx.rxbuflock, flags);
if (rxbuf == NULL) {
ath_dbg(common, ANY, "No free RX buffer\n");
goto err;
}
- spin_lock(&priv->rx.rxbuflock);
+ spin_lock_irqsave(&priv->rx.rxbuflock, flags);
rxbuf->skb = skb;
rxbuf->in_process = true;
- spin_unlock(&priv->rx.rxbuflock);
+ spin_unlock_irqrestore(&priv->rx.rxbuflock, flags);
tasklet_schedule(&priv->rx_tasklet);
return;
diff --git a/drivers/net/wireless/ath/ath9k/wmi.c b/drivers/net/wireless/ath/ath9k/wmi.c
index 65c8894..101b771 100644
--- a/drivers/net/wireless/ath/ath9k/wmi.c
+++ b/drivers/net/wireless/ath/ath9k/wmi.c
@@ -207,6 +207,7 @@ static void ath9k_wmi_ctrl_rx(void *priv, struct sk_buff *skb,
struct wmi *wmi = (struct wmi *) priv;
struct wmi_cmd_hdr *hdr;
u16 cmd_id;
+ unsigned long flags;
if (unlikely(wmi->stopped))
goto free_skb;
@@ -215,20 +216,20 @@ static void ath9k_wmi_ctrl_rx(void *priv, struct sk_buff *skb,
cmd_id = be16_to_cpu(hdr->command_id);
if (cmd_id & 0x1000) {
- spin_lock(&wmi->wmi_lock);
+ spin_lock_irqsave(&wmi->wmi_lock, flags);
__skb_queue_tail(&wmi->wmi_event_queue, skb);
- spin_unlock(&wmi->wmi_lock);
+ spin_unlock_irqrestore(&wmi->wmi_lock, flags);
tasklet_schedule(&wmi->wmi_event_tasklet);
return;
}
/* Check if there has been a timeout. */
- spin_lock(&wmi->wmi_lock);
+ spin_lock_irqsave(&wmi->wmi_lock, flags);
if (cmd_id != wmi->last_cmd_id) {
- spin_unlock(&wmi->wmi_lock);
+ spin_unlock_irqrestore(&wmi->wmi_lock, flags);
goto free_skb;
}
- spin_unlock(&wmi->wmi_lock);
+ spin_unlock_irqrestore(&wmi->wmi_lock, flags);
/* WMI command response */
ath9k_wmi_rsp_callback(wmi, skb);
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related
* [PATCH v1 35/49] wireless: libertas: prepare for enabling irq in complete()
From: Ming Lei @ 2013-08-17 16:25 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA, Oliver Neukum, Alan Stern,
Ming Lei, John W. Linville,
libertas-dev-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-wireless-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1376756714-25479-1-git-send-email-ming.lei-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
Complete() will be run with interrupt enabled, so change to
spin_lock_irqsave().
Cc: "John W. Linville" <linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
Cc: libertas-dev-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Signed-off-by: Ming Lei <ming.lei-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
---
drivers/net/wireless/libertas/if_usb.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c
index 2798077..f6a8396 100644
--- a/drivers/net/wireless/libertas/if_usb.c
+++ b/drivers/net/wireless/libertas/if_usb.c
@@ -626,6 +626,7 @@ static inline void process_cmdrequest(int recvlength, uint8_t *recvbuff,
struct lbs_private *priv)
{
u8 i;
+ unsigned long flags;
if (recvlength > LBS_CMD_BUFFER_SIZE) {
lbs_deb_usbd(&cardp->udev->dev,
@@ -636,7 +637,7 @@ static inline void process_cmdrequest(int recvlength, uint8_t *recvbuff,
BUG_ON(!in_interrupt());
- spin_lock(&priv->driver_lock);
+ spin_lock_irqsave(&priv->driver_lock, flags);
i = (priv->resp_idx == 0) ? 1 : 0;
BUG_ON(priv->resp_len[i]);
@@ -646,7 +647,7 @@ static inline void process_cmdrequest(int recvlength, uint8_t *recvbuff,
kfree_skb(skb);
lbs_notify_command_response(priv, i);
- spin_unlock(&priv->driver_lock);
+ spin_unlock_irqrestore(&priv->driver_lock, flags);
lbs_deb_usbd(&cardp->udev->dev,
"Wake up main thread to handle cmd response\n");
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related
* [PATCH v1 27/49] ISDN: hfcsusb: prepare for enabling irq in complete()
From: Ming Lei @ 2013-08-17 16:24 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: linux-usb, Oliver Neukum, Alan Stern, Ming Lei, Karsten Keil,
David S. Miller, netdev
In-Reply-To: <1376756714-25479-1-git-send-email-ming.lei@canonical.com>
Complete() will be run with interrupt enabled, so change to
spin_lock_irqsave().
Cc: Karsten Keil <isdn@linux-pingi.de>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Signed-off-by: Ming Lei <ming.lei@canonical.com>
---
drivers/isdn/hardware/mISDN/hfcsusb.c | 36 ++++++++++++++++++---------------
1 file changed, 20 insertions(+), 16 deletions(-)
diff --git a/drivers/isdn/hardware/mISDN/hfcsusb.c b/drivers/isdn/hardware/mISDN/hfcsusb.c
index 114f3bc..082f9e0 100644
--- a/drivers/isdn/hardware/mISDN/hfcsusb.c
+++ b/drivers/isdn/hardware/mISDN/hfcsusb.c
@@ -819,6 +819,7 @@ hfcsusb_rx_frame(struct usb_fifo *fifo, __u8 *data, unsigned int len,
int fifon = fifo->fifonum;
int i;
int hdlc = 0;
+ unsigned long flags;
if (debug & DBG_HFC_CALL_TRACE)
printk(KERN_DEBUG "%s: %s: fifo(%i) len(%i) "
@@ -835,7 +836,7 @@ hfcsusb_rx_frame(struct usb_fifo *fifo, __u8 *data, unsigned int len,
return;
}
- spin_lock(&hw->lock);
+ spin_lock_irqsave(&hw->lock, flags);
if (fifo->dch) {
rx_skb = fifo->dch->rx_skb;
maxlen = fifo->dch->maxlen;
@@ -844,7 +845,7 @@ hfcsusb_rx_frame(struct usb_fifo *fifo, __u8 *data, unsigned int len,
if (fifo->bch) {
if (test_bit(FLG_RX_OFF, &fifo->bch->Flags)) {
fifo->bch->dropcnt += len;
- spin_unlock(&hw->lock);
+ spin_unlock_irqrestore(&hw->lock, flags);
return;
}
maxlen = bchannel_get_rxbuf(fifo->bch, len);
@@ -854,7 +855,7 @@ hfcsusb_rx_frame(struct usb_fifo *fifo, __u8 *data, unsigned int len,
skb_trim(rx_skb, 0);
pr_warning("%s.B%d: No bufferspace for %d bytes\n",
hw->name, fifo->bch->nr, len);
- spin_unlock(&hw->lock);
+ spin_unlock_irqrestore(&hw->lock, flags);
return;
}
maxlen = fifo->bch->maxlen;
@@ -878,7 +879,7 @@ hfcsusb_rx_frame(struct usb_fifo *fifo, __u8 *data, unsigned int len,
} else {
printk(KERN_DEBUG "%s: %s: No mem for rx_skb\n",
hw->name, __func__);
- spin_unlock(&hw->lock);
+ spin_unlock_irqrestore(&hw->lock, flags);
return;
}
}
@@ -888,7 +889,7 @@ hfcsusb_rx_frame(struct usb_fifo *fifo, __u8 *data, unsigned int len,
"for fifo(%d) HFCUSB_D_RX\n",
hw->name, __func__, fifon);
skb_trim(rx_skb, 0);
- spin_unlock(&hw->lock);
+ spin_unlock_irqrestore(&hw->lock, flags);
return;
}
}
@@ -942,7 +943,7 @@ hfcsusb_rx_frame(struct usb_fifo *fifo, __u8 *data, unsigned int len,
/* deliver transparent data to layer2 */
recv_Bchannel(fifo->bch, MISDN_ID_ANY, false);
}
- spin_unlock(&hw->lock);
+ spin_unlock_irqrestore(&hw->lock, flags);
}
static void
@@ -979,18 +980,19 @@ rx_iso_complete(struct urb *urb)
__u8 *buf;
static __u8 eof[8];
__u8 s0_state;
+ unsigned long flags;
fifon = fifo->fifonum;
status = urb->status;
- spin_lock(&hw->lock);
+ spin_lock_irqsave(&hw->lock, flags);
if (fifo->stop_gracefull) {
fifo->stop_gracefull = 0;
fifo->active = 0;
- spin_unlock(&hw->lock);
+ spin_unlock_irqrestore(&hw->lock, flags);
return;
}
- spin_unlock(&hw->lock);
+ spin_unlock_irqrestore(&hw->lock, flags);
/*
* ISO transfer only partially completed,
@@ -1096,15 +1098,16 @@ rx_int_complete(struct urb *urb)
struct usb_fifo *fifo = (struct usb_fifo *) urb->context;
struct hfcsusb *hw = fifo->hw;
static __u8 eof[8];
+ unsigned long flags;
- spin_lock(&hw->lock);
+ spin_lock_irqsave(&hw->lock, flags);
if (fifo->stop_gracefull) {
fifo->stop_gracefull = 0;
fifo->active = 0;
- spin_unlock(&hw->lock);
+ spin_unlock_irqrestore(&hw->lock, flags);
return;
}
- spin_unlock(&hw->lock);
+ spin_unlock_irqrestore(&hw->lock, flags);
fifon = fifo->fifonum;
if ((!fifo->active) || (urb->status)) {
@@ -1172,12 +1175,13 @@ tx_iso_complete(struct urb *urb)
int *tx_idx;
int frame_complete, fifon, status, fillempty = 0;
__u8 threshbit, *p;
+ unsigned long flags;
- spin_lock(&hw->lock);
+ spin_lock_irqsave(&hw->lock, flags);
if (fifo->stop_gracefull) {
fifo->stop_gracefull = 0;
fifo->active = 0;
- spin_unlock(&hw->lock);
+ spin_unlock_irqrestore(&hw->lock, flags);
return;
}
@@ -1195,7 +1199,7 @@ tx_iso_complete(struct urb *urb)
} else {
printk(KERN_DEBUG "%s: %s: neither BCH nor DCH\n",
hw->name, __func__);
- spin_unlock(&hw->lock);
+ spin_unlock_irqrestore(&hw->lock, flags);
return;
}
@@ -1375,7 +1379,7 @@ tx_iso_complete(struct urb *urb)
hw->name, __func__,
symbolic(urb_errlist, status), status, fifon);
}
- spin_unlock(&hw->lock);
+ spin_unlock_irqrestore(&hw->lock, flags);
}
/*
--
1.7.9.5
^ permalink raw reply related
* [PATCH v1 28/49] USBNET: cdc-phonet: prepare for enabling irq in complete()
From: Ming Lei @ 2013-08-17 16:24 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-usb, Oliver Neukum, Alan Stern, Ming Lei, netdev
In-Reply-To: <1376756714-25479-1-git-send-email-ming.lei@canonical.com>
Complete() will be run with interrupt enabled, so change to
spin_lock_irqsave().
Cc: netdev@vger.kernel.org
Signed-off-by: Ming Lei <ming.lei@canonical.com>
---
drivers/net/usb/cdc-phonet.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/usb/cdc-phonet.c b/drivers/net/usb/cdc-phonet.c
index 7d78669..413ec32 100644
--- a/drivers/net/usb/cdc-phonet.c
+++ b/drivers/net/usb/cdc-phonet.c
@@ -99,6 +99,7 @@ static void tx_complete(struct urb *req)
struct net_device *dev = skb->dev;
struct usbpn_dev *pnd = netdev_priv(dev);
int status = req->status;
+ unsigned long flags;
switch (status) {
case 0:
@@ -115,10 +116,10 @@ static void tx_complete(struct urb *req)
}
dev->stats.tx_packets++;
- spin_lock(&pnd->tx_lock);
+ spin_lock_irqsave(&pnd->tx_lock, flags);
pnd->tx_queue--;
netif_wake_queue(dev);
- spin_unlock(&pnd->tx_lock);
+ spin_unlock_irqrestore(&pnd->tx_lock, flags);
dev_kfree_skb_any(skb);
usb_free_urb(req);
--
1.7.9.5
^ permalink raw reply related
* [PATCH v1 33/49] wireless: zd1211rw: prepare for enabling irq in complete()
From: Ming Lei @ 2013-08-17 16:24 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: linux-usb, Oliver Neukum, Alan Stern, Ming Lei, Daniel Drake,
Ulrich Kunitz, John W. Linville, linux-wireless, netdev
In-Reply-To: <1376756714-25479-1-git-send-email-ming.lei@canonical.com>
Complete() will be run with interrupt enabled, so change to
spin_lock_irqsave().
Cc: Daniel Drake <dsd@gentoo.org>
Cc: Ulrich Kunitz <kune@deine-taler.de>
Cc: "John W. Linville" <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org
Cc: netdev@vger.kernel.org
Signed-off-by: Ming Lei <ming.lei@canonical.com>
---
drivers/net/wireless/zd1211rw/zd_usb.c | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)
diff --git a/drivers/net/wireless/zd1211rw/zd_usb.c b/drivers/net/wireless/zd1211rw/zd_usb.c
index 7ef0b4a..8169ee0 100644
--- a/drivers/net/wireless/zd1211rw/zd_usb.c
+++ b/drivers/net/wireless/zd1211rw/zd_usb.c
@@ -372,14 +372,15 @@ static inline void handle_regs_int_override(struct urb *urb)
{
struct zd_usb *usb = urb->context;
struct zd_usb_interrupt *intr = &usb->intr;
+ unsigned long flags;
- spin_lock(&intr->lock);
+ spin_lock_irqsave(&intr->lock, flags);
if (atomic_read(&intr->read_regs_enabled)) {
atomic_set(&intr->read_regs_enabled, 0);
intr->read_regs_int_overridden = 1;
complete(&intr->read_regs.completion);
}
- spin_unlock(&intr->lock);
+ spin_unlock_irqrestore(&intr->lock, flags);
}
static inline void handle_regs_int(struct urb *urb)
@@ -388,9 +389,10 @@ static inline void handle_regs_int(struct urb *urb)
struct zd_usb_interrupt *intr = &usb->intr;
int len;
u16 int_num;
+ unsigned long flags;
ZD_ASSERT(in_interrupt());
- spin_lock(&intr->lock);
+ spin_lock_irqsave(&intr->lock, flags);
int_num = le16_to_cpu(*(__le16 *)(urb->transfer_buffer+2));
if (int_num == CR_INTERRUPT) {
@@ -426,7 +428,7 @@ static inline void handle_regs_int(struct urb *urb)
}
out:
- spin_unlock(&intr->lock);
+ spin_unlock_irqrestore(&intr->lock, flags);
/* CR_INTERRUPT might override read_reg too. */
if (int_num == CR_INTERRUPT && atomic_read(&intr->read_regs_enabled))
@@ -666,6 +668,7 @@ static void rx_urb_complete(struct urb *urb)
struct zd_usb_rx *rx;
const u8 *buffer;
unsigned int length;
+ unsigned long flags;
switch (urb->status) {
case 0:
@@ -694,14 +697,14 @@ static void rx_urb_complete(struct urb *urb)
/* If there is an old first fragment, we don't care. */
dev_dbg_f(urb_dev(urb), "*** first fragment ***\n");
ZD_ASSERT(length <= ARRAY_SIZE(rx->fragment));
- spin_lock(&rx->lock);
+ spin_lock_irqsave(&rx->lock, flags);
memcpy(rx->fragment, buffer, length);
rx->fragment_length = length;
- spin_unlock(&rx->lock);
+ spin_unlock_irqrestore(&rx->lock, flags);
goto resubmit;
}
- spin_lock(&rx->lock);
+ spin_lock_irqsave(&rx->lock, flags);
if (rx->fragment_length > 0) {
/* We are on a second fragment, we believe */
ZD_ASSERT(length + rx->fragment_length <=
@@ -711,9 +714,9 @@ static void rx_urb_complete(struct urb *urb)
handle_rx_packet(usb, rx->fragment,
rx->fragment_length + length);
rx->fragment_length = 0;
- spin_unlock(&rx->lock);
+ spin_unlock_irqrestore(&rx->lock, flags);
} else {
- spin_unlock(&rx->lock);
+ spin_unlock_irqrestore(&rx->lock, flags);
handle_rx_packet(usb, buffer, length);
}
--
1.7.9.5
^ permalink raw reply related
* [PATCH v1 34/49] wireless: ath: carl9170: prepare for enabling irq in complete()
From: Ming Lei @ 2013-08-17 16:24 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: linux-usb, Oliver Neukum, Alan Stern, Ming Lei,
Christian Lamparter, John W. Linville, linux-wireless, netdev
In-Reply-To: <1376756714-25479-1-git-send-email-ming.lei@canonical.com>
Complete() will be run with interrupt enabled, so change to
spin_lock_irqsave().
Cc: Christian Lamparter <chunkeey@googlemail.com>
Cc: "John W. Linville" <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org
Cc: netdev@vger.kernel.org
Signed-off-by: Ming Lei <ming.lei@canonical.com>
---
drivers/net/wireless/ath/carl9170/rx.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ath/carl9170/rx.c b/drivers/net/wireless/ath/carl9170/rx.c
index 4684dd9..61f62a6 100644
--- a/drivers/net/wireless/ath/carl9170/rx.c
+++ b/drivers/net/wireless/ath/carl9170/rx.c
@@ -129,6 +129,7 @@ static int carl9170_check_sequence(struct ar9170 *ar, unsigned int seq)
static void carl9170_cmd_callback(struct ar9170 *ar, u32 len, void *buffer)
{
+ unsigned long flags;
/*
* Some commands may have a variable response length
* and we cannot predict the correct length in advance.
@@ -148,7 +149,7 @@ static void carl9170_cmd_callback(struct ar9170 *ar, u32 len, void *buffer)
carl9170_restart(ar, CARL9170_RR_INVALID_RSP);
}
- spin_lock(&ar->cmd_lock);
+ spin_lock_irqsave(&ar->cmd_lock, flags);
if (ar->readbuf) {
if (len >= 4)
memcpy(ar->readbuf, buffer + 4, len - 4);
@@ -156,7 +157,7 @@ static void carl9170_cmd_callback(struct ar9170 *ar, u32 len, void *buffer)
ar->readbuf = NULL;
}
complete(&ar->cmd_wait);
- spin_unlock(&ar->cmd_lock);
+ spin_unlock_irqrestore(&ar->cmd_lock, flags);
}
void carl9170_handle_command_response(struct ar9170 *ar, void *buf, u32 len)
--
1.7.9.5
^ permalink raw reply related
* [PATCH v1 36/49] wireless: libertas_tf: prepare for enabling irq in complete()
From: Ming Lei @ 2013-08-17 16:25 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: linux-usb, Oliver Neukum, Alan Stern, Ming Lei, John W. Linville,
libertas-dev, linux-wireless, netdev
In-Reply-To: <1376756714-25479-1-git-send-email-ming.lei@canonical.com>
Complete() will be run with interrupt enabled, so change to
spin_lock_irqsave().
Cc: "John W. Linville" <linville@tuxdriver.com>
Cc: libertas-dev@lists.infradead.org
Cc: linux-wireless@vger.kernel.org
Cc: netdev@vger.kernel.org
Signed-off-by: Ming Lei <ming.lei@canonical.com>
---
drivers/net/wireless/libertas_tf/if_usb.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/libertas_tf/if_usb.c b/drivers/net/wireless/libertas_tf/if_usb.c
index d576dd6..0e9e972 100644
--- a/drivers/net/wireless/libertas_tf/if_usb.c
+++ b/drivers/net/wireless/libertas_tf/if_usb.c
@@ -610,6 +610,8 @@ static inline void process_cmdrequest(int recvlength, uint8_t *recvbuff,
struct if_usb_card *cardp,
struct lbtf_private *priv)
{
+ unsigned long flags;
+
if (recvlength > LBS_CMD_BUFFER_SIZE) {
lbtf_deb_usbd(&cardp->udev->dev,
"The receive buffer is too large\n");
@@ -619,12 +621,12 @@ static inline void process_cmdrequest(int recvlength, uint8_t *recvbuff,
BUG_ON(!in_interrupt());
- spin_lock(&priv->driver_lock);
+ spin_lock_irqsave(&priv->driver_lock, flags);
memcpy(priv->cmd_resp_buff, recvbuff + MESSAGE_HEADER_LEN,
recvlength - MESSAGE_HEADER_LEN);
kfree_skb(skb);
lbtf_cmd_response_rx(priv);
- spin_unlock(&priv->driver_lock);
+ spin_unlock_irqrestore(&priv->driver_lock, flags);
}
/**
--
1.7.9.5
^ permalink raw reply related
* Re: [B.A.T.M.A.N.] pull request net: 2013-08-17b
From: Antonio Quartulli @ 2013-08-17 17:31 UTC (permalink / raw)
To: davem; +Cc: netdev, b.a.t.m.a.n
In-Reply-To: <1376737486-1863-1-git-send-email-ordex@autistici.org>
[-- Attachment #1: Type: text/plain, Size: 745 bytes --]
On Sat, Aug 17, 2013 at 01:04:44PM +0200, Antonio Quartulli wrote:
> Hello David,
>
> here is the correct pull request for net/linux-3.11.
>
> As described earlier this patchset contains a change which properly ends a
> seq_read cycle and another change that takes care of aborting TX operations if
> the skb preparation should faile.
Hi David,
sorry for the noise but after analysing the code once more we realised that
skb_abort_seq_read() is not needed anymore for >=linux-3.11.
Therefore one of the patches in this pull request is not needed.
I will send a third pull request with the correct patch only.
Thanks,
Antonio
--
Antonio Quartulli
..each of us alone is worth nothing..
Ernesto "Che" Guevara
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* [PATCH ipsec 1/3] ipv6: wire up skb->encapsulation
From: Hannes Frederic Sowa @ 2013-08-17 17:51 UTC (permalink / raw)
To: netdev; +Cc: steffen.klassert, yoshfuji, nicolas.dichtel
When pushing a new header before current one call skb_reset_inner_headers
to record the position of the inner headers in the various ipv6 tunnel
protocols.
We later need this to correctly identify the addresses needed to send
back an error in the xfrm layer.
This change is safe, because skb->protocol is always checked before
dereferencing data from the inner protocol.
Cc: Steffen Klassert <steffen.klassert@secunet.com>
Cc: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Cc: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
This patch is based on Steffen Klassert's ipsec tree.
net/ipv6/ip6_gre.c | 5 +++++
net/ipv6/ip6_tunnel.c | 6 ++++++
net/ipv6/sit.c | 5 +++++
3 files changed, 16 insertions(+)
diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
index ecd6073..90747f1 100644
--- a/net/ipv6/ip6_gre.c
+++ b/net/ipv6/ip6_gre.c
@@ -724,6 +724,11 @@ static netdev_tx_t ip6gre_xmit2(struct sk_buff *skb,
ipv6_push_nfrag_opts(skb, &opt.ops, &proto, NULL);
}
+ if (likely(!skb->encapsulation)) {
+ skb_reset_inner_headers(skb);
+ skb->encapsulation = 1;
+ }
+
skb_push(skb, gre_hlen);
skb_reset_network_header(skb);
skb_set_transport_header(skb, sizeof(*ipv6h));
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index 1e55866..46ba243 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -1027,6 +1027,12 @@ static int ip6_tnl_xmit2(struct sk_buff *skb,
init_tel_txopt(&opt, encap_limit);
ipv6_push_nfrag_opts(skb, &opt.ops, &proto, NULL);
}
+
+ if (likely(!skb->encapsulation)) {
+ skb_reset_inner_headers(skb);
+ skb->encapsulation = 1;
+ }
+
skb_push(skb, sizeof(struct ipv6hdr));
skb_reset_network_header(skb);
ipv6h = ipv6_hdr(skb);
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index a3437a4..fbfc5a8 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -888,6 +888,11 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb,
ttl = iph6->hop_limit;
tos = INET_ECN_encapsulate(tos, ipv6_get_dsfield(iph6));
+ if (likely(!skb->encapsulation)) {
+ skb_reset_inner_headers(skb);
+ skb->encapsulation = 1;
+ }
+
err = iptunnel_xmit(dev_net(dev), rt, skb, fl4.saddr, fl4.daddr,
IPPROTO_IPV6, tos, ttl, df);
iptunnel_xmit_stats(err, &dev->stats, dev->tstats);
--
1.8.3.1
^ permalink raw reply related
* [PATCH ipsec 2/3] ipv6: xfrm: dereference inner ipv6 header if encapsulated
From: Hannes Frederic Sowa @ 2013-08-17 17:51 UTC (permalink / raw)
To: netdev; +Cc: steffen.klassert
In xfrm6_local_error use inner_header if the packet was encapsulated.
Cc: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
This patch is based on Steffen Klassert's ipsec tree.
net/ipv6/xfrm6_output.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/ipv6/xfrm6_output.c b/net/ipv6/xfrm6_output.c
index 3ac5ab2..45effcc 100644
--- a/net/ipv6/xfrm6_output.c
+++ b/net/ipv6/xfrm6_output.c
@@ -59,10 +59,12 @@ static void xfrm6_local_rxpmtu(struct sk_buff *skb, u32 mtu)
void xfrm6_local_error(struct sk_buff *skb, u32 mtu)
{
struct flowi6 fl6;
+ struct ipv6hdr *hdr;
struct sock *sk = skb->sk;
+ hdr = skb->encapsulation ? inner_ipv6_hdr(skb) : ipv6_hdr(skb);
fl6.fl6_dport = inet_sk(sk)->inet_dport;
- fl6.daddr = ipv6_hdr(skb)->daddr;
+ fl6.daddr = hdr->daddr;
ipv6_local_error(sk, EMSGSIZE, &fl6, mtu);
}
--
1.8.3.1
^ permalink raw reply related
* [PATCH ipsec 3/3] xfrm: choose protocol family by skb protocol
From: Hannes Frederic Sowa @ 2013-08-17 17:51 UTC (permalink / raw)
To: netdev; +Cc: steffen.klassert
We need to choose the protocol family by skb->protocol. Otherwise we
call the wrong xfrm{4,6}_local_error handler in case an ipv6 sockets is
used in ipv4 mode, in which case we should call down to xfrm4_local_error
(ip6 sockets are a superset of ip4 ones).
We are called before before ip_output functions, so skb->protocol is
not reset.
Cc: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
This patch is based on Steffen Klassert's ipsec tree.
include/net/xfrm.h | 4 ++--
net/xfrm/xfrm_output.c | 10 +++++++++-
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index b41d2d1..ac5b025 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -1728,9 +1728,9 @@ static inline int xfrm_skb_dst_mtu(struct sk_buff *skb)
{
struct sock *sk = skb->sk;
- if (sk && sk->sk_family == AF_INET6)
+ if (sk && skb->protocol == htons(ETH_P_IPV6))
return ip6_skb_dst_mtu(skb);
- else if (sk && sk->sk_family == AF_INET)
+ else if (sk && skb->protocol == htons(ETH_P_IP))
return ip_skb_dst_mtu(skb);
return dst_mtu(skb_dst(skb));
}
diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c
index 6f5fc61..3bb2cdc 100644
--- a/net/xfrm/xfrm_output.c
+++ b/net/xfrm/xfrm_output.c
@@ -216,9 +216,17 @@ int xfrm_inner_extract_output(struct xfrm_state *x, struct sk_buff *skb)
void xfrm_local_error(struct sk_buff *skb, int mtu)
{
+ unsigned int proto;
struct xfrm_state_afinfo *afinfo;
- afinfo = xfrm_state_get_afinfo(skb->sk->sk_family);
+ if (skb->protocol == htons(ETH_P_IP))
+ proto = AF_INET;
+ else if (skb->protocol == htons(ETH_P_IPV6))
+ proto = AF_INET6;
+ else
+ return;
+
+ afinfo = xfrm_state_get_afinfo(proto);
if (!afinfo)
return;
--
1.8.3.1
^ permalink raw reply related
* Re: [PATCH net-next 2/2] bnx2x: add RSS capability for GRE traffic
From: Jerry Chu @ 2013-08-17 17:53 UTC (permalink / raw)
To: Dmitry Kravkov
Cc: Eric Dumazet, davem@davemloft.net, netdev@vger.kernel.org,
Eilon Greenstein, Tom Herbert, Maciej Żenczykowski
In-Reply-To: <504C9EFCA2D0054393414C9CB605C37F20BE935B@SJEXCHMB06.corp.ad.broadcom.com>
Dmitry,
On Mon, Mar 18, 2013 at 11:30 PM, Dmitry Kravkov <dmitry@broadcom.com> wrote:
>> -----Original Message-----
>> From: netdev-owner@vger.kernel.org [mailto:netdev-owner@vger.kernel.org] On Behalf Of Eric Dumazet
>> Sent: Tuesday, March 19, 2013 2:08 AM
>> To: Dmitry Kravkov
>> Cc: davem@davemloft.net; netdev@vger.kernel.org; Eilon Greenstein; Tom Herbert; Maciej Żenczykowski
>> Subject: Re: [PATCH net-next 2/2] bnx2x: add RSS capability for GRE traffic
>>
>> On Mon, 2013-03-18 at 18:51 +0200, Dmitry Kravkov wrote:
>> > The patch drives FW to perform RSS for GRE traffic,
>> > based on inner headers.
>> >
>> > Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
>> > Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
>> > ---
>> > drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h | 3 +++
>> > drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c | 23 ++++++++++++-----------
>> > drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h | 9 +++++++++
>> > 3 files changed, 24 insertions(+), 11 deletions(-)
>>
>> This works very well.
>>
>> Problem is we skb_set_queue_mapping(skb, 0); in __skb_tunnel_rx()
>>
>> (this was a patch from Tom Herbert, commit
>> 693019e90ca45d881109d32c0c6d29adf03f6447 (net: reset skb queue mapping
>> when rx'ing over tunnel )
>>
>> Meaning we hit a single cpu for the GRO stuff in ip_gre.
>>
>> I have to think about it.
>>
>>
>> Another question is :
>>
>> Can bnx2x check the tcp checksum if GRE encapsulated ?
>>
> Current HW can't provide this. Probably, it's possible to separate CSUM from GRO/TPA then stack will have to handle CSUM validation for huge packets. Is it worth?
Could you elaborate on what you meant above? (I'm looking for any form
of h/w assist for
csum validation for GRO/TPA pkts since csum computation can be expensive and as
you said below CHECKSUM_COMPLETE is out of the question.)
Thanks,
Jerry
>
^ permalink raw reply
* Re: [PATCH ipsec 1/3] ipv6: wire up skb->encapsulation
From: Hannes Frederic Sowa @ 2013-08-17 18:07 UTC (permalink / raw)
To: horms; +Cc: netdev, steffen.klassert, yoshfuji, nicolas.dichtel
In-Reply-To: <20130817175116.GA7001@order.stressinduktion.org>
Hi Simon!
On Sat, Aug 17, 2013 at 07:51:16PM +0200, Hannes Frederic Sowa wrote:
> When pushing a new header before current one call skb_reset_inner_headers
> to record the position of the inner headers in the various ipv6 tunnel
> protocols.
>
> We later need this to correctly identify the addresses needed to send
> back an error in the xfrm layer.
>
> This change is safe, because skb->protocol is always checked before
> dereferencing data from the inner protocol.
>
> Cc: Steffen Klassert <steffen.klassert@secunet.com>
> Cc: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
> Cc: Nicolas Dichtel <nicolas.dichtel@6wind.com>
> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
> ---
>
> This patch is based on Steffen Klassert's ipsec tree.
>
> net/ipv6/ip6_gre.c | 5 +++++
> net/ipv6/ip6_tunnel.c | 6 ++++++
> net/ipv6/sit.c | 5 +++++
> 3 files changed, 16 insertions(+)
>
> diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
> index ecd6073..90747f1 100644
> --- a/net/ipv6/ip6_gre.c
> +++ b/net/ipv6/ip6_gre.c
> @@ -724,6 +724,11 @@ static netdev_tx_t ip6gre_xmit2(struct sk_buff *skb,
> ipv6_push_nfrag_opts(skb, &opt.ops, &proto, NULL);
> }
>
> + if (likely(!skb->encapsulation)) {
> + skb_reset_inner_headers(skb);
> + skb->encapsulation = 1;
> + }
> +
While doing these patches, I wondered how skb->inner_protocol will be
used in future (you added it in 0d89d2035fe063461a5ddb609b2c12e7fb006e44
("MPLS: Add limited GSO support")). Current use by tunnels seems safe to
me, but I wondered how you would extend its use?
Thanks,
Hannes
^ permalink raw reply
* Re: [PATCH net-next 2/2] bnx2x: add RSS capability for GRE traffic
From: Dmitry Kravkov @ 2013-08-17 18:52 UTC (permalink / raw)
To: Jerry Chu
Cc: Dmitry Kravkov, Eric Dumazet, davem@davemloft.net,
netdev@vger.kernel.org, Eilon Greenstein, Tom Herbert,
Maciej Żenczykowski
In-Reply-To: <CAPshTCgpE3MoR3D8=EZa_CFVDBwN+fYDZZQrTchhtq-OM_rKzQ@mail.gmail.com>
On Sat, Aug 17, 2013 at 8:53 PM, Jerry Chu <hkchu@google.com> wrote:
> Dmitry,
>
> On Mon, Mar 18, 2013 at 11:30 PM, Dmitry Kravkov <dmitry@broadcom.com> wrote:
>>> -----Original Message-----
>>> From: netdev-owner@vger.kernel.org [mailto:netdev-owner@vger.kernel.org] On Behalf Of Eric Dumazet
>>> Sent: Tuesday, March 19, 2013 2:08 AM
>>> To: Dmitry Kravkov
>>> Cc: davem@davemloft.net; netdev@vger.kernel.org; Eilon Greenstein; Tom Herbert; Maciej Żenczykowski
>>> Subject: Re: [PATCH net-next 2/2] bnx2x: add RSS capability for GRE traffic
>>>
>>> On Mon, 2013-03-18 at 18:51 +0200, Dmitry Kravkov wrote:
>>> > The patch drives FW to perform RSS for GRE traffic,
>>> > based on inner headers.
>>> >
>>> > Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
>>> > Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
>>> > ---
>>> > drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h | 3 +++
>>> > drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c | 23 ++++++++++++-----------
>>> > drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h | 9 +++++++++
>>> > 3 files changed, 24 insertions(+), 11 deletions(-)
>>>
>>> This works very well.
>>>
>>> Problem is we skb_set_queue_mapping(skb, 0); in __skb_tunnel_rx()
>>>
>>> (this was a patch from Tom Herbert, commit
>>> 693019e90ca45d881109d32c0c6d29adf03f6447 (net: reset skb queue mapping
>>> when rx'ing over tunnel )
>>>
>>> Meaning we hit a single cpu for the GRO stuff in ip_gre.
>>>
>>> I have to think about it.
>>>
>>>
>>> Another question is :
>>>
>>> Can bnx2x check the tcp checksum if GRE encapsulated ?
>>>
>> Current HW can't provide this. Probably, it's possible to separate CSUM from GRO/TPA then stack will have to handle CSUM validation for huge packets. Is it worth?
>
> Could you elaborate on what you meant above? (I'm looking for any form
> of h/w assist for
> csum validation for GRO/TPA pkts since csum computation can be expensive and as
> you said below CHECKSUM_COMPLETE is out of the question.)
>
Current bnx2x HW is not able to perform CSUM validation for
encapsulated packets, so in any case host needs to do that.
Today GRO/TPA feature depends on CSUM, but theoretically (i did not
investigate it) and probably HW can provide aggregated packets w/o
csum validation - this will save headers processing for host.
> Thanks,
>
> Jerry
>
>>
^ permalink raw reply
* Re: [PATCH net-next 2/2] bnx2x: add RSS capability for GRE traffic
From: Eric Dumazet @ 2013-08-17 19:01 UTC (permalink / raw)
To: Dmitry Kravkov
Cc: Jerry Chu, Dmitry Kravkov, davem@davemloft.net,
netdev@vger.kernel.org, Eilon Greenstein, Tom Herbert,
Maciej Żenczykowski
In-Reply-To: <CAM8tLiNRi7mOb9wwSHuY4867ANUvzd_XxfZLV0gDPO2jKMtWsQ@mail.gmail.com>
On Sat, 2013-08-17 at 21:52 +0300, Dmitry Kravkov wrote:
>
> Current bnx2x HW is not able to perform CSUM validation for
> encapsulated packets, so in any case host needs to do that.
> Today GRO/TPA feature depends on CSUM, but theoretically (i did not
> investigate it) and probably HW can provide aggregated packets w/o
> csum validation - this will save headers processing for host.
I am not sure I understand this.
Aggregation cannot be done if csums are not validated.
^ permalink raw reply
* Re: [PATCH ipsec 1/3] ipv6: wire up skb->encapsulation
From: Eric Dumazet @ 2013-08-17 19:02 UTC (permalink / raw)
To: Hannes Frederic Sowa; +Cc: netdev, steffen.klassert, yoshfuji, nicolas.dichtel
In-Reply-To: <20130817175116.GA7001@order.stressinduktion.org>
On Sat, 2013-08-17 at 19:51 +0200, Hannes Frederic Sowa wrote:
> When pushing a new header before current one call skb_reset_inner_headers
> to record the position of the inner headers in the various ipv6 tunnel
> protocols.
>
> We later need this to correctly identify the addresses needed to send
> back an error in the xfrm layer.
>
> This change is safe, because skb->protocol is always checked before
> dereferencing data from the inner protocol.
>
> Cc: Steffen Klassert <steffen.klassert@secunet.com>
> Cc: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
> Cc: Nicolas Dichtel <nicolas.dichtel@6wind.com>
> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
> ---
Acked-by: Eric Dumazet <edumazet@googl.com>
^ permalink raw reply
* Re: [PATCH ipsec 2/3] ipv6: xfrm: dereference inner ipv6 header if encapsulated
From: Eric Dumazet @ 2013-08-17 19:03 UTC (permalink / raw)
To: Hannes Frederic Sowa; +Cc: netdev, steffen.klassert
In-Reply-To: <20130817175130.GA7039@order.stressinduktion.org>
On Sat, 2013-08-17 at 19:51 +0200, Hannes Frederic Sowa wrote:
> In xfrm6_local_error use inner_header if the packet was encapsulated.
>
> Cc: Steffen Klassert <steffen.klassert@secunet.com>
> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
> ---
>
> This patch is based on Steffen Klassert's ipsec tree.
>
> net/ipv6/xfrm6_output.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/net/ipv6/xfrm6_output.c b/net/ipv6/xfrm6_output.c
> index 3ac5ab2..45effcc 100644
> --- a/net/ipv6/xfrm6_output.c
> +++ b/net/ipv6/xfrm6_output.c
> @@ -59,10 +59,12 @@ static void xfrm6_local_rxpmtu(struct sk_buff *skb, u32 mtu)
> void xfrm6_local_error(struct sk_buff *skb, u32 mtu)
> {
> struct flowi6 fl6;
> + struct ipv6hdr *hdr;
> struct sock *sk = skb->sk;
>
> + hdr = skb->encapsulation ? inner_ipv6_hdr(skb) : ipv6_hdr(skb);
> fl6.fl6_dport = inet_sk(sk)->inet_dport;
> - fl6.daddr = ipv6_hdr(skb)->daddr;
> + fl6.daddr = hdr->daddr;
>
> ipv6_local_error(sk, EMSGSIZE, &fl6, mtu);
> }
You could have use "const struct ipv6hdr *hdr;", but otherwise :
Acked-by: Eric Dumazet <edumazet@google.com>
^ permalink raw reply
* Re: [PATCH net-next 2/2] bnx2x: add RSS capability for GRE traffic
From: Dmitry Kravkov @ 2013-08-17 19:04 UTC (permalink / raw)
To: Eric Dumazet
Cc: Jerry Chu, Dmitry Kravkov, davem@davemloft.net,
netdev@vger.kernel.org, Eilon Greenstein, Tom Herbert,
Maciej Żenczykowski
In-Reply-To: <1376766116.21329.9.camel@edumazet-glaptop>
On Sat, Aug 17, 2013 at 10:01 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> On Sat, 2013-08-17 at 21:52 +0300, Dmitry Kravkov wrote:
>
>>
>> Current bnx2x HW is not able to perform CSUM validation for
>> encapsulated packets, so in any case host needs to do that.
>> Today GRO/TPA feature depends on CSUM, but theoretically (i did not
>> investigate it) and probably HW can provide aggregated packets w/o
>> csum validation - this will save headers processing for host.
>
> I am not sure I understand this.
>
> Aggregation cannot be done if csums are not validated.
>
>
Thanks. Eric. So we can't do with current bnx2x HW.
^ permalink raw reply
* Re: [PATCH ipsec 3/3] xfrm: choose protocol family by skb protocol
From: Eric Dumazet @ 2013-08-17 19:04 UTC (permalink / raw)
To: Hannes Frederic Sowa; +Cc: netdev, steffen.klassert
In-Reply-To: <20130817175137.GA7088@order.stressinduktion.org>
On Sat, 2013-08-17 at 19:51 +0200, Hannes Frederic Sowa wrote:
> We need to choose the protocol family by skb->protocol. Otherwise we
> call the wrong xfrm{4,6}_local_error handler in case an ipv6 sockets is
> used in ipv4 mode, in which case we should call down to xfrm4_local_error
> (ip6 sockets are a superset of ip4 ones).
>
> We are called before before ip_output functions, so skb->protocol is
> not reset.
>
> Cc: Steffen Klassert <steffen.klassert@secunet.com>
> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
> ---
Acked-by: Eric Dumazet <edumazet@google.com>
^ permalink raw reply
* Re: [PATCH ipsec 2/3] ipv6: xfrm: dereference inner ipv6 header if encapsulated
From: Hannes Frederic Sowa @ 2013-08-17 19:53 UTC (permalink / raw)
To: Eric Dumazet; +Cc: netdev, steffen.klassert
In-Reply-To: <1376766234.21329.11.camel@edumazet-glaptop>
On Sat, Aug 17, 2013 at 12:03:54PM -0700, Eric Dumazet wrote:
> On Sat, 2013-08-17 at 19:51 +0200, Hannes Frederic Sowa wrote:
> > In xfrm6_local_error use inner_header if the packet was encapsulated.
> >
> > Cc: Steffen Klassert <steffen.klassert@secunet.com>
> > Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
> > ---
> >
> > This patch is based on Steffen Klassert's ipsec tree.
> >
> > net/ipv6/xfrm6_output.c | 4 +++-
> > 1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/net/ipv6/xfrm6_output.c b/net/ipv6/xfrm6_output.c
> > index 3ac5ab2..45effcc 100644
> > --- a/net/ipv6/xfrm6_output.c
> > +++ b/net/ipv6/xfrm6_output.c
> > @@ -59,10 +59,12 @@ static void xfrm6_local_rxpmtu(struct sk_buff *skb, u32 mtu)
> > void xfrm6_local_error(struct sk_buff *skb, u32 mtu)
> > {
> > struct flowi6 fl6;
> > + struct ipv6hdr *hdr;
> > struct sock *sk = skb->sk;
> >
> > + hdr = skb->encapsulation ? inner_ipv6_hdr(skb) : ipv6_hdr(skb);
> > fl6.fl6_dport = inet_sk(sk)->inet_dport;
> > - fl6.daddr = ipv6_hdr(skb)->daddr;
> > + fl6.daddr = hdr->daddr;
> >
> > ipv6_local_error(sk, EMSGSIZE, &fl6, mtu);
> > }
>
> You could have use "const struct ipv6hdr *hdr;", but otherwise :
Thanks for the review, Eric!
I do think such details matter, so I'll respin this series by tomorrow.
^ permalink raw reply
* Re: [PATCH RESEND] can: mcp251x: Replace power callbacks with regulator API
From: Marc Kleine-Budde @ 2013-08-17 19:59 UTC (permalink / raw)
To: Alexander Shiyan
Cc: Haojian Zhuang, Eric Miao, netdev, linux-can, Wolfgang Grandegger,
Russell King, linux-arm-kernel
In-Reply-To: <20130817083014.a01144051b158c34ec7dd9d9@mail.ru>
[-- Attachment #1: Type: text/plain, Size: 1749 bytes --]
On 08/17/2013 06:30 AM, Alexander Shiyan wrote:
[...]
>> Since DT conversion isn't finished, I still accept the board files.
>> But this patch should be split into two parts. One is for pxa, and the
>> other one is for net.
>
> Patch cannot be splitted because this can create hole which break git-bisect.
>
> In any case, I want to create a v2 with a more detailed description, and I
> have a supplementary question for the CAN subsystem maintainers.
> "Transciever power" is not used by any of the boards, can we remove it
> completely? This will greatly simplify driver.
Do you mean the former transceiver_enable() callback?
> struct mcp251x_platform_data {
> unsigned long oscillator_frequency;
> unsigned long irq_flags;
> - int (*board_specific_setup)(struct spi_device *spi);
> - int (*transceiver_enable)(int enable);
> - int (*power_enable) (int enable);
> };
Having a switchable transceiver is a quite common thing. So I'd like
that you keep it. The flexcan driver was just converted from a callback
to a regulator too. It already has device tree bindings and I'd like to
use these bindings as a standard for new drivers. From flexcan's dt
bindings:
> - xceiver-supply: Regulator that powers the CAN transceiver
which translates into:
> priv->reg_xceiver = devm_regulator_get(&pdev->dev, "xceiver");
Can you please use "xceiver" instead of "transceiver", so that future DT
binding will fit the scheme.
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 259 bytes --]
^ permalink raw reply
* Re: [PATCH RESEND] can: mcp251x: Replace power callbacks with regulator API
From: Alexander Shiyan @ 2013-08-17 21:10 UTC (permalink / raw)
To: Marc Kleine-Budde
Cc: Russell King, netdev, Haojian Zhuang, linux-can, linux-arm-kernel,
Eric Miao, Wolfgang Grandegger
In-Reply-To: <520FD60E.4040709@pengutronix.de>
> On 08/17/2013 06:30 AM, Alexander Shiyan wrote:
> [...]
> >> Since DT conversion isn't finished, I still accept the board files.
> >> But this patch should be split into two parts. One is for pxa, and the
> >> other one is for net.
> >
> > Patch cannot be splitted because this can create hole which break git-bisect.
> >
> > In any case, I want to create a v2 with a more detailed description, and I
> > have a supplementary question for the CAN subsystem maintainers.
> > "Transciever power" is not used by any of the boards, can we remove it
> > completely? This will greatly simplify driver.
>
> Do you mean the former transceiver_enable() callback?
Yes.
> > struct mcp251x_platform_data {
> > unsigned long oscillator_frequency;
> > unsigned long irq_flags;
> > - int (*board_specific_setup)(struct spi_device *spi);
> > - int (*transceiver_enable)(int enable);
> > - int (*power_enable) (int enable);
> > };
>
> Having a switchable transceiver is a quite common thing. So I'd like
> that you keep it. The flexcan driver was just converted from a callback
> to a regulator too. It already has device tree bindings and I'd like to
> use these bindings as a standard for new drivers. From flexcan's dt
> bindings:
>
> > - xceiver-supply: Regulator that powers the CAN transceiver
>
> which translates into:
>
> > priv->reg_xceiver = devm_regulator_get(&pdev->dev, "xceiver");
>
> Can you please use "xceiver" instead of "transceiver", so that future DT
> binding will fit the scheme.
OK. I am not ready to add DT support yet, but it can be added later,
so v2 will contain 3 parts:
1 - Replace power callbacks with regulator API
2 - Eliminate mcp251x_platform_data->irq_flags
3 - Replace oscillator_frequency with CLK API (and remove mcp251x.h header)
Are you OK with such changes?
---
^ permalink raw reply
* Re: [PATCH v2] r8169: fix invalid register dump
From: Francois Romieu @ 2013-08-17 21:14 UTC (permalink / raw)
To: Ben Hutchings; +Cc: Peter Wu, netdev, nic_swsd
In-Reply-To: <1376735258.11042.102.camel@deadeye.wl.decadent.org.uk>
Ben Hutchings <bhutchings@solarflare.com> :
[...]
> I would be very wary of accessing registers with any width other than
> the usual (32 bits).
You are right. Most registers do not seem to care - some are 8 bits
wide - but the 8168c datasheet states that it's out of spec for the
descriptor ring address registers.
Peter, please use Ben's suggestion as is.
--
Ueimor
^ permalink raw reply
* [PATCH 0/2] SH: fix platform Ether support
From: Sergei Shtylyov @ 2013-08-17 22:11 UTC (permalink / raw)
To: netdev, lethal, linux-sh, davem
Hello.
Here's a couple of patches fixing Ether support on some SH platforms.
They are against David Miller's 'net.git' (and also apply to 'net-next.git)
since they are prerequisite for the 'sh_eth' driver cleanup patchset that will
be posted a bit later. David, can I ask you to push these patches thru your
tree for that reason?
[1/2] SH7619: fix Ether support
[2/2] SolutionEngine7724: fix Ether support
WBR, Sergei
^ permalink raw reply
* [PATCH 0/2] SH: fix platform Ether support
From: Sergei Shtylyov @ 2013-08-17 22:13 UTC (permalink / raw)
To: netdev, lethal, linux-sh, davem
Hello.
[Resending with correct David's email.]
Here's a couple of patches fixing Ether support on some SH platforms.
They are against David Miller's 'net.git' (and also apply to 'net-next.git)
since they are prerequisite for the 'sh_eth' driver cleanup patchset that will
be posted a bit later. David, can I ask you to push these patches thru your
tree for that reason?
[1/2] SH7619: fix Ether support
[2/2] SolutionEngine7724: fix Ether support
WBR, Sergei
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox