* [PATCH] cxgb3: simplify need_skb_unmap
From: FUJITA Tomonori @ 2010-07-08 9:52 UTC (permalink / raw)
To: netdev; +Cc: divy
We can use CONFIG_NEED_DMA_MAP_STATE to see if a platform does real
DMA unmapping.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
---
drivers/net/cxgb3/sge.c | 14 +++++---------
1 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c
index 5962b91..8ff96c6 100644
--- a/drivers/net/cxgb3/sge.c
+++ b/drivers/net/cxgb3/sge.c
@@ -203,15 +203,11 @@ static inline void refill_rspq(struct adapter *adapter,
*/
static inline int need_skb_unmap(void)
{
- /*
- * This structure is used to tell if the platform needs buffer
- * unmapping by checking if DECLARE_PCI_UNMAP_ADDR defines anything.
- */
- struct dummy {
- DEFINE_DMA_UNMAP_ADDR(addr);
- };
-
- return sizeof(struct dummy) != 0;
+#ifdef CONFIG_NEED_DMA_MAP_STATE
+ return 1;
+#else
+ return 0;
+#endif
}
/**
--
1.6.5
^ permalink raw reply related
* [PATCH] cxgb4vf: remove obsolete DECLARE_PCI_UNMAP_ADDR usage
From: FUJITA Tomonori @ 2010-07-08 9:52 UTC (permalink / raw)
To: netdev; +Cc: leedom
We could use DEFINE_DMA_UNMAP_ADDR instead but using
CONFIG_NEED_DMA_MAP_STATE is a simpler way to see if a platform does
real DMA unmapping.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
---
drivers/net/cxgb4vf/sge.c | 14 +++++---------
1 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/drivers/net/cxgb4vf/sge.c b/drivers/net/cxgb4vf/sge.c
index 3a7c02f..4bc1858 100644
--- a/drivers/net/cxgb4vf/sge.c
+++ b/drivers/net/cxgb4vf/sge.c
@@ -228,15 +228,11 @@ static inline bool is_buf_mapped(const struct rx_sw_desc *sdesc)
*/
static inline int need_skb_unmap(void)
{
- /*
- * This structure is used to tell if the platfrom needs buffer
- * unmapping by checking if DECLARE_PCI_UNMAP_ADDR defines anything.
- */
- struct dummy {
- DECLARE_PCI_UNMAP_ADDR(addr);
- };
-
- return sizeof(struct dummy) != 0;
+#ifdef CONFIG_NEED_DMA_MAP_STATE
+ return 1;
+#else
+ return 0;
+#endif
}
/**
--
1.6.5
^ permalink raw reply related
* [PATCH v2] vlan: allow TSO setting on vlan interfaces
From: Eric Dumazet @ 2010-07-08 9:39 UTC (permalink / raw)
To: Ben Hutchings; +Cc: David Miller, netdev, Patrick McHardy
In-Reply-To: <1278571587.2543.9.camel@edumazet-laptop>
When we need to shape traffic with low speeds, we need to disable tso on
network interface :
ethtool -K eth0.2240 tso off
It seems vlan interfaces miss the set_tso() ethtool method.
Propagating tso changes from lower device is not always wanted, some
vlans want TSO on, others want TSO off.
Before enabling TSO, we must check real device supports it.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
net/8021q/vlan_dev.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index c6456cb..870bc53 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -838,12 +838,25 @@ static struct rtnl_link_stats64 *vlan_dev_get_stats64(struct net_device *dev)
return stats;
}
+static int vlan_ethtool_set_tso(struct net_device *dev, u32 data)
+{
+ if (data) {
+ struct net_device *real_dev = vlan_dev_info(dev)->real_dev;
+ unsigned long rdev_vfeatures = real_dev->features & real_dev->vlan_features;
+
+ dev->features |= (NETIF_F_TSO & rdev_vfeatures);
+ } else
+ dev->features &= ~NETIF_F_TSO;
+ return 0;
+}
+
static const struct ethtool_ops vlan_ethtool_ops = {
.get_settings = vlan_ethtool_get_settings,
.get_drvinfo = vlan_ethtool_get_drvinfo,
.get_link = ethtool_op_get_link,
.get_rx_csum = vlan_ethtool_get_rx_csum,
.get_flags = vlan_ethtool_get_flags,
+ .set_tso = vlan_ethtool_set_tso,
};
static const struct net_device_ops vlan_netdev_ops = {
^ permalink raw reply related
* RE: [PATCH RFC 0/4] ARM/KGDB: Some fixes for SMP machines
From: Will Deacon @ 2010-07-08 8:48 UTC (permalink / raw)
To: 'Anton Vorontsov', kgdb-bugreport
Cc: netdev, Russell King, David S. Miller, linux-arm-kernel,
Jason Wessel
In-Reply-To: <20100707171222.GA16448@oksana.dev.rtsoft.ru>
Hi Anton,
> It appears that KGDB can easily hang SMP ARM machines.
Yep. As pointed out at:
http://lkml.org/lkml/2010/4/8/214
Commit ae6bf53e broke kgdb on SMP systems because it incorrectly assumes
that atomic_{inc,dec} imply barriers. Until this is fixed, it will never
work reliably on ARM. Try reverting the patch [this doesn't completely
resolve the situation, but it might help].
> 1. I'm testing with I/D caches disabled. With enabled caches,
> ARMv6K still locks-up. I'll test ARMv7 soon, and will try
> to debug cache issues on ARMv6K.
This patch might help if you're using the ARM11MPCore:
http://lists.infradead.org/pipermail/linux-arm-kernel/2010-May/016567.html
Hope that helps,
Will
^ permalink raw reply
* Re: [PATCH RFC 0/4] ARM/KGDB: Some fixes for SMP machines
From: Will Deacon @ 2010-07-08 8:48 UTC (permalink / raw)
To: 'Anton Vorontsov', kgdb-bugreport
Cc: netdev, Russell King, David S. Miller, linux-arm-kernel,
Jason Wessel
In-Reply-To: <20100707171222.GA16448@oksana.dev.rtsoft.ru>
Hi Anton,
> It appears that KGDB can easily hang SMP ARM machines.
Yep. As pointed out at:
http://lkml.org/lkml/2010/4/8/214
Commit ae6bf53e broke kgdb on SMP systems because it incorrectly assumes
that atomic_{inc,dec} imply barriers. Until this is fixed, it will never
work reliably on ARM. Try reverting the patch [this doesn't completely
resolve the situation, but it might help].
> 1. I'm testing with I/D caches disabled. With enabled caches,
> ARMv6K still locks-up. I'll test ARMv7 soon, and will try
> to debug cache issues on ARMv6K.
This patch might help if you're using the ARM11MPCore:
http://lists.infradead.org/pipermail/linux-arm-kernel/2010-May/016567.html
Hope that helps,
Will
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
^ permalink raw reply
* RE: [PATCH] bnx2x: add support for receive hashing
From: Vladislav Zolotarov @ 2010-07-08 8:40 UTC (permalink / raw)
To: Tom Herbert; +Cc: netdev@vger.kernel.org
In-Reply-To: <AANLkTinRUJS6e8dwqvIMhtAUWBcj5oTk-D9MMrhbL9Bk@mail.gmail.com>
> -----Original Message-----
> From: netdev-owner@vger.kernel.org [mailto:netdev-owner@vger.kernel.org] On
> Behalf Of Tom Herbert
> Sent: Wednesday, July 07, 2010 10:18 PM
> To: Vladislav Zolotarov
> Cc: netdev@vger.kernel.org
> Subject: Re: [PATCH] bnx2x: add support for receive hashing
>
> On Tue, Jul 6, 2010 at 12:16 AM, Vladislav Zolotarov <vladz@broadcom.com>
> wrote:
> > Let me rephrase: the part of your patch below enables RSS flow in our FW
> even if there is only one HW queue and I wonder why?
> > To refresh:
> > 1) FW won't provide Toeplitz hash on CQE if RSS is not enabled.
> > 2) There can be one HW queue in only 2 cases:
> > - There is only one CPU in the system. In that case I wonder
> if u have anything to do with Toeplitz hash on the skb at all.
> > - User has explicitly requested 1 HW queue with module
> parameter (num_queues=1). In that case if u r going to use the RSS hash on
> the skb means that u r actually going to do SW RSS instead of HW RSS, which
> sounds strange to me.
>
> It might not be so strange. Previously, we has hit a firmware bug in
> bnx2x that was make multi-queue not perform well under some loads, so
> we had disabled it for a while... it is a valid configuration we have
> used.
Tom, according to our FW guys there are no known RSS issues since FW 5.0.x versions. Currently upstream has 5.2.13 FW so, if u know about any issue with the current upstream bnx2x FW, pls., let us know ASAP. Pls., include the relevant performance data. We would also like to know if u see that the FW bug u've mentioned has been resolved in the current upstream bnx2x FW so that we could remove these lines unless u have any other reason to leave them.
Thanks,
vlad
>
> >
> > So, Herbert, could u, pls., explain, what was your original idea about
> these code lines?
> >
>
> It is to enable the device to provide the RSS hash in RX descriptor.
> The hash severs two purposes now, it's used internally in the device
> to perform RSS table lookup and also value in RX descriptor. The
> latter does not require multi-queue. Strictly speaking, on a single
> processor system without multqueue, it would be true that enabling the
> RX hash on bnx2x is currently superfluous (notwithstanding some other
> use of the hash might be implemented).
>
> > Thanks,
> > vlad
> >
> >> -----Original Message-----
> >> From: netdev-owner@vger.kernel.org [mailto:netdev-owner@vger.kernel.org]
> On
> >> Behalf Of Vladislav Zolotarov
> >> Sent: Sunday, July 04, 2010 7:36 PM
> >> To: Tom Herbert
> >> Cc: netdev@vger.kernel.org
> >> Subject: RE: [PATCH] bnx2x: add support for receive hashing
> >>
> >> Tom, could u, pls., explain what did u mean by taking the (RSS) flags
> >> configuration out of RSS "if"? To recall "if(is_multi(bp))" is true iff
> RSS
> >> is enabled.
> >>
> >> Thanks,
> >> vlad
> >>
> >> > @@ -5750,10 +5757,10 @@ static void bnx2x_init_internal_func(struct
> bnx2x
> >> > *bp)
> >> > u32 offset;
> >> > u16 max_agg_size;
> >> >
> >> > - if (is_multi(bp)) {
> >> > - tstorm_config.config_flags = MULTI_FLAGS(bp);
> >> > + tstorm_config.config_flags = RSS_FLAGS(bp);
> >> > +
> >> > + if (is_multi(bp))
> >> > tstorm_config.rss_result_mask = MULTI_MASK;
> >> > - }
> >> >
> >> > /* Enable TPA if needed */
> >> > if (bp->flags & TPA_ENABLE_FLAG)
> >>
> >>
> >> > -----Original Message-----
> >> > From: netdev-owner@vger.kernel.org [mailto:netdev-owner@vger.kernel.org]
> On
> >> > Behalf Of Tom Herbert
> >> > Sent: Friday, April 23, 2010 8:54 AM
> >> > To: davem@davemloft.net; netdev@vger.kernel.org
> >> > Subject: [PATCH] bnx2x: add support for receive hashing
> >> >
> >> > Add support to bnx2x to extract Toeplitz hash out of the receive
> descriptor
> >> > for use in skb->rxhash.
> >> >
> >> > Signed-off-by: Tom Herbert <therbert@google.com>
> >> > ---
> >> > diff --git a/drivers/net/bnx2x.h b/drivers/net/bnx2x.h
> >> > index 0819530..8bd2368 100644
> >> > --- a/drivers/net/bnx2x.h
> >> > +++ b/drivers/net/bnx2x.h
> >> > @@ -1330,7 +1330,7 @@ static inline u32 reg_poll(struct bnx2x *bp, u32
> reg,
> >> > u32 expected, int ms,
> >> > AEU_INPUTS_ATTN_BITS_MCP_LATCHED_UMP_TX_PARITY | \
> >> > AEU_INPUTS_ATTN_BITS_MCP_LATCHED_SCPAD_PARITY)
> >> >
> >> > -#define MULTI_FLAGS(bp) \
> >> > +#define RSS_FLAGS(bp) \
> >> > (TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_CAPABILITY | \
> >> > TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_TCP_CAPABILITY |
> \
> >> > TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_CAPABILITY | \
> >> > diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c
> >> > index 0c6dba2..613f727 100644
> >> > --- a/drivers/net/bnx2x_main.c
> >> > +++ b/drivers/net/bnx2x_main.c
> >> > @@ -1582,7 +1582,7 @@ static int bnx2x_rx_int(struct bnx2x_fastpath *fp,
> >> int
> >> > budget)
> >> > struct sw_rx_bd *rx_buf = NULL;
> >> > struct sk_buff *skb;
> >> > union eth_rx_cqe *cqe;
> >> > - u8 cqe_fp_flags;
> >> > + u8 cqe_fp_flags, cqe_fp_status_flags;
> >> > u16 len, pad;
> >> >
> >> > comp_ring_cons = RCQ_BD(sw_comp_cons);
> >> > @@ -1598,6 +1598,7 @@ static int bnx2x_rx_int(struct bnx2x_fastpath *fp,
> >> int
> >> > budget)
> >> >
> >> > cqe = &fp->rx_comp_ring[comp_ring_cons];
> >> > cqe_fp_flags = cqe->fast_path_cqe.type_error_flags;
> >> > + cqe_fp_status_flags = cqe->fast_path_cqe.status_flags;
> >> >
> >> > DP(NETIF_MSG_RX_STATUS, "CQE type %x err %x status %x"
> >> > " queue %x vlan %x len %u\n", CQE_TYPE(cqe_fp_flags),
> >> > @@ -1727,6 +1728,12 @@ reuse_rx:
> >> >
> >> > skb->protocol = eth_type_trans(skb, bp->dev);
> >> >
> >> > + if ((bp->dev->features & ETH_FLAG_RXHASH) &&
> >> > + (cqe_fp_status_flags &
> >> > + ETH_FAST_PATH_RX_CQE_RSS_HASH_FLG))
> >> > + skb->rxhash = le32_to_cpu(
> >> > + cqe->fast_path_cqe.rss_hash_result);
> >> > +
> >> > skb->ip_summed = CHECKSUM_NONE;
> >> > if (bp->rx_csum) {
> >> > if (likely(BNX2X_RX_CSUM_OK(cqe)))
> >> > @@ -5750,10 +5757,10 @@ static void bnx2x_init_internal_func(struct
> bnx2x
> >> > *bp)
> >> > u32 offset;
> >> > u16 max_agg_size;
> >> >
> >> > - if (is_multi(bp)) {
> >> > - tstorm_config.config_flags = MULTI_FLAGS(bp);
> >> > + tstorm_config.config_flags = RSS_FLAGS(bp);
> >> > +
> >> > + if (is_multi(bp))
> >> > tstorm_config.rss_result_mask = MULTI_MASK;
> >> > - }
> >> >
> >> > /* Enable TPA if needed */
> >> > if (bp->flags & TPA_ENABLE_FLAG)
> >> > @@ -6629,10 +6636,8 @@ static int bnx2x_init_common(struct bnx2x *bp)
> >> > bnx2x_init_block(bp, PBF_BLOCK, COMMON_STAGE);
> >> >
> >> > REG_WR(bp, SRC_REG_SOFT_RST, 1);
> >> > - for (i = SRC_REG_KEYRSS0_0; i <= SRC_REG_KEYRSS1_9; i += 4) {
> >> > - REG_WR(bp, i, 0xc0cac01a);
> >> > - /* TODO: replace with something meaningful */
> >> > - }
> >> > + for (i = SRC_REG_KEYRSS0_0; i <= SRC_REG_KEYRSS1_9; i += 4)
> >> > + REG_WR(bp, i, random32());
> >> > bnx2x_init_block(bp, SRCH_BLOCK, COMMON_STAGE);
> >> > #ifdef BCM_CNIC
> >> > REG_WR(bp, SRC_REG_KEYSEARCH_0, 0x63285672);
> >> > @@ -11001,6 +11006,11 @@ static int bnx2x_set_flags(struct net_device
> *dev,
> >> > u32 data)
> >> > changed = 1;
> >> > }
> >> >
> >> > + if (data & ETH_FLAG_RXHASH)
> >> > + dev->features |= NETIF_F_RXHASH;
> >> > + else
> >> > + dev->features &= ~NETIF_F_RXHASH;
> >> > +
> >> > if (changed && netif_running(dev)) {
> >> > bnx2x_nic_unload(bp, UNLOAD_NORMAL);
> >> > rc = bnx2x_nic_load(bp, LOAD_NORMAL);
> >> > --
> >> > 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
> >>
> >>
> >> --
> >> 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
> >
> >
> >
> --
> 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
* [PATCH v4 9/9] usb/atm/ueagle-atm.c: call atm_dev_signal_change() when signal changes.
From: Karl Hiramoto @ 2010-07-08 8:34 UTC (permalink / raw)
To: linux-atm-general, netdev, chas, davem; +Cc: Karl Hiramoto
In-Reply-To: <1278578095-25324-1-git-send-email-karl@hiramoto.org>
Propagate signal changes to upper atm layer.
Signed-off-by: Karl Hiramoto <karl@hiramoto.org>
---
drivers/usb/atm/ueagle-atm.c | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/atm/ueagle-atm.c b/drivers/usb/atm/ueagle-atm.c
index e213d3f..ebae944 100644
--- a/drivers/usb/atm/ueagle-atm.c
+++ b/drivers/usb/atm/ueagle-atm.c
@@ -575,6 +575,13 @@ MODULE_PARM_DESC(annex,
sc->usbatm->atm_dev->type = val; \
} while (0)
+#define UPDATE_ATM_SIGNAL(val) \
+ do { \
+ if (sc->usbatm->atm_dev) \
+ atm_dev_signal_change(sc->usbatm->atm_dev, val); \
+ } while (0)
+
+
/* Firmware loading */
#define LOAD_INTERNAL 0xA0
#define F8051_USBCS 0x7f92
@@ -1359,7 +1366,7 @@ static int uea_stat_e1(struct uea_softc *sc)
/* always update it as atm layer could not be init when we switch to
* operational state
*/
- UPDATE_ATM_STAT(signal, ATM_PHY_SIG_FOUND);
+ UPDATE_ATM_SIGNAL(ATM_PHY_SIG_FOUND);
/* wake up processes waiting for synchronization */
wake_up(&sc->sync_q);
@@ -1498,7 +1505,7 @@ static int uea_stat_e4(struct uea_softc *sc)
/* always update it as atm layer could not be init when we switch to
* operational state
*/
- UPDATE_ATM_STAT(signal, ATM_PHY_SIG_FOUND);
+ UPDATE_ATM_SIGNAL(ATM_PHY_SIG_FOUND);
/* wake up processes waiting for synchronization */
wake_up(&sc->sync_q);
@@ -1825,7 +1832,7 @@ static int uea_start_reset(struct uea_softc *sc)
* So we will failed to wait Ready CMV.
*/
sc->cmv_ack = 0;
- UPDATE_ATM_STAT(signal, ATM_PHY_SIG_LOST);
+ UPDATE_ATM_SIGNAL(ATM_PHY_SIG_LOST);
/* reset statistics */
memset(&sc->stats, 0, sizeof(struct uea_stats));
--
1.7.1
^ permalink raw reply related
* [PATCH v4 8/9] usb/atm/speedtch.c: call atm_dev_signal_change() when signal changes.
From: Karl Hiramoto @ 2010-07-08 8:34 UTC (permalink / raw)
To: linux-atm-general, netdev, chas, davem; +Cc: Karl Hiramoto
In-Reply-To: <1278578095-25324-1-git-send-email-karl@hiramoto.org>
Propagate signal changes to upper atm layer.
Signed-off-by: Karl Hiramoto <karl@hiramoto.org>
---
drivers/usb/atm/speedtch.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/usb/atm/speedtch.c b/drivers/usb/atm/speedtch.c
index 1335456..80f9617 100644
--- a/drivers/usb/atm/speedtch.c
+++ b/drivers/usb/atm/speedtch.c
@@ -525,7 +525,7 @@ static void speedtch_check_status(struct work_struct *work)
switch (status) {
case 0:
- atm_dev->signal = ATM_PHY_SIG_LOST;
+ atm_dev_signal_change(atm_dev, ATM_PHY_SIG_LOST);
if (instance->last_status)
atm_info(usbatm, "ADSL line is down\n");
/* It may never resync again unless we ask it to... */
@@ -533,12 +533,12 @@ static void speedtch_check_status(struct work_struct *work)
break;
case 0x08:
- atm_dev->signal = ATM_PHY_SIG_UNKNOWN;
+ atm_dev_signal_change(atm_dev, ATM_PHY_SIG_UNKNOWN);
atm_info(usbatm, "ADSL line is blocked?\n");
break;
case 0x10:
- atm_dev->signal = ATM_PHY_SIG_LOST;
+ atm_dev_signal_change(atm_dev, ATM_PHY_SIG_LOST);
atm_info(usbatm, "ADSL line is synchronising\n");
break;
@@ -554,7 +554,7 @@ static void speedtch_check_status(struct work_struct *work)
}
atm_dev->link_rate = down_speed * 1000 / 424;
- atm_dev->signal = ATM_PHY_SIG_FOUND;
+ atm_dev_signal_change(atm_dev, ATM_PHY_SIG_FOUND);
atm_info(usbatm,
"ADSL line is up (%d kb/s down | %d kb/s up)\n",
@@ -562,7 +562,7 @@ static void speedtch_check_status(struct work_struct *work)
break;
default:
- atm_dev->signal = ATM_PHY_SIG_UNKNOWN;
+ atm_dev_signal_change(atm_dev, ATM_PHY_SIG_UNKNOWN);
atm_info(usbatm, "unknown line state %02x\n", status);
break;
}
--
1.7.1
^ permalink raw reply related
* [PATCH v4 7/9] usb/atm/cxacru.c: call atm_dev_signal_change() when signal changes.
From: Karl Hiramoto @ 2010-07-08 8:34 UTC (permalink / raw)
To: linux-atm-general, netdev, chas, davem; +Cc: Karl Hiramoto
In-Reply-To: <1278578095-25324-1-git-send-email-karl@hiramoto.org>
Propagate signal changes to upper atm layer.
Signed-off-by: Karl Hiramoto <karl@hiramoto.org>
---
drivers/usb/atm/cxacru.c | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/usb/atm/cxacru.c b/drivers/usb/atm/cxacru.c
index c89990f..101ffc9 100644
--- a/drivers/usb/atm/cxacru.c
+++ b/drivers/usb/atm/cxacru.c
@@ -866,50 +866,50 @@ static void cxacru_poll_status(struct work_struct *work)
instance->line_status = buf[CXINF_LINE_STATUS];
switch (instance->line_status) {
case 0:
- atm_dev->signal = ATM_PHY_SIG_LOST;
+ atm_dev_signal_change(atm_dev, ATM_PHY_SIG_LOST);
atm_info(usbatm, "ADSL line: down\n");
break;
case 1:
- atm_dev->signal = ATM_PHY_SIG_LOST;
+ atm_dev_signal_change(atm_dev, ATM_PHY_SIG_LOST);
atm_info(usbatm, "ADSL line: attempting to activate\n");
break;
case 2:
- atm_dev->signal = ATM_PHY_SIG_LOST;
+ atm_dev_signal_change(atm_dev, ATM_PHY_SIG_LOST);
atm_info(usbatm, "ADSL line: training\n");
break;
case 3:
- atm_dev->signal = ATM_PHY_SIG_LOST;
+ atm_dev_signal_change(atm_dev, ATM_PHY_SIG_LOST);
atm_info(usbatm, "ADSL line: channel analysis\n");
break;
case 4:
- atm_dev->signal = ATM_PHY_SIG_LOST;
+ atm_dev_signal_change(atm_dev, ATM_PHY_SIG_LOST);
atm_info(usbatm, "ADSL line: exchange\n");
break;
case 5:
atm_dev->link_rate = buf[CXINF_DOWNSTREAM_RATE] * 1000 / 424;
- atm_dev->signal = ATM_PHY_SIG_FOUND;
+ atm_dev_signal_change(atm_dev, ATM_PHY_SIG_FOUND);
atm_info(usbatm, "ADSL line: up (%d kb/s down | %d kb/s up)\n",
buf[CXINF_DOWNSTREAM_RATE], buf[CXINF_UPSTREAM_RATE]);
break;
case 6:
- atm_dev->signal = ATM_PHY_SIG_LOST;
+ atm_dev_signal_change(atm_dev, ATM_PHY_SIG_LOST);
atm_info(usbatm, "ADSL line: waiting\n");
break;
case 7:
- atm_dev->signal = ATM_PHY_SIG_LOST;
+ atm_dev_signal_change(atm_dev, ATM_PHY_SIG_LOST);
atm_info(usbatm, "ADSL line: initializing\n");
break;
default:
- atm_dev->signal = ATM_PHY_SIG_UNKNOWN;
+ atm_dev_signal_change(atm_dev, ATM_PHY_SIG_UNKNOWN);
atm_info(usbatm, "Unknown line state %02x\n", instance->line_status);
break;
}
--
1.7.1
^ permalink raw reply related
* [PATCH v4 6/9] atm/suni.c: call atm_dev_signal_change() when signal changes.
From: Karl Hiramoto @ 2010-07-08 8:34 UTC (permalink / raw)
To: linux-atm-general, netdev, chas, davem; +Cc: Karl Hiramoto
In-Reply-To: <1278578095-25324-1-git-send-email-karl@hiramoto.org>
Propagate changes to upper atm layer.
Signed-off-by: Karl Hiramoto <karl@hiramoto.org>
---
drivers/atm/suni.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/atm/suni.c b/drivers/atm/suni.c
index da4b91f..41c56ea 100644
--- a/drivers/atm/suni.c
+++ b/drivers/atm/suni.c
@@ -291,8 +291,9 @@ static int suni_ioctl(struct atm_dev *dev,unsigned int cmd,void __user *arg)
static void poll_los(struct atm_dev *dev)
{
- dev->signal = GET(RSOP_SIS) & SUNI_RSOP_SIS_LOSV ? ATM_PHY_SIG_LOST :
- ATM_PHY_SIG_FOUND;
+ atm_dev_signal_change(dev,
+ GET(RSOP_SIS) & SUNI_RSOP_SIS_LOSV ?
+ ATM_PHY_SIG_LOST : ATM_PHY_SIG_FOUND);
}
--
1.7.1
^ permalink raw reply related
* [PATCH v4 5/9] atm/solos-pci: call atm_dev_signal_change() when signal changes.
From: Karl Hiramoto @ 2010-07-08 8:34 UTC (permalink / raw)
To: linux-atm-general, netdev, chas, davem; +Cc: Karl Hiramoto
In-Reply-To: <1278578095-25324-1-git-send-email-karl@hiramoto.org>
Propagate changes to upper atm layer, so userspace netmontor knows when DSL
showtime reached.
Signed-off-by: Karl Hiramoto <karl@hiramoto.org>
---
drivers/atm/solos-pci.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c
index ded76c4..6174965 100644
--- a/drivers/atm/solos-pci.c
+++ b/drivers/atm/solos-pci.c
@@ -383,7 +383,7 @@ static int process_status(struct solos_card *card, int port, struct sk_buff *skb
/* Anything but 'Showtime' is down */
if (strcmp(state_str, "Showtime")) {
- card->atmdev[port]->signal = ATM_PHY_SIG_LOST;
+ atm_dev_signal_change(card->atmdev[port], ATM_PHY_SIG_LOST);
release_vccs(card->atmdev[port]);
dev_info(&card->dev->dev, "Port %d: %s\n", port, state_str);
return 0;
@@ -401,7 +401,7 @@ static int process_status(struct solos_card *card, int port, struct sk_buff *skb
snr[0]?", SNR ":"", snr, attn[0]?", Attn ":"", attn);
card->atmdev[port]->link_rate = rate_down / 424;
- card->atmdev[port]->signal = ATM_PHY_SIG_FOUND;
+ atm_dev_signal_change(card->atmdev[port], ATM_PHY_SIG_FOUND);
return 0;
}
@@ -1246,7 +1246,7 @@ static int atm_init(struct solos_card *card)
card->atmdev[i]->ci_range.vci_bits = 16;
card->atmdev[i]->dev_data = card;
card->atmdev[i]->phy_data = (void *)(unsigned long)i;
- card->atmdev[i]->signal = ATM_PHY_SIG_UNKNOWN;
+ atm_dev_signal_change(card->atmdev[i], ATM_PHY_SIG_UNKNOWN);
skb = alloc_skb(sizeof(*header), GFP_ATOMIC);
if (!skb) {
--
1.7.1
^ permalink raw reply related
* [PATCH v4 4/9] atm/idt77105.c: call atm_dev_signal_change() when signal changes.
From: Karl Hiramoto @ 2010-07-08 8:34 UTC (permalink / raw)
To: linux-atm-general, netdev, chas, davem; +Cc: Karl Hiramoto
In-Reply-To: <1278578095-25324-1-git-send-email-karl@hiramoto.org>
Propagate changes to upper atm layer.
Signed-off-by: Karl Hiramoto <karl@hiramoto.org>
---
drivers/atm/idt77105.c | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/atm/idt77105.c b/drivers/atm/idt77105.c
index dab5cf5..bca9cb8 100644
--- a/drivers/atm/idt77105.c
+++ b/drivers/atm/idt77105.c
@@ -126,7 +126,7 @@ static void idt77105_restart_timer_func(unsigned long dummy)
istat = GET(ISTAT); /* side effect: clears all interrupt status bits */
if (istat & IDT77105_ISTAT_GOODSIG) {
/* Found signal again */
- dev->signal = ATM_PHY_SIG_FOUND;
+ atm_dev_signal_change(dev, ATM_PHY_SIG_FOUND);
printk(KERN_NOTICE "%s(itf %d): signal detected again\n",
dev->type,dev->number);
/* flush the receive FIFO */
@@ -222,7 +222,7 @@ static void idt77105_int(struct atm_dev *dev)
/* Rx Signal Condition Change - line went up or down */
if (istat & IDT77105_ISTAT_GOODSIG) { /* signal detected again */
/* This should not happen (restart timer does it) but JIC */
- dev->signal = ATM_PHY_SIG_FOUND;
+ atm_dev_signal_change(dev, ATM_PHY_SIG_FOUND);
} else { /* signal lost */
/*
* Disable interrupts and stop all transmission and
@@ -235,7 +235,7 @@ static void idt77105_int(struct atm_dev *dev)
IDT77105_MCR_DRIC|
IDT77105_MCR_HALTTX
) & ~IDT77105_MCR_EIP, MCR);
- dev->signal = ATM_PHY_SIG_LOST;
+ atm_dev_signal_change(dev, ATM_PHY_SIG_LOST);
printk(KERN_NOTICE "%s(itf %d): signal lost\n",
dev->type,dev->number);
}
@@ -272,8 +272,9 @@ static int idt77105_start(struct atm_dev *dev)
memset(&PRIV(dev)->stats,0,sizeof(struct idt77105_stats));
/* initialise dev->signal from Good Signal Bit */
- dev->signal = GET(ISTAT) & IDT77105_ISTAT_GOODSIG ? ATM_PHY_SIG_FOUND :
- ATM_PHY_SIG_LOST;
+ atm_dev_signal_change(dev,
+ GET(ISTAT) & IDT77105_ISTAT_GOODSIG ?
+ ATM_PHY_SIG_FOUND : ATM_PHY_SIG_LOST);
if (dev->signal == ATM_PHY_SIG_LOST)
printk(KERN_WARNING "%s(itf %d): no signal\n",dev->type,
dev->number);
--
1.7.1
^ permalink raw reply related
* [PATCH v4 3/9] atm/adummy: add syfs DEVICE_ATTR to change signal
From: Karl Hiramoto @ 2010-07-08 8:34 UTC (permalink / raw)
To: linux-atm-general, netdev, chas, davem; +Cc: Karl Hiramoto
In-Reply-To: <1278578095-25324-1-git-send-email-karl@hiramoto.org>
Signed-off-by: Karl Hiramoto <karl@hiramoto.org>
---
drivers/atm/adummy.c | 39 +++++++++++++++++++++++++++++++++++++++
1 files changed, 39 insertions(+), 0 deletions(-)
diff --git a/drivers/atm/adummy.c b/drivers/atm/adummy.c
index 6d44f07..46b9476 100644
--- a/drivers/atm/adummy.c
+++ b/drivers/atm/adummy.c
@@ -40,6 +40,42 @@ struct adummy_dev {
static LIST_HEAD(adummy_devs);
+static ssize_t __set_signal(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t len)
+{
+ struct atm_dev *atm_dev = container_of(dev, struct atm_dev, class_dev);
+ int signal;
+
+ if (sscanf(buf, "%d", &signal) == 1) {
+
+ if (signal < ATM_PHY_SIG_LOST || signal > ATM_PHY_SIG_FOUND)
+ signal = ATM_PHY_SIG_UNKNOWN;
+
+ atm_dev_signal_change(atm_dev, signal);
+ return 1;
+ }
+ return -EINVAL;
+}
+
+static ssize_t __show_signal(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct atm_dev *atm_dev = container_of(dev, struct atm_dev, class_dev);
+ return sprintf(buf, "%d\n", atm_dev->signal);
+}
+static DEVICE_ATTR(signal, 0644, __show_signal, __set_signal);
+
+static struct attribute *adummy_attrs[] = {
+ &dev_attr_signal.attr,
+ NULL
+};
+
+static struct attribute_group adummy_group_attrs = {
+ .name = NULL, /* We want them in dev's root folder */
+ .attrs = adummy_attrs
+};
+
static int __init
adummy_start(struct atm_dev *dev)
{
@@ -128,6 +164,9 @@ static int __init adummy_init(void)
adummy_dev->atm_dev = atm_dev;
atm_dev->dev_data = adummy_dev;
+ if (sysfs_create_group(&atm_dev->class_dev.kobj, &adummy_group_attrs))
+ dev_err(&atm_dev->class_dev, "Could not register attrs for adummy\n");
+
if (adummy_start(atm_dev)) {
printk(KERN_ERR DEV_LABEL ": adummy_start() failed\n");
err = -ENODEV;
--
1.7.1
^ permalink raw reply related
* [PATCH v4 2/9] atm/br2684: register notifier event for carrier signal changes.
From: Karl Hiramoto @ 2010-07-08 8:34 UTC (permalink / raw)
To: linux-atm-general, netdev, chas, davem; +Cc: Karl Hiramoto
In-Reply-To: <1278578095-25324-1-git-send-email-karl@hiramoto.org>
When a signal change event occurs call netif_carrier_on/off.
Signed-off-by: Karl Hiramoto <karl@hiramoto.org>
---
net/atm/br2684.c | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 64 insertions(+), 2 deletions(-)
diff --git a/net/atm/br2684.c b/net/atm/br2684.c
index 6719af6..651babd 100644
--- a/net/atm/br2684.c
+++ b/net/atm/br2684.c
@@ -139,6 +139,43 @@ static struct net_device *br2684_find_dev(const struct br2684_if_spec *s)
return NULL;
}
+static int atm_dev_event(struct notifier_block *this, unsigned long event,
+ void *arg)
+{
+ struct atm_dev *atm_dev = arg;
+ struct list_head *lh;
+ struct net_device *net_dev;
+ struct br2684_vcc *brvcc;
+ struct atm_vcc *atm_vcc;
+ unsigned long flags;
+
+ pr_debug("event=%ld dev=%p\n", event, atm_dev);
+
+ read_lock_irqsave(&devs_lock, flags);
+ list_for_each(lh, &br2684_devs) {
+ net_dev = list_entry_brdev(lh);
+
+ list_for_each_entry(brvcc, &BRPRIV(net_dev)->brvccs, brvccs) {
+ atm_vcc = brvcc->atmvcc;
+ if (atm_vcc && brvcc->atmvcc->dev == atm_dev) {
+
+ if (atm_vcc->dev->signal == ATM_PHY_SIG_LOST)
+ netif_carrier_off(net_dev);
+ else
+ netif_carrier_on(net_dev);
+
+ }
+ }
+ }
+ read_unlock_irqrestore(&devs_lock, flags);
+
+ return NOTIFY_DONE;
+}
+
+static struct notifier_block atm_dev_notifier = {
+ .notifier_call = atm_dev_event,
+};
+
/* chained vcc->pop function. Check if we should wake the netif_queue */
static void br2684_pop(struct atm_vcc *vcc, struct sk_buff *skb)
{
@@ -362,6 +399,12 @@ static void br2684_push(struct atm_vcc *atmvcc, struct sk_buff *skb)
unregister_netdev(net_dev);
free_netdev(net_dev);
}
+ read_lock_irq(&devs_lock);
+ if (list_empty(&br2684_devs)) {
+ /* last br2684 device */
+ unregister_atmdevice_notifier(&atm_dev_notifier);
+ }
+ read_unlock_irq(&devs_lock);
return;
}
@@ -530,6 +573,13 @@ static int br2684_regvcc(struct atm_vcc *atmvcc, void __user * arg)
br2684_push(atmvcc, skb);
}
+
+ /* initialize netdev carrier state */
+ if (atmvcc->dev->signal == ATM_PHY_SIG_LOST)
+ netif_carrier_off(net_dev);
+ else
+ netif_carrier_on(net_dev);
+
__module_get(THIS_MODULE);
return 0;
@@ -620,9 +670,16 @@ static int br2684_create(void __user *arg)
}
write_lock_irq(&devs_lock);
+
brdev->payload = payload;
- brdev->number = list_empty(&br2684_devs) ? 1 :
- BRPRIV(list_entry_brdev(br2684_devs.prev))->number + 1;
+
+ if (list_empty(&br2684_devs)) {
+ /* 1st br2684 device */
+ register_atmdevice_notifier(&atm_dev_notifier);
+ brdev->number = 1;
+ } else
+ brdev->number = BRPRIV(list_entry_brdev(br2684_devs.prev))->number + 1;
+
list_add_tail(&brdev->br2684_devs, &br2684_devs);
write_unlock_irq(&devs_lock);
return 0;
@@ -772,6 +829,11 @@ static void __exit br2684_exit(void)
remove_proc_entry("br2684", atm_proc_root);
#endif
+
+ /* if not already empty */
+ if (!list_empty(&br2684_devs))
+ unregister_atmdevice_notifier(&atm_dev_notifier);
+
while (!list_empty(&br2684_devs)) {
net_dev = list_entry_brdev(br2684_devs.next);
brdev = BRPRIV(net_dev);
--
1.7.1
^ permalink raw reply related
* [PATCH v4 1/9] atm: propagate signal changes via notifier
From: Karl Hiramoto @ 2010-07-08 8:34 UTC (permalink / raw)
To: linux-atm-general, netdev, chas, davem; +Cc: Karl Hiramoto
In-Reply-To: <1278578095-25324-1-git-send-email-karl@hiramoto.org>
Add notifier chain for changes in atm_dev.
Clients like br2684 will call register_atmdevice_notifier() to be notified of
changes. Drivers will call atm_dev_signal_change() to notify clients like
br2684 of the change.
On DSL and ATM devices it's usefull to have a know if you have a carrier
signal. netdevice LOWER_UP changes can be propagated to userspace via netlink
monitor.
Signed-off-by: Karl Hiramoto <karl@hiramoto.org>
---
include/linux/atmdev.h | 20 ++++++++++++++++++++
net/atm/common.c | 30 ++++++++++++++++++++++++++++++
2 files changed, 50 insertions(+), 0 deletions(-)
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h
index 817b237..649dd24 100644
--- a/include/linux/atmdev.h
+++ b/include/linux/atmdev.h
@@ -431,6 +431,15 @@ struct atm_dev *atm_dev_register(const char *type,const struct atmdev_ops *ops,
int number,unsigned long *flags); /* number == -1: pick first available */
struct atm_dev *atm_dev_lookup(int number);
void atm_dev_deregister(struct atm_dev *dev);
+
+/*
+ * atm_dev_signal_change
+ *
+ * Propagate lower layer signal change in atm_dev->signal to netdevice.
+ * The event will be sent via a notifier call chain.
+ */
+void atm_dev_signal_change(struct atm_dev *dev, char signal);
+
void vcc_insert_socket(struct sock *sk);
@@ -510,6 +519,17 @@ void register_atm_ioctl(struct atm_ioctl *);
*/
void deregister_atm_ioctl(struct atm_ioctl *);
+
+
+/*
+ * register_atmdevice_notifier - register atm_dev notify events
+ *
+ * Clients like br2684 will register notify events
+ * Currently we notify of signal found/lost
+ */
+int register_atmdevice_notifier(struct notifier_block *nb);
+void unregister_atmdevice_notifier(struct notifier_block *nb);
+
#endif /* __KERNEL__ */
#endif
diff --git a/net/atm/common.c b/net/atm/common.c
index b43feb1..940404a 100644
--- a/net/atm/common.c
+++ b/net/atm/common.c
@@ -37,6 +37,8 @@ EXPORT_SYMBOL(vcc_hash);
DEFINE_RWLOCK(vcc_sklist_lock);
EXPORT_SYMBOL(vcc_sklist_lock);
+static ATOMIC_NOTIFIER_HEAD(atm_dev_notify_chain);
+
static void __vcc_insert_socket(struct sock *sk)
{
struct atm_vcc *vcc = atm_sk(sk);
@@ -212,6 +214,22 @@ void vcc_release_async(struct atm_vcc *vcc, int reply)
}
EXPORT_SYMBOL(vcc_release_async);
+void atm_dev_signal_change(struct atm_dev *dev, char signal)
+{
+ pr_debug("%s signal=%d dev=%p number=%d dev->signal=%d\n",
+ __func__, signal, dev, dev->number, dev->signal);
+
+ /* atm driver sending invalid signal */
+ WARN_ON(signal < ATM_PHY_SIG_LOST || signal > ATM_PHY_SIG_FOUND);
+
+ if (dev->signal == signal)
+ return; /* no change */
+
+ dev->signal = signal;
+
+ atomic_notifier_call_chain(&atm_dev_notify_chain, signal, dev);
+}
+EXPORT_SYMBOL(atm_dev_signal_change);
void atm_dev_release_vccs(struct atm_dev *dev)
{
@@ -781,6 +799,18 @@ int vcc_getsockopt(struct socket *sock, int level, int optname,
return vcc->dev->ops->getsockopt(vcc, level, optname, optval, len);
}
+int register_atmdevice_notifier(struct notifier_block *nb)
+{
+ return atomic_notifier_chain_register(&atm_dev_notify_chain, nb);
+}
+EXPORT_SYMBOL_GPL(register_atmdevice_notifier);
+
+void unregister_atmdevice_notifier(struct notifier_block *nb)
+{
+ atomic_notifier_chain_unregister(&atm_dev_notify_chain, nb);
+}
+EXPORT_SYMBOL_GPL(unregister_atmdevice_notifier);
+
static int __init atm_init(void)
{
int error;
--
1.7.1
^ permalink raw reply related
* [PATCH v4 0/9] atm: propagate atm_dev signal carrier to LOWER_UP of netdevice
From: Karl Hiramoto @ 2010-07-08 8:34 UTC (permalink / raw)
To: linux-atm-general, netdev, chas, davem; +Cc: Karl Hiramoto
Changes from v3:
* read_lock_irqsave() instead of read_lock_irq()
* format comments in atmdev.h
Changes from v2:
* use atomic instead of blocking notifier
* use read_lock_irq() instead of read_lock() in atm/br2684
* clean up comments
* remove unused variable.
Changes from v1:
Use atm_dev notifier chain instead of callback function pointer in struct vcc.
In drivers/usb/atm call atm_dev_signal_change().
In userspace it's helpful to know if a network device has a carrier signal.
Often it is monitored via netlink. This patchset allows a way for the
struct atm_dev drivers to pass carrier on/off to the netdevice.
For DSL, carrier is on when the line has reached showtime state.
Currently this patchset only propagates the changes to br2684 vccs,
as this is the only type of hardware I have to test.
If you prefer git you can pull from:
git://github.com/karlhiramoto/linux-2.6.git atm-v4
Karl Hiramoto (9):
atm: propagate signal changes via notifier
atm/br2684: register notifier event for carrier signal changes.
atm/adummy: add syfs DEVICE_ATTR to change signal
atm/idt77105.c: call atm_dev_signal_change() when signal changes.
atm/solos-pci: call atm_dev_signal_change() when signal changes.
atm/suni.c: call atm_dev_signal_change() when signal changes.
usb/atm/cxacru.c: call atm_dev_signal_change() when signal changes.
usb/atm/speedtch.c: call atm_dev_signal_change() when signal changes.
usb/atm/ueagle-atm.c: call atm_dev_signal_change() when signal
changes.
drivers/atm/adummy.c | 39 ++++++++++++++++++++++++
drivers/atm/idt77105.c | 11 ++++---
drivers/atm/solos-pci.c | 6 ++--
drivers/atm/suni.c | 5 ++-
drivers/usb/atm/cxacru.c | 18 ++++++------
drivers/usb/atm/speedtch.c | 10 +++---
drivers/usb/atm/ueagle-atm.c | 13 ++++++--
include/linux/atmdev.h | 20 ++++++++++++
net/atm/br2684.c | 66 ++++++++++++++++++++++++++++++++++++++++-
net/atm/common.c | 30 +++++++++++++++++++
10 files changed, 189 insertions(+), 29 deletions(-)
^ permalink raw reply
* oops in tcp_xmit_retransmit_queue() w/ v2.6.32.15
From: Tejun Heo @ 2010-07-08 8:22 UTC (permalink / raw)
To: David S. Miller, lkml, netdev@vger.kernel.org
Cc: Fehrmann, Henning, Carsten Aulbert
[-- Attachment #1: Type: text/plain, Size: 1970 bytes --]
Hello,
We've been seeing oops in tcp_xmit_retransmit_queue() w/ 2.6.32.15.
Please see the attached photoshoot. This is happening on a HPC
cluster and very interestingly caused by one particular job. How long
it takes isn't clear yet (at least more than a day) but when it
happens it happens on a lot of machines in relatively short time.
With a bit of disassemblying, I've found that the oops is happening
during tcp_for_write_queue_from() because the skb->next points to
NULL.
void tcp_xmit_retransmit_queue(struct sock *sk)
{
...
if (tp->retransmit_skb_hint) {
skb = tp->retransmit_skb_hint;
last_lost = TCP_SKB_CB(skb)->end_seq;
if (after(last_lost, tp->retransmit_high))
last_lost = tp->retransmit_high;
} else {
skb = tcp_write_queue_head(sk);
last_lost = tp->snd_una;
}
=> tcp_for_write_queue_from(skb, sk) {
__u8 sacked = TCP_SKB_CB(skb)->sacked;
if (skb == tcp_send_head(sk))
break;
/* we could do better than to assign each time */
if (hole == NULL)
This can happen for one of the following reasons,
1. tp->retransmit_skb_hint is NULL and tcp_write_queue_head() is NULL
too. ie. tcp_xmit_retransmit_queue() is called on an empty write
queue for some reason.
2. tp->retransmit_skb_hint is pointing to a skb which is not on the
write_queue. ie. somebody forgot to update hint while removing the
skb from the write queue.
3. The hint is pointing to a skb on the list but the list itself is
corrupt.
I added some debug code and the crash is happening when
tp->retransmit_skb_hint is not NULL but tp->retransmit_skb_hint->next
is NULL. So, #1 is out; unfortunately, I didn't have debug code in
place to discern between #2 and #3.
Does anything ring a bell? This is a production system and debugging
affects quite a number of people. I can put debug code in to discern
between #2 and #3 but I'm basically shooting in the dark and it would
be great if someone has a better idea.
Thanks.
--
tejun
[-- Attachment #2: oops.jpg --]
[-- Type: image/jpeg, Size: 92585 bytes --]
^ permalink raw reply
* Re: [PATCH linux-2.6.35-rc3] ks8842 driver
From: Simon Horman @ 2010-07-08 7:52 UTC (permalink / raw)
To: Choi, David; +Cc: netdev, Li, Charles
In-Reply-To: <C43529A246480145B0A6D0234BDB0F0D0212A4@MELANITE.micrel.com>
On Wed, Jul 07, 2010 at 08:24:33AM -0700, Choi, David wrote:
> To whom it may have concerned,
>
> It seems that there are differences between Micrel ks8842 device and Timberdale FPGA based device with generic bus interface. In order to check the differences, I have sent several times but have not received any response. This patch is to support ks8841/ks8842 device from Micrel.
Is it desirable that the code can never be compiled to work with both devices?
Is this code likely to be included in a generic/distro kernel?
>
> From: David J. Choi <david.choi@micrel.com>
>
> Body of the explanation:
> -support 16bit and 32bit bus width.
> -add device reset for ks8842/8841 Micrel device.
> -set 100Mbps as a default for Micrel device.
> -set MAC address in both MAC/Switch layer with different sequence for Micrel device,
> as mentioned in data sheet.
>
> Signed-off-by: David J. Choi <david.choi@micrel.com>
>
> ---
> --- linux-2.6.35-rc3/drivers/net/ks8842.c.orig 2010-07-01 16:26:50.000000000 -0700
> +++ linux-2.6.35-rc3/drivers/net/ks8842.c 2010-07-07 07:41:03.000000000 -0700
> @@ -18,6 +18,7 @@
>
> /* Supports:
> * The Micrel KS8842 behind the timberdale FPGA
> + * The genuine Micrel KS8841/42 device with ISA 16/32bit bus interface
> */
>
> #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> @@ -191,6 +192,12 @@ static inline u32 ks8842_read32(struct k
>
> static void ks8842_reset(struct ks8842_adapter *adapter)
> {
> +#ifdef CONFIG_MICREL_KS884X
> + ks8842_write16(adapter, 3, 1, REG_GRR);
> + msleep(10);
> + iowrite16(0, adapter->hw_addr + REG_GRR);
> +
> +#else
> /* The KS8842 goes haywire when doing softare reset
> * a work around in the timberdale IP is implemented to
> * do a hardware reset instead
> @@ -201,6 +208,7 @@ static void ks8842_reset(struct ks8842_a
> iowrite16(32, adapter->hw_addr + REG_SELECT_BANK);
> iowrite32(0x1, adapter->hw_addr + REG_TIMB_RST);
> msleep(20);
> +#endif
> }
>
> static void ks8842_update_link_status(struct net_device *netdev,
> @@ -269,8 +277,11 @@ static void ks8842_reset_hw(struct ks884
>
> /* restart port auto-negotiation */
> ks8842_enable_bits(adapter, 49, 1 << 13, REG_P1CR4);
> +
> +#ifndef CONFIG_MICREL_KS884X
> /* only advertise 10Mbps */
> ks8842_clear_bits(adapter, 49, 3 << 2, REG_P1CR4);
> +#endif
>
> /* Enable the transmitter */
> ks8842_enable_tx(adapter);
> @@ -296,6 +307,20 @@ static void ks8842_read_mac_addr(struct
> for (i = 0; i < ETH_ALEN; i++)
> dest[ETH_ALEN - i - 1] = ks8842_read8(adapter, 2, REG_MARL + i);
>
> +#ifdef CONFIG_MICREL_KS884X
> + /*
> + the sequence of saving mac addr between MAC and Switch is
> + different.
> + */
> +
> + mac = ks8842_read16(adapter, 2, REG_MARL);
> + ks8842_write16(adapter, 39, mac, REG_MACAR3);
> + mac = ks8842_read16(adapter, 2, REG_MARM);
> + ks8842_write16(adapter, 39, mac, REG_MACAR2);
> + mac = ks8842_read16(adapter, 2, REG_MARH);
> + ks8842_write16(adapter, 39, mac, REG_MACAR1);
> +#else
> +
> /* make sure the switch port uses the same MAC as the QMU */
> mac = ks8842_read16(adapter, 2, REG_MARL);
> ks8842_write16(adapter, 39, mac, REG_MACAR1);
> @@ -303,6 +328,7 @@ static void ks8842_read_mac_addr(struct
> ks8842_write16(adapter, 39, mac, REG_MACAR2);
> mac = ks8842_read16(adapter, 2, REG_MARH);
> ks8842_write16(adapter, 39, mac, REG_MACAR3);
> +#endif
> }
>
> static void ks8842_write_mac_addr(struct ks8842_adapter *adapter, u8 *mac)
> @@ -313,8 +339,13 @@ static void ks8842_write_mac_addr(struct
> spin_lock_irqsave(&adapter->lock, flags);
> for (i = 0; i < ETH_ALEN; i++) {
> ks8842_write8(adapter, 2, mac[ETH_ALEN - i - 1], REG_MARL + i);
> +#ifdef CONFIG_MICREL_KS884X
> + ks8842_write8(adapter, 39, mac[ETH_ALEN - i - 1],
> + REG_MACAR3 + 1 - i);
> +#else
> ks8842_write8(adapter, 39, mac[ETH_ALEN - i - 1],
> REG_MACAR1 + i);
> +#endif
> }
> spin_unlock_irqrestore(&adapter->lock, flags);
> }
> @@ -328,8 +359,12 @@ static int ks8842_tx_frame(struct sk_buf
> {
> struct ks8842_adapter *adapter = netdev_priv(netdev);
> int len = skb->len;
> +#ifdef CONFIG_KS884X_16BIT
> + u16 *ptr16 = (u16 *)skb->data;
> +#else
> u32 *ptr = (u32 *)skb->data;
> u32 ctrl;
> +#endif
>
> dev_dbg(&adapter->pdev->dev,
> "%s: len %u head %p data %p tail %p end %p\n",
> @@ -340,6 +375,18 @@ static int ks8842_tx_frame(struct sk_buf
> if (ks8842_tx_fifo_space(adapter) < len + 8)
> return NETDEV_TX_BUSY;
>
> +#ifdef CONFIG_KS884X_16BIT
> + ks8842_write16(adapter, 17, 0x8000 | 0x100, REG_QMU_DATA_LO);
> + ks8842_write16(adapter, 17, (u16)len, REG_QMU_DATA_HI);
> + netdev->stats.tx_bytes += len;
> +
> + /* copy buffer */
> + while (len > 0) {
> + iowrite16(*ptr16++, adapter->hw_addr + REG_QMU_DATA_LO);
> + iowrite16(*ptr16++, adapter->hw_addr + REG_QMU_DATA_HI);
> + len -= sizeof(u32);
> + }
> +#else
> /* the control word, enable IRQ, port 1 and the length */
> ctrl = 0x8000 | 0x100 | (len << 16);
> ks8842_write32(adapter, 17, ctrl, REG_QMU_DATA_LO);
> @@ -352,6 +399,7 @@ static int ks8842_tx_frame(struct sk_buf
> len -= sizeof(u32);
> ptr++;
> }
> +#endif
>
> /* enqueue packet */
> ks8842_write16(adapter, 17, 1, REG_TXQCR);
> @@ -364,10 +412,15 @@ static int ks8842_tx_frame(struct sk_buf
> static void ks8842_rx_frame(struct net_device *netdev,
> struct ks8842_adapter *adapter)
> {
> +#ifdef CONFIG_KS884X_16BIT
> + u16 status = ks8842_read16(adapter, 17, REG_QMU_DATA_LO);
> + int len = (int)ks8842_read16(adapter, 17, REG_QMU_DATA_HI) & 0xffff;
> +#else
> u32 status = ks8842_read32(adapter, 17, REG_QMU_DATA_LO);
> int len = (status >> 16) & 0x7ff;
>
> status &= 0xffff;
> +#endif
>
> dev_dbg(&adapter->pdev->dev, "%s - rx_data: status: %x\n",
> __func__, status);
> @@ -379,13 +432,28 @@ static void ks8842_rx_frame(struct net_d
> dev_dbg(&adapter->pdev->dev, "%s, got package, len: %d\n",
> __func__, len);
> if (skb) {
> +#ifdef CONFIG_KS884X_16BIT
> + u16 *data16;
> +#else
> u32 *data;
> +#endif
>
> netdev->stats.rx_packets++;
> netdev->stats.rx_bytes += len;
> if (status & RXSR_MULTICAST)
> netdev->stats.multicast++;
>
> +#ifdef CONFIG_KS884X_16BIT
> + data16 = (u16 *)skb_put(skb, len);
> + ks8842_select_bank(adapter, 17);
> + while (len > 0) {
> + *data16++ = ioread16(adapter->hw_addr +
> + REG_QMU_DATA_LO);
> + *data16++ = ioread16(adapter->hw_addr +
> + REG_QMU_DATA_HI);
> + len -= sizeof(u32);
> + }
> +#else
> data = (u32 *)skb_put(skb, len);
>
> ks8842_select_bank(adapter, 17);
> @@ -397,6 +465,7 @@ static void ks8842_rx_frame(struct net_d
>
> skb->protocol = eth_type_trans(skb, netdev);
> netif_rx(skb);
> +#endif
> } else
> netdev->stats.rx_dropped++;
> } else {
> --- linux-2.6.35-rc3/drivers/net/Kconfig.orig 2010-07-02 15:52:41.000000000 -0700
> +++ linux-2.6.35-rc3/drivers/net/Kconfig 2010-07-07 07:45:47.000000000 -0700
> @@ -1748,11 +1748,29 @@ config TLAN
> Please email feedback to <torben.mathiasen@compaq.com>.
>
> config KS8842
> - tristate "Micrel KSZ8842"
> + tristate "Micrel KSZ8841/42 with generic bus interface"
> depends on HAS_IOMEM
> help
> - This platform driver is for Micrel KSZ8842 / KS8842
> - 2-port ethernet switch chip (managed, VLAN, QoS).
> + This platform driver is for KSZ8841(1-port) / KS8842(2-port)
> + ethernet switch chip (managed, VLAN, QoS) from Micrel or
> + Timberdale(FPGA).
> +
> +if KS8842
> +config MICREL_KS884X
> + boolean "KSZ8841/42 device from Micrel"
> + default n
> + help
> + Say Y to use Micrel device. Otherwise Timberdale(FPGA) device is
> + selected.
> +
> +config KS884X_16BIT
> + boolean "16bit bus width"
> + default y
> + help
> + This option specifies 16bit or 32bit bus interface. Say Y to use
> + 16bit bus. Otherwise 32bit bus is selected.
> +
> +endif # KS8842
>
> config KS8851
> tristate "Micrel KS8851 SPI"
> ---
> --
> 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
* [PATCH net-2.6] Phonet: fix skb leak in pipe endpoint accept()
From: Rémi Denis-Courmont @ 2010-07-08 6:56 UTC (permalink / raw)
To: netdev
From: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
---
net/phonet/pep.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/net/phonet/pep.c b/net/phonet/pep.c
index 94d72e8..b2a3ae6 100644
--- a/net/phonet/pep.c
+++ b/net/phonet/pep.c
@@ -698,6 +698,7 @@ static struct sock *pep_sock_accept(struct sock *sk, int flags, int *errp)
newsk = NULL;
goto out;
}
+ kfree_skb(oskb);
sock_hold(sk);
pep_sk(newsk)->listener = sk;
--
1.7.0.4
^ permalink raw reply related
* Re: [PATCH] vlan: allow TSO setting on vlan interfaces
From: Eric Dumazet @ 2010-07-08 6:46 UTC (permalink / raw)
To: Ben Hutchings; +Cc: David Miller, netdev, Patrick McHardy
In-Reply-To: <1278523511.2080.3.camel@achroite.uk.solarflarecom.com>
Le mercredi 07 juillet 2010 à 18:25 +0100, Ben Hutchings a écrit :
> On Wed, 2010-07-07 at 19:14 +0200, Eric Dumazet wrote:
> > When we need to shape traffic with low speeds, we need to disable tso on
> > network interface :
> >
> > ethtool -K eth0.2240 tso off
> >
> > It seems vlan interfaces miss the set_tso() ethtool method.
> > Propagating tso changes from lower device is not always wanted, some
> > vlan want TSO on, other want TSO off.
>
> But it should not be possible to enable TSO if the underlying device
> doesn't support it.
Yes indeed, I'll provide a more generic patch, thanks !
^ permalink raw reply
* [PATCH net-next-2.6 V2] tg3: 64 bit stats on all arches
From: Eric Dumazet @ 2010-07-08 6:44 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Matt Carlson, Michael Chan
Now core network is able to handle 64 bit netdevice stats on 32 bit
arches, we can provide them for tg3, since hardware maintains 64 bit
counters.
I'll provide bnx2 and bnx2x patches as well.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
drivers/net/tg3.c | 35 ++++++++++++-----------------------
drivers/net/tg3.h | 4 ++--
2 files changed, 14 insertions(+), 25 deletions(-)
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 289cdc5..7c75f1e 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -9021,7 +9021,8 @@ err_out1:
return err;
}
-static struct net_device_stats *tg3_get_stats(struct net_device *);
+static struct rtnl_link_stats64 *tg3_get_stats64(struct net_device *,
+ struct rtnl_link_stats64 *);
static struct tg3_ethtool_stats *tg3_get_estats(struct tg3 *);
static int tg3_close(struct net_device *dev)
@@ -9055,8 +9056,8 @@ static int tg3_close(struct net_device *dev)
tg3_ints_fini(tp);
- memcpy(&tp->net_stats_prev, tg3_get_stats(tp->dev),
- sizeof(tp->net_stats_prev));
+ tg3_get_stats64(tp->dev, &tp->net_stats_prev);
+
memcpy(&tp->estats_prev, tg3_get_estats(tp),
sizeof(tp->estats_prev));
@@ -9069,24 +9070,12 @@ static int tg3_close(struct net_device *dev)
return 0;
}
-static inline unsigned long get_stat64(tg3_stat64_t *val)
-{
- unsigned long ret;
-
-#if (BITS_PER_LONG == 32)
- ret = val->low;
-#else
- ret = ((u64)val->high << 32) | ((u64)val->low);
-#endif
- return ret;
-}
-
-static inline u64 get_estat64(tg3_stat64_t *val)
+static inline u64 get_stat64(tg3_stat64_t *val)
{
return ((u64)val->high << 32) | ((u64)val->low);
}
-static unsigned long calc_crc_errors(struct tg3 *tp)
+static u64 calc_crc_errors(struct tg3 *tp)
{
struct tg3_hw_stats *hw_stats = tp->hw_stats;
@@ -9114,7 +9103,7 @@ static unsigned long calc_crc_errors(struct tg3 *tp)
#define ESTAT_ADD(member) \
estats->member = old_estats->member + \
- get_estat64(&hw_stats->member)
+ get_stat64(&hw_stats->member)
static struct tg3_ethtool_stats *tg3_get_estats(struct tg3 *tp)
{
@@ -9204,11 +9193,11 @@ static struct tg3_ethtool_stats *tg3_get_estats(struct tg3 *tp)
return estats;
}
-static struct net_device_stats *tg3_get_stats(struct net_device *dev)
+static struct rtnl_link_stats64 *tg3_get_stats64(struct net_device *dev,
+ struct rtnl_link_stats64 *stats)
{
struct tg3 *tp = netdev_priv(dev);
- struct net_device_stats *stats = &tp->net_stats;
- struct net_device_stats *old_stats = &tp->net_stats_prev;
+ struct rtnl_link_stats64 *old_stats = &tp->net_stats_prev;
struct tg3_hw_stats *hw_stats = tp->hw_stats;
if (!hw_stats)
@@ -14317,7 +14306,7 @@ static const struct net_device_ops tg3_netdev_ops = {
.ndo_open = tg3_open,
.ndo_stop = tg3_close,
.ndo_start_xmit = tg3_start_xmit,
- .ndo_get_stats = tg3_get_stats,
+ .ndo_get_stats64 = tg3_get_stats64,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_multicast_list = tg3_set_rx_mode,
.ndo_set_mac_address = tg3_set_mac_addr,
@@ -14336,7 +14325,7 @@ static const struct net_device_ops tg3_netdev_ops_dma_bug = {
.ndo_open = tg3_open,
.ndo_stop = tg3_close,
.ndo_start_xmit = tg3_start_xmit_dma_bug,
- .ndo_get_stats = tg3_get_stats,
+ .ndo_get_stats64 = tg3_get_stats64,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_multicast_list = tg3_set_rx_mode,
.ndo_set_mac_address = tg3_set_mac_addr,
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index 6b6af76..b72ac52 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -2772,8 +2772,8 @@ struct tg3 {
/* begin "everything else" cacheline(s) section */
- struct net_device_stats net_stats;
- struct net_device_stats net_stats_prev;
+ struct rtnl_link_stats64 net_stats;
+ struct rtnl_link_stats64 net_stats_prev;
struct tg3_ethtool_stats estats;
struct tg3_ethtool_stats estats_prev;
^ permalink raw reply related
* Re: [PATCH net-next] cxgb4: fix for new ndo_get_stats64 signature
From: David Miller @ 2010-07-08 5:41 UTC (permalink / raw)
To: eric.dumazet; +Cc: dm, netdev
In-Reply-To: <1278566230.2543.0.camel@edumazet-laptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Thu, 08 Jul 2010 07:17:10 +0200
> Le mercredi 07 juillet 2010 à 19:11 -0700, Dimitris Michailidis a
> écrit :
>> The change to ndo_get_stats64 in "net: fix 64 bit counters on 32 bit arches"
>> missed cxgb4. Fix it.
>>
>> Signed-off-by: Dimitris Michailidis <dm@chelsio.com>
>> ---
>
> Indeed, sorry and thanks !
>
> Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH net-next-2.6 V2] net: fix 64 bit counters on 32 bit arches
From: Eric Dumazet @ 2010-07-08 5:18 UTC (permalink / raw)
To: David Miller; +Cc: bhutchings, shemminger, arnd, netdev, linux-net-drivers
In-Reply-To: <20100707.154109.26944330.davem@davemloft.net>
Le mercredi 07 juillet 2010 à 15:41 -0700, David Miller a écrit :
> Some dev_get_stats() conversions were missing, such as parisc/led,
> some s390 code, usb rndis, etc.
>
> I took care of this when integrating this patch.
Thats very kind of you David, thanks !
^ permalink raw reply
* Re: [PATCH net-next] cxgb4: fix for new ndo_get_stats64 signature
From: Eric Dumazet @ 2010-07-08 5:17 UTC (permalink / raw)
To: Dimitris Michailidis; +Cc: netdev
In-Reply-To: <1278555085-17074-1-git-send-email-dm@chelsio.com>
Le mercredi 07 juillet 2010 à 19:11 -0700, Dimitris Michailidis a
écrit :
> The change to ndo_get_stats64 in "net: fix 64 bit counters on 32 bit arches"
> missed cxgb4. Fix it.
>
> Signed-off-by: Dimitris Michailidis <dm@chelsio.com>
> ---
Indeed, sorry and thanks !
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
^ permalink raw reply
* Re: linux-next: build warning after merge of the net tree
From: Joe Perches @ 2010-07-08 4:13 UTC (permalink / raw)
To: David Miller; +Cc: sfr, netdev, linux-next, linux-kernel, gregkh
In-Reply-To: <20100707.181847.62350965.davem@davemloft.net>
On Wed, 2010-07-07 at 18:18 -0700, David Miller wrote:
> From: David Miller <davem@davemloft.net>
> Date: Wed, 07 Jul 2010 17:45:22 -0700 (PDT)
> > From: Stephen Rothwell <sfr@canb.auug.org.au>
> > Date: Tue, 6 Jul 2010 14:25:42 +1000
> >> After merging the net tree, today's linux-next build (powerpc
> >> ppc64_defconfig) produced these warnings:
> >> drivers/scsi/sym53c8xx_2/sym_hipd.c: In function 'sym_print_msg':
> >> drivers/scsi/sym53c8xx_2/sym_hipd.c:78: warning: zero-length gnu_printf format string
> > Thanks Stephen I'll look into this.
> Yeah this is a bit ugly.
>
> It used to be that the dev_*() format string was CPP pasted to whatever
> format string the user gave. So if the user gave an empty string it
> still looked like a non-empty printf string.
>
> But that no longer happens because we hide the implementation, and thus
> the top-level printf format string, in the external functions.
>
> It seems the construction:
>
> /*
> * Stupid hackaround for existing uses of non-printk uses dev_info
> *
> * Note that the definition of dev_info below is actually _dev_info
> * and a macro is used to avoid redefining dev_info
> */
>
> #define dev_info(dev, fmt, arg...) _dev_info(dev, fmt, ##arg)
>
> added to linux/device.h was meant to handle these cases, but as we see
> it doesn't.
Nope, the _dev_info/dev_info is meant to handle the
current uses of dev_info as a variable like this one:
$ grep dev_info drivers/net/pcmcia/pcnet_cs.c
static dev_info_t dev_info = "pcnet_cs";
ret = request_irq(dev->irq, ei_irq_wrapper, IRQF_SHARED, dev_info, dev);
Without the _dev_info and dev_info as a macro,
the function is redefined as a variable.
> It looks like there are just a hand-ful of cases, so maybe we can tweak
> them by hand. For example, in the sym53c8xx_2 driver bits we can replace
> the NULL labels passed to sym_print_msg() with a real string and therefore
> remove the "" case.
>
> Joe, any better ideas?
You're right there are just a few cases where dev_info
is uses as a preface for a hex_dump style display.
Maybe it'd be OK to simply add a trailing space to the
preface and remove any leading spaces from the subsequent
initial printks.
dev_info(dev, " ");
^ 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