Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Browse files Browse the repository at this point in the history
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (23 commits)
  bridge: Fix LRO crash with tun
  IPv6: fix to set device name when new IPv6 over IPv6 tunnel device is created.
  gianfar: Fix boot hangs while bringing up gianfar ethernet
  netfilter: xt_sctp: sctp chunk mapping doesn't work
  netfilter: ctnetlink: fix echo if not subscribed to any multicast group
  netfilter: ctnetlink: allow changing NAT sequence adjustment in creation
  netfilter: nf_conntrack_ipv6: don't track ICMPv6 negotiation message
  netfilter: fix tuple inversion for Node information request
  netxen: fix msi-x interrupt handling
  de2104x: force correct order when writing to rx ring
  tun: Fix unicast filter overflow
  drivers/isdn: introduce missing kfree
  drivers/atm: introduce missing kfree
  sunhme: Don't match PCI devices in SBUS probe.
  9p: fix endian issues [attempt 3]
  net_dma: call dmaengine_get only if NET_DMA enabled
  3c509: Fix resume from hibernation for PnP mode.
  sungem: Soft lockup in sungem on Netra AC200 when switching interface up
  RxRPC: Fix a potential NULL dereference
  r8169: Don't update statistics counters when interface is down
  ...
  • Loading branch information
Linus Torvalds committed Feb 10, 2009
2 parents 5a6fe12 + 4906f99 commit 29ef011
Show file tree
Hide file tree
Showing 23 changed files with 195 additions and 78 deletions.
1 change: 1 addition & 0 deletions drivers/atm/solos-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,7 @@ static int fpga_probe(struct pci_dev *dev, const struct pci_device_id *id)
out_release_regions:
pci_release_regions(dev);
out:
kfree(card);
return err;
}

Expand Down
2 changes: 2 additions & 0 deletions drivers/isdn/hardware/mISDN/hfcmulti.c
Original file line number Diff line number Diff line change
Expand Up @@ -4599,6 +4599,7 @@ init_e1_port(struct hfc_multi *hc, struct hm_map *m)
printk(KERN_ERR "%s: no memory for coeffs\n",
__func__);
ret = -ENOMEM;
kfree(bch);
goto free_chan;
}
bch->nr = ch;
Expand Down Expand Up @@ -4767,6 +4768,7 @@ init_multi_port(struct hfc_multi *hc, int pt)
printk(KERN_ERR "%s: no memory for coeffs\n",
__func__);
ret = -ENOMEM;
kfree(bch);
goto free_chan;
}
bch->nr = ch + 1;
Expand Down
1 change: 1 addition & 0 deletions drivers/net/3c509.c
Original file line number Diff line number Diff line change
Expand Up @@ -1475,6 +1475,7 @@ el3_resume(struct device *pdev)
spin_lock_irqsave(&lp->lock, flags);

outw(PowerUp, ioaddr + EL3_CMD);
EL3WINDOW(0);
el3_up(dev);

if (netif_running(dev))
Expand Down
6 changes: 6 additions & 0 deletions drivers/net/gianfar.c
Original file line number Diff line number Diff line change
Expand Up @@ -1629,6 +1629,12 @@ static void gfar_schedule_cleanup(struct net_device *dev)
if (netif_rx_schedule_prep(&priv->napi)) {
gfar_write(&priv->regs->imask, IMASK_RTX_DISABLED);
__netif_rx_schedule(&priv->napi);
} else {
/*
* Clear IEVENT, so interrupts aren't called again
* because of the packets that have already arrived.
*/
gfar_write(&priv->regs->ievent, IEVENT_RTX_MASK);
}

