Commit c8fab1b6 authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://kernel.bkbits.net/davem/net-2.6

into ppc970.osdl.org:/home/torvalds/v2.6/linux
parents 5efa19a8 559b540d
......@@ -2291,11 +2291,10 @@ static int __init do_pci_device(struct pci_dev *pci_dev)
// read resources from PCI configuration space
u8 irq = pci_dev->irq;
u32 * membase = bus_to_virt (pci_resource_start (pci_dev, 0));
u32 iobase = pci_resource_start (pci_dev, 1);
PRINTD (DBG_INFO, "found Madge ATM adapter (amb) at"
" IO %x, IRQ %u, MEM %p", iobase, irq, membase);
" IO %x, IRQ %u, MEM %p", pci_resource_start(pci_dev, 1),
irq, bus_to_virt(pci_resource_start(pci_dev, 0)));
// check IO region
err = pci_request_region(pci_dev, 1, DEV_LABEL);
......
......@@ -173,7 +173,7 @@ static void dump_mem(struct eni_dev *eni_dev)
int i;
for (i = 0; i < eni_dev->free_len; i++)
printk(KERN_DEBUG " %d: 0x%lx %d\n",i,
printk(KERN_DEBUG " %d: %p %d\n",i,
eni_dev->free_list[i].start,
1 << eni_dev->free_list[i].order);
}
......@@ -191,19 +191,19 @@ static void dump(struct atm_dev *dev)
printk(KERN_NOTICE "TX buffers\n");
for (i = 0; i < NR_CHAN; i++)
if (eni_dev->tx[i].send)
printk(KERN_NOTICE " TX %d @ 0x%lx: %ld\n",i,
printk(KERN_NOTICE " TX %d @ %p: %ld\n",i,
eni_dev->tx[i].send,eni_dev->tx[i].words*4);
printk(KERN_NOTICE "RX buffers\n");
for (i = 0; i < 1024; i++)
if (eni_dev->rx_map[i] && ENI_VCC(eni_dev->rx_map[i])->rx)
printk(KERN_NOTICE " RX %d @ 0x%lx: %ld\n",i,
printk(KERN_NOTICE " RX %d @ %p: %ld\n",i,
ENI_VCC(eni_dev->rx_map[i])->recv,
ENI_VCC(eni_dev->rx_map[i])->words*4);
printk(KERN_NOTICE "----\n");
}
static void eni_put_free(struct eni_dev *eni_dev,unsigned long start,
static void eni_put_free(struct eni_dev *eni_dev, void __iomem *start,
unsigned long size)
{
struct eni_free *list;
......@@ -215,17 +215,17 @@ static void eni_put_free(struct eni_dev *eni_dev,unsigned long start,
len = eni_dev->free_len;
while (size) {
if (len >= eni_dev->free_list_size) {
printk(KERN_CRIT "eni_put_free overflow (0x%lx,%ld)\n",
printk(KERN_CRIT "eni_put_free overflow (%p,%ld)\n",
start,size);
break;
}
for (order = 0; !((start | size) & (1 << order)); order++);
for (order = 0; !(((unsigned long)start | size) & (1 << order)); order++);
if (MID_MIN_BUF_SIZE > (1 << order)) {
printk(KERN_CRIT "eni_put_free: order %d too small\n",
order);
break;
}
list[len].start = start;
list[len].start = (void __iomem *) start;
list[len].order = order;
len++;
start += 1 << order;
......@@ -236,10 +236,10 @@ static void eni_put_free(struct eni_dev *eni_dev,unsigned long start,
}
static unsigned long eni_alloc_mem(struct eni_dev *eni_dev,unsigned long *size)
static void __iomem *eni_alloc_mem(struct eni_dev *eni_dev, unsigned long *size)
{
struct eni_free *list;
unsigned long start;
void __iomem *start;
int len,i,order,best_order,index;
list = eni_dev->free_list;
......@@ -273,7 +273,7 @@ static unsigned long eni_alloc_mem(struct eni_dev *eni_dev,unsigned long *size)
}
static void eni_free_mem(struct eni_dev *eni_dev,unsigned long start,
static void eni_free_mem(struct eni_dev *eni_dev, void __iomem *start,
unsigned long size)
{
struct eni_free *list;
......@@ -283,20 +283,20 @@ static void eni_free_mem(struct eni_dev *eni_dev,unsigned long start,
list = eni_dev->free_list;
len = eni_dev->free_len;
for (order = -1; size; order++) size >>= 1;
DPRINTK("eni_free_mem: 0x%lx+0x%lx (order %d)\n",start,size,order);
DPRINTK("eni_free_mem: %p+0x%lx (order %d)\n",start,size,order);
for (i = 0; i < len; i++)
if (list[i].start == (start^(1 << order)) &&
if (((unsigned long) list[i].start) == ((unsigned long)start^(1 << order)) &&
list[i].order == order) {
DPRINTK("match[%d]: 0x%lx/0x%lx(0x%x), %d/%d\n",i,
list[i].start,start,1 << order,list[i].order,order);
list[i] = list[--len];
start &= ~(unsigned long) (1 << order);
start = (void __iomem *) ((unsigned long) start & ~(unsigned long) (1 << order));
order++;
i = -1;
continue;
}
if (len >= eni_dev->free_list_size) {
printk(KERN_ALERT "eni_free_mem overflow (0x%lx,%d)\n",start,
printk(KERN_ALERT "eni_free_mem overflow (%p,%d)\n",start,
order);
return;
}
......@@ -333,7 +333,7 @@ static void rx_ident_err(struct atm_vcc *vcc)
printk(KERN_ALERT " host descr 0x%lx, rx pos 0x%lx, descr value "
"0x%x\n",eni_vcc->descr,eni_vcc->rx_pos,
(unsigned) readl(eni_vcc->recv+eni_vcc->descr*4));
printk(KERN_ALERT " last 0x%p, servicing %d\n",eni_vcc->last,
printk(KERN_ALERT " last %p, servicing %d\n",eni_vcc->last,
eni_vcc->servicing);
EVENT("---dump ends here---\n",0,0);
printk(KERN_NOTICE "---recent events---\n");
......@@ -617,7 +617,8 @@ static int rx_aal5(struct atm_vcc *vcc)
static inline int rx_vcc(struct atm_vcc *vcc)
{
unsigned long vci_dsc,tmp;
void __iomem *vci_dsc;
unsigned long tmp;
struct eni_vcc *eni_vcc;
eni_vcc = ENI_VCC(vcc);
......@@ -728,7 +729,7 @@ static void dequeue_rx(struct atm_dev *dev)
struct eni_vcc *eni_vcc;
struct atm_vcc *vcc;
struct sk_buff *skb;
unsigned long vci_dsc;
void __iomem *vci_dsc;
int first;
eni_dev = ENI_DEV(dev);
......@@ -808,7 +809,7 @@ static int open_rx_first(struct atm_vcc *vcc)
static int open_rx_second(struct atm_vcc *vcc)
{
unsigned long here;
void __iomem *here;
struct eni_dev *eni_dev;
struct eni_vcc *eni_vcc;
unsigned long size;
......@@ -840,7 +841,7 @@ static int open_rx_second(struct atm_vcc *vcc)
static void close_rx(struct atm_vcc *vcc)
{
DECLARE_WAITQUEUE(wait,current);
unsigned long here;
void __iomem *here;
struct eni_dev *eni_dev;
struct eni_vcc *eni_vcc;
......@@ -1289,7 +1290,8 @@ static int reserve_or_set_tx(struct atm_vcc *vcc,struct atm_trafprm *txtp,
struct eni_dev *eni_dev = ENI_DEV(vcc->dev);
struct eni_vcc *eni_vcc = ENI_VCC(vcc);
struct eni_tx *tx;
unsigned long size,mem;
unsigned long size;
void __iomem *mem;
int rate,ubr,unlimited,new_tx;
int pre,res,order;
int error;
......@@ -1687,9 +1689,9 @@ static int __devinit get_esi_asic(struct atm_dev *dev)
#undef GET_SEPROM
static int __devinit get_esi_fpga(struct atm_dev *dev,unsigned long base)
static int __devinit get_esi_fpga(struct atm_dev *dev, void __iomem *base)
{
unsigned long mac_base;
void __iomem *mac_base;
int i;
mac_base = base+EPROM_SIZE-sizeof(struct midway_eprom);
......@@ -1703,7 +1705,8 @@ static int __devinit eni_do_init(struct atm_dev *dev)
struct midway_eprom *eprom;
struct eni_dev *eni_dev;
struct pci_dev *pci_dev;
unsigned long real_base,base;
unsigned long real_base;
void __iomem *base;
unsigned char revision;
int error,i,last;
......@@ -1730,13 +1733,13 @@ static int __devinit eni_do_init(struct atm_dev *dev)
}
printk(KERN_NOTICE DEV_LABEL "(itf %d): rev.%d,base=0x%lx,irq=%d,",
dev->number,revision,real_base,eni_dev->irq);
if (!(base = (unsigned long) ioremap_nocache(real_base,MAP_MAX_SIZE))) {
if (!(base = ioremap_nocache(real_base,MAP_MAX_SIZE))) {
printk("\n");
printk(KERN_ERR DEV_LABEL "(itf %d): can't set up page "
"mapping\n",dev->number);
return error;
}
eni_dev->base_diff = real_base-base;
eni_dev->base_diff = real_base - (unsigned long) base;
/* id may not be present in ASIC Tonga boards - check this @@@ */
if (!eni_dev->asic) {
eprom = (struct midway_eprom *) (base+EPROM_SIZE-sizeof(struct
......@@ -1790,7 +1793,9 @@ static int __devinit eni_do_init(struct atm_dev *dev)
static int __devinit eni_start(struct atm_dev *dev)
{
struct eni_dev *eni_dev;
unsigned long buf,buffer_mem;
void __iomem *buf;
unsigned long buffer_mem;
int error;
DPRINTK(">eni_start\n");
......@@ -1828,7 +1833,7 @@ static int __devinit eni_start(struct atm_dev *dev)
tasklet_init(&eni_dev->task,eni_tasklet,(unsigned long) dev);
eni_dev->events = 0;
/* initialize memory management */
buffer_mem = eni_dev->mem-(buf-eni_dev->ram);
buffer_mem = eni_dev->mem - (buf - eni_dev->ram);
eni_dev->free_list_size = buffer_mem/MID_MIN_BUF_SIZE/2;
eni_dev->free_list = (struct eni_free *) kmalloc(
sizeof(struct eni_free)*(eni_dev->free_list_size+1),GFP_KERNEL);
......@@ -1955,7 +1960,7 @@ static int eni_change_qos(struct atm_vcc *vcc,struct atm_qos *qos,int flgs)
*/
tasklet_disable(&eni_dev->task);
skb_queue_walk(&eni_dev->tx_queue, skb) {
unsigned long dsc;
void __iomem *dsc;
if (ATM_SKB(skb)->vcc != vcc) continue;
dsc = tx->send+ENI_PRV_POS(skb)*4;
......@@ -2136,9 +2141,9 @@ static int eni_proc_read(struct atm_dev *dev,loff_t *pos,char *page)
if (!tx->send) continue;
if (!--left) {
return sprintf(page,"tx[%d]: 0x%06lx-0x%06lx "
return sprintf(page,"tx[%d]: 0x%ld-0x%ld "
"(%6ld bytes), rsv %d cps, shp %d cps%s\n",i,
tx->send-eni_dev->ram,
(unsigned long) (tx->send - eni_dev->ram),
tx->send-eni_dev->ram+tx->words*4-1,tx->words*4,
tx->reserved,tx->shaping,
tx == eni_dev->ubr ? " (UBR)" : "");
......@@ -2162,9 +2167,9 @@ static int eni_proc_read(struct atm_dev *dev,loff_t *pos,char *page)
if (--left) continue;
length = sprintf(page,"vcc %4d: ",vcc->vci);
if (eni_vcc->rx) {
length += sprintf(page+length,"0x%06lx-0x%06lx "
length += sprintf(page+length,"0x%ld-0x%ld "
"(%6ld bytes)",
eni_vcc->recv-eni_dev->ram,
(unsigned long) (eni_vcc->recv - eni_dev->ram),
eni_vcc->recv-eni_dev->ram+eni_vcc->words*4-1,
eni_vcc->words*4);
if (eni_vcc->tx) length += sprintf(page+length,", ");
......@@ -2183,8 +2188,8 @@ static int eni_proc_read(struct atm_dev *dev,loff_t *pos,char *page)
unsigned long offset;
if (--left) continue;
offset = eni_dev->ram+eni_dev->base_diff;
return sprintf(page,"free 0x%06lx-0x%06lx (%6d bytes)\n",
offset = (unsigned long) eni_dev->ram+eni_dev->base_diff;
return sprintf(page,"free %p-%p (%6d bytes)\n",
fe->start-offset,fe->start-offset+(1 << fe->order)-1,
1 << fe->order);
}
......
......@@ -33,12 +33,12 @@
struct eni_free {
unsigned long start; /* counting in bytes */
void __iomem *start; /* counting in bytes */
int order;
};
struct eni_tx {
unsigned long send; /* base, 0 if unused */
void __iomem *send; /* base, 0 if unused */
int prescaler; /* shaping prescaler */
int resolution; /* shaping divider */
unsigned long tx_pos; /* current TX write position */
......@@ -51,7 +51,7 @@ struct eni_tx {
struct eni_vcc {
int (*rx)(struct atm_vcc *vcc); /* RX function, NULL if none */
unsigned long recv; /* receive buffer */
void __iomem *recv; /* receive buffer */
unsigned long words; /* its size in words */
unsigned long descr; /* next descriptor (RX) */
unsigned long rx_pos; /* current RX descriptor pos */
......@@ -72,13 +72,13 @@ struct eni_dev {
u32 events; /* pending events */
/*-------------------------------- base pointers into Midway address
space */
unsigned long phy; /* PHY interface chip registers */
unsigned long reg; /* register base */
unsigned long ram; /* RAM base */
unsigned long vci; /* VCI table */
unsigned long rx_dma; /* RX DMA queue */
unsigned long tx_dma; /* TX DMA queue */
unsigned long service; /* service list */
void __iomem *phy; /* PHY interface chip registers */
void __iomem *reg; /* register base */
void __iomem *ram; /* RAM base */
void __iomem *vci; /* VCI table */
void __iomem *rx_dma; /* RX DMA queue */
void __iomem *tx_dma; /* TX DMA queue */
void __iomem *service; /* service list */
/*-------------------------------- TX part */
struct eni_tx tx[NR_CHAN]; /* TX channels */
struct eni_tx *ubr; /* UBR channel */
......
......@@ -565,7 +565,7 @@ typedef struct host_cmdq_entry {
typedef struct chunk {
void* alloc_addr; /* base address of allocated chunk */
void* align_addr; /* base address of aligned chunk */
u32 dma_addr; /* DMA address of aligned chunk */
dma_addr_t dma_addr; /* DMA address of aligned chunk */
int direction; /* direction of DMA mapping */
u32 alloc_size; /* length of allocated chunk */
u32 align_size; /* length of aligned chunk */
......
......@@ -813,7 +813,7 @@ static void lanai_shutdown_tx_vci(struct lanai_dev *lanai,
DPRINTK("read, write = %d, %d\n", read, write);
break;
}
msleep(4);
msleep(40);
}
/* 15.2.2 - clear out all tx registers */
cardvcc_write(lvcc, 0, vcc_txreadptr);
......
......@@ -401,7 +401,8 @@ static int arcnet_open(struct net_device *dev)
lp->rfc1201.sequence = 1;
/* bring up the hardware driver */
lp->hw.open(dev);
if (lp->hw.open)
lp->hw.open(dev);
if (dev->dev_addr[0] == 0)
BUGMSG(D_NORMAL, "WARNING! Station address 00 is reserved "
......
......@@ -271,7 +271,7 @@ struct sk_buff {
#ifdef CONFIG_NET_CLS_ACT
__u32 tc_verd; /* traffic control verdict */
__u32 tc_classid; /* traffic control classid */
#endif
#endif
#endif
......
......@@ -52,6 +52,9 @@
*
* Fixed unaligned access on IA-64 Grant Grundler <grundler@parisc-linux.org>
*
* New xmit() return, do_div and misc clean up by Stephen Hemminger
* <shemminger@osdl.org> 040923
*
* See Documentation/networking/pktgen.txt for how to use this.
*/
......@@ -94,7 +97,7 @@
#define VERSION "pktgen version 1.32"
static char version[] __initdata =
"pktgen.c: v1.3: Packet Generator for packet performance testing.\n";
"pktgen.c: v1.4: Packet Generator for packet performance testing.\n";
/* Used to help with determining the pkts on receive */
......@@ -584,15 +587,48 @@ static struct sk_buff *fill_packet(struct net_device *odev, struct pktgen_info*
return skb;
}
static void show_results(struct pktgen_info* info, int nr_frags)
{
__u64 total, bps, mbps, pps;
unsigned long idle;
int size = info->pkt_size + 4; /* incl 32bit ethernet CRC */
char *p = info->result;
total = (info->stopped_at.tv_sec - info->started_at.tv_sec) * 1000000ull
+ info->stopped_at.tv_usec - info->started_at.tv_usec;
BUG_ON(cpu_speed == 0);
idle = info->idle_acc;
do_div(idle, cpu_speed);
p += sprintf(p, "OK: %llu(c%llu+d%lu) usec, %llu (%dbyte,%dfrags)\n",
total, total - idle, idle,
info->sofar, size, nr_frags);
pps = info->sofar * USEC_PER_SEC;
while ((total >> 32) != 0) {
pps >>= 1;
total >>= 1;
}
do_div(pps, total);
bps = pps * 8 * size;
mbps = bps;
do_div(mbps, 1000000);
p += sprintf(p, " %llupps %lluMb/sec (%llubps) errors: %llu",
pps, mbps, bps, info->errors);
}
static void inject(struct pktgen_info* info)
{
struct net_device *odev = NULL;
struct net_device *odev;
struct sk_buff *skb = NULL;
__u64 total = 0;
__u64 idle = 0;
__u64 lcount = 0;
int nr_frags = 0;
int ret;
int last_ok = 1; /* Was last skb sent?
* Or a failed transmit of some sort? This will keep
* sequence numbers in order, for example.
......@@ -632,28 +668,30 @@ static void inject(struct pktgen_info* info)
}
}
nr_frags = skb_shinfo(skb)->nr_frags;
if (!(odev->features & NETIF_F_LLTX))
spin_lock_bh(&odev->xmit_lock);
if (!netif_queue_stopped(odev)) {
atomic_inc(&skb->users);
if (odev->hard_start_xmit(skb, odev)) {
retry:
ret = odev->hard_start_xmit(skb, odev);
if (likely(ret == NETDEV_TX_OK)) {
last_ok = 1;
info->sofar++;
info->seq_num++;
} else if (ret == NETDEV_TX_LOCKED
&& (odev->features & NETIF_F_LLTX)) {
cpu_relax();
goto retry;
} else {
atomic_dec(&skb->users);
if (net_ratelimit()) {
if (debug && net_ratelimit()) {
printk(KERN_INFO "Hard xmit error\n");
}
info->errors++;
last_ok = 0;
}
else {
last_ok = 1;
info->sofar++;
info->seq_num++;
}
}
else {
/* Re-try it next time */
......@@ -725,38 +763,7 @@ static void inject(struct pktgen_info* info)
do_gettimeofday(&(info->stopped_at));
total = (info->stopped_at.tv_sec - info->started_at.tv_sec) * 1000000 +
info->stopped_at.tv_usec - info->started_at.tv_usec;
idle = (__u32)(info->idle_acc)/(__u32)(cpu_speed);
{
char *p = info->result;
__u64 bps, pps = 0;
if (total > 1000)
pps = (__u32)(info->sofar * 1000) / ((__u32)(total) / 1000);
else if(total > 100)
pps = (__u32)(info->sofar * 10000) / ((__u32)(total) / 100);
else if(total > 10)
pps = (__u32)(info->sofar * 100000) / ((__u32)(total) / 10);
else if(total > 1)
pps = (__u32)(info->sofar * 1000000) / (__u32)total;
bps = pps * 8 * (info->pkt_size + 4); /* take 32bit ethernet CRC into account */
p += sprintf(p, "OK: %llu(c%llu+d%llu) usec, %llu (%dbyte,%dfrags) %llupps %lluMb/sec (%llubps) errors: %llu",
(unsigned long long) total,
(unsigned long long) (total - idle),
(unsigned long long) idle,
(unsigned long long) info->sofar,
skb->len + 4, /* Add 4 to account for the ethernet checksum */
nr_frags,
(unsigned long long) pps,
(unsigned long long) (bps / (u64) 1024 / (u64) 1024),
(unsigned long long) bps,
(unsigned long long) info->errors
);
}
show_results(info, skb_shinfo(skb)->nr_frags);
kfree_skb(skb);
......
......@@ -11,7 +11,6 @@ obj-y := utils.o route.o inetpeer.o protocol.o \
obj-$(CONFIG_PROC_FS) += proc.o
obj-$(CONFIG_IP_MULTIPLE_TABLES) += fib_rules.o
obj-$(CONFIG_IP_ROUTE_NAT) += ip_nat_dumb.o
obj-$(CONFIG_IP_MROUTE) += ipmr.o
obj-$(CONFIG_NET_IPIP) += ipip.o
obj-$(CONFIG_NET_IPGRE) += ip_gre.o
......
......@@ -109,7 +109,7 @@ static struct hlist_head *fz_hash_alloc(int divisor)
{
unsigned long size = divisor * sizeof(struct hlist_head);
if (divisor <= 1024) {
if (size <= PAGE_SIZE) {
return kmalloc(size, GFP_KERNEL);
} else {
return (struct hlist_head *)
......@@ -141,11 +141,12 @@ static inline void fn_rebuild_zone(struct fn_zone *fz,
static void fz_hash_free(struct hlist_head *hash, int divisor)
{
if (divisor <= 1024)
unsigned long size = divisor * sizeof(struct hlist_head);
if (size <= PAGE_SIZE)
kfree(hash);
else
free_pages((unsigned long) hash,
get_order(divisor * sizeof(struct hlist_head)));
free_pages((unsigned long)hash, get_order(size));
}
static void fn_rehash_zone(struct fn_zone *fz)
......@@ -447,7 +448,7 @@ static struct fib_alias *fib_find_alias(struct fib_node *fn, u8 tos, u32 prio)
if (prio <= fa->fa_info->fib_priority)
break;
}
return fa;
return prev_fa;
}
return NULL;
}
......@@ -537,6 +538,8 @@ fn_hash_insert(struct fib_table *tb, struct rtmsg *r, struct kern_rta *rta,
*/
fa_orig = fa;
list_for_each_entry(fa, fa_orig->fa_list.prev, fa_list) {
if (fa->fa_tos != tos)
break;
if (fa->fa_info->fib_priority != fi->fib_priority)
break;
if (fa->fa_type == type &&
......@@ -608,6 +611,7 @@ fn_hash_delete(struct fib_table *tb, struct rtmsg *r, struct kern_rta *rta,
struct fn_hash *table = (struct fn_hash*)tb->tb_data;
struct fib_node *f;
struct fib_alias *fa, *fa_to_delete;
struct list_head *fa_head;
int z = r->rtm_dst_len;
struct fn_zone *fz;
u32 key;
......@@ -633,9 +637,13 @@ fn_hash_delete(struct fib_table *tb, struct rtmsg *r, struct kern_rta *rta,
return -ESRCH;
fa_to_delete = NULL;
list_for_each_entry(fa, fa->fa_list.prev, fa_list) {
fa_head = fa->fa_list.prev;
list_for_each_entry(fa, fa_head, fa_list) {
struct fib_info *fi = fa->fa_info;
if (fa->fa_tos != tos)
break;
if ((!r->rtm_type ||
fa->fa_type == r->rtm_type) &&
(r->rtm_scope == RT_SCOPE_NOWHERE ||
......
......@@ -73,7 +73,7 @@ adjust_tcp_sequence(u32 seq,
LOCK_BH(&ip_nat_seqofs_lock);
/* SYN adjust. If it's uninitialized, of this is after last
/* SYN adjust. If it's uninitialized, or this is after last
* correction, record it: we don't handle more than one
* adjustment in the window, but do deal with common case of a
* retransmit */
......
......@@ -592,7 +592,6 @@ static struct xfrm_state *__xfrm_find_acq_byseq(u32 seq)
list_for_each_entry(x, xfrm_state_bydst+i, bydst) {
if (x->km.seq == seq) {
xfrm_state_hold(x);
spin_unlock_bh(&xfrm_state_lock);
return x;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment