Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 111553
b: refs/heads/master
c: 410e27a
h: refs/heads/master
i:
  111551: 50513f2
v: v3
  • Loading branch information
Gerrit Renker committed Sep 9, 2008
1 parent 0da3ac2 commit 222fbe7
Show file tree
Hide file tree
Showing 38 changed files with 2,897 additions and 4,055 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: f8ef6e44474037b1671bb913bc259e048a7d5548
refs/heads/master: 410e27a49bb98bc7fa3ff5fc05cc313817b9f253
54 changes: 12 additions & 42 deletions trunk/Documentation/networking/dccp.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,25 +45,6 @@ http://linux-net.osdl.org/index.php/DCCP_Testing#Experimental_DCCP_source_tree

Socket options
==============
DCCP_SOCKOPT_QPOLICY_ID sets the dequeuing policy for outgoing packets. It takes
a policy ID as argument and can only be set before the connection (i.e. changes
during an established connection are not supported). Currently, two policies are
defined: the "simple" policy (DCCPQ_POLICY_SIMPLE), which does nothing special,
and a priority-based variant (DCCPQ_POLICY_PRIO). The latter allows to pass an
u32 priority value as ancillary data to sendmsg(), where higher numbers indicate
a higher packet priority (similar to SO_PRIORITY). This ancillary data needs to
be formatted using a cmsg(3) message header filled in as follows:
cmsg->cmsg_level = SOL_DCCP;
cmsg->cmsg_type = DCCP_SCM_PRIORITY;
cmsg->cmsg_len = CMSG_LEN(sizeof(uint32_t)); /* or CMSG_LEN(4) */

DCCP_SOCKOPT_QPOLICY_TXQLEN sets the maximum length of the output queue. A zero
value is always interpreted as unbounded queue length. If different from zero,
the interpretation of this parameter depends on the current dequeuing policy
(see above): the "simple" policy will enforce a fixed queue size by returning
EAGAIN, whereas the "prio" policy enforces a fixed queue length by dropping the
lowest-priority packet first. The default value for this parameter is
initialised from /proc/sys/net/dccp/default/tx_qlen.

DCCP_SOCKOPT_SERVICE sets the service. The specification mandates use of
service codes (RFC 4340, sec. 8.1.2); if this socket option is not set,
Expand All @@ -76,24 +57,6 @@ can be set before calling bind().
DCCP_SOCKOPT_GET_CUR_MPS is read-only and retrieves the current maximum packet
size (application payload size) in bytes, see RFC 4340, section 14.

DCCP_SOCKOPT_AVAILABLE_CCIDS is also read-only and returns the list of CCIDs
supported by the endpoint (see include/linux/dccp.h for symbolic constants).
The caller needs to provide a sufficiently large (> 2) array of type uint8_t.

DCCP_SOCKOPT_CCID is write-only and sets both the TX and RX CCIDs at the same
time, combining the operation of the next two socket options. This option is
preferrable over the latter two, since often applications will use the same
type of CCID for both directions; and mixed use of CCIDs is not currently well
understood. This socket option takes as argument at least one uint8_t value, or
an array of uint8_t values, which must match available CCIDS (see above). CCIDs
must be registered on the socket before calling connect() or listen().

