* Re: [PATCH 1/3] offloading: Make scatter/gather more tolerant of vlans.
From: Ben Hutchings @ 2010-11-01 20:06 UTC (permalink / raw)
To: Jesse Gross; +Cc: David Miller, netdev
In-Reply-To: <1288390495-28923-1-git-send-email-jesse@nicira.com>
On Fri, 2010-10-29 at 15:14 -0700, Jesse Gross wrote:
> When checking if it is necessary to linearize a packet, we currently
> use vlan_features if the packet contains either an in-band or out-
> of-band vlan tag. However, in-band tags aren't special in any way
> for scatter/gather since they are part of the packet buffer and are
> simply more data to DMA. Therefore, only use vlan_features for out-
> of-band tags, which could potentially have some interaction with
> scatter/gather.
>
> Signed-off-by: Jesse Gross <jesse@nicira.com>
> CC: Ben Hutchings <bhutchings@solarflare.com>
[...]
Reviewed-by: Ben Hutchings <bhutchings@solarflare.com>
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: [PATCH] net: check queue_index from sock is valid for device
From: David Miller @ 2010-11-01 19:56 UTC (permalink / raw)
To: therbert; +Cc: netdev
In-Reply-To: <alpine.DEB.1.00.1011011249590.5368@pokey.mtv.corp.google.com>
From: Tom Herbert <therbert@google.com>
Date: Mon, 1 Nov 2010 12:53:32 -0700 (PDT)
> In dev_pick_tx recompute the queue index if the value stored in the
> socket is greater than or equal to the number of real queues for the
> device. The saved index in the sock structure is not guaranteed to
> be appropriate for the egress device (this could happen on a route
> change or in presence of tunnelling). The result of the queue index
> being bad would be to return a bogus queue (crash could prersumably
> follow).
>
> Signed-off-by: Tom Herbert <therbert@google.com>
Looks good, applied, thanks Tom.
^ permalink raw reply
* [PATCH] net: check queue_index from sock is valid for device
From: Tom Herbert @ 2010-11-01 19:53 UTC (permalink / raw)
To: davem, netdev
In dev_pick_tx recompute the queue index if the value stored in the
socket is greater than or equal to the number of real queues for the
device. The saved index in the sock structure is not guaranteed to
be appropriate for the egress device (this could happen on a route
change or in presence of tunnelling). The result of the queue index
being bad would be to return a bogus queue (crash could prersumably
follow).
Signed-off-by: Tom Herbert <therbert@google.com>
---
net/core/dev.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index 78b5a89..dc2a307 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2135,7 +2135,7 @@ static struct netdev_queue *dev_pick_tx(struct net_device *dev,
} else {
struct sock *sk = skb->sk;
queue_index = sk_tx_queue_get(sk);
- if (queue_index < 0) {
+ if (queue_index < 0 || queue_index >= dev->real_num_tx_queues) {
queue_index = 0;
if (dev->real_num_tx_queues > 1)
--
1.7.3.1
^ permalink raw reply related
* [PATCH] net: sh_eth: Move off of deprecated I/O routines.
From: Paul Mundt @ 2010-11-01 19:29 UTC (permalink / raw)
To: David Miller; +Cc: Nobuhiro Iwamatsu, netdev
sh_eth is the last in-tree user of the ctrl_xxx I/O routines. This simply
converts them over to regular MMIO accesors.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
---
drivers/net/sh_eth.c | 244 +++++++++++++++++++++++++--------------------------
1 file changed, 122 insertions(+), 122 deletions(-)
diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c
index 50259df..b12660d 100644
--- a/drivers/net/sh_eth.c
+++ b/drivers/net/sh_eth.c
@@ -45,9 +45,9 @@ static void sh_eth_set_duplex(struct net_device *ndev)
u32 ioaddr = ndev->base_addr;
if (mdp->duplex) /* Full */
- ctrl_outl(ctrl_inl(ioaddr + ECMR) | ECMR_DM, ioaddr + ECMR);
+ writel(readl(ioaddr + ECMR) | ECMR_DM, ioaddr + ECMR);
else /* Half */
- ctrl_outl(ctrl_inl(ioaddr + ECMR) & ~ECMR_DM, ioaddr + ECMR);
+ writel(readl(ioaddr + ECMR) & ~ECMR_DM, ioaddr + ECMR);
}
static void sh_eth_set_rate(struct net_device *ndev)
@@ -57,10 +57,10 @@ static void sh_eth_set_rate(struct net_device *ndev)
switch (mdp->speed) {
case 10: /* 10BASE */
- ctrl_outl(ctrl_inl(ioaddr + ECMR) & ~ECMR_RTM, ioaddr + ECMR);
+ writel(readl(ioaddr + ECMR) & ~ECMR_RTM, ioaddr + ECMR);
break;
case 100:/* 100BASE */
- ctrl_outl(ctrl_inl(ioaddr + ECMR) | ECMR_RTM, ioaddr + ECMR);
+ writel(readl(ioaddr + ECMR) | ECMR_RTM, ioaddr + ECMR);
break;
default:
break;
@@ -96,9 +96,9 @@ static void sh_eth_set_duplex(struct net_device *ndev)
u32 ioaddr = ndev->base_addr;
if (mdp->duplex) /* Full */
- ctrl_outl(ctrl_inl(ioaddr + ECMR) | ECMR_DM, ioaddr + ECMR);
+ writel(readl(ioaddr + ECMR) | ECMR_DM, ioaddr + ECMR);
else /* Half */
- ctrl_outl(ctrl_inl(ioaddr + ECMR) & ~ECMR_DM, ioaddr + ECMR);
+ writel(readl(ioaddr + ECMR) & ~ECMR_DM, ioaddr + ECMR);
}
static void sh_eth_set_rate(struct net_device *ndev)
@@ -108,10 +108,10 @@ static void sh_eth_set_rate(struct net_device *ndev)
switch (mdp->speed) {
case 10: /* 10BASE */
- ctrl_outl(0, ioaddr + RTRATE);
+ writel(0, ioaddr + RTRATE);
break;
case 100:/* 100BASE */
- ctrl_outl(1, ioaddr + RTRATE);
+ writel(1, ioaddr + RTRATE);
break;
default:
break;
@@ -143,7 +143,7 @@ static struct sh_eth_cpu_data sh_eth_my_cpu_data = {
static void sh_eth_chip_reset(struct net_device *ndev)
{
/* reset device */
- ctrl_outl(ARSTR_ARSTR, ARSTR);
+ writel(ARSTR_ARSTR, ARSTR);
mdelay(1);
}
@@ -152,10 +152,10 @@ static void sh_eth_reset(struct net_device *ndev)
u32 ioaddr = ndev->base_addr;
int cnt = 100;
- ctrl_outl(EDSR_ENALL, ioaddr + EDSR);
- ctrl_outl(ctrl_inl(ioaddr + EDMR) | EDMR_SRST, ioaddr + EDMR);
+ writel(EDSR_ENALL, ioaddr + EDSR);
+ writel(readl(ioaddr + EDMR) | EDMR_SRST, ioaddr + EDMR);
while (cnt > 0) {
- if (!(ctrl_inl(ioaddr + EDMR) & 0x3))
+ if (!(readl(ioaddr + EDMR) & 0x3))
break;
mdelay(1);
cnt--;
@@ -164,14 +164,14 @@ static void sh_eth_reset(struct net_device *ndev)
printk(KERN_ERR "Device reset fail\n");
/* Table Init */
- ctrl_outl(0x0, ioaddr + TDLAR);
- ctrl_outl(0x0, ioaddr + TDFAR);
- ctrl_outl(0x0, ioaddr + TDFXR);
- ctrl_outl(0x0, ioaddr + TDFFR);
- ctrl_outl(0x0, ioaddr + RDLAR);
- ctrl_outl(0x0, ioaddr + RDFAR);
- ctrl_outl(0x0, ioaddr + RDFXR);
- ctrl_outl(0x0, ioaddr + RDFFR);
+ writel(0x0, ioaddr + TDLAR);
+ writel(0x0, ioaddr + TDFAR);
+ writel(0x0, ioaddr + TDFXR);
+ writel(0x0, ioaddr + TDFFR);
+ writel(0x0, ioaddr + RDLAR);
+ writel(0x0, ioaddr + RDFAR);
+ writel(0x0, ioaddr + RDFXR);
+ writel(0x0, ioaddr + RDFFR);
}
static void sh_eth_set_duplex(struct net_device *ndev)
@@ -180,9 +180,9 @@ static void sh_eth_set_duplex(struct net_device *ndev)
u32 ioaddr = ndev->base_addr;
if (mdp->duplex) /* Full */
- ctrl_outl(ctrl_inl(ioaddr + ECMR) | ECMR_DM, ioaddr + ECMR);
+ writel(readl(ioaddr + ECMR) | ECMR_DM, ioaddr + ECMR);
else /* Half */
- ctrl_outl(ctrl_inl(ioaddr + ECMR) & ~ECMR_DM, ioaddr + ECMR);
+ writel(readl(ioaddr + ECMR) & ~ECMR_DM, ioaddr + ECMR);
}
static void sh_eth_set_rate(struct net_device *ndev)
@@ -192,13 +192,13 @@ static void sh_eth_set_rate(struct net_device *ndev)
switch (mdp->speed) {
case 10: /* 10BASE */
- ctrl_outl(GECMR_10, ioaddr + GECMR);
+ writel(GECMR_10, ioaddr + GECMR);
break;
case 100:/* 100BASE */
- ctrl_outl(GECMR_100, ioaddr + GECMR);
+ writel(GECMR_100, ioaddr + GECMR);
break;
case 1000: /* 1000BASE */
- ctrl_outl(GECMR_1000, ioaddr + GECMR);
+ writel(GECMR_1000, ioaddr + GECMR);
break;
default:
break;
@@ -283,9 +283,9 @@ static void sh_eth_reset(struct net_device *ndev)
{
u32 ioaddr = ndev->base_addr;
- ctrl_outl(ctrl_inl(ioaddr + EDMR) | EDMR_SRST, ioaddr + EDMR);
+ writel(readl(ioaddr + EDMR) | EDMR_SRST, ioaddr + EDMR);
mdelay(3);
- ctrl_outl(ctrl_inl(ioaddr + EDMR) & ~EDMR_SRST, ioaddr + EDMR);
+ writel(readl(ioaddr + EDMR) & ~EDMR_SRST, ioaddr + EDMR);
}
#endif
@@ -336,10 +336,10 @@ static void update_mac_address(struct net_device *ndev)
{
u32 ioaddr = ndev->base_addr;
- ctrl_outl((ndev->dev_addr[0] << 24) | (ndev->dev_addr[1] << 16) |
+ writel((ndev->dev_addr[0] << 24) | (ndev->dev_addr[1] << 16) |
(ndev->dev_addr[2] << 8) | (ndev->dev_addr[3]),
ioaddr + MAHR);
- ctrl_outl((ndev->dev_addr[4] << 8) | (ndev->dev_addr[5]),
+ writel((ndev->dev_addr[4] << 8) | (ndev->dev_addr[5]),
ioaddr + MALR);
}
@@ -358,12 +358,12 @@ static void read_mac_address(struct net_device *ndev, unsigned char *mac)
if (mac[0] || mac[1] || mac[2] || mac[3] || mac[4] || mac[5]) {
memcpy(ndev->dev_addr, mac, 6);
} else {
- ndev->dev_addr[0] = (ctrl_inl(ioaddr + MAHR) >> 24);
- ndev->dev_addr[1] = (ctrl_inl(ioaddr + MAHR) >> 16) & 0xFF;
- ndev->dev_addr[2] = (ctrl_inl(ioaddr + MAHR) >> 8) & 0xFF;
- ndev->dev_addr[3] = (ctrl_inl(ioaddr + MAHR) & 0xFF);
- ndev->dev_addr[4] = (ctrl_inl(ioaddr + MALR) >> 8) & 0xFF;
- ndev->dev_addr[5] = (ctrl_inl(ioaddr + MALR) & 0xFF);
+ ndev->dev_addr[0] = (readl(ioaddr + MAHR) >> 24);
+ ndev->dev_addr[1] = (readl(ioaddr + MAHR) >> 16) & 0xFF;
+ ndev->dev_addr[2] = (readl(ioaddr + MAHR) >> 8) & 0xFF;
+ ndev->dev_addr[3] = (readl(ioaddr + MAHR) & 0xFF);
+ ndev->dev_addr[4] = (readl(ioaddr + MALR) >> 8) & 0xFF;
+ ndev->dev_addr[5] = (readl(ioaddr + MALR) & 0xFF);
}
}
@@ -379,19 +379,19 @@ struct bb_info {
/* PHY bit set */
static void bb_set(u32 addr, u32 msk)
{
- ctrl_outl(ctrl_inl(addr) | msk, addr);
+ writel(readl(addr) | msk, addr);
}
/* PHY bit clear */
static void bb_clr(u32 addr, u32 msk)
{
- ctrl_outl((ctrl_inl(addr) & ~msk), addr);
+ writel((readl(addr) & ~msk), addr);
}
/* PHY bit read */
static int bb_read(u32 addr, u32 msk)
{
- return (ctrl_inl(addr) & msk) != 0;
+ return (readl(addr) & msk) != 0;
}
/* Data I/O pin control */
@@ -506,9 +506,9 @@ static void sh_eth_ring_format(struct net_device *ndev)
rxdesc->buffer_length = ALIGN(mdp->rx_buf_sz, 16);
/* Rx descriptor address set */
if (i == 0) {
- ctrl_outl(mdp->rx_desc_dma, ioaddr + RDLAR);
+ writel(mdp->rx_desc_dma, ioaddr + RDLAR);
#if defined(CONFIG_CPU_SUBTYPE_SH7763)
- ctrl_outl(mdp->rx_desc_dma, ioaddr + RDFAR);
+ writel(mdp->rx_desc_dma, ioaddr + RDFAR);
#endif
}
}
@@ -528,9 +528,9 @@ static void sh_eth_ring_format(struct net_device *ndev)
txdesc->buffer_length = 0;
if (i == 0) {
/* Tx descriptor address set */
- ctrl_outl(mdp->tx_desc_dma, ioaddr + TDLAR);
+ writel(mdp->tx_desc_dma, ioaddr + TDLAR);
#if defined(CONFIG_CPU_SUBTYPE_SH7763)
- ctrl_outl(mdp->tx_desc_dma, ioaddr + TDFAR);
+ writel(mdp->tx_desc_dma, ioaddr + TDFAR);
#endif
}
}
@@ -623,71 +623,71 @@ static int sh_eth_dev_init(struct net_device *ndev)
/* Descriptor format */
sh_eth_ring_format(ndev);
if (mdp->cd->rpadir)
- ctrl_outl(mdp->cd->rpadir_value, ioaddr + RPADIR);
+ writel(mdp->cd->rpadir_value, ioaddr + RPADIR);
/* all sh_eth int mask */
- ctrl_outl(0, ioaddr + EESIPR);
+ writel(0, ioaddr + EESIPR);
#if defined(__LITTLE_ENDIAN__)
if (mdp->cd->hw_swap)
- ctrl_outl(EDMR_EL, ioaddr + EDMR);
+ writel(EDMR_EL, ioaddr + EDMR);
else
#endif
- ctrl_outl(0, ioaddr + EDMR);
+ writel(0, ioaddr + EDMR);
/* FIFO size set */
- ctrl_outl(mdp->cd->fdr_value, ioaddr + FDR);
- ctrl_outl(0, ioaddr + TFTR);
+ writel(mdp->cd->fdr_value, ioaddr + FDR);
+ writel(0, ioaddr + TFTR);
/* Frame recv control */
- ctrl_outl(mdp->cd->rmcr_value, ioaddr + RMCR);
+ writel(mdp->cd->rmcr_value, ioaddr + RMCR);
rx_int_var = mdp->rx_int_var = DESC_I_RINT8 | DESC_I_RINT5;
tx_int_var = mdp->tx_int_var = DESC_I_TINT2;
- ctrl_outl(rx_int_var | tx_int_var, ioaddr + TRSCER);
+ writel(rx_int_var | tx_int_var, ioaddr + TRSCER);
if (mdp->cd->bculr)
- ctrl_outl(0x800, ioaddr + BCULR); /* Burst sycle set */
+ writel(0x800, ioaddr + BCULR); /* Burst sycle set */
- ctrl_outl(mdp->cd->fcftr_value, ioaddr + FCFTR);
+ writel(mdp->cd->fcftr_value, ioaddr + FCFTR);
if (!mdp->cd->no_trimd)
- ctrl_outl(0, ioaddr + TRIMD);
+ writel(0, ioaddr + TRIMD);
/* Recv frame limit set register */
- ctrl_outl(RFLR_VALUE, ioaddr + RFLR);
+ writel(RFLR_VALUE, ioaddr + RFLR);
- ctrl_outl(ctrl_inl(ioaddr + EESR), ioaddr + EESR);
- ctrl_outl(mdp->cd->eesipr_value, ioaddr + EESIPR);
+ writel(readl(ioaddr + EESR), ioaddr + EESR);
+ writel(mdp->cd->eesipr_value, ioaddr + EESIPR);
/* PAUSE Prohibition */
- val = (ctrl_inl(ioaddr + ECMR) & ECMR_DM) |
+ val = (readl(ioaddr + ECMR) & ECMR_DM) |
ECMR_ZPF | (mdp->duplex ? ECMR_DM : 0) | ECMR_TE | ECMR_RE;
- ctrl_outl(val, ioaddr + ECMR);
+ writel(val, ioaddr + ECMR);
if (mdp->cd->set_rate)
mdp->cd->set_rate(ndev);
/* E-MAC Status Register clear */
- ctrl_outl(mdp->cd->ecsr_value, ioaddr + ECSR);
+ writel(mdp->cd->ecsr_value, ioaddr + ECSR);
/* E-MAC Interrupt Enable register */
- ctrl_outl(mdp->cd->ecsipr_value, ioaddr + ECSIPR);
+ writel(mdp->cd->ecsipr_value, ioaddr + ECSIPR);
/* Set MAC address */
update_mac_address(ndev);
/* mask reset */
if (mdp->cd->apr)
- ctrl_outl(APR_AP, ioaddr + APR);
+ writel(APR_AP, ioaddr + APR);
if (mdp->cd->mpr)
- ctrl_outl(MPR_MP, ioaddr + MPR);
+ writel(MPR_MP, ioaddr + MPR);
if (mdp->cd->tpauser)
- ctrl_outl(TPAUSER_UNLIMITED, ioaddr + TPAUSER);
+ writel(TPAUSER_UNLIMITED, ioaddr + TPAUSER);
/* Setting the Rx mode will start the Rx process. */
- ctrl_outl(EDRRR_R, ioaddr + EDRRR);
+ writel(EDRRR_R, ioaddr + EDRRR);
netif_start_queue(ndev);
@@ -811,8 +811,8 @@ static int sh_eth_rx(struct net_device *ndev)
/* Restart Rx engine if stopped. */
/* If we don't need to check status, don't. -KDU */
- if (!(ctrl_inl(ndev->base_addr + EDRRR) & EDRRR_R))
- ctrl_outl(EDRRR_R, ndev->base_addr + EDRRR);
+ if (!(readl(ndev->base_addr + EDRRR) & EDRRR_R))
+ writel(EDRRR_R, ndev->base_addr + EDRRR);
return 0;
}
@@ -827,8 +827,8 @@ static void sh_eth_error(struct net_device *ndev, int intr_status)
u32 mask;
if (intr_status & EESR_ECI) {
- felic_stat = ctrl_inl(ioaddr + ECSR);
- ctrl_outl(felic_stat, ioaddr + ECSR); /* clear int */
+ felic_stat = readl(ioaddr + ECSR);
+ writel(felic_stat, ioaddr + ECSR); /* clear int */
if (felic_stat & ECSR_ICD)
mdp->stats.tx_carrier_errors++;
if (felic_stat & ECSR_LCHNG) {
@@ -839,25 +839,25 @@ static void sh_eth_error(struct net_device *ndev, int intr_status)
else
link_stat = PHY_ST_LINK;
} else {
- link_stat = (ctrl_inl(ioaddr + PSR));
+ link_stat = (readl(ioaddr + PSR));
if (mdp->ether_link_active_low)
link_stat = ~link_stat;
}
if (!(link_stat & PHY_ST_LINK)) {
/* Link Down : disable tx and rx */
- ctrl_outl(ctrl_inl(ioaddr + ECMR) &
+ writel(readl(ioaddr + ECMR) &
~(ECMR_RE | ECMR_TE), ioaddr + ECMR);
} else {
/* Link Up */
- ctrl_outl(ctrl_inl(ioaddr + EESIPR) &
+ writel(readl(ioaddr + EESIPR) &
~DMAC_M_ECI, ioaddr + EESIPR);
/*clear int */
- ctrl_outl(ctrl_inl(ioaddr + ECSR),
+ writel(readl(ioaddr + ECSR),
ioaddr + ECSR);
- ctrl_outl(ctrl_inl(ioaddr + EESIPR) |
+ writel(readl(ioaddr + EESIPR) |
DMAC_M_ECI, ioaddr + EESIPR);
/* enable tx and rx */
- ctrl_outl(ctrl_inl(ioaddr + ECMR) |
+ writel(readl(ioaddr + ECMR) |
(ECMR_RE | ECMR_TE), ioaddr + ECMR);
}
}
@@ -888,8 +888,8 @@ static void sh_eth_error(struct net_device *ndev, int intr_status)
/* Receive Descriptor Empty int */
mdp->stats.rx_over_errors++;
- if (ctrl_inl(ioaddr + EDRRR) ^ EDRRR_R)
- ctrl_outl(EDRRR_R, ioaddr + EDRRR);
+ if (readl(ioaddr + EDRRR) ^ EDRRR_R)
+ writel(EDRRR_R, ioaddr + EDRRR);
dev_err(&ndev->dev, "Receive Descriptor Empty\n");
}
if (intr_status & EESR_RFE) {
@@ -903,7 +903,7 @@ static void sh_eth_error(struct net_device *ndev, int intr_status)
mask &= ~EESR_ADE;
if (intr_status & mask) {
/* Tx error */
- u32 edtrr = ctrl_inl(ndev->base_addr + EDTRR);
+ u32 edtrr = readl(ndev->base_addr + EDTRR);
/* dmesg */
dev_err(&ndev->dev, "TX error. status=%8.8x cur_tx=%8.8x ",
intr_status, mdp->cur_tx);
@@ -915,7 +915,7 @@ static void sh_eth_error(struct net_device *ndev, int intr_status)
/* SH7712 BUG */
if (edtrr ^ EDTRR_TRNS) {
/* tx dma start */
- ctrl_outl(EDTRR_TRNS, ndev->base_addr + EDTRR);
+ writel(EDTRR_TRNS, ndev->base_addr + EDTRR);
}
/* wakeup */
netif_wake_queue(ndev);
@@ -934,12 +934,12 @@ static irqreturn_t sh_eth_interrupt(int irq, void *netdev)
spin_lock(&mdp->lock);
/* Get interrpt stat */
- intr_status = ctrl_inl(ioaddr + EESR);
+ intr_status = readl(ioaddr + EESR);
/* Clear interrupt */
if (intr_status & (EESR_FRC | EESR_RMAF | EESR_RRF |
EESR_RTLF | EESR_RTSF | EESR_PRE | EESR_CERF |
cd->tx_check | cd->eesr_err_check)) {
- ctrl_outl(intr_status, ioaddr + EESR);
+ writel(intr_status, ioaddr + EESR);
ret = IRQ_HANDLED;
} else
goto other_irq;
@@ -1000,7 +1000,7 @@ static void sh_eth_adjust_link(struct net_device *ndev)
mdp->cd->set_rate(ndev);
}
if (mdp->link == PHY_DOWN) {
- ctrl_outl((ctrl_inl(ioaddr + ECMR) & ~ECMR_TXF)
+ writel((readl(ioaddr + ECMR) & ~ECMR_TXF)
| ECMR_DM, ioaddr + ECMR);
new_state = 1;
mdp->link = phydev->link;
@@ -1125,7 +1125,7 @@ static void sh_eth_tx_timeout(struct net_device *ndev)
/* worning message out. */
printk(KERN_WARNING "%s: transmit timed out, status %8.8x,"
- " resetting...\n", ndev->name, (int)ctrl_inl(ioaddr + EESR));
+ " resetting...\n", ndev->name, (int)readl(ioaddr + EESR));
/* tx_errors count up */
mdp->stats.tx_errors++;
@@ -1196,8 +1196,8 @@ static int sh_eth_start_xmit(struct sk_buff *skb, struct net_device *ndev)
mdp->cur_tx++;
- if (!(ctrl_inl(ndev->base_addr + EDTRR) & EDTRR_TRNS))
- ctrl_outl(EDTRR_TRNS, ndev->base_addr + EDTRR);
+ if (!(readl(ndev->base_addr + EDTRR) & EDTRR_TRNS))
+ writel(EDTRR_TRNS, ndev->base_addr + EDTRR);
return NETDEV_TX_OK;
}
@@ -1212,11 +1212,11 @@ static int sh_eth_close(struct net_device *ndev)
netif_stop_queue(ndev);
/* Disable interrupts by clearing the interrupt mask. */
- ctrl_outl(0x0000, ioaddr + EESIPR);
+ writel(0x0000, ioaddr + EESIPR);
/* Stop the chip's Tx and Rx processes. */
- ctrl_outl(0, ioaddr + EDTRR);
- ctrl_outl(0, ioaddr + EDRRR);
+ writel(0, ioaddr + EDTRR);
+ writel(0, ioaddr + EDRRR);
/* PHY Disconnect */
if (mdp->phydev) {
@@ -1251,20 +1251,20 @@ static struct net_device_stats *sh_eth_get_stats(struct net_device *ndev)
pm_runtime_get_sync(&mdp->pdev->dev);
- mdp->stats.tx_dropped += ctrl_inl(ioaddr + TROCR);
- ctrl_outl(0, ioaddr + TROCR); /* (write clear) */
- mdp->stats.collisions += ctrl_inl(ioaddr + CDCR);
- ctrl_outl(0, ioaddr + CDCR); /* (write clear) */
- mdp->stats.tx_carrier_errors += ctrl_inl(ioaddr + LCCR);
- ctrl_outl(0, ioaddr + LCCR); /* (write clear) */
+ mdp->stats.tx_dropped += readl(ioaddr + TROCR);
+ writel(0, ioaddr + TROCR); /* (write clear) */
+ mdp->stats.collisions += readl(ioaddr + CDCR);
+ writel(0, ioaddr + CDCR); /* (write clear) */
+ mdp->stats.tx_carrier_errors += readl(ioaddr + LCCR);
+ writel(0, ioaddr + LCCR); /* (write clear) */
#if defined(CONFIG_CPU_SUBTYPE_SH7763)
- mdp->stats.tx_carrier_errors += ctrl_inl(ioaddr + CERCR);/* CERCR */
- ctrl_outl(0, ioaddr + CERCR); /* (write clear) */
- mdp->stats.tx_carrier_errors += ctrl_inl(ioaddr + CEECR);/* CEECR */
- ctrl_outl(0, ioaddr + CEECR); /* (write clear) */
+ mdp->stats.tx_carrier_errors += readl(ioaddr + CERCR);/* CERCR */
+ writel(0, ioaddr + CERCR); /* (write clear) */
+ mdp->stats.tx_carrier_errors += readl(ioaddr + CEECR);/* CEECR */
+ writel(0, ioaddr + CEECR); /* (write clear) */
#else
- mdp->stats.tx_carrier_errors += ctrl_inl(ioaddr + CNDCR);
- ctrl_outl(0, ioaddr + CNDCR); /* (write clear) */
+ mdp->stats.tx_carrier_errors += readl(ioaddr + CNDCR);
+ writel(0, ioaddr + CNDCR); /* (write clear) */
#endif
pm_runtime_put_sync(&mdp->pdev->dev);
@@ -1295,11 +1295,11 @@ static void sh_eth_set_multicast_list(struct net_device *ndev)
if (ndev->flags & IFF_PROMISC) {
/* Set promiscuous. */
- ctrl_outl((ctrl_inl(ioaddr + ECMR) & ~ECMR_MCT) | ECMR_PRM,
+ writel((readl(ioaddr + ECMR) & ~ECMR_MCT) | ECMR_PRM,
ioaddr + ECMR);
} else {
/* Normal, unicast/broadcast-only mode. */
- ctrl_outl((ctrl_inl(ioaddr + ECMR) & ~ECMR_PRM) | ECMR_MCT,
+ writel((readl(ioaddr + ECMR) & ~ECMR_PRM) | ECMR_MCT,
ioaddr + ECMR);
}
}
@@ -1307,30 +1307,30 @@ static void sh_eth_set_multicast_list(struct net_device *ndev)
/* SuperH's TSU register init function */
static void sh_eth_tsu_init(u32 ioaddr)
{
- ctrl_outl(0, ioaddr + TSU_FWEN0); /* Disable forward(0->1) */
- ctrl_outl(0, ioaddr + TSU_FWEN1); /* Disable forward(1->0) */
- ctrl_outl(0, ioaddr + TSU_FCM); /* forward fifo 3k-3k */
- ctrl_outl(0xc, ioaddr + TSU_BSYSL0);
- ctrl_outl(0xc, ioaddr + TSU_BSYSL1);
- ctrl_outl(0, ioaddr + TSU_PRISL0);
- ctrl_outl(0, ioaddr + TSU_PRISL1);
- ctrl_outl(0, ioaddr + TSU_FWSL0);
- ctrl_outl(0, ioaddr + TSU_FWSL1);
- ctrl_outl(TSU_FWSLC_POSTENU | TSU_FWSLC_POSTENL, ioaddr + TSU_FWSLC);
+ writel(0, ioaddr + TSU_FWEN0); /* Disable forward(0->1) */
+ writel(0, ioaddr + TSU_FWEN1); /* Disable forward(1->0) */
+ writel(0, ioaddr + TSU_FCM); /* forward fifo 3k-3k */
+ writel(0xc, ioaddr + TSU_BSYSL0);
+ writel(0xc, ioaddr + TSU_BSYSL1);
+ writel(0, ioaddr + TSU_PRISL0);
+ writel(0, ioaddr + TSU_PRISL1);
+ writel(0, ioaddr + TSU_FWSL0);
+ writel(0, ioaddr + TSU_FWSL1);
+ writel(TSU_FWSLC_POSTENU | TSU_FWSLC_POSTENL, ioaddr + TSU_FWSLC);
#if defined(CONFIG_CPU_SUBTYPE_SH7763)
- ctrl_outl(0, ioaddr + TSU_QTAG0); /* Disable QTAG(0->1) */
- ctrl_outl(0, ioaddr + TSU_QTAG1); /* Disable QTAG(1->0) */
+ writel(0, ioaddr + TSU_QTAG0); /* Disable QTAG(0->1) */
+ writel(0, ioaddr + TSU_QTAG1); /* Disable QTAG(1->0) */
#else
- ctrl_outl(0, ioaddr + TSU_QTAGM0); /* Disable QTAG(0->1) */
- ctrl_outl(0, ioaddr + TSU_QTAGM1); /* Disable QTAG(1->0) */
+ writel(0, ioaddr + TSU_QTAGM0); /* Disable QTAG(0->1) */
+ writel(0, ioaddr + TSU_QTAGM1); /* Disable QTAG(1->0) */
#endif
- ctrl_outl(0, ioaddr + TSU_FWSR); /* all interrupt status clear */
- ctrl_outl(0, ioaddr + TSU_FWINMK); /* Disable all interrupt */
- ctrl_outl(0, ioaddr + TSU_TEN); /* Disable all CAM entry */
- ctrl_outl(0, ioaddr + TSU_POST1); /* Disable CAM entry [ 0- 7] */
- ctrl_outl(0, ioaddr + TSU_POST2); /* Disable CAM entry [ 8-15] */
- ctrl_outl(0, ioaddr + TSU_POST3); /* Disable CAM entry [16-23] */
- ctrl_outl(0, ioaddr + TSU_POST4); /* Disable CAM entry [24-31] */
+ writel(0, ioaddr + TSU_FWSR); /* all interrupt status clear */
+ writel(0, ioaddr + TSU_FWINMK); /* Disable all interrupt */
+ writel(0, ioaddr + TSU_TEN); /* Disable all CAM entry */
+ writel(0, ioaddr + TSU_POST1); /* Disable CAM entry [ 0- 7] */
+ writel(0, ioaddr + TSU_POST2); /* Disable CAM entry [ 8-15] */
+ writel(0, ioaddr + TSU_POST3); /* Disable CAM entry [16-23] */
+ writel(0, ioaddr + TSU_POST4); /* Disable CAM entry [24-31] */
}
#endif /* SH_ETH_HAS_TSU */
^ permalink raw reply related
* Re: [PATCH v4 0/2] Get and Set Feature Reports on HIDRAW (USB and Bluetooth)
From: Jiri Kosina @ 2010-11-01 19:23 UTC (permalink / raw)
To: Alan Ott, Marcel Holtmann, David S. Miller
Cc: Stefan Achatz, Antonio Ospite, Alexey Dobriyan, Tejun Heo,
Alan Stern, Greg Kroah-Hartman, Stephane Chatty, Michael Poole,
Bastien Nocera, Eric Dumazet, linux-input, linux-kernel,
linux-usb, linux-bluetooth, netdev
In-Reply-To: <alpine.LNX.2.00.1009221408330.26813@pobox.suse.cz>
On Wed, 22 Sep 2010, Jiri Kosina wrote:
> > > > This is version 4. Built against 2.6.35+ revision 320b2b8de12698 .
> > > >
> > > > Alan Ott (2):
> > > > HID: Add Support for Setting and Getting Feature Reports from hidraw
> > > > Bluetooth: hidp: Add support for hidraw HIDIOCGFEATURE and
> > > > HIDIOCSFEATURE
> > > >
> > > > drivers/hid/hidraw.c | 105 ++++++++++++++++++++++++++++++++++++--
> > > > drivers/hid/usbhid/hid-core.c | 37 +++++++++++++-
> > > > include/linux/hid.h | 3 +
> > > > include/linux/hidraw.h | 3 +
> > > > net/bluetooth/hidp/core.c | 114 +++++++++++++++++++++++++++++++++++++++--
> > > > net/bluetooth/hidp/hidp.h | 8 +++
> > > > 6 files changed, 260 insertions(+), 10 deletions(-)
> > >
> > > Marcel, as per our previous discussion -- what is your word on this? I'd
> > > be glad taking it once you Ack the bluetooth bits (which, as far as I
> > > understood from your last mail, don't have strong objections against any
> > > more).
> >
> > ... Marcel?
> >
> > I'd really like not to miss 2.6.37 merge window with this.
>
> Seemingly I have not enought powers to get statement from Marcel here
> these days/weeks.
>
> Davem, would you perhaps be able to step in here?
Marcel, any word on this patchset by chance?
Thanks,
--
Jiri Kosina
SUSE Labs, Novell Inc.
^ permalink raw reply
* Re: [PATCH] USB: gadget: fix ethernet gadget crash in gether_setup
From: David Miller @ 2010-11-01 16:34 UTC (permalink / raw)
To: dkirjanov; +Cc: mad_soft, dbrownell, gregkh, netdev, linux-kernel, therbert
In-Reply-To: <4CCEEAEA.4050504@kernel.org>
From: Denis Kirjanov <dkirjanov@kernel.org>
Date: Mon, 01 Nov 2010 19:29:30 +0300
> [PATCH] USB: gadget: fix ethernet gadget crash in gether_setup
>
> Crash is triggered by commit e6484930d7 ("net: allocate tx queues in
> register_netdevice"), which moved tx netqueue creation into register_netdev.
> So now calling netif_stop_queue() before register_netdev causes an oops.
> Move netif_stop_queue() after net device registration to fix crash.
>
> Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
> Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org>
Applied, thanks.
^ permalink raw reply
* Re: Fwd: [PATCH] USB: gadget: fix ethernet gadget crash in gether_setup
From: Denis Kirjanov @ 2010-11-01 16:29 UTC (permalink / raw)
To: mad_soft
Cc: David Brownell, Greg Kroah-Hartman, netdev, linux-kernel,
Tom Herbert, David S. Miller
In-Reply-To: <AANLkTi=B93UqfiBFMFryLk1wxus6LwHsSo+8+Ff5D0Ne@mail.gmail.com>
On 11/01/2010 07:12 PM, Denis Kirjanov wrote:
> ---------- Forwarded message ----------
> From: Dmitry Artamonow <mad_soft@inbox.ru>
> Date: Thu, Oct 28, 2010 at 12:18 PM
> Subject: [PATCH] USB: gadget: fix ethernet gadget crash in gether_setup
> To: linux-usb@vger.kernel.org
> Cc: David Brownell <dbrownell@users.sourceforge.net>, Greg
> Kroah-Hartman <gregkh@suse.de>, netdev@vger.kernel.org,
> linux-kernel@vger.kernel.org, Tom Herbert <therbert@google.com>,
> "David S. Miller" <davem@davemloft.net>
>
>
> Crash is triggered by commit e6484930d7 ("net: allocate tx queues in
> register_netdevice"), which moved tx netqueue creation into register_netdev.
> So now calling netif_stop_queue() before register_netdev causes an oops.
> Move netif_stop_queue() after net device registration to fix crash.
>
> Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
> ---
Doesn't this is racy with the ->open? eth_open invokes netif_wake_queue() inside eth_start
[PATCH] USB: gadget: fix ethernet gadget crash in gether_setup
Crash is triggered by commit e6484930d7 ("net: allocate tx queues in
register_netdevice"), which moved tx netqueue creation into register_netdev.
So now calling netif_stop_queue() before register_netdev causes an oops.
Move netif_stop_queue() after net device registration to fix crash.
Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org>
---
drivers/usb/gadget/u_ether.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/drivers/usb/gadget/u_ether.c b/drivers/usb/gadget/u_ether.c
index cb23355..fbe86ca 100644
--- a/drivers/usb/gadget/u_ether.c
+++ b/drivers/usb/gadget/u_ether.c
@@ -811,7 +811,6 @@ int gether_setup(struct usb_gadget *g, u8 ethaddr[ETH_ALEN])
INFO(dev, "MAC %pM\n", net->dev_addr);
INFO(dev, "HOST MAC %pM\n", dev->host_mac);
- netif_stop_queue(net);
the_dev = dev;
}
--
1.7.1
^ permalink raw reply related
* Re: [PATCH] USB: gadget: fix ethernet gadget crash in gether_setup
From: David Miller @ 2010-11-01 16:22 UTC (permalink / raw)
To: mirqus-Re5JQEeQqe8AvxtiuMwx3w
Cc: mad_soft-aPYA7nAdAYY, linux-usb-u79uwXL29TY76Z2rM5mHXA,
dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f, gregkh-l3A5Bk7waGM,
netdev-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
therbert-hpIqsD4AKlfQT0dZR+AlfA
In-Reply-To: <AANLkTimMwTbj-2oP-VP7Ht1VnA8_w7vpTGz1kk5HG7zx-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: Text/Plain; charset=utf-8, Size: 1815 bytes --]
From: MichaÅ MirosÅaw <mirqus@gmail.com>
Date: Mon, 1 Nov 2010 17:16:39 +0100
> 2010/10/28 Dmitry Artamonow <mad_soft@inbox.ru>:
>> Crash is triggered by commit e6484930d7 ("net: allocate tx queues in
>> register_netdevice"), which moved tx netqueue creation into register_netdev.
>> So now calling netif_stop_queue() before register_netdev causes an oops.
>> Move netif_stop_queue() after net device registration to fix crash.
>>
>> Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
>> ---
>> Â drivers/usb/gadget/u_ether.c | Â Â 2 +-
>> Â 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/usb/gadget/u_ether.c b/drivers/usb/gadget/u_ether.c
>> index 6bb876d..cb23355 100644
>> --- a/drivers/usb/gadget/u_ether.c
>> +++ b/drivers/usb/gadget/u_ether.c
>> @@ -797,7 +797,6 @@ int gether_setup(struct usb_gadget *g, u8 ethaddr[ETH_ALEN])
>> Â Â Â Â * Â - iff DATA transfer is active, carrier is "on"
>> Â Â Â Â * Â - tx queueing enabled if open *and* carrier is "on"
>> Â Â Â Â */
>> - Â Â Â netif_stop_queue(net);
>> Â Â Â Â netif_carrier_off(net);
>>
>> Â Â Â Â dev->gadget = g;
>> @@ -812,6 +811,7 @@ int gether_setup(struct usb_gadget *g, u8 ethaddr[ETH_ALEN])
>> Â Â Â Â Â Â Â Â INFO(dev, "MAC %pM\n", net->dev_addr);
>> Â Â Â Â Â Â Â Â INFO(dev, "HOST MAC %pM\n", dev->host_mac);
>>
>> + Â Â Â Â Â Â Â netif_stop_queue(net);
>> Â Â Â Â Â Â Â Â the_dev = dev;
>> Â Â Â Â }
>>
>
> What about a race between register_netdev() -> open() -> rest of
> gether_setup() ? What is this netif_stop_queue() here needed for?
Nothing, it should be completely removed.
N§²æìr¸yúèØb²X¬¶Ç§vØ^)Þº{.nÇ+·¥{±ºÆâØ^nr¡ö¦zË\x1aëh¨èÚ&¢îý»\x05ËÛÔØï¦v¬Îf\x1dp)¹¹br ê+Ê+zf£¢·h§~Ûiÿûàz¹\x1e®w¥¢¸?¨èÚ&¢)ߢ^[f
^ permalink raw reply
* Re: [PATCH] USB: gadget: fix ethernet gadget crash in gether_setup
From: Michał Mirosław @ 2010-11-01 16:16 UTC (permalink / raw)
To: Dmitry Artamonow
Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA, David Brownell,
Greg Kroah-Hartman, netdev-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Tom Herbert, David S. Miller
In-Reply-To: <1288253909-12084-1-git-send-email-mad_soft-aPYA7nAdAYY@public.gmane.org>
2010/10/28 Dmitry Artamonow <mad_soft-aPYA7nAdAYY@public.gmane.org>:
> Crash is triggered by commit e6484930d7 ("net: allocate tx queues in
> register_netdevice"), which moved tx netqueue creation into register_netdev.
> So now calling netif_stop_queue() before register_netdev causes an oops.
> Move netif_stop_queue() after net device registration to fix crash.
>
> Signed-off-by: Dmitry Artamonow <mad_soft-aPYA7nAdAYY@public.gmane.org>
> ---
> drivers/usb/gadget/u_ether.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/usb/gadget/u_ether.c b/drivers/usb/gadget/u_ether.c
> index 6bb876d..cb23355 100644
> --- a/drivers/usb/gadget/u_ether.c
> +++ b/drivers/usb/gadget/u_ether.c
> @@ -797,7 +797,6 @@ int gether_setup(struct usb_gadget *g, u8 ethaddr[ETH_ALEN])
> * - iff DATA transfer is active, carrier is "on"
> * - tx queueing enabled if open *and* carrier is "on"
> */
> - netif_stop_queue(net);
> netif_carrier_off(net);
>
> dev->gadget = g;
> @@ -812,6 +811,7 @@ int gether_setup(struct usb_gadget *g, u8 ethaddr[ETH_ALEN])
> INFO(dev, "MAC %pM\n", net->dev_addr);
> INFO(dev, "HOST MAC %pM\n", dev->host_mac);
>
> + netif_stop_queue(net);
> the_dev = dev;
> }
>
What about a race between register_netdev() -> open() -> rest of
gether_setup() ? What is this netif_stop_queue() here needed for?
Best Regards,
Michał Mirosław
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [PATCH] USB: gadget: fix ethernet gadget crash in gether_setup
From: Dmitry Artamonow @ 2010-10-28 8:18 UTC (permalink / raw)
To: linux-usb
Cc: David Brownell, Greg Kroah-Hartman, netdev, linux-kernel,
Tom Herbert, David S. Miller
Crash is triggered by commit e6484930d7 ("net: allocate tx queues in
register_netdevice"), which moved tx netqueue creation into register_netdev.
So now calling netif_stop_queue() before register_netdev causes an oops.
Move netif_stop_queue() after net device registration to fix crash.
Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
---
drivers/usb/gadget/u_ether.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/usb/gadget/u_ether.c b/drivers/usb/gadget/u_ether.c
index 6bb876d..cb23355 100644
--- a/drivers/usb/gadget/u_ether.c
+++ b/drivers/usb/gadget/u_ether.c
@@ -797,7 +797,6 @@ int gether_setup(struct usb_gadget *g, u8 ethaddr[ETH_ALEN])
* - iff DATA transfer is active, carrier is "on"
* - tx queueing enabled if open *and* carrier is "on"
*/
- netif_stop_queue(net);
netif_carrier_off(net);
dev->gadget = g;
@@ -812,6 +811,7 @@ int gether_setup(struct usb_gadget *g, u8 ethaddr[ETH_ALEN])
INFO(dev, "MAC %pM\n", net->dev_addr);
INFO(dev, "HOST MAC %pM\n", dev->host_mac);
+ netif_stop_queue(net);
the_dev = dev;
}
--
1.7.0.4
^ permalink raw reply related
* Re: [PATCH] OF device tree: Move of_get_mac_address() to a common source file.
From: Grant Likely @ 2010-11-01 15:51 UTC (permalink / raw)
To: Timur Tabi
Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ
In-Reply-To: <AANLkTimp-AFN5T3z9o6X9qM-GQXSU5vinf+Lqu_jUmJj-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On Mon, Nov 1, 2010 at 11:46 AM, Timur Tabi <timur-KZfg59tc24xl57MIdRCFDg@public.gmane.org> wrote:
> On Mon, Nov 1, 2010 at 12:17 AM, Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org> wrote:
>
>> Applied, thanks; but made some changes to protect this code because it
>> does not work on little endian (it can be fixed in a separate patch)
>
> I'm confused. How does of_get_mac_address() not work on little-endian?
Hmmm, right. I got confused here. It should be just fine on
little-endian. I'll revert my change. Thanks.
g.
^ permalink raw reply
* Re: [PATCH] OF device tree: Move of_get_mac_address() to a common source file.
From: Timur Tabi @ 2010-11-01 15:46 UTC (permalink / raw)
To: Grant Likely; +Cc: devicetree-discuss, netdev, linuxppc-dev
In-Reply-To: <20101101051734.GB17587@angua.secretlab.ca>
On Mon, Nov 1, 2010 at 12:17 AM, Grant Likely <grant.likely@secretlab.ca> wrote:
> Applied, thanks; but made some changes to protect this code because it
> does not work on little endian (it can be fixed in a separate patch)
I'm confused. How does of_get_mac_address() not work on little-endian?
--
Timur Tabi
Linux kernel developer at Freescale
^ permalink raw reply
* Re: [PATCH] usbnet: fix usb_autopm_get_interface failure(v1)
From: David Miller @ 2010-11-01 15:08 UTC (permalink / raw)
To: andy.shevchenko
Cc: tom.leiming, netdev, oliver, dbrownell, gregkh, ben, joe, stable
In-Reply-To: <AANLkTim_NRFV0ELzpOE6K539Wfxsw8j1eW-3TXLCrgOZ@mail.gmail.com>
From: Andy Shevchenko <andy.shevchenko@gmail.com>
Date: Mon, 1 Nov 2010 17:04:35 +0200
>> + /*usbnet already took usb runtime pm, so have to enable the feature
>> + * for usb interface, otherwise usb_autopm_get_interface may return
>> + * failure if USB_SUSPEND(RUNTIME_PM) is enabled.
>> + * */
> Just minor: multiline comments doesn't follow the required style.
There were also spaces before tabs at the beginning of each
line.
I fixed all of this up when applying the patch.
^ permalink raw reply
* Re: [PATCH] usbnet: fix usb_autopm_get_interface failure(v1)
From: Andy Shevchenko @ 2010-11-01 15:04 UTC (permalink / raw)
To: tom.leiming
Cc: netdev, oliver, davem, David Brownell, Greg Kroah-Hartman,
Ben Hutchings, Joe Perches, stable
In-Reply-To: <1288620349-9769-1-git-send-email-tom.leiming@gmail.com>
On Mon, Nov 1, 2010 at 4:05 PM, <tom.leiming@gmail.com> wrote:
> From: Ming Lei <tom.leiming@gmail.com>
>
> Since usbnet already took usb runtime pm, we have to
> enable runtime pm for usb interface of usbnet, otherwise
> usb_autopm_get_interface may return failure and cause
> 'ifconfig usb0 up' failed if USB_SUSPEND(RUNTIME_PM) is
> enabled.
>
> Cc: David Brownell <dbrownell@users.sourceforge.net>
> Cc: Greg Kroah-Hartman <gregkh@suse.de>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Ben Hutchings <ben@decadent.org.uk>
> Cc: Joe Perches <joe@perches.com>
> Cc: Oliver Neukum <oliver@neukum.org>
> Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
> Cc: stable@kernel.org
> Signed-off-by: Ming Lei <tom.leiming@gmail.com>
> ---
> v1: include header file
>
> ---
> drivers/net/usb/usbnet.c | 11 +++++++++++
> 1 files changed, 11 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
> index ca7fc9d..06b1dee 100644
> --- a/drivers/net/usb/usbnet.c
> +++ b/drivers/net/usb/usbnet.c
> @@ -45,6 +45,7 @@
> #include <linux/usb/usbnet.h>
> #include <linux/slab.h>
> #include <linux/kernel.h>
> +#include <linux/pm_runtime.h>
>
> #define DRIVER_VERSION "22-Aug-2005"
>
> @@ -1273,6 +1274,16 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
> struct usb_device *xdev;
> int status;
> const char *name;
> + struct usb_driver *driver = to_usb_driver(udev->dev.driver);
> +
> + /*usbnet already took usb runtime pm, so have to enable the feature
> + * for usb interface, otherwise usb_autopm_get_interface may return
> + * failure if USB_SUSPEND(RUNTIME_PM) is enabled.
> + * */
Just minor: multiline comments doesn't follow the required style.
> + if (!driver->supports_autosuspend) {
> + driver->supports_autosuspend = 1;
> + pm_runtime_enable(&udev->dev);
> + }
>
> name = udev->dev.driver->name;
> info = (struct driver_info *) prod->driver_info;
> --
> 1.7.3
>
>
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply
* Re: [PATCH RFC] tun: remove of user-controlled memory allocation
From: David Miller @ 2010-11-01 14:16 UTC (permalink / raw)
To: mst; +Cc: herbert, eric.dumazet, joe, netdev, linux-kernel
In-Reply-To: <20101101082749.GA25860@redhat.com>
From: "Michael S. Tsirkin" <mst@redhat.com>
Date: Mon, 1 Nov 2010 10:27:49 +0200
> Untested, this is just an RFC.
>
> tun does a kmalloc where userspace controls the length. This will
> produce warnings in kernel log when the length is too large, or might
> block for a long while. A simple fix is to avoid the allocatiuon
> altogether, and copy from user in a loop.
>
> However, with this patch an illegal address passed to the ioctl might
> leave the filter disabled. Is this something we care about? If
> yes we could recover by creating a copy of the filter. Thoughts?
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
I think the key issue in situations like this is simply to make
sure that reasonable things that worked before, still do afterwards.
And I think your patch does that, so it's fine as far as I can tell.
^ permalink raw reply
* Re: [PATCH] usbnet: fix usb_autopm_get_interface failure(v1)
From: David Miller @ 2010-11-01 14:13 UTC (permalink / raw)
To: tom.leiming
Cc: netdev, oliver, dbrownell, gregkh, ben, joe, andy.shevchenko,
stable
In-Reply-To: <1288620349-9769-1-git-send-email-tom.leiming@gmail.com>
From: tom.leiming@gmail.com
Date: Mon, 1 Nov 2010 22:05:49 +0800
> From: Ming Lei <tom.leiming@gmail.com>
>
> Since usbnet already took usb runtime pm, we have to
> enable runtime pm for usb interface of usbnet, otherwise
> usb_autopm_get_interface may return failure and cause
> 'ifconfig usb0 up' failed if USB_SUSPEND(RUNTIME_PM) is
> enabled.
>
> Cc: David Brownell <dbrownell@users.sourceforge.net>
> Cc: Greg Kroah-Hartman <gregkh@suse.de>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Ben Hutchings <ben@decadent.org.uk>
> Cc: Joe Perches <joe@perches.com>
> Cc: Oliver Neukum <oliver@neukum.org>
> Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
> Cc: stable@kernel.org
> Signed-off-by: Ming Lei <tom.leiming@gmail.com>
> ---
> v1: include header file
Applied, thanks.
^ permalink raw reply
* [PATCH] usbnet: fix usb_autopm_get_interface failure(v1)
From: tom.leiming @ 2010-11-01 14:05 UTC (permalink / raw)
To: netdev, oliver, davem
Cc: Ming Lei, David Brownell, Greg Kroah-Hartman, Ben Hutchings,
Joe Perches, Andy Shevchenko, stable
From: Ming Lei <tom.leiming@gmail.com>
Since usbnet already took usb runtime pm, we have to
enable runtime pm for usb interface of usbnet, otherwise
usb_autopm_get_interface may return failure and cause
'ifconfig usb0 up' failed if USB_SUSPEND(RUNTIME_PM) is
enabled.
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Ben Hutchings <ben@decadent.org.uk>
Cc: Joe Perches <joe@perches.com>
Cc: Oliver Neukum <oliver@neukum.org>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
---
v1: include header file
---
drivers/net/usb/usbnet.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index ca7fc9d..06b1dee 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -45,6 +45,7 @@
#include <linux/usb/usbnet.h>
#include <linux/slab.h>
#include <linux/kernel.h>
+#include <linux/pm_runtime.h>
#define DRIVER_VERSION "22-Aug-2005"
@@ -1273,6 +1274,16 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
struct usb_device *xdev;
int status;
const char *name;
+ struct usb_driver *driver = to_usb_driver(udev->dev.driver);
+
+ /*usbnet already took usb runtime pm, so have to enable the feature
+ * for usb interface, otherwise usb_autopm_get_interface may return
+ * failure if USB_SUSPEND(RUNTIME_PM) is enabled.
+ * */
+ if (!driver->supports_autosuspend) {
+ driver->supports_autosuspend = 1;
+ pm_runtime_enable(&udev->dev);
+ }
name = udev->dev.driver->name;
info = (struct driver_info *) prod->driver_info;
--
1.7.3
^ permalink raw reply related
* Re: [PATCH] kzalloc with swapped params in l2tp_dfs_seq_open
From: David Miller @ 2010-11-01 13:56 UTC (permalink / raw)
To: linux; +Cc: linux-kernel, jchapman, netdev
In-Reply-To: <20101031172603.GB16459@gallifrey>
From: "Dr. David Alan Gilbert" <linux@treblig.org>
Date: Sun, 31 Oct 2010 17:26:03 +0000
> Hi,
> 'sparse' spotted that the parameters to kzalloc in l2tp_dfs_seq_open
> were swapped.
>
> Tested on current git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
> at 1792f17b7210280a3d7ff29da9614ba779cfcedb build, boots and I can see that directory,
> but there again I could see /sys/kernel/debug/l2tp with it swapped; I don't have
> any l2tp in use.
>
> Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Applied, thank you.
^ permalink raw reply
* Re: [PATCH] usbnet: runtime pm: fix usb_autopm_get_interface failure
From: David Miller @ 2010-11-01 13:42 UTC (permalink / raw)
To: tom.leiming
Cc: netdev, oliver, dbrownell, gregkh, ben, joe, andy.shevchenko,
stable
In-Reply-To: <20101101.064052.226792945.davem@davemloft.net>
From: David Miller <davem@davemloft.net>
Date: Mon, 01 Nov 2010 06:40:52 -0700 (PDT)
> Applied, thanks.
Actually, I had to revert, this doesn't compile when CONFIG_PM is
disabled:
drivers/net/usb/usbnet.c: In function 'usbnet_probe':
drivers/net/usb/usbnet.c:1284:3: error: implicit declaration of function 'pm_runtime_enable'
^ permalink raw reply
* Re: [PATCH] usbnet: runtime pm: fix usb_autopm_get_interface failure
From: David Miller @ 2010-11-01 13:40 UTC (permalink / raw)
To: tom.leiming
Cc: netdev, oliver, dbrownell, gregkh, ben, joe, andy.shevchenko,
stable
In-Reply-To: <1288190703-3154-1-git-send-email-tom.leiming@gmail.com>
From: tom.leiming@gmail.com
Date: Wed, 27 Oct 2010 22:45:03 +0800
> From: Ming Lei <tom.leiming@gmail.com>
>
> Since usbnet already took usb runtime pm, we have to
> enable runtime pm for usb interface of usbnet, otherwise
> usb_autopm_get_interface may return failure and cause
> 'ifconfig usb0 up' failed if USB_SUSPEND(RUNTIME_PM) is
> enabled.
>
> Cc: David Brownell <dbrownell@users.sourceforge.net>
> Cc: Greg Kroah-Hartman <gregkh@suse.de>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Ben Hutchings <ben@decadent.org.uk>
> Cc: Joe Perches <joe@perches.com>
> Cc: Oliver Neukum <oliver@neukum.org>
> Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
> Cc: stable@kernel.org
> Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH net-2.6 0/8] bnx2x: Minor link related fixes
From: David Miller @ 2010-11-01 13:21 UTC (permalink / raw)
To: yaniv.rosner; +Cc: netdev, eilong
In-Reply-To: <1288625541.3533.12.camel@lb-tlvb-yanivr.il.broadcom.com>
From: "Yaniv Rosner" <yaniv.rosner@broadcom.com>
Date: Mon, 1 Nov 2010 17:32:21 +0200
> The following patch series is dealing with some small adaptations of the
> bnx2x link code which were discovered on latest HW variations or fixing some
> minor issues with existing HW.
>
> Please consider applying it to net-2.6
All applied, thanks Yaniv.
^ permalink raw reply
* Re: bridging: flow control regression
From: Eric Dumazet @ 2010-11-01 12:59 UTC (permalink / raw)
To: Simon Horman; +Cc: netdev, Jay Vosburgh, David S. Miller
In-Reply-To: <20101101122920.GB10052@verge.net.au>
Le lundi 01 novembre 2010 à 21:29 +0900, Simon Horman a écrit :
> Hi,
>
> I have observed what appears to be a regression between 2.6.34 and
> 2.6.35-rc1. The behaviour described below is still present in Linus's
> current tree (2.6.36+).
>
> On 2.6.34 and earlier when sending a UDP stream to a bonded interface
> the throughput is approximately equal to the available physical bandwidth.
>
> # netperf -c -4 -t UDP_STREAM -H 172.17.50.253 -l 30 -- -m 1472
> UDP UNIDIRECTIONAL SEND TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to
> 172.17.50.253 (172.17.50.253) port 0 AF_INET
> Socket Message Elapsed Messages CPU Service
> Size Size Time Okay Errors Throughput Util Demand
> bytes bytes secs # # 10^6bits/sec % SU us/KB
>
> 114688 1472 30.00 2438265 0 957.1 18.09 3.159
> 109568 30.00 2389980 938.1 -1.00 -1.000
>
> On 2.6.35-rc1 netpref sends~7Gbits/s.
> Curiously it only consumes 50% CPU, I would expect this to be CPU bound.
>
> # netperf -c -4 -t UDP_STREAM -H 172.17.50.253 -l 30 -- -m 1472
> UDP UNIDIRECTIONAL SEND TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to
> 172.17.50.253 (172.17.50.253) port 0 AF_INET
> Socket Message Elapsed Messages CPU Service
> Size Size Time Okay Errors Throughput Util Demand
> bytes bytes secs # # 10^6bits/sec % SU us/KB
>
> 116736 1472 30.00 18064360 0 7090.8 50.62 8.665
> 109568 30.00 2438090 957.0 -1.00 -1.000
>
> In this case the bonding device has a single gitabit slave device
> and is running in balance-rr mode. I have observed similar results
> with two and three slave devices.
>
> I have bisected the problem and the offending commit appears to be
> "net: Introduce skb_orphan_try()". My tired eyes tell me that change
> frees skb's earlier than they otherwise would be unless tx timestamping
> is in effect. That does seem to make sense in relation to this problem,
> though I am yet to dig into specifically why bonding is adversely affected.
>
I assume you meant "bonding: flow control regression", ie this is not
related to bridging ?
One problem on bonding is that the xmit() method always returns
NETDEV_TX_OK.
So a flooder cannot know some of its frames were lost.
So yes, the patch you mention has the effect of allowing UDP to flood
bonding device, since we orphan skb before giving it to device (bond or
ethX)
With a normal device (with a qdisc), we queue skb, and orphan it only
when leaving queue. With a not too big socket send buffer, it slows down
the sender enough to "send UDP frames at line rate only"
^ permalink raw reply
* bridging: flow control regression
From: Simon Horman @ 2010-11-01 12:29 UTC (permalink / raw)
To: netdev; +Cc: Jay Vosburgh, Eric Dumazet, David S. Miller
Hi,
I have observed what appears to be a regression between 2.6.34 and
2.6.35-rc1. The behaviour described below is still present in Linus's
current tree (2.6.36+).
On 2.6.34 and earlier when sending a UDP stream to a bonded interface
the throughput is approximately equal to the available physical bandwidth.
# netperf -c -4 -t UDP_STREAM -H 172.17.50.253 -l 30 -- -m 1472
UDP UNIDIRECTIONAL SEND TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to
172.17.50.253 (172.17.50.253) port 0 AF_INET
Socket Message Elapsed Messages CPU Service
Size Size Time Okay Errors Throughput Util Demand
bytes bytes secs # # 10^6bits/sec % SU us/KB
114688 1472 30.00 2438265 0 957.1 18.09 3.159
109568 30.00 2389980 938.1 -1.00 -1.000
On 2.6.35-rc1 netpref sends~7Gbits/s.
Curiously it only consumes 50% CPU, I would expect this to be CPU bound.
# netperf -c -4 -t UDP_STREAM -H 172.17.50.253 -l 30 -- -m 1472
UDP UNIDIRECTIONAL SEND TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to
172.17.50.253 (172.17.50.253) port 0 AF_INET
Socket Message Elapsed Messages CPU Service
Size Size Time Okay Errors Throughput Util Demand
bytes bytes secs # # 10^6bits/sec % SU us/KB
116736 1472 30.00 18064360 0 7090.8 50.62 8.665
109568 30.00 2438090 957.0 -1.00 -1.000
In this case the bonding device has a single gitabit slave device
and is running in balance-rr mode. I have observed similar results
with two and three slave devices.
I have bisected the problem and the offending commit appears to be
"net: Introduce skb_orphan_try()". My tired eyes tell me that change
frees skb's earlier than they otherwise would be unless tx timestamping
is in effect. That does seem to make sense in relation to this problem,
though I am yet to dig into specifically why bonding is adversely affected.
^ permalink raw reply
* [PATCH net-2.6 6/8] bnx2x: Do not enable CL37 BAM unless it is explicitly enabled
From: Yaniv Rosner @ 2010-11-01 15:32 UTC (permalink / raw)
To: davem; +Cc: netdev, eilong
Enabling CL37 BAM on BCM8073 by default may lead to link issues since not all switches support it. So enable CL37 BAM only if explicitly selected.
Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
drivers/net/bnx2x/bnx2x_hsi.h | 9 ++++++++-
drivers/net/bnx2x/bnx2x_link.c | 18 ++++++++++++------
2 files changed, 20 insertions(+), 7 deletions(-)
diff --git a/drivers/net/bnx2x/bnx2x_hsi.h b/drivers/net/bnx2x/bnx2x_hsi.h
index 18c8e23..4cfd4e9 100644
--- a/drivers/net/bnx2x/bnx2x_hsi.h
+++ b/drivers/net/bnx2x/bnx2x_hsi.h
@@ -244,7 +244,14 @@ struct port_hw_cfg { /* port 0: 0x12c port 1: 0x2bc */
u16 xgxs_config_tx[4]; /* 0x1A0 */
- u32 Reserved1[57]; /* 0x1A8 */
+ u32 Reserved1[56]; /* 0x1A8 */
+ u32 default_cfg; /* 0x288 */
+ /* Enable BAM on KR */
+#define PORT_HW_CFG_ENABLE_BAM_ON_KR_MASK 0x00100000
+#define PORT_HW_CFG_ENABLE_BAM_ON_KR_SHIFT 20
+#define PORT_HW_CFG_ENABLE_BAM_ON_KR_DISABLED 0x00000000
+#define PORT_HW_CFG_ENABLE_BAM_ON_KR_ENABLED 0x00100000
+
u32 speed_capability_mask2; /* 0x28C */
#define PORT_HW_CFG_SPEED_CAPABILITY2_D3_MASK 0x0000FFFF
#define PORT_HW_CFG_SPEED_CAPABILITY2_D3_SHIFT 0
diff --git a/drivers/net/bnx2x/bnx2x_link.c b/drivers/net/bnx2x/bnx2x_link.c
index 488e251..d076b91 100644
--- a/drivers/net/bnx2x/bnx2x_link.c
+++ b/drivers/net/bnx2x/bnx2x_link.c
@@ -3525,13 +3525,19 @@ static u8 bnx2x_8073_config_init(struct bnx2x_phy *phy,
DP(NETIF_MSG_LINK, "Before rom RX_ALARM(port1): 0x%x\n", tmp1);
/* Enable CL37 BAM */
- bnx2x_cl45_read(bp, phy,
- MDIO_AN_DEVAD,
- MDIO_AN_REG_8073_BAM, &val);
- bnx2x_cl45_write(bp, phy,
- MDIO_AN_DEVAD,
- MDIO_AN_REG_8073_BAM, val | 1);
+ if (REG_RD(bp, params->shmem_base +
+ offsetof(struct shmem_region, dev_info.
+ port_hw_config[params->port].default_cfg)) &
+ PORT_HW_CFG_ENABLE_BAM_ON_KR_ENABLED) {
+ bnx2x_cl45_read(bp, phy,
+ MDIO_AN_DEVAD,
+ MDIO_AN_REG_8073_BAM, &val);
+ bnx2x_cl45_write(bp, phy,
+ MDIO_AN_DEVAD,
+ MDIO_AN_REG_8073_BAM, val | 1);
+ DP(NETIF_MSG_LINK, "Enable CL37 BAM on KR\n");
+ }
if (params->loopback_mode == LOOPBACK_EXT) {
bnx2x_807x_force_10G(bp, phy);
DP(NETIF_MSG_LINK, "Forced speed 10G on 807X\n");
--
1.7.1
^ permalink raw reply related
* [PATCH net-2.6 7/8] bnx2x: Reset 8073 phy during common init
From: Yaniv Rosner @ 2010-11-01 15:32 UTC (permalink / raw)
To: davem; +Cc: netdev, eilong
Resetting 8073 during common init is required on boards in which the 8073 reset pin is not asserted by default.
Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
drivers/net/bnx2x/bnx2x_link.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/net/bnx2x/bnx2x_link.c b/drivers/net/bnx2x/bnx2x_link.c
index d076b91..5809196 100644
--- a/drivers/net/bnx2x/bnx2x_link.c
+++ b/drivers/net/bnx2x/bnx2x_link.c
@@ -7024,6 +7024,7 @@ static u8 bnx2x_8073_common_init_phy(struct bnx2x *bp,
s8 port;
s8 port_of_path = 0;
+ bnx2x_ext_phy_hw_reset(bp, 0);
/* PART1 - Reset both phys */
for (port = PORT_MAX - 1; port >= PORT_0; port--) {
u32 shmem_base, shmem2_base;
--
1.7.1
^ 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