* Re: [PATCH] net-netlink: fix diag to export IPv4 tos for dual-stack IPv6 sockets
From: David Miller @ 2011-11-22 21:03 UTC (permalink / raw)
To: zenczykowski; +Cc: netdev, maze, muralira, shemminger, eric.dumazet
In-Reply-To: <CAHo-OoxNkDvuTJWfz=Q6XxS_gJyf-w_A=V_3Qi8hL_k5-18RPg@mail.gmail.com>
From: Maciej Żenczykowski <zenczykowski@gmail.com>
Date: Mon, 21 Nov 2011 17:52:09 -0800
> As you see, I've decided to go with the simplest 'punt the problem to
> userspace' solution.
>
> Hope this is acceptable...
It's a good solution, especially for 3.2-rcX
Thanks.
^ permalink raw reply
* Re: [PATCH] net-netlink: fix diag to export IPv4 tos for dual-stack IPv6 sockets
From: David Miller @ 2011-11-22 21:03 UTC (permalink / raw)
To: zenczykowski; +Cc: maze, netdev, muralira, shemminger, eric.dumazet
In-Reply-To: <1321926620-28753-1-git-send-email-zenczykowski@gmail.com>
From: Maciej Żenczykowski <zenczykowski@gmail.com>
Date: Mon, 21 Nov 2011 17:50:20 -0800
> From: Maciej Żenczykowski <maze@google.com>
>
> Signed-off-by: Maciej Żenczykowski <maze@google.com>
Looks good, applied, thanks!
^ permalink raw reply
* Re: [PATCH net-next 0/4] tg3: Cleanups, corrections, and MDI-X
From: David Miller @ 2011-11-22 21:02 UTC (permalink / raw)
To: mcarlson; +Cc: netdev
In-Reply-To: <1321923680-7925-1-git-send-email-mcarlson@broadcom.com>
From: "Matt Carlson" <mcarlson@broadcom.com>
Date: Mon, 21 Nov 2011 17:01:16 -0800
> This patchset cleans-up 1000Base-X flow control resolution, then continues
> on to tune some thresholds and then adds MDI-X reporting.
Series applied, thanks.
^ permalink raw reply
* Re: pull request: wireless 2011-11-22
From: John W. Linville @ 2011-11-22 20:56 UTC (permalink / raw)
To: David Miller; +Cc: linux-wireless, netdev, linux-kernel
In-Reply-To: <20111122.151429.253381379981773726.davem@davemloft.net>
On Tue, Nov 22, 2011 at 03:14:29PM -0500, David Miller wrote:
> From: "John W. Linville" <linville@tuxdriver.com>
> Date: Tue, 22 Nov 2011 14:35:05 -0500
>
> > Here is the latest batch of fixes intended for 3.2. This includes a
> > correction for a user-visible error in mac80211's debugfs info, a fix
> > for a potential memory corrupter in prism54, an endian fix for rt2x00,
> > an endian fix for mac80211, a fix for a NULL derefernce in cfg80211, a
> > locking fix and a deadlock fix for p54spi, and a pair of rt2x00 fixes
> > for handling some spurious interrupts that hardware can generate.
> >
> > Please let me know if there are problems!
>
> The rt2800pci change doesn't look correct.
>
> If the IRQ line is shared with another device, this change will make it
> never see interrupts. Once you say "IRQ_HANDLED" the IRQ dispatch
> stops processing the interrupt handler list.
I thought this at first as well. But looking at the code in
kernel/irq/handle.c doesn't support that conclusion. In fact, every
handler gets invoked no matter what they all return. All of the irq
handler return values are ORed together and passed to note_interrupt.
Only if every irq handler returns IRQ_NONE does the code in
kernel/irq/spurious.c start getting involved.
Anyway, this seems to be safe even for shared interrupts. That said,
this is a bit ugly. But it makes a serious difference in performance
for those afflicted with this issue.
John
--
John W. Linville Someday the world will need a hero, and you
linville@tuxdriver.com might be all we have. Be ready.
^ permalink raw reply
* Re: [PATCH 0/2] net: Add network priority cgroup (v4)
From: Neil Horman @ 2011-11-22 21:00 UTC (permalink / raw)
To: David Miller; +Cc: netdev, john.r.fastabend, robert.w.love
In-Reply-To: <20111122.154516.228225371031125826.davem@davemloft.net>
On Tue, Nov 22, 2011 at 03:45:16PM -0500, David Miller wrote:
> From: Neil Horman <nhorman@tuxdriver.com>
> Date: Tue, 22 Nov 2011 15:39:38 -0500
>
> > On Tue, Nov 22, 2011 at 03:23:15PM -0500, David Miller wrote:
> >> From: Neil Horman <nhorman@tuxdriver.com>
> >> Date: Tue, 22 Nov 2011 10:10:50 -0500
> >>
> >> > (v2)
> >> > Based on reviews from John F., Amerigo Wang and Neerav Parikh, I've cleaned up
> >> > the rcu locking, fixed a memory leak in an error path, and corrected some typos.
> >> >
> >> > (v3)
> >> > Converted rcu_dereference to rntl_dereference where appropriate as per request
> >> > from John F.
> >> >
> >> > (v4)
> >> > Cleaned up some spacing issues, and optimized the skb_update_priority path as
> >> > per request from Dave M.
> >> >
> >> > Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> >> > Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
> >> > CC: Robert Love <robert.w.love@intel.com>
> >> > CC: "David S. Miller" <davem@davemloft.net>
> >>
> >> Applied and going through some build testing now, thanks Neil.
> > Thanks Dave! I tested here building separately with:
> > CONFIG_CGROUPS=n
> > CONFIG_CROUPS=y && CONFIG_NETPRIO_CGROUP=y
> > CONFIG_CROUPS=y && CONFIG_NETPRIO_CGROUP=m
> >
> > So you should be square, but theres rarely any valid accounting for my ability
> > to screw something up :)
>
> I want to be absolutely sure, because I had to apply your changes by hand,
> in particular the linux/netdevice.h changes had line offsets of up to 67.
Really? Thats odd, I've got thse changes here applied to a local copy of the
net-next tree. I branched from commit 8b3408f8ee994973869d8ba32c5bf482bc4ddca4
and it applies cleanly. Perhaps something wen't in while I was developing this?
Thanks & Regards
Neil
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply
* Re: [PATCH] CDC NCM: Use kzalloc rather than kmalloc followed by memset with 0
From: David Miller @ 2011-11-22 20:58 UTC (permalink / raw)
To: thomas; +Cc: oliver, linux-usb, netdev, linux-kernel
In-Reply-To: <1321569820.1624.264.camel@localhost.localdomain>
From: Thomas Meyer <thomas@m3y3r.de>
Date: Thu, 17 Nov 2011 23:43:40 +0100
> This considers some simple cases that are common and easy to validate
> Note in particular that there are no ...s in the rule, so all of the
> matched code has to be contiguous
>
> The semantic patch that makes this change is available
> in scripts/coccinelle/api/alloc/kzalloc-simple.cocci.
>
> Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Applied.
^ permalink raw reply
* [PATCH net-next] net: remove netdev_alloc_page and use __GFP_COLD
From: Eric Dumazet @ 2011-11-22 20:57 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Jeff Kirsher, Dimitris Michailidis
Given we dont use anymore the struct net_device *dev argument, and this
interface brings litle benefit, remove netdev_{alloc|free}_page(), to
debloat include/linux/skbuff.h a bit.
(Some drivers used a mix of these interfaces and alloc_pages())
When allocating a page given to device for DMA transfert (device to
memory), it makes sense to use a cold one (__GFP_COLD)
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
CC: Dimitris Michailidis <dm@chelsio.com>
---
drivers/net/ethernet/chelsio/cxgb4/sge.c | 6 +-
drivers/net/ethernet/chelsio/cxgb4vf/sge.c | 5 -
drivers/net/ethernet/intel/igb/igb_main.c | 2
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 2
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 2
drivers/net/usb/cdc-phonet.c | 10 +--
drivers/usb/gadget/f_phonet.c | 11 +---
include/linux/skbuff.h | 32 ------------
8 files changed, 18 insertions(+), 52 deletions(-)
diff --git a/drivers/net/ethernet/chelsio/cxgb4/sge.c b/drivers/net/ethernet/chelsio/cxgb4/sge.c
index 140254c..2dae795 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/sge.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/sge.c
@@ -491,7 +491,7 @@ static unsigned int refill_fl(struct adapter *adap, struct sge_fl *q, int n,
__be64 *d = &q->desc[q->pidx];
struct rx_sw_desc *sd = &q->sdesc[q->pidx];
- gfp |= __GFP_NOWARN; /* failures are expected */
+ gfp |= __GFP_NOWARN | __GFP_COLD;
#if FL_PG_ORDER > 0
/*
@@ -528,7 +528,7 @@ static unsigned int refill_fl(struct adapter *adap, struct sge_fl *q, int n,
#endif
while (n--) {
- pg = __netdev_alloc_page(adap->port[0], gfp);
+ pg = alloc_page(gfp);
if (unlikely(!pg)) {
q->alloc_failed++;
break;
@@ -537,7 +537,7 @@ static unsigned int refill_fl(struct adapter *adap, struct sge_fl *q, int n,
mapping = dma_map_page(adap->pdev_dev, pg, 0, PAGE_SIZE,
PCI_DMA_FROMDEVICE);
if (unlikely(dma_mapping_error(adap->pdev_dev, mapping))) {
- netdev_free_page(adap->port[0], pg);
+ put_page(pg);
goto out;
}
*d++ = cpu_to_be64(mapping);
diff --git a/drivers/net/ethernet/chelsio/cxgb4vf/sge.c b/drivers/net/ethernet/chelsio/cxgb4vf/sge.c
index 8d5d55a..c381db2 100644
--- a/drivers/net/ethernet/chelsio/cxgb4vf/sge.c
+++ b/drivers/net/ethernet/chelsio/cxgb4vf/sge.c
@@ -653,8 +653,7 @@ static unsigned int refill_fl(struct adapter *adapter, struct sge_fl *fl,
alloc_small_pages:
while (n--) {
- page = __netdev_alloc_page(adapter->port[0],
- gfp | __GFP_NOWARN);
+ page = alloc_page(gfp | __GFP_NOWARN | __GFP_COLD);
if (unlikely(!page)) {
fl->alloc_failed++;
break;
@@ -664,7 +663,7 @@ alloc_small_pages:
dma_addr = dma_map_page(adapter->pdev_dev, page, 0, PAGE_SIZE,
PCI_DMA_FROMDEVICE);
if (unlikely(dma_mapping_error(adapter->pdev_dev, dma_addr))) {
- netdev_free_page(adapter->port[0], page);
+ put_page(page);
break;
}
*d++ = cpu_to_be64(dma_addr);
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index bd9b30e..b66b8aa 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -6135,7 +6135,7 @@ static bool igb_alloc_mapped_page(struct igb_ring *rx_ring,
return true;
if (!page) {
- page = netdev_alloc_page(rx_ring->netdev);
+ page = alloc_page(GFP_ATOMIC | __GFP_COLD);
bi->page = page;
if (unlikely(!page)) {
rx_ring->rx_stats.alloc_failed++;
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 820fc04..1b28ed9 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -1140,7 +1140,7 @@ void ixgbe_alloc_rx_buffers(struct ixgbe_ring *rx_ring, u16 cleaned_count)
if (ring_is_ps_enabled(rx_ring)) {
if (!bi->page) {
- bi->page = netdev_alloc_page(rx_ring->netdev);
+ bi->page = alloc_page(GFP_ATOMIC | __GFP_COLD);
if (!bi->page) {
rx_ring->rx_stats.alloc_rx_page_failed++;
goto no_buffers;
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
index 0c39bb1..5d1a643 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
@@ -366,7 +366,7 @@ static void ixgbevf_alloc_rx_buffers(struct ixgbevf_adapter *adapter,
if (!bi->page_dma &&
(adapter->flags & IXGBE_FLAG_RX_PS_ENABLED)) {
if (!bi->page) {
- bi->page = netdev_alloc_page(adapter->netdev);
+ bi->page = alloc_page(GFP_ATOMIC | __GFP_COLD);
if (!bi->page) {
adapter->alloc_rx_page_failed++;
goto no_buffers;
diff --git a/drivers/net/usb/cdc-phonet.c b/drivers/net/usb/cdc-phonet.c
index a60d006..331e440 100644
--- a/drivers/net/usb/cdc-phonet.c
+++ b/drivers/net/usb/cdc-phonet.c
@@ -130,7 +130,7 @@ static int rx_submit(struct usbpn_dev *pnd, struct urb *req, gfp_t gfp_flags)
struct page *page;
int err;
- page = __netdev_alloc_page(dev, gfp_flags);
+ page = alloc_page(gfp_flags);
if (!page)
return -ENOMEM;
@@ -140,7 +140,7 @@ static int rx_submit(struct usbpn_dev *pnd, struct urb *req, gfp_t gfp_flags)
err = usb_submit_urb(req, gfp_flags);
if (unlikely(err)) {
dev_dbg(&dev->dev, "RX submit error (%d)\n", err);
- netdev_free_page(dev, page);
+ put_page(page);
}
return err;
}
@@ -208,9 +208,9 @@ static void rx_complete(struct urb *req)
dev->stats.rx_errors++;
resubmit:
if (page)
- netdev_free_page(dev, page);
+ put_page(page);
if (req)
- rx_submit(pnd, req, GFP_ATOMIC);
+ rx_submit(pnd, req, GFP_ATOMIC | __GFP_COLD);
}
static int usbpn_close(struct net_device *dev);
@@ -229,7 +229,7 @@ static int usbpn_open(struct net_device *dev)
for (i = 0; i < rxq_size; i++) {
struct urb *req = usb_alloc_urb(0, GFP_KERNEL);
- if (!req || rx_submit(pnd, req, GFP_KERNEL)) {
+ if (!req || rx_submit(pnd, req, GFP_KERNEL | __GFP_COLD)) {
usbpn_close(dev);
return -ENOMEM;
}
diff --git a/drivers/usb/gadget/f_phonet.c b/drivers/usb/gadget/f_phonet.c
index 16a509a..7cdcb63 100644
--- a/drivers/usb/gadget/f_phonet.c
+++ b/drivers/usb/gadget/f_phonet.c
@@ -298,11 +298,10 @@ static void pn_net_setup(struct net_device *dev)
static int
pn_rx_submit(struct f_phonet *fp, struct usb_request *req, gfp_t gfp_flags)
{
- struct net_device *dev = fp->dev;
struct page *page;
int err;
- page = __netdev_alloc_page(dev, gfp_flags);
+ page = alloc_page(gfp_flags);
if (!page)
return -ENOMEM;
@@ -312,7 +311,7 @@ pn_rx_submit(struct f_phonet *fp, struct usb_request *req, gfp_t gfp_flags)
err = usb_ep_queue(fp->out_ep, req, gfp_flags);
if (unlikely(err))
- netdev_free_page(dev, page);
+ put_page(page);
return err;
}
@@ -374,9 +373,9 @@ static void pn_rx_complete(struct usb_ep *ep, struct usb_request *req)
}
if (page)
- netdev_free_page(dev, page);
+ put_page(page);
if (req)
- pn_rx_submit(fp, req, GFP_ATOMIC);
+ pn_rx_submit(fp, req, GFP_ATOMIC | __GFP_COLD);
}
/*-------------------------------------------------------------------------*/
@@ -436,7 +435,7 @@ static int pn_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
netif_carrier_on(dev);
for (i = 0; i < phonet_rxq_size; i++)
- pn_rx_submit(fp, fp->out_reqv[i], GFP_ATOMIC);
+ pn_rx_submit(fp, fp->out_reqv[i], GFP_ATOMIC | __GFP_COLD);
}
spin_unlock(&port->lock);
return 0;
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 09b7ea5..cec0657 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -1669,38 +1669,6 @@ static inline struct sk_buff *netdev_alloc_skb_ip_align(struct net_device *dev,
}
/**
- * __netdev_alloc_page - allocate a page for ps-rx on a specific device
- * @dev: network device to receive on
- * @gfp_mask: alloc_pages_node mask
- *
- * Allocate a new page. dev currently unused.
- *
- * %NULL is returned if there is no free memory.
- */
-static inline struct page *__netdev_alloc_page(struct net_device *dev, gfp_t gfp_mask)
-{
- return alloc_pages_node(NUMA_NO_NODE, gfp_mask, 0);
-}
-
-/**
- * netdev_alloc_page - allocate a page for ps-rx on a specific device
- * @dev: network device to receive on
- *
- * Allocate a new page. dev currently unused.
- *
- * %NULL is returned if there is no free memory.
- */
-static inline struct page *netdev_alloc_page(struct net_device *dev)
-{
- return __netdev_alloc_page(dev, GFP_ATOMIC);
-}
-
-static inline void netdev_free_page(struct net_device *dev, struct page *page)
-{
- __free_page(page);
-}
-
-/**
* skb_frag_page - retrieve the page refered to by a paged fragment
* @frag: the paged fragment
*
^ permalink raw reply related
* Re: softirq oops from b44_poll
From: David Miller @ 2011-11-22 20:54 UTC (permalink / raw)
To: peter.p.waskiewicz.jr; +Cc: lkml, linux-kernel, netdev
In-Reply-To: <1321917453.10276.3.camel@pjaxe>
From: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Date: Mon, 21 Nov 2011 15:17:33 -0800
> I suspect the "right" way to fix this is to call dev_kfree_skb_any(skb);
> instead, since that will handle the in-interrupt case if that's where
> we're stuck.
Caller is always b44_poll(), and that caller always does spin_lock_irqsave().
Adding the extra tests implied by dev_kfree_skb_any() therefore doesn't
make any sense, as it will always evaluate to dev_kfree_skb_irq().
^ permalink raw reply
* Re: [GIT PULL v2] Open vSwitch
From: David Miller @ 2011-11-22 20:50 UTC (permalink / raw)
To: jesse-l0M0P4e3n4LQT0dZR+AlfA
Cc: dev-yBygre7rU0TnMu66kgdUjQ, netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1321911029-20707-1-git-send-email-jesse-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
I would like to see some discussion wrt. Jamal's feedback, which is that
a lot of the side-band functionality added by this code is either 1) already
doable with packet scheduler actions or 2) should be implemented there.
^ permalink raw reply
* Re: [PATCH net-next v1 0/4] e1000e: ethtool setfeatures fixes + loopback
From: David Miller @ 2011-11-22 20:49 UTC (permalink / raw)
To: david.decotigny
Cc: ian.campbell, paul.gortmaker, e1000-devel, bruce.w.allan,
jesse.brandeburg, linux-kernel, john.ronciak, netdev
In-Reply-To: <20111122.154927.1808817488257424268.davem@davemloft.net>
Sorry I replied to the wrong posting :-/ My bad.
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply
* Re: [PATCH net-next v1 0/4] e1000e: ethtool setfeatures fixes + loopback
From: David Miller @ 2011-11-22 20:49 UTC (permalink / raw)
To: david.decotigny
Cc: ian.campbell, paul.gortmaker, e1000-devel, bruce.w.allan,
jesse.brandeburg, linux-kernel, john.ronciak, netdev
In-Reply-To: <cover.1321917278.git.david.decotigny@google.com>
I would like to see some discussion wrt. Jamal's feedback, which is that
a lot of the side-band functionality added by this code is either 1) already
doable with packet scheduler actions or 2) should be implemented there.
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply
* Re: [PATCH net-next v2 0/4] e1000e: ethtool setfeatures fixes + loopback
From: Jeff Kirsher @ 2011-11-22 20:46 UTC (permalink / raw)
To: David Decotigny
Cc: Brandeburg, Jesse, Allan, Bruce W, Wyborny, Carolyn,
Skidmore, Donald C, Rose, Gregory V, Waskiewicz Jr, Peter P,
Duyck, Alexander H, Ronciak, John,
e1000-devel@lists.sourceforge.net, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, David S. Miller, Eric Dumazet,
Ian Campbell, Paul Gortmaker
In-Reply-To: <cover.1321989502.git.david.decotigny@google.com>
[-- Attachment #1: Type: text/plain, Size: 1235 bytes --]
On Tue, 2011-11-22 at 11:23 -0800, David Decotigny wrote:
> This series fixes a bug in ethtool setfeatures and adds loopback
> support through ethtool setfeatures.
>
> I believe these patches could easily be adapted to e1000, but I don't
> have the hardware to test.
>
> Changes since v1:
> - simplification in patch 1/4 (from Michał Mirosław)
>
> ############################################
> # Patch Set Summary:
>
> David Decotigny (2):
> net-e1000e: fix ethtool set_features taking new features into account
> too late
> net-e1000e: ethtool loopback support
>
> Maciej Żenczykowski (2):
> net-e1000e: reworked carrier detection logic
> net-e1000e: Report carrier in loopback mode
>
> drivers/net/ethernet/intel/e1000e/e1000.h | 2 +
> drivers/net/ethernet/intel/e1000e/ethtool.c | 6 +-
> drivers/net/ethernet/intel/e1000e/netdev.c | 32 +++++++++++-
> drivers/net/ethernet/intel/e1000e/phy.c | 69 +++++++++++++++++----------
> 4 files changed, 78 insertions(+), 31 deletions(-)
>
Thanks David for the patch set. I have added the e1000e patches to my
queue. As an fyi, I want Bruce Allan to look over these patches and he
is out this week on vacation.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* Re: [PATCH 0/2] net: Add network priority cgroup (v4)
From: David Miller @ 2011-11-22 20:45 UTC (permalink / raw)
To: nhorman; +Cc: netdev, john.r.fastabend, robert.w.love
In-Reply-To: <20111122203938.GB4207@hmsreliant.think-freely.org>
From: Neil Horman <nhorman@tuxdriver.com>
Date: Tue, 22 Nov 2011 15:39:38 -0500
> On Tue, Nov 22, 2011 at 03:23:15PM -0500, David Miller wrote:
>> From: Neil Horman <nhorman@tuxdriver.com>
>> Date: Tue, 22 Nov 2011 10:10:50 -0500
>>
>> > (v2)
>> > Based on reviews from John F., Amerigo Wang and Neerav Parikh, I've cleaned up
>> > the rcu locking, fixed a memory leak in an error path, and corrected some typos.
>> >
>> > (v3)
>> > Converted rcu_dereference to rntl_dereference where appropriate as per request
>> > from John F.
>> >
>> > (v4)
>> > Cleaned up some spacing issues, and optimized the skb_update_priority path as
>> > per request from Dave M.
>> >
>> > Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
>> > Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
>> > CC: Robert Love <robert.w.love@intel.com>
>> > CC: "David S. Miller" <davem@davemloft.net>
>>
>> Applied and going through some build testing now, thanks Neil.
> Thanks Dave! I tested here building separately with:
> CONFIG_CGROUPS=n
> CONFIG_CROUPS=y && CONFIG_NETPRIO_CGROUP=y
> CONFIG_CROUPS=y && CONFIG_NETPRIO_CGROUP=m
>
> So you should be square, but theres rarely any valid accounting for my ability
> to screw something up :)
I want to be absolutely sure, because I had to apply your changes by hand,
in particular the linux/netdevice.h changes had line offsets of up to 67.
^ permalink raw reply
* Re: [PATCH 0/2] net: Add network priority cgroup (v4)
From: Neil Horman @ 2011-11-22 20:39 UTC (permalink / raw)
To: David Miller; +Cc: netdev, john.r.fastabend, robert.w.love
In-Reply-To: <20111122.152315.2256366823688148380.davem@davemloft.net>
On Tue, Nov 22, 2011 at 03:23:15PM -0500, David Miller wrote:
> From: Neil Horman <nhorman@tuxdriver.com>
> Date: Tue, 22 Nov 2011 10:10:50 -0500
>
> > (v2)
> > Based on reviews from John F., Amerigo Wang and Neerav Parikh, I've cleaned up
> > the rcu locking, fixed a memory leak in an error path, and corrected some typos.
> >
> > (v3)
> > Converted rcu_dereference to rntl_dereference where appropriate as per request
> > from John F.
> >
> > (v4)
> > Cleaned up some spacing issues, and optimized the skb_update_priority path as
> > per request from Dave M.
> >
> > Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> > Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
> > CC: Robert Love <robert.w.love@intel.com>
> > CC: "David S. Miller" <davem@davemloft.net>
>
> Applied and going through some build testing now, thanks Neil.
Thanks Dave! I tested here building separately with:
CONFIG_CGROUPS=n
CONFIG_CROUPS=y && CONFIG_NETPRIO_CGROUP=y
CONFIG_CROUPS=y && CONFIG_NETPRIO_CGROUP=m
So you should be square, but theres rarely any valid accounting for my ability
to screw something up :)
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply
* Re: [PATCH net-next] atm: use SKB_TRUESIZE() in atm_guess_pdu2truesize()
From: chas williams - CONTRACTOR @ 2011-11-22 20:22 UTC (permalink / raw)
To: Eric Dumazet; +Cc: netdev
In-Reply-To: <1321941094.27077.14.camel@edumazet-laptop>
it doesnt seem like a good idea to create a wrapper for a one to one
call. perhaps this whole bit of nonsense should be removed. the
iphase driver should be returning skb->truesize like everyone.
if atm_alloc_charge() just uses SKB_TRUESIZE() then we konw that guess
will be the same as skb->truesize and atm_alloc_charge() can be
simplified by removing atomic_add(skb->truesize - guess, which will be
0 in all cases.
something like:
diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c
index 3d0c2b0..9e373ba 100644
--- a/drivers/atm/iphase.c
+++ b/drivers/atm/iphase.c
@@ -1320,8 +1320,8 @@ static void rx_dle_intr(struct atm_dev *dev)
if (ia_vcc == NULL)
{
atomic_inc(&vcc->stats->rx_err);
+ atm_return(vcc, skb->truesize);
dev_kfree_skb_any(skb);
- atm_return(vcc, atm_guess_pdu2truesize(len));
goto INCR_DLE;
}
// get real pkt length pwang_test
@@ -1334,8 +1334,8 @@ static void rx_dle_intr(struct atm_dev *dev)
atomic_inc(&vcc->stats->rx_err);
IF_ERR(printk("rx_dle_intr: Bad AAL5 trailer %d (skb len %d)",
length, skb->len);)
+ atm_return(vcc, skb->truesize);
dev_kfree_skb_any(skb);
- atm_return(vcc, atm_guess_pdu2truesize(len));
goto INCR_DLE;
}
skb_trim(skb, length);
diff --git a/net/atm/atm_misc.c b/net/atm/atm_misc.c
index f41f026..073fd99 100644
--- a/net/atm/atm_misc.c
+++ b/net/atm/atm_misc.c
@@ -26,19 +26,16 @@ struct sk_buff *atm_alloc_charge(struct atm_vcc *vcc, int pdu_size,
gfp_t gfp_flags)
{
struct sock *sk = sk_atm(vcc);
- int guess = atm_guess_pdu2truesize(pdu_size);
+ int truesize = SKB_TRUESIZE(pdu_size);
- atm_force_charge(vcc, guess);
+ atm_force_charge(vcc, truesize);
if (atomic_read(&sk->sk_rmem_alloc) <= sk->sk_rcvbuf) {
struct sk_buff *skb = alloc_skb(pdu_size, gfp_flags);
- if (skb) {
- atomic_add(skb->truesize-guess,
- &sk->sk_rmem_alloc);
+ if (skb)
return skb;
- }
}
- atm_return(vcc, guess);
+ atm_return(vcc, truesize);
atomic_inc(&vcc->stats->rx_drop);
return NULL;
}
On Tue, 22 Nov 2011 06:51:34 +0100
Eric Dumazet <eric.dumazet@gmail.com> wrote:
> SKB_TRUESIZE() provides a better approximation of expected skb truesize.
>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
> ---
> include/linux/atmdev.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h
> index 49a83ca..43ea1b2 100644
> --- a/include/linux/atmdev.h
> +++ b/include/linux/atmdev.h
> @@ -452,7 +452,7 @@ void atm_dev_release_vccs(struct atm_dev *dev);
>
> static inline int atm_guess_pdu2truesize(int size)
> {
> - return SKB_DATA_ALIGN(size) + sizeof(struct skb_shared_info);
> + return SKB_TRUESIZE(size);
> }
>
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply related
* [PATCH] net-e1000e: Report carrier in loopback mode.
From: Maciej Żenczykowski @ 2011-11-22 20:34 UTC (permalink / raw)
To: Maciej Żenczykowski; +Cc: netdev, Maciej Żenczykowski
In-Reply-To: <CAHo-OozdBn5jBNsRVzbCnmxozquJnTAYa0bNbK5VoaiKaK=7qQ@mail.gmail.com>
From: Maciej Żenczykowski <maze@google.com>
When loopback mode is forced on interface, and if the carrier check returns
negative, then force carrier check positive. This is useful when interface
does not have carrier and test puts the interface in loopback mode.
While we're at it rework the code to fix other bugs in it.
---
drivers/net/ethernet/intel/e1000e/e1000.h | 4 +-
drivers/net/ethernet/intel/e1000e/ich8lan.c | 4 +-
drivers/net/ethernet/intel/e1000e/lib.c | 2 +-
drivers/net/ethernet/intel/e1000e/phy.c | 98 +++++++++++++++++----------
4 files changed, 68 insertions(+), 40 deletions(-)
diff --git a/drivers/net/ethernet/intel/e1000e/e1000.h b/drivers/net/ethernet/intel/e1000e/e1000.h
index 9fe18d1..93ffc39 100644
--- a/drivers/net/ethernet/intel/e1000e/e1000.h
+++ b/drivers/net/ethernet/intel/e1000e/e1000.h
@@ -620,8 +620,8 @@ extern s32 e1000e_write_kmrn_reg_locked(struct e1000_hw *hw, u32 offset,
extern s32 e1000e_read_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 *data);
extern s32 e1000e_read_kmrn_reg_locked(struct e1000_hw *hw, u32 offset,
u16 *data);
-extern s32 e1000e_phy_has_link_generic(struct e1000_hw *hw, u32 iterations,
- u32 usec_interval, bool *success);
+extern s32 e1000e_phy_has_link_generic(struct e1000_hw *hw, int intervals,
+ u32 usec_interval, bool *link);
extern s32 e1000e_phy_reset_dsp(struct e1000_hw *hw);
extern void e1000_power_up_phy_copper(struct e1000_hw *hw);
extern void e1000_power_down_phy_copper(struct e1000_hw *hw);
diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c
index e2a80a2..955cd8c 100644
--- a/drivers/net/ethernet/intel/e1000e/ich8lan.c
+++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c
@@ -681,7 +681,7 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw)
* link. If so, then we want to get the current speed/duplex
* of the PHY.
*/
- ret_val = e1000e_phy_has_link_generic(hw, 1, 0, &link);
+ ret_val = e1000e_phy_has_link_generic(hw, 0, 0, &link);
if (ret_val)
goto out;
@@ -3527,7 +3527,7 @@ static s32 e1000_kmrn_lock_loss_workaround_ich8lan(struct e1000_hw *hw)
* Attempting this while link is negotiating fouled up link
* stability
*/
- ret_val = e1000e_phy_has_link_generic(hw, 1, 0, &link);
+ ret_val = e1000e_phy_has_link_generic(hw, 0, 0, &link);
if (!link)
return 0;
diff --git a/drivers/net/ethernet/intel/e1000e/lib.c b/drivers/net/ethernet/intel/e1000e/lib.c
index 0893ab1..e9b9e52 100644
--- a/drivers/net/ethernet/intel/e1000e/lib.c
+++ b/drivers/net/ethernet/intel/e1000e/lib.c
@@ -456,7 +456,7 @@ s32 e1000e_check_for_copper_link(struct e1000_hw *hw)
* link. If so, then we want to get the current speed/duplex
* of the PHY.
*/
- ret_val = e1000e_phy_has_link_generic(hw, 1, 0, &link);
+ ret_val = e1000e_phy_has_link_generic(hw, 0, 0, &link);
if (ret_val)
return ret_val;
diff --git a/drivers/net/ethernet/intel/e1000e/phy.c b/drivers/net/ethernet/intel/e1000e/phy.c
index 8666476..f026cba 100644
--- a/drivers/net/ethernet/intel/e1000e/phy.c
+++ b/drivers/net/ethernet/intel/e1000e/phy.c
@@ -1768,46 +1768,74 @@ static s32 e1000_wait_autoneg(struct e1000_hw *hw)
/**
* e1000e_phy_has_link_generic - Polls PHY for link
* @hw: pointer to the HW structure
- * @iterations: number of times to poll for link
+ * @intervals: number of times to delay between polls for link
* @usec_interval: delay between polling attempts
- * @success: pointer to whether polling was successful or not
+ * @link: pointer to whether link was present or not
*
- * Polls the PHY status register for link, 'iterations' number of times.
+ * Polls the PHY status register for link, 'intervals + 1' number of times.
+ * Max run time is approx 'intervals * usec_interval' microseconds.
**/
-s32 e1000e_phy_has_link_generic(struct e1000_hw *hw, u32 iterations,
- u32 usec_interval, bool *success)
+s32 e1000e_phy_has_link_generic(struct e1000_hw *hw, int intervals,
+ u32 usec_interval, bool *link)
{
- s32 ret_val = 0;
- u16 i, phy_status;
+ int good_reads_phy_status = 0;
+ bool loopback_checked = false;
+ s32 err;
+ u16 reg;
+
+ /* Remember that e1e_rphy may fail because of another entity
+ * (like the firmware) holding the lock, we need to handle
+ * this gracefully - by waiting and trying again.
+ *
+ * Some PHYs require the PHY_STATUS register to be
+ * read twice due to the link bit being sticky.
+ * No harm doing it across the board.
+ *
+ * This first initial read slightly improves the probability of
+ * a successful double read of the PHY_STATUS on the first iteration.
+ * (and thus also whenever this function is called with iterations == 0)
+ */
+ err = e1e_rphy(hw, PHY_STATUS, ®);
+ if (!err) ++good_reads_phy_status;
+
+ for (;;) {
+ err = e1e_rphy(hw, PHY_STATUS, ®);
+ if (!err) {
+ if (++good_reads_phy_status < 2) continue;
+ if (reg & MII_SR_LINK_STATUS) {
+ *link = true;
+ return 0; /* success: link up */
+ }
+ }
+
+ if (!loopback_checked) {
+ /* If the interface is in loopback-mode... */
+ err = e1e_rphy(hw, PHY_CONTROL, ®);
+ if (!err) {
+ loopback_checked = true;
+ if (reg & MII_CR_LOOPBACK) {
+ /* ... fake link up. */
+ *link = true;
+ return 0; /* success: link up */
+ }
+ }
+ }
+
+ if (--intervals < 0) {
+ /* timeout waiting for link to go up (or only errors) */
+ if (good_reads_phy_status < 2) {
+ if (!err) err = -E1000_ERR_PHY;
+ return err; /* failure */
+ }
+ *link = false;
+ return 0; /* success: link down */
+ }
- for (i = 0; i < iterations; i++) {
- /*
- * Some PHYs require the PHY_STATUS register to be read
- * twice due to the link bit being sticky. No harm doing
- * it across the board.
- */
- ret_val = e1e_rphy(hw, PHY_STATUS, &phy_status);
- if (ret_val)
- /*
- * If the first read fails, another entity may have
- * ownership of the resources, wait and try again to
- * see if they have relinquished the resources yet.
- */
- udelay(usec_interval);
- ret_val = e1e_rphy(hw, PHY_STATUS, &phy_status);
- if (ret_val)
- break;
- if (phy_status & MII_SR_LINK_STATUS)
- break;
if (usec_interval >= 1000)
- mdelay(usec_interval/1000);
+ mdelay(usec_interval / 1000);
else
udelay(usec_interval);
}
-
- *success = (i < iterations);
-
- return ret_val;
}
/**
@@ -1943,7 +1971,7 @@ s32 e1000e_get_phy_info_m88(struct e1000_hw *hw)
return -E1000_ERR_CONFIG;
}
- ret_val = e1000e_phy_has_link_generic(hw, 1, 0, &link);
+ ret_val = e1000e_phy_has_link_generic(hw, 0, 0, &link);
if (ret_val)
return ret_val;
@@ -2011,7 +2039,7 @@ s32 e1000e_get_phy_info_igp(struct e1000_hw *hw)
u16 data;
bool link;
- ret_val = e1000e_phy_has_link_generic(hw, 1, 0, &link);
+ ret_val = e1000e_phy_has_link_generic(hw, 0, 0, &link);
if (ret_val)
return ret_val;
@@ -2071,7 +2099,7 @@ s32 e1000_get_phy_info_ife(struct e1000_hw *hw)
u16 data;
bool link;
- ret_val = e1000e_phy_has_link_generic(hw, 1, 0, &link);
+ ret_val = e1000e_phy_has_link_generic(hw, 0, 0, &link);
if (ret_val)
goto out;
@@ -3298,7 +3326,7 @@ s32 e1000_get_phy_info_82577(struct e1000_hw *hw)
u16 data;
bool link;
- ret_val = e1000e_phy_has_link_generic(hw, 1, 0, &link);
+ ret_val = e1000e_phy_has_link_generic(hw, 0, 0, &link);
if (ret_val)
goto out;
--
1.7.3.1
^ permalink raw reply related
* Re: [PATCH net-next] atm: use SKB_TRUESIZE() in atm_guess_pdu2truesize()
From: Eric Dumazet @ 2011-11-22 20:33 UTC (permalink / raw)
To: chas williams - CONTRACTOR; +Cc: netdev
In-Reply-To: <20111122152207.114bcd68@thirdoffive.cmf.nrl.navy.mil>
Le mardi 22 novembre 2011 à 15:22 -0500, chas williams - CONTRACTOR a
écrit :
> it doesnt seem like a good idea to create a wrapper for a one to one
> call. perhaps this whole bit of nonsense should be removed. the
> iphase driver should be returning skb->truesize like everyone.
>
> if atm_alloc_charge() just uses SKB_TRUESIZE() then we konw that guess
> will be the same as skb->truesize and atm_alloc_charge() can be
> simplified by removing atomic_add(skb->truesize - guess, which will be
> 0 in all cases.
>
Please note I didnt create a wrapper, only correct existing one :)
Feel free to send a (tested) patch, but be warned that following code is
not correct :
int size = something;
struct sk_buff *skb = skb_alloc(size);
ASSERT(skb->truesize == SKB_TRUESIZE(size));
(It might be true with SLOB only)
^ permalink raw reply
* Re: [PATCH net-next v1 3/4] net-e1000e: reworked carrier detection logic
From: Maciej Żenczykowski @ 2011-11-22 20:32 UTC (permalink / raw)
To: David Decotigny
Cc: Ian Campbell, Paul Gortmaker, e1000-devel, Bruce Allan,
Jesse Brandeburg, linux-kernel, John Ronciak, netdev,
David S. Miller
In-Reply-To: <3badc590e12be93a2d2ffbf998d138a81e6e7181.1321917278.git.david.decotigny@google.com>
David,
I know you asked for a review of this on Friday, before you sent this
out to netdev, and I was planning on doing so, but I see you've sent
it out to a wider audience now.
So, I'll attach comments directly here.
You took my patch (which was for 2.6.34) and split it in two (it was
erroneously marked author zenczykowski@gmail.com instead of
maze@google.com, so that should be fixed) and while you seem to have
reduced the amount of lines-of-code-churn, I'm not sure you've
actually made the resulting code (as a whole) more readable.
I'm not sure how much of these changes were a result of changes
elsewhere in the driver between 2.6.34 and now.
This was very tricky code to get right, and I'm not sure whether the
patch as you posted it gets all the corner cases right...
Indeed I actually think the changes you've made reduce the robustness
wrt. timeouts caused by firmware concurrent accesses. In particular
the first read access you make is very likely to fail.
I think renaming success to link and iterations to intervals was
worthwhile since it improved readability...
For reference, the original patch, cherrypicked onto net-next and
compile (but not anything else) tested will be a reply to this email.
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply
* Re: [PATCH v2] xfrm: optimize ipv4 selector matching
From: David Miller @ 2011-11-22 20:27 UTC (permalink / raw)
To: adobriyan; +Cc: David.Laight, eric.dumazet, netdev
In-Reply-To: <20111122164602.GC25127@p183.telecom.by>
From: Alexey Dobriyan <adobriyan@gmail.com>
Date: Tue, 22 Nov 2011 19:46:02 +0300
> Current addr_match() is errh, under-optimized.
>
> Compiler doesn't know that memcmp() branch doesn't trigger for IPv4.
> Also, pass addresses by value -- they fit into register.
>
> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH 0/2] net: Add network priority cgroup (v4)
From: David Miller @ 2011-11-22 20:23 UTC (permalink / raw)
To: nhorman; +Cc: netdev, john.r.fastabend, robert.w.love
In-Reply-To: <1321974652-8318-1-git-send-email-nhorman@tuxdriver.com>
From: Neil Horman <nhorman@tuxdriver.com>
Date: Tue, 22 Nov 2011 10:10:50 -0500
> (v2)
> Based on reviews from John F., Amerigo Wang and Neerav Parikh, I've cleaned up
> the rcu locking, fixed a memory leak in an error path, and corrected some typos.
>
> (v3)
> Converted rcu_dereference to rntl_dereference where appropriate as per request
> from John F.
>
> (v4)
> Cleaned up some spacing issues, and optimized the skb_update_priority path as
> per request from Dave M.
>
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
> CC: Robert Love <robert.w.love@intel.com>
> CC: "David S. Miller" <davem@davemloft.net>
Applied and going through some build testing now, thanks Neil.
^ permalink raw reply
* Re: [PATCH net-next V2] tg3: Fix advertisement handling
From: David Miller @ 2011-11-22 20:18 UTC (permalink / raw)
To: shimoda.hiroaki; +Cc: mcarlson, mchan, eric.dumazet, netdev
In-Reply-To: <20111122230541.f2f96c9e.shimoda.hiroaki@gmail.com>
From: Hiroaki SHIMODA <shimoda.hiroaki@gmail.com>
Date: Tue, 22 Nov 2011 23:05:41 +0900
> Commit 28011cf19b (net: Add ethtool to mii advertisment conversion
> helpers) added a helper function ethtool_adv_to_mii_100bt() and
> tg3_copper_is_advertising_all(), tg3_phy_autoneg_cfg() were
> modified to use this.
> Before that commit, ethtool to mii advertisement conversion was
> done wrt speed, but now pause operation is also taken account.
> So, in tg3_copper_is_advertising_all(), below condition becomes
> true and this makes link up fails.
>
> if ((adv_reg & ADVERTISE_ALL) != all_mask)
> return 0;
>
> To fix this add ADVERTISE_ALL bit and operation to cap speed,
> and change default advertisement not including ADVERTISED_Pause.
>
> Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
> Signed-off-by: Hiroaki SHIMODA <shimoda.hiroaki@gmail.com>
> ---
> V2: change default advertisement not including ADVERTISED_Pause
I'll apply this, thank you.
^ permalink raw reply
* Re: [PATCH net-next] atm: use SKB_TRUESIZE() in atm_guess_pdu2truesize()
From: David Miller @ 2011-11-22 20:16 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev
In-Reply-To: <1321941094.27077.14.camel@edumazet-laptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Tue, 22 Nov 2011 06:51:34 +0100
> SKB_TRUESIZE() provides a better approximation of expected skb truesize.
>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Applied.
^ permalink raw reply
* Re: pull request: wireless 2011-11-22
From: David Miller @ 2011-11-22 20:14 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, netdev, linux-kernel
In-Reply-To: <20111122193505.GC8452@tuxdriver.com>
From: "John W. Linville" <linville@tuxdriver.com>
Date: Tue, 22 Nov 2011 14:35:05 -0500
> Here is the latest batch of fixes intended for 3.2. This includes a
> correction for a user-visible error in mac80211's debugfs info, a fix
> for a potential memory corrupter in prism54, an endian fix for rt2x00,
> an endian fix for mac80211, a fix for a NULL derefernce in cfg80211, a
> locking fix and a deadlock fix for p54spi, and a pair of rt2x00 fixes
> for handling some spurious interrupts that hardware can generate.
>
> Please let me know if there are problems!
The rt2800pci change doesn't look correct.
If the IRQ line is shared with another device, this change will make it
never see interrupts. Once you say "IRQ_HANDLED" the IRQ dispatch
stops processing the interrupt handler list.
^ permalink raw reply
* Re: slub: Lockout validation scans during freeing of object
From: Christoph Lameter @ 2011-11-22 19:46 UTC (permalink / raw)
To: Markus Trippelsdorf
Cc: Eric Dumazet, Christian Kujau, Benjamin Herrenschmidt, Alex,Shi,
linux-kernel@vger.kernel.org, linux-mm@kvack.org, Pekka Enberg,
Matt Mackall, netdev@vger.kernel.org, Tejun Heo
In-Reply-To: <20111122193231.GB1627@x4.trippels.de>
On Tue, 22 Nov 2011, Markus Trippelsdorf wrote:
> > Could you get me the value of the "slabs" field for the slabs showing the
> > wierd values. I.e. do
> >
> > cat /sys/kernel/slab/signal_cache/slabs
> >
> > > signal_cache 268 920 360.4K 18446744073709551614/7/24 17 2 31 68 A
> >
>
> It's quite easy to explain. You're using unsigned ints in:
> snprintf(dist_str, 40, "%lu/%lu/%d", s->slabs - s->cpu_slabs, s->partial, s->cpu_slabs);
>
> and (s->slabs - s->cpu_slabs) can get negative. For example:
>
> task_struct 269 1504 557.0K 18446744073709551601/5/32 21 3 29 72
>
> Here s-slabs is 17 and s->cpu_slabs is 32.
> That gives: 17-32=18446744073709551601.
s->cpu_slabs includes the number of per cpu partial slabs since 3.2. And
that calculation is broken it seems. It adds up the number of objects instead
of the number of slab pages.
So much for review and having that stuff in -next for a long time. Sigh.
Subject: slub: Fix per cpu partial statistics
Support for SO_OBJECTS was not properly added to show_slab_objects().
If SO_OBJECTS is not set then the number of slab pages needs to be
returned not the number of objects in the partial slabs.
We do not have that number so just return 1 until we find a better
way to determine that.
Signed-off-by: Christoph Lameter <cl@linux.com>
---
mm/slub.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
Index: linux-2.6/mm/slub.c
===================================================================
--- linux-2.6.orig/mm/slub.c 2011-11-22 13:42:23.000000000 -0600
+++ linux-2.6/mm/slub.c 2011-11-22 13:43:56.000000000 -0600
@@ -4451,7 +4451,7 @@ static ssize_t show_slab_objects(struct
continue;
if (c->page) {
- if (flags & SO_TOTAL)
+ if (flags & SO_TOTAL)
x = c->page->objects;
else if (flags & SO_OBJECTS)
x = c->page->inuse;
@@ -4464,7 +4464,11 @@ static ssize_t show_slab_objects(struct
page = c->partial;
if (page) {
- x = page->pobjects;
+ if (flags & SO_OBJECTS)
+ x = page->pobjects;
+ else
+ /* Assume one */
+ x = 1;
total += x;
nodes[c->node] += x;
}
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply
* pull request: wireless 2011-11-22
From: John W. Linville @ 2011-11-22 19:35 UTC (permalink / raw)
To: davem; +Cc: linux-wireless, netdev, linux-kernel
Dave,
Here is the latest batch of fixes intended for 3.2. This includes a
correction for a user-visible error in mac80211's debugfs info, a fix
for a potential memory corrupter in prism54, an endian fix for rt2x00,
an endian fix for mac80211, a fix for a NULL derefernce in cfg80211, a
locking fix and a deadlock fix for p54spi, and a pair of rt2x00 fixes
for handling some spurious interrupts that hardware can generate.
Please let me know if there are problems!
Thanks,
John
---
The following changes since commit f23aa62545c18728eb2b9434aa258be27e07dd49:
caif: fix endian conversion in cffrml_transmit() (2011-11-21 16:46:24 -0500)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless.git for-davem
Ben Greear (1):
mac80211: Fix AMSDU rate printout in debugfs.
Dan Carpenter (1):
prism54: potential memory corruption in prism54_get_essid()
Gertjan van Wingerde (1):
rt2x00: Fix efuse EEPROM reading on PPC32.
Helmut Schaa (1):
mac80211: Fix endian bug in radiotap header generation
Johannes Berg (1):
cfg80211: fix regulatory NULL dereference
John W. Linville (1):
Merge branch 'master' of git://git.kernel.org/.../linville/wireless into for-davem
Michael Buesch (2):
p54spi: Add missing spin_lock_init
p54spi: Fix workqueue deadlock
Stanislaw Gruszka (2):
rt2800pci: handle spurious interrupts
rt2x00: handle spurious pci interrupts
drivers/net/wireless/p54/p54spi.c | 5 +++--
drivers/net/wireless/prism54/isl_ioctl.c | 2 +-
drivers/net/wireless/rt2x00/rt2400pci.c | 2 +-
drivers/net/wireless/rt2x00/rt2500pci.c | 2 +-
drivers/net/wireless/rt2x00/rt2800lib.c | 2 +-
drivers/net/wireless/rt2x00/rt2800pci.c | 7 ++++++-
drivers/net/wireless/rt2x00/rt61pci.c | 2 +-
net/mac80211/debugfs_sta.c | 4 ++--
net/mac80211/status.c | 8 ++++----
net/wireless/reg.c | 4 ++++
10 files changed, 24 insertions(+), 14 deletions(-)
diff --git a/drivers/net/wireless/p54/p54spi.c b/drivers/net/wireless/p54/p54spi.c
index f18df82..78d0d69 100644
--- a/drivers/net/wireless/p54/p54spi.c
+++ b/drivers/net/wireless/p54/p54spi.c
@@ -588,8 +588,6 @@ static void p54spi_op_stop(struct ieee80211_hw *dev)
WARN_ON(priv->fw_state != FW_STATE_READY);
- cancel_work_sync(&priv->work);
-
p54spi_power_off(priv);
spin_lock_irqsave(&priv->tx_lock, flags);
INIT_LIST_HEAD(&priv->tx_pending);
@@ -597,6 +595,8 @@ static void p54spi_op_stop(struct ieee80211_hw *dev)
priv->fw_state = FW_STATE_OFF;
mutex_unlock(&priv->mutex);
+
+ cancel_work_sync(&priv->work);
}
static int __devinit p54spi_probe(struct spi_device *spi)
@@ -656,6 +656,7 @@ static int __devinit p54spi_probe(struct spi_device *spi)
init_completion(&priv->fw_comp);
INIT_LIST_HEAD(&priv->tx_pending);
mutex_init(&priv->mutex);
+ spin_lock_init(&priv->tx_lock);
SET_IEEE80211_DEV(hw, &spi->dev);
priv->common.open = p54spi_op_start;
priv->common.stop = p54spi_op_stop;
diff --git a/drivers/net/wireless/prism54/isl_ioctl.c b/drivers/net/wireless/prism54/isl_ioctl.c
index d97a2ca..bc2ba80 100644
--- a/drivers/net/wireless/prism54/isl_ioctl.c
+++ b/drivers/net/wireless/prism54/isl_ioctl.c
@@ -778,7 +778,7 @@ prism54_get_essid(struct net_device *ndev, struct iw_request_info *info,
dwrq->flags = 0;
dwrq->length = 0;
}
- essid->octets[essid->length] = '\0';
+ essid->octets[dwrq->length] = '\0';
memcpy(extra, essid->octets, dwrq->length);
kfree(essid);
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c
index 3a6b402..676c765 100644
--- a/drivers/net/wireless/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/rt2x00/rt2400pci.c
@@ -1380,7 +1380,7 @@ static irqreturn_t rt2400pci_interrupt(int irq, void *dev_instance)
rt2x00pci_register_write(rt2x00dev, CSR7, reg);
if (!reg)
- return IRQ_NONE;
+ return IRQ_HANDLED;
if (!test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags))
return IRQ_HANDLED;
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c
index dcc0e1f..d0b627c 100644
--- a/drivers/net/wireless/rt2x00/rt2500pci.c
+++ b/drivers/net/wireless/rt2x00/rt2500pci.c
@@ -1512,7 +1512,7 @@ static irqreturn_t rt2500pci_interrupt(int irq, void *dev_instance)
rt2x00pci_register_write(rt2x00dev, CSR7, reg);
if (!reg)
- return IRQ_NONE;
+ return IRQ_HANDLED;
if (!test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags))
return IRQ_HANDLED;
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index 3f183a1..1ba079d 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -3771,7 +3771,7 @@ static void rt2800_efuse_read(struct rt2x00_dev *rt2x00dev, unsigned int i)
/* Apparently the data is read from end to start */
rt2800_register_read_lock(rt2x00dev, EFUSE_DATA3, ®);
/* The returned value is in CPU order, but eeprom is le */
- rt2x00dev->eeprom[i] = cpu_to_le32(reg);
+ *(u32 *)&rt2x00dev->eeprom[i] = cpu_to_le32(reg);
rt2800_register_read_lock(rt2x00dev, EFUSE_DATA2, ®);
*(u32 *)&rt2x00dev->eeprom[i + 2] = cpu_to_le32(reg);
rt2800_register_read_lock(rt2x00dev, EFUSE_DATA1, ®);
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
index da48c8a..4dc2d0f 100644
--- a/drivers/net/wireless/rt2x00/rt2800pci.c
+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
@@ -880,8 +880,13 @@ static irqreturn_t rt2800pci_interrupt(int irq, void *dev_instance)
rt2x00pci_register_read(rt2x00dev, INT_SOURCE_CSR, ®);
rt2x00pci_register_write(rt2x00dev, INT_SOURCE_CSR, reg);
+ /*
+ * Some devices can generate interrupts with empty CSR register, we
+ * "handle" such irq's to prevent interrupt controller treat them as
+ * spurious interrupts and disable irq line.
+ */
if (!reg)
- return IRQ_NONE;
+ return IRQ_HANDLED;
if (!test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags))
return IRQ_HANDLED;
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index bf55b4a..9d83e70 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -2337,7 +2337,7 @@ static irqreturn_t rt61pci_interrupt(int irq, void *dev_instance)
rt2x00pci_register_write(rt2x00dev, INT_SOURCE_CSR, reg);
if (!reg && !reg_mcu)
- return IRQ_NONE;
+ return IRQ_HANDLED;
if (!test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags))
return IRQ_HANDLED;
diff --git a/net/mac80211/debugfs_sta.c b/net/mac80211/debugfs_sta.c
index c5f3417..3110cbd 100644
--- a/net/mac80211/debugfs_sta.c
+++ b/net/mac80211/debugfs_sta.c
@@ -274,9 +274,9 @@ static ssize_t sta_ht_capa_read(struct file *file, char __user *userbuf,
PRINT_HT_CAP((htc->cap & BIT(10)), "HT Delayed Block Ack");
- PRINT_HT_CAP((htc->cap & BIT(11)), "Max AMSDU length: "
- "3839 bytes");
PRINT_HT_CAP(!(htc->cap & BIT(11)), "Max AMSDU length: "
+ "3839 bytes");
+ PRINT_HT_CAP((htc->cap & BIT(11)), "Max AMSDU length: "
"7935 bytes");
/*
diff --git a/net/mac80211/status.c b/net/mac80211/status.c
index 80de436..16518f3 100644
--- a/net/mac80211/status.c
+++ b/net/mac80211/status.c
@@ -260,7 +260,7 @@ static void ieee80211_add_tx_radiotap_header(struct ieee80211_supported_band
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
struct ieee80211_radiotap_header *rthdr;
unsigned char *pos;
- __le16 txflags;
+ u16 txflags;
rthdr = (struct ieee80211_radiotap_header *) skb_push(skb, rtap_len);
@@ -290,13 +290,13 @@ static void ieee80211_add_tx_radiotap_header(struct ieee80211_supported_band
txflags = 0;
if (!(info->flags & IEEE80211_TX_STAT_ACK) &&
!is_multicast_ether_addr(hdr->addr1))
- txflags |= cpu_to_le16(IEEE80211_RADIOTAP_F_TX_FAIL);
+ txflags |= IEEE80211_RADIOTAP_F_TX_FAIL;
if ((info->status.rates[0].flags & IEEE80211_TX_RC_USE_RTS_CTS) ||
(info->status.rates[0].flags & IEEE80211_TX_RC_USE_CTS_PROTECT))
- txflags |= cpu_to_le16(IEEE80211_RADIOTAP_F_TX_CTS);
+ txflags |= IEEE80211_RADIOTAP_F_TX_CTS;
else if (info->status.rates[0].flags & IEEE80211_TX_RC_USE_RTS_CTS)
- txflags |= cpu_to_le16(IEEE80211_RADIOTAP_F_TX_RTS);
+ txflags |= IEEE80211_RADIOTAP_F_TX_RTS;
put_unaligned_le16(txflags, pos);
pos += 2;
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index e71f5a6..77e9267 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -2037,6 +2037,10 @@ static int __set_regdom(const struct ieee80211_regdomain *rd)
}
request_wiphy = wiphy_idx_to_wiphy(last_request->wiphy_idx);
+ if (!request_wiphy) {
+ reg_set_request_processed();
+ return -ENODEV;
+ }
if (!last_request->intersect) {
int r;
--
John W. Linville Someday the world will need a hero, and you
linville@tuxdriver.com might be all we have. Be ready.
^ permalink raw reply related
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