spin_unlock(&priv->rxlock);
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/netxen/netxen_nic.h
Original file line number Diff line number Diff line change
Expand Up @@ -1203,7 +1203,7 @@ typedef struct {
#define NETXEN_IS_MSI_FAMILY(adapter) \
((adapter)->flags & (NETXEN_NIC_MSI_ENABLED | NETXEN_NIC_MSIX_ENABLED))

#define MSIX_ENTRIES_PER_ADAPTER 8
#define MSIX_ENTRIES_PER_ADAPTER 1
#define NETXEN_MSIX_TBL_SPACE 8192
#define NETXEN_PCI_REG_MSIX_TBL 0x44

Expand Down
13 changes: 12 additions & 1 deletion drivers/net/netxen/netxen_nic_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ static void netxen_nic_poll_controller(struct net_device *netdev);
#endif
static irqreturn_t netxen_intr(int irq, void *data);
static irqreturn_t netxen_msi_intr(int irq, void *data);
static irqreturn_t netxen_msix_intr(int irq, void *data);

/* PCI Device ID Table */
#define ENTRY(device) \
Expand Down Expand Up @@ -1084,7 +1085,9 @@ static int netxen_nic_open(struct net_device *netdev)
for (ring = 0; ring < adapter->max_rds_rings; ring++)
netxen_post_rx_buffers(adapter, ctx, ring);
}
if (NETXEN_IS_MSI_FAMILY(adapter))
if (adapter->flags & NETXEN_NIC_MSIX_ENABLED)
handler = netxen_msix_intr;
else if (adapter->flags & NETXEN_NIC_MSI_ENABLED)
handler = netxen_msi_intr;
else {
flags |= IRQF_SHARED;
Expand Down Expand Up @@ -1612,6 +1615,14 @@ static irqreturn_t netxen_msi_intr(int irq, void *data)
return IRQ_HANDLED;
}

static irqreturn_t netxen_msix_intr(int irq, void *data)
{
struct netxen_adapter *adapter = data;

napi_schedule(&adapter->napi);
return IRQ_HANDLED;
}

static int netxen_nic_poll(struct napi_struct *napi, int budget)
{
struct netxen_adapter *adapter = container_of(napi, struct netxen_adapter, napi);
Expand Down
93 changes: 58 additions & 35 deletions drivers/net/r8169.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,22 @@ enum features {
RTL_FEATURE_GMII = (1 << 2),
};

struct rtl8169_counters {
__le64 tx_packets;
__le64 rx_packets;
__le64 tx_errors;
__le32 rx_errors;
__le16 rx_missed;
__le16 align_errors;
__le32 tx_one_collision;
__le32 tx_multi_collision;
__le64 rx_unicast;
__le64 rx_broadcast;
__le32 rx_multicast;
__le16 tx_aborted;
__le16 tx_underun;
};

struct rtl8169_private {
void __iomem *mmio_addr; /* memory map physical address */
struct pci_dev *pci_dev; /* Index of PCI device */
Expand Down Expand Up @@ -480,6 +496,7 @@ struct rtl8169_private {
unsigned features;

struct mii_if_info mii;
struct rtl8169_counters counters;
};

MODULE_AUTHOR("Realtek and the Linux r8169 crew <netdev@vger.kernel.org>");
Expand Down Expand Up @@ -1100,22 +1117,6 @@ static const char rtl8169_gstrings[][ETH_GSTRING_LEN] = {
"tx_underrun",
};

struct rtl8169_counters {
__le64 tx_packets;
__le64 rx_packets;
__le64 tx_errors;
__le32 rx_errors;
__le16 rx_missed;
__le16 align_errors;
__le32 tx_one_collision;
__le32 tx_multi_collision;
__le64 rx_unicast;
__le64 rx_broadcast;
__le32 rx_multicast;
__le16 tx_aborted;
__le16 tx_underun;
};

static int rtl8169_get_sset_count(struct net_device *dev, int sset)
{
switch (sset) {
Expand All @@ -1126,16 +1127,21 @@ static int rtl8169_get_sset_count(struct net_device *dev, int sset)
}
}

static void rtl8169_get_ethtool_stats(struct net_device *dev,
struct ethtool_stats *stats, u64 *data)
static void rtl8169_update_counters(struct net_device *dev)
{
struct rtl8169_private *tp = netdev_priv(dev);
void __iomem *ioaddr = tp->mmio_addr;
struct rtl8169_counters *counters;
dma_addr_t paddr;
u32 cmd;
int wait = 1000;

ASSERT_RTNL();
/*
* Some chips are unable to dump tally counters when the receiver
* is disabled.
*/
if ((RTL_R8(ChipCmd) & CmdRxEnb) == 0)
return;

counters = pci_alloc_consistent(tp->pci_dev, sizeof(*counters), &paddr);
if (!counters)
Expand All @@ -1146,31 +1152,45 @@ static void rtl8169_get_ethtool_stats(struct net_device *dev,
RTL_W32(CounterAddrLow, cmd);
RTL_W32(CounterAddrLow, cmd | CounterDump);

while (RTL_R32(CounterAddrLow) & CounterDump) {
if (msleep_interruptible(1))
while (wait--) {
if ((RTL_R32(CounterAddrLow) & CounterDump) == 0) {
/* copy updated counters */
memcpy(&tp->counters, counters, sizeof(*counters));
break;
}
udelay(10);
}

RTL_W32(CounterAddrLow, 0);
RTL_W32(CounterAddrHigh, 0);

data[0] = le64_to_cpu(counters->tx_packets);
data[1] = le64_to_cpu(counters->rx_packets);
data[2] = le64_to_cpu(counters->tx_errors);
data[3] = le32_to_cpu(counters->rx_errors);
data[4] = le16_to_cpu(counters->rx_missed);
data[5] = le16_to_cpu(counters->align_errors);
data[6] = le32_to_cpu(counters->tx_one_collision);
data[7] = le32_to_cpu(counters->tx_multi_collision);
data[8] = le64_to_cpu(counters->rx_unicast);
data[9] = le64_to_cpu(counters->rx_broadcast);
data[10] = le32_to_cpu(counters->rx_multicast);
data[11] = le16_to_cpu(counters->tx_aborted);
data[12] = le16_to_cpu(counters->tx_underun);

pci_free_consistent(tp->pci_dev, sizeof(*counters), counters, paddr);
}

static void rtl8169_get_ethtool_stats(struct net_device *dev,
struct ethtool_stats *stats, u64 *data)
{
struct rtl8169_private *tp = netdev_priv(dev);

ASSERT_RTNL();

rtl8169_update_counters(dev);

data[0] = le64_to_cpu(tp->counters.tx_packets);
data[1] = le64_to_cpu(tp->counters.rx_packets);
data[2] = le64_to_cpu(tp->counters.tx_errors);
data[3] = le32_to_cpu(tp->counters.rx_errors);
data[4] = le16_to_cpu(tp->counters.rx_missed);
data[5] = le16_to_cpu(tp->counters.align_errors);
data[6] = le32_to_cpu(tp->counters.tx_one_collision);
data[7] = le32_to_cpu(tp->counters.tx_multi_collision);
data[8] = le64_to_cpu(tp->counters.rx_unicast);
data[9] = le64_to_cpu(tp->counters.rx_broadcast);
data[10] = le32_to_cpu(tp->counters.rx_multicast);
data[11] = le16_to_cpu(tp->counters.tx_aborted);
data[12] = le16_to_cpu(tp->counters.tx_underun);
}

static void rtl8169_get_strings(struct net_device *dev, u32 stringset, u8 *data)
{
switch(stringset) {
Expand Down Expand Up @@ -3682,6 +3702,9 @@ static int rtl8169_close(struct net_device *dev)
struct rtl8169_private *tp = netdev_priv(dev);
struct pci_dev *pdev = tp->pci_dev;

/* update counters before going down */
rtl8169_update_counters(dev);

rtl8169_down(dev);

free_irq(dev->irq, dev);
Expand Down
8 changes: 4 additions & 4 deletions drivers/net/sungem.c
Original file line number Diff line number Diff line change
Expand Up @@ -2221,6 +2221,8 @@ static int gem_do_start(struct net_device *dev)

gp->running = 1;

napi_enable(&gp->napi);

if (gp->lstate == link_up) {
netif_carrier_on(gp->dev);
gem_set_link_modes(gp);
Expand All @@ -2238,6 +2240,8 @@ static int gem_do_start(struct net_device *dev)
spin_lock_irqsave(&gp->lock, flags);
spin_lock(&gp->tx_lock);

napi_disable(&gp->napi);

gp->running = 0;
gem_reset(gp);
gem_clean_rings(gp);
Expand Down Expand Up @@ -2338,8 +2342,6 @@ static int gem_open(struct net_device *dev)
if (!gp->asleep)
rc = gem_do_start(dev);
gp->opened = (rc == 0);
if (gp->opened)
napi_enable(&gp->napi);

mutex_unlock(&gp->pm_mutex);

Expand Down Expand Up @@ -2476,8 +2478,6 @@ static int gem_resume(struct pci_dev *pdev)

/* Re-attach net device */
netif_device_attach(dev);

napi_enable(&gp->napi);
}

spin_lock_irqsave(&gp->lock, flags);
Expand Down
12 changes: 8 additions & 4 deletions drivers/net/sunhme.c
Original file line number Diff line number Diff line change
Expand Up @@ -2629,6 +2629,14 @@ static int __devinit happy_meal_sbus_probe_one(struct of_device *op, int is_qfe)
int i, qfe_slot = -1;
int err = -ENODEV;

sbus_dp = to_of_device(op->dev.parent)->node;
if (is_qfe)
sbus_dp = to_of_device(op->dev.parent->parent)->node;

/* We can match PCI devices too, do not accept those here. */
if (strcmp(sbus_dp->name, "sbus"))
return err;

if (is_qfe) {
qp = quattro_sbus_find(op);
if (qp == NULL)
Expand Down Expand Up @@ -2734,10 +2742,6 @@ static int __devinit happy_meal_sbus_probe_one(struct of_device *op, int is_qfe)
if (qp != NULL)
hp->happy_flags |= HFLAG_QUATTRO;

sbus_dp = to_of_device(op->dev.parent)->node;
if (is_qfe)
sbus_dp = to_of_device(op->dev.parent->parent)->node;

/* Get the supported DVMA burst sizes from our Happy SBUS. */
hp->happy_bursts = of_getintprop_default(sbus_dp,
"burst-sizes", 0x00);
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/tulip/de2104x.c
Original file line number Diff line number Diff line change
Expand Up @@ -464,13 +464,14 @@ static void de_rx (struct de_private *de)
drop = 1;

rx_next:
de->rx_ring[rx_tail].opts1 = cpu_to_le32(DescOwn);
if (rx_tail == (DE_RX_RING_SIZE - 1))
de->rx_ring[rx_tail].opts2 =
cpu_to_le32(RingEnd | de->rx_buf_sz);
else
de->rx_ring[rx_tail].opts2 = cpu_to_le32(de->rx_buf_sz);
de->rx_ring[rx_tail].addr1 = cpu_to_le32(mapping);
wmb();
de->rx_ring[rx_tail].opts1 = cpu_to_le32(DescOwn);
rx_tail = NEXT_RX(rx_tail);
}

Expand Down
10 changes: 8 additions & 2 deletions drivers/net/tun.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,16 @@ static int update_filter(struct tap_filter *filter, void __user *arg)

nexact = n;

/* The rest is hashed */
/* Remaining multicast addresses are hashed,
* unicast will leave the filter disabled. */
memset(filter->mask, 0, sizeof(filter->mask));
for (; n < uf.count; n++)
for (; n < uf.count; n++) {
if (!is_multicast_ether_addr(addr[n].u)) {
err = 0; /* no filter */
goto done;
}
addr_hash_set(filter->mask, addr[n].u);
}

/* For ALLMULTI just set the mask to all ones.
* This overrides the mask populated above. */
Expand Down
12 changes: 12 additions & 0 deletions include/linux/dmaengine.h
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,18 @@ static inline void dmaengine_put(void)
}
#endif

#ifdef CONFIG_NET_DMA
#define net_dmaengine_get() dmaengine_get()
#define net_dmaengine_put() dmaengine_put()
#else
static inline void net_dmaengine_get(void)
{
}
static inline void net_dmaengine_put(void)
{
}
#endif

dma_cookie_t dma_async_memcpy_buf_to_buf(struct dma_chan *chan,
void *dest, void *src, size_t len);
dma_cookie_t dma_async_memcpy_buf_to_pg(struct dma_chan *chan,
Expand Down
Loading

0 comments on commit 29ef011

Please sign in to comment.