Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 23227
b: refs/heads/master
c: a3ea9b5
h: refs/heads/master
i:
  23225: c955a55
  23223: d456fce
v: v3
  • Loading branch information
Linus Torvalds committed Mar 23, 2006
1 parent 4681b35 commit 6d98bfa
Show file tree
Hide file tree
Showing 80 changed files with 5,274 additions and 3,230 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b2e6e3ba7deb525f180df64f32f3fcb214538bea
refs/heads/master: a3ea9b584ed2acdeae817f0dc91a5880e0828a05
20 changes: 19 additions & 1 deletion trunk/Documentation/networking/pktgen.txt
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,22 @@ Examples:
cycle through the port range.
pgset "udp_dst_max 9" set UDP destination port max.

pgset "mpls 0001000a,0002000a,0000000a" set MPLS labels (in this example
outer label=16,middle label=32,
inner label=0 (IPv4 NULL)) Note that
there must be no spaces between the
arguments. Leading zeros are required.
Do not set the bottom of stack bit,
thats done automatically. If you do
set the bottom of stack bit, that
indicates that you want to randomly
generate that address and the flag
MPLS_RND will be turned on. You
can have any mix of random and fixed
labels in the label stack.

pgset "mpls 0" turn off mpls (or any invalid argument works too!)

pgset stop aborts injection. Also, ^C aborts generator.


Expand Down Expand Up @@ -167,6 +183,8 @@ pkt_size
min_pkt_size
max_pkt_size

mpls

udp_src_min
udp_src_max

Expand Down Expand Up @@ -211,4 +229,4 @@ Grant Grundler for testing on IA-64 and parisc, Harald Welte, Lennert Buytenhek
Stephen Hemminger, Andi Kleen, Dave Miller and many others.


Good luck with the linux net-development.
Good luck with the linux net-development.
108 changes: 75 additions & 33 deletions trunk/drivers/net/bnx2.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,54 @@
* Written by: Michael Chan (mchan@broadcom.com)
*/

#include <linux/config.h>

#include <linux/module.h>
#include <linux/moduleparam.h>

#include <linux/kernel.h>
#include <linux/timer.h>
#include <linux/errno.h>
#include <linux/ioport.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/interrupt.h>
#include <linux/pci.h>
#include <linux/init.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/dma-mapping.h>
#include <asm/bitops.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <linux/delay.h>
#include <asm/byteorder.h>
#include <linux/time.h>
#include <linux/ethtool.h>
#include <linux/mii.h>
#ifdef NETIF_F_HW_VLAN_TX
#include <linux/if_vlan.h>
#define BCM_VLAN 1
#endif
#ifdef NETIF_F_TSO
#include <net/ip.h>
#include <net/tcp.h>
#include <net/checksum.h>
#define BCM_TSO 1
#endif
#include <linux/workqueue.h>
#include <linux/crc32.h>
#include <linux/prefetch.h>
#include <linux/cache.h>

#include "bnx2.h"
#include "bnx2_fw.h"

#define DRV_MODULE_NAME "bnx2"
#define PFX DRV_MODULE_NAME ": "
#define DRV_MODULE_VERSION "1.4.38"
#define DRV_MODULE_RELDATE "February 10, 2006"
#define DRV_MODULE_VERSION "1.4.39"
#define DRV_MODULE_RELDATE "March 22, 2006"

#define RUN_AT(x) (jiffies + (x))

Expand Down Expand Up @@ -313,17 +354,14 @@ bnx2_disable_int(struct bnx2 *bp)
static void
bnx2_enable_int(struct bnx2 *bp)
{
u32 val;

REG_WR(bp, BNX2_PCICFG_INT_ACK_CMD,
BNX2_PCICFG_INT_ACK_CMD_INDEX_VALID |
BNX2_PCICFG_INT_ACK_CMD_MASK_INT | bp->last_status_idx);

REG_WR(bp, BNX2_PCICFG_INT_ACK_CMD,
BNX2_PCICFG_INT_ACK_CMD_INDEX_VALID | bp->last_status_idx);

val = REG_RD(bp, BNX2_HC_COMMAND);
REG_WR(bp, BNX2_HC_COMMAND, val | BNX2_HC_COMMAND_COAL_NOW);
REG_WR(bp, BNX2_HC_COMMAND, bp->hc_cmd | BNX2_HC_COMMAND_COAL_NOW);
}

static void
Expand Down Expand Up @@ -362,15 +400,11 @@ bnx2_free_mem(struct bnx2 *bp)
{
int i;

if (bp->stats_blk) {
pci_free_consistent(bp->pdev, sizeof(struct statistics_block),
bp->stats_blk, bp->stats_blk_mapping);
bp->stats_blk = NULL;
}
if (bp->status_blk) {
pci_free_consistent(bp->pdev, sizeof(struct status_block),
pci_free_consistent(bp->pdev, bp->status_stats_size,
bp->status_blk, bp->status_blk_mapping);
bp->status_blk = NULL;
bp->stats_blk = NULL;
}
if (bp->tx_desc_ring) {
pci_free_consistent(bp->pdev,
Expand All @@ -395,14 +429,13 @@ bnx2_free_mem(struct bnx2 *bp)
static int
bnx2_alloc_mem(struct bnx2 *bp)
{
int i;
int i, status_blk_size;

bp->tx_buf_ring = kmalloc(sizeof(struct sw_bd) * TX_DESC_CNT,
GFP_KERNEL);
bp->tx_buf_ring = kzalloc(sizeof(struct sw_bd) * TX_DESC_CNT,
GFP_KERNEL);
if (bp->tx_buf_ring == NULL)
return -ENOMEM;

memset(bp->tx_buf_ring, 0, sizeof(struct sw_bd) * TX_DESC_CNT);
bp->tx_desc_ring = pci_alloc_consistent(bp->pdev,
sizeof(struct tx_bd) *
TX_DESC_CNT,
Expand All @@ -428,21 +461,22 @@ bnx2_alloc_mem(struct bnx2 *bp)

}

bp->status_blk = pci_alloc_consistent(bp->pdev,
sizeof(struct status_block),
/* Combine status and statistics blocks into one allocation. */
status_blk_size = L1_CACHE_ALIGN(sizeof(struct status_block));
bp->status_stats_size = status_blk_size +
sizeof(struct statistics_block);

bp->status_blk = pci_alloc_consistent(bp->pdev, bp->status_stats_size,
&bp->status_blk_mapping);
if (bp->status_blk == NULL)
goto alloc_mem_err;

memset(bp->status_blk, 0, sizeof(struct status_block));
memset(bp->status_blk, 0, bp->status_stats_size);

bp->stats_blk = pci_alloc_consistent(bp->pdev,
sizeof(struct statistics_block),
&bp->stats_blk_mapping);
if (bp->stats_blk == NULL)
goto alloc_mem_err;
bp->stats_blk = (void *) ((unsigned long) bp->status_blk +
status_blk_size);

memset(bp->stats_blk, 0, sizeof(struct statistics_block));
bp->stats_blk_mapping = bp->status_blk_mapping + status_blk_size;

return 0;

Expand Down Expand Up @@ -1926,6 +1960,13 @@ bnx2_poll(struct net_device *dev, int *budget)
spin_lock(&bp->phy_lock);
bnx2_phy_int(bp);
spin_unlock(&bp->phy_lock);

/* This is needed to take care of transient status
* during link changes.
*/
REG_WR(bp, BNX2_HC_COMMAND,
bp->hc_cmd | BNX2_HC_COMMAND_COAL_NOW_WO_INT);
REG_RD(bp, BNX2_HC_COMMAND);
}

if (bp->status_blk->status_tx_quick_consumer_index0 != bp->hw_tx_cons)
Expand Down Expand Up @@ -3307,6 +3348,8 @@ bnx2_init_chip(struct bnx2 *bp)

udelay(20);

bp->hc_cmd = REG_RD(bp, BNX2_HC_COMMAND);

return rc;
}

Expand Down Expand Up @@ -3746,7 +3789,6 @@ bnx2_run_loopback(struct bnx2 *bp, int loopback_mode)
struct sk_buff *skb, *rx_skb;
unsigned char *packet;
u16 rx_start_idx, rx_idx;
u32 val;
dma_addr_t map;
struct tx_bd *txbd;
struct sw_bd *rx_buf;
Expand Down Expand Up @@ -3777,8 +3819,9 @@ bnx2_run_loopback(struct bnx2 *bp, int loopback_mode)
map = pci_map_single(bp->pdev, skb->data, pkt_size,
PCI_DMA_TODEVICE);

val = REG_RD(bp, BNX2_HC_COMMAND);
REG_WR(bp, BNX2_HC_COMMAND, val | BNX2_HC_COMMAND_COAL_NOW_WO_INT);
REG_WR(bp, BNX2_HC_COMMAND,
bp->hc_cmd | BNX2_HC_COMMAND_COAL_NOW_WO_INT);

REG_RD(bp, BNX2_HC_COMMAND);

udelay(5);
Expand All @@ -3802,8 +3845,9 @@ bnx2_run_loopback(struct bnx2 *bp, int loopback_mode)

udelay(100);

val = REG_RD(bp, BNX2_HC_COMMAND);
REG_WR(bp, BNX2_HC_COMMAND, val | BNX2_HC_COMMAND_COAL_NOW_WO_INT);
REG_WR(bp, BNX2_HC_COMMAND,
bp->hc_cmd | BNX2_HC_COMMAND_COAL_NOW_WO_INT);

REG_RD(bp, BNX2_HC_COMMAND);

udelay(5);
Expand Down Expand Up @@ -3939,7 +3983,6 @@ static int
bnx2_test_intr(struct bnx2 *bp)
{
int i;
u32 val;
u16 status_idx;

if (!netif_running(bp->dev))
Expand All @@ -3948,8 +3991,7 @@ bnx2_test_intr(struct bnx2 *bp)
status_idx = REG_RD(bp, BNX2_PCICFG_INT_ACK_CMD) & 0xffff;

/* This register is not touched during run-time. */
val = REG_RD(bp, BNX2_HC_COMMAND);
REG_WR(bp, BNX2_HC_COMMAND, val | BNX2_HC_COMMAND_COAL_NOW);
REG_WR(bp, BNX2_HC_COMMAND, bp->hc_cmd | BNX2_HC_COMMAND_COAL_NOW);
REG_RD(bp, BNX2_HC_COMMAND);

for (i = 0; i < 10; i++) {
Expand Down
62 changes: 14 additions & 48 deletions trunk/drivers/net/bnx2.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,46 +13,6 @@
#ifndef BNX2_H
#define BNX2_H

#include <linux/config.h>

#include <linux/module.h>
#include <linux/moduleparam.h>

#include <linux/kernel.h>
#include <linux/timer.h>
#include <linux/errno.h>
#include <linux/ioport.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/interrupt.h>
#include <linux/pci.h>
#include <linux/init.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/dma-mapping.h>
#include <asm/bitops.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <linux/delay.h>
#include <asm/byteorder.h>
#include <linux/time.h>
#include <linux/ethtool.h>
#include <linux/mii.h>
#ifdef NETIF_F_HW_VLAN_TX
#include <linux/if_vlan.h>
#define BCM_VLAN 1
#endif
#ifdef NETIF_F_TSO
#include <net/ip.h>
#include <net/tcp.h>
#include <net/checksum.h>
#define BCM_TSO 1
#endif
#include <linux/workqueue.h>
#include <linux/crc32.h>
#include <linux/prefetch.h>

/* Hardware data structures and register definitions automatically
* generated from RTL code. Do not modify.
*/
Expand Down Expand Up @@ -3917,15 +3877,17 @@ struct bnx2 {
#define USING_MSI_FLAG 0x20
#define ASF_ENABLE_FLAG 0x40

struct tx_bd *tx_desc_ring;
struct sw_bd *tx_buf_ring;
u32 tx_prod_bseq;
u16 tx_prod;
u16 tx_cons;
int tx_ring_size;
/* Put tx producer and consumer fields in separate cache lines. */

u16 hw_tx_cons;
u16 hw_rx_cons;
u32 tx_prod_bseq __attribute__((aligned(L1_CACHE_BYTES)));
u16 tx_prod;

struct tx_bd *tx_desc_ring;
struct sw_bd *tx_buf_ring;
int tx_ring_size;

u16 tx_cons __attribute__((aligned(L1_CACHE_BYTES)));
u16 hw_tx_cons;

#ifdef BCM_VLAN
struct vlan_group *vlgrp;
Expand All @@ -3939,6 +3901,7 @@ struct bnx2 {
u32 rx_prod_bseq;
u16 rx_prod;
u16 rx_cons;
u16 hw_rx_cons;

u32 rx_csum;

Expand Down Expand Up @@ -4038,6 +4001,7 @@ struct bnx2 {
struct statistics_block *stats_blk;
dma_addr_t stats_blk_mapping;

u32 hc_cmd;
u32 rx_mode;

u16 req_line_speed;
Expand Down Expand Up @@ -4082,6 +4046,8 @@ struct bnx2 {

struct flash_spec *flash_info;
u32 flash_size;

int status_stats_size;
};

static u32 bnx2_reg_rd_ind(struct bnx2 *bp, u32 offset);
Expand Down
Loading

0 comments on commit 6d98bfa

Please sign in to comment.