DCCP_SOCKOPT_TX_CCID is read/write. It returns the current CCID (if set) or sets
the preference list for the TX CCID, using the same format as DCCP_SOCKOPT_CCID.
Please note that the getsockopt argument type here is `int', not uint8_t.

DCCP_SOCKOPT_RX_CCID is analogous to DCCP_SOCKOPT_TX_CCID, but for the RX CCID.

DCCP_SOCKOPT_SERVER_TIMEWAIT enables the server (listening socket) to hold
timewait state when closing the connection (RFC 4340, 8.3). The usual case is
that the closing server sends a CloseReq, whereupon the client holds timewait
Expand Down Expand Up @@ -152,16 +115,23 @@ retries2
importance for retransmitted acknowledgments and feature negotiation,
data packets are never retransmitted. Analogue of tcp_retries2.

send_ndp = 1
Whether or not to send NDP count options (sec. 7.7.2).

send_ackvec = 1
Whether or not to send Ack Vector options (sec. 11.5).

ack_ratio = 2
The default Ack Ratio (sec. 11.3) to use.

tx_ccid = 2
Default CCID for the sender-receiver half-connection. Depending on the
choice of CCID, the Send Ack Vector feature is enabled automatically.
Default CCID for the sender-receiver half-connection.

rx_ccid = 2
Default CCID for the receiver-sender half-connection; see tx_ccid.
Default CCID for the receiver-sender half-connection.

seq_window = 100
The initial sequence window (sec. 7.5.2) of the sender. This influences
the local ackno validity and the remote seqno validity windows (7.5.1).
The initial sequence window (sec. 7.5.2).

tx_qlen = 5
The size of the transmit buffer in packets. A value of 0 corresponds
Expand Down
95 changes: 12 additions & 83 deletions trunk/drivers/net/bnx2x_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@
#include "bnx2x.h"
#include "bnx2x_init.h"

#define DRV_MODULE_VERSION "1.45.22"
#define DRV_MODULE_RELDATE "2008/09/09"
#define DRV_MODULE_VERSION "1.45.21"
#define DRV_MODULE_RELDATE "2008/09/03"
#define BNX2X_BC_VER 0x040200

/* Time in jiffies before concluding the transmitter is hung */
Expand Down Expand Up @@ -649,16 +649,15 @@ static void bnx2x_int_disable(struct bnx2x *bp)
BNX2X_ERR("BUG! proper val not read from IGU!\n");
}

static void bnx2x_int_disable_sync(struct bnx2x *bp, int disable_hw)
static void bnx2x_int_disable_sync(struct bnx2x *bp)
{
int msix = (bp->flags & USING_MSIX_FLAG) ? 1 : 0;
int i;

/* disable interrupt handling */
atomic_inc(&bp->intr_sem);
if (disable_hw)
/* prevent the HW from sending interrupts */
bnx2x_int_disable(bp);
/* prevent the HW from sending interrupts */
bnx2x_int_disable(bp);

/* make sure all ISRs are done */
if (msix) {
Expand Down Expand Up @@ -6087,9 +6086,9 @@ static void bnx2x_netif_start(struct bnx2x *bp)
}
}

static void bnx2x_netif_stop(struct bnx2x *bp, int disable_hw)
static void bnx2x_netif_stop(struct bnx2x *bp)
{
bnx2x_int_disable_sync(bp, disable_hw);
bnx2x_int_disable_sync(bp);
if (netif_running(bp->dev)) {
bnx2x_napi_disable(bp);
netif_tx_disable(bp->dev);
Expand Down Expand Up @@ -6476,7 +6475,7 @@ static int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
for_each_queue(bp, i)
bnx2x_free_rx_sge_range(bp, bp->fp + i, NUM_RX_SGE);
load_int_disable:
bnx2x_int_disable_sync(bp, 1);
bnx2x_int_disable_sync(bp);
/* Release IRQs */
bnx2x_free_irq(bp);
load_error:
Expand Down Expand Up @@ -6651,7 +6650,7 @@ static int bnx2x_nic_unload(struct bnx2x *bp, int unload_mode)
bp->rx_mode = BNX2X_RX_MODE_NONE;
bnx2x_set_storm_rx_mode(bp);

bnx2x_netif_stop(bp, 1);
bnx2x_netif_stop(bp);
if (!netif_running(bp->dev))
bnx2x_napi_disable(bp);
del_timer_sync(&bp->timer);
Expand Down Expand Up @@ -8792,7 +8791,7 @@ static int bnx2x_test_loopback(struct bnx2x *bp, u8 link_up)
if (!netif_running(bp->dev))
return BNX2X_LOOPBACK_FAILED;

bnx2x_netif_stop(bp, 1);
bnx2x_netif_stop(bp);

if (bnx2x_run_loopback(bp, BNX2X_MAC_LOOPBACK, link_up)) {
DP(NETIF_MSG_PROBE, "MAC loopback failed\n");
Expand Down Expand Up @@ -10347,74 +10346,6 @@ static int bnx2x_resume(struct pci_dev *pdev)
return rc;
}

static int bnx2x_eeh_nic_unload(struct bnx2x *bp)
{
int i;

bp->state = BNX2X_STATE_ERROR;

bp->rx_mode = BNX2X_RX_MODE_NONE;

bnx2x_netif_stop(bp, 0);

del_timer_sync(&bp->timer);
bp->stats_state = STATS_STATE_DISABLED;
DP(BNX2X_MSG_STATS, "stats_state - DISABLED\n");

/* Release IRQs */
bnx2x_free_irq(bp);

if (CHIP_IS_E1(bp)) {
struct mac_configuration_cmd *config =
bnx2x_sp(bp, mcast_config);

for (i = 0; i < config->hdr.length_6b; i++)
CAM_INVALIDATE(config->config_table[i]);
}

/* Free SKBs, SGEs, TPA pool and driver internals */
bnx2x_free_skbs(bp);
for_each_queue(bp, i)
bnx2x_free_rx_sge_range(bp, bp->fp + i, NUM_RX_SGE);
bnx2x_free_mem(bp);

bp->state = BNX2X_STATE_CLOSED;

netif_carrier_off(bp->dev);

return 0;
}

static void bnx2x_eeh_recover(struct bnx2x *bp)
{
u32 val;

mutex_init(&bp->port.phy_mutex);

bp->common.shmem_base = REG_RD(bp, MISC_REG_SHARED_MEM_ADDR);
bp->link_params.shmem_base = bp->common.shmem_base;
BNX2X_DEV_INFO("shmem offset is 0x%x\n", bp->common.shmem_base);

if (!bp->common.shmem_base ||
(bp->common.shmem_base < 0xA0000) ||
(bp->common.shmem_base >= 0xC0000)) {
BNX2X_DEV_INFO("MCP not active\n");
bp->flags |= NO_MCP_FLAG;
return;
}

val = SHMEM_RD(bp, validity_map[BP_PORT(bp)]);
if ((val & (SHR_MEM_VALIDITY_DEV_INFO | SHR_MEM_VALIDITY_MB))
!= (SHR_MEM_VALIDITY_DEV_INFO | SHR_MEM_VALIDITY_MB))
BNX2X_ERR("BAD MCP validity signature\n");

if (!BP_NOMCP(bp)) {
bp->fw_seq = (SHMEM_RD(bp, func_mb[BP_FUNC(bp)].drv_mb_header)
& DRV_MSG_SEQ_NUMBER_MASK);
BNX2X_DEV_INFO("fw_seq 0x%08x\n", bp->fw_seq);
}
}

/**
* bnx2x_io_error_detected - called when PCI error is detected
* @pdev: Pointer to PCI device
Expand All @@ -10434,7 +10365,7 @@ static pci_ers_result_t bnx2x_io_error_detected(struct pci_dev *pdev,
netif_device_detach(dev);

if (netif_running(dev))
bnx2x_eeh_nic_unload(bp);
bnx2x_nic_unload(bp, UNLOAD_CLOSE);

pci_disable_device(pdev);

Expand Down Expand Up @@ -10489,10 +10420,8 @@ static void bnx2x_io_resume(struct pci_dev *pdev)

rtnl_lock();

bnx2x_eeh_recover(bp);

if (netif_running(dev))
bnx2x_nic_load(bp, LOAD_NORMAL);
bnx2x_nic_load(bp, LOAD_OPEN);

netif_device_attach(dev);

Expand Down
Loading

0 comments on commit 222fbe7

Please sign in to comment.