Skip to content

Commit

Permalink
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Browse files Browse the repository at this point in the history
* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6: (27 commits)
  [Bluetooth] Add RFCOMM role switch support
  [Bluetooth] Allow disabling of credit based flow control
  [Bluetooth] Small cleanup of the L2CAP source code
  [Bluetooth] Use real devices for host controllers
  [Bluetooth] Add platform device for virtual and serial devices
  [Bluetooth] Add automatic sniff mode support
  [Bluetooth] Correct SCO buffer size on request
  [Bluetooth] Add suspend/resume support to the HCI USB driver
  [Bluetooth] Use raw mode for the Frontline sniffer device
  [BRIDGE]: br_dump_ifinfo index fix
  [ATM]: add+use poison defines
  [NET]: add+use poison defines
  [IOAT]: fix kernel-doc in source files
  [IOAT]: fix header file kernel-doc
  [TG3]: Add ipv6 TSO feature
  [IPV6]: Fix ipv6 GSO payload length
  [TIPC] Fixed sk_buff panic caused by tipc_link_bundle_buf (REVISED)
  [NET]: Verify gso_type too in gso_segment
  [IPVS]: Add sysctl documentation
  [ROSE]: Try all routes when establishing a ROSE connections.
  ...
  • Loading branch information
Linus Torvalds committed Jul 4, 2006
2 parents f7d57e4 + 300b939 commit 67ab33d
Show file tree
Hide file tree
Showing 44 changed files with 1,159 additions and 464 deletions.
143 changes: 143 additions & 0 deletions Documentation/networking/ipvs-sysctl.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
/proc/sys/net/ipv4/vs/* Variables:

am_droprate - INTEGER
default 10

It sets the always mode drop rate, which is used in the mode 3
of the drop_rate defense.

amemthresh - INTEGER
default 1024

It sets the available memory threshold (in pages), which is
used in the automatic modes of defense. When there is no
enough available memory, the respective strategy will be
enabled and the variable is automatically set to 2, otherwise
the strategy is disabled and the variable is set to 1.

cache_bypass - BOOLEAN
0 - disabled (default)
not 0 - enabled

If it is enabled, forward packets to the original destination
directly when no cache server is available and destination
address is not local (iph->daddr is RTN_UNICAST). It is mostly
used in transparent web cache cluster.

debug_level - INTEGER
0 - transmission error messages (default)
1 - non-fatal error messages
2 - configuration
3 - destination trash
4 - drop entry
5 - service lookup
6 - scheduling
7 - connection new/expire, lookup and synchronization
8 - state transition
9 - binding destination, template checks and applications
10 - IPVS packet transmission
11 - IPVS packet handling (ip_vs_in/ip_vs_out)
12 or more - packet traversal

Only available when IPVS is compiled with the CONFIG_IPVS_DEBUG

Higher debugging levels include the messages for lower debugging
levels, so setting debug level 2, includes level 0, 1 and 2
messages. Thus, logging becomes more and more verbose the higher
the level.

drop_entry - INTEGER
0 - disabled (default)

The drop_entry defense is to randomly drop entries in the
connection hash table, just in order to collect back some
memory for new connections. In the current code, the
drop_entry procedure can be activated every second, then it
randomly scans 1/32 of the whole and drops entries that are in
the SYN-RECV/SYNACK state, which should be effective against
syn-flooding attack.

The valid values of drop_entry are from 0 to 3, where 0 means
that this strategy is always disabled, 1 and 2 mean automatic
modes (when there is no enough available memory, the strategy
is enabled and the variable is automatically set to 2,
otherwise the strategy is disabled and the variable is set to
1), and 3 means that that the strategy is always enabled.

drop_packet - INTEGER
0 - disabled (default)

The drop_packet defense is designed to drop 1/rate packets
before forwarding them to real servers. If the rate is 1, then
drop all the incoming packets.

The value definition is the same as that of the drop_entry. In
the automatic mode, the rate is determined by the follow
formula: rate = amemthresh / (amemthresh - available_memory)
when available memory is less than the available memory
threshold. When the mode 3 is set, the always mode drop rate
is controlled by the /proc/sys/net/ipv4/vs/am_droprate.

expire_nodest_conn - BOOLEAN
0 - disabled (default)
not 0 - enabled

The default value is 0, the load balancer will silently drop
packets when its destination server is not available. It may
be useful, when user-space monitoring program deletes the
destination server (because of server overload or wrong
detection) and add back the server later, and the connections
to the server can continue.

If this feature is enabled, the load balancer will expire the
connection immediately when a packet arrives and its
destination server is not available, then the client program
will be notified that the connection is closed. This is
equivalent to the feature some people requires to flush
connections when its destination is not available.

expire_quiescent_template - BOOLEAN
0 - disabled (default)
not 0 - enabled

When set to a non-zero value, the load balancer will expire
persistent templates when the destination server is quiescent.
This may be useful, when a user makes a destination server
quiescent by setting its weight to 0 and it is desired that
subsequent otherwise persistent connections are sent to a
different destination server. By default new persistent
connections are allowed to quiescent destination servers.

If this feature is enabled, the load balancer will expire the
persistence template if it is to be used to schedule a new
connection and the destination server is quiescent.

nat_icmp_send - BOOLEAN
0 - disabled (default)
not 0 - enabled

It controls sending icmp error messages (ICMP_DEST_UNREACH)
for VS/NAT when the load balancer receives packets from real
servers but the connection entries don't exist.

secure_tcp - INTEGER
0 - disabled (default)

The secure_tcp defense is to use a more complicated state
transition table and some possible short timeouts of each
state. In the VS/NAT, it delays the entering the ESTABLISHED
until the real server starts to send data and ACK packet
(after 3-way handshake).

The value definition is the same as that of drop_entry or
drop_packet.

sync_threshold - INTEGER
default 3

It sets synchronization threshold, which is the minimum number
of incoming packets that a connection needs to receive before
the connection will be synchronized. A connection will be
synchronized, every time the number of its incoming packets
modulus 50 equals the threshold. The range of the threshold is
from 0 to 49.
3 changes: 2 additions & 1 deletion drivers/atm/ambassador.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <linux/atmdev.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/poison.h>

#include <asm/atomic.h>
#include <asm/io.h>
Expand Down Expand Up @@ -1995,7 +1996,7 @@ static int __devinit ucode_init (loader_block * lb, amb_dev * dev) {
}
i += 1;
}
if (*pointer == 0xdeadbeef) {
if (*pointer == ATM_POISON) {
return loader_start (lb, dev, ucode_start);
} else {
// cast needed as there is no %? for pointer differnces
Expand Down
3 changes: 2 additions & 1 deletion drivers/atm/idt77252.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ static char const rcsid[] =

#include <linux/module.h>
#include <linux/pci.h>
#include <linux/poison.h>
#include <linux/skbuff.h>
#include <linux/kernel.h>
#include <linux/vmalloc.h>
Expand Down Expand Up @@ -3657,7 +3658,7 @@ probe_sram(struct idt77252_dev *card)
writel(SAR_CMD_WRITE_SRAM | (0 << 2), SAR_REG_CMD);

for (addr = 0x4000; addr < 0x80000; addr += 0x4000) {
writel(0xdeadbeef, SAR_REG_DR0);
writel(ATM_POISON, SAR_REG_DR0);
writel(SAR_CMD_WRITE_SRAM | (addr << 2), SAR_REG_CMD);

writel(SAR_CMD_READ_SRAM | (0 << 2), SAR_REG_CMD);
Expand Down
1 change: 1 addition & 0 deletions drivers/bluetooth/bluecard_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,7 @@ static int bluecard_open(bluecard_info_t *info)

hdev->type = HCI_PCCARD;
hdev->driver_data = info;
SET_HCIDEV_DEV(hdev, &info->p_dev->dev);

hdev->open = bluecard_hci_open;
hdev->close = bluecard_hci_close;
Expand Down
1 change: 1 addition & 0 deletions drivers/bluetooth/bt3c_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,7 @@ static int bt3c_open(bt3c_info_t *info)

hdev->type = HCI_PCCARD;
hdev->driver_data = info;
SET_HCIDEV_DEV(hdev, &info->p_dev->dev);

hdev->open = bt3c_hci_open;
hdev->close = bt3c_hci_close;
Expand Down
1 change: 1 addition & 0 deletions drivers/bluetooth/btuart_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,7 @@ static int btuart_open(btuart_info_t *info)

hdev->type = HCI_PCCARD;
hdev->driver_data = info;
SET_HCIDEV_DEV(hdev, &info->p_dev->dev);

hdev->open = btuart_hci_open;
hdev->close = btuart_hci_close;
Expand Down
1 change: 1 addition & 0 deletions drivers/bluetooth/dtl1_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,7 @@ static int dtl1_open(dtl1_info_t *info)

hdev->type = HCI_PCCARD;
hdev->driver_data = info;
SET_HCIDEV_DEV(hdev, &info->p_dev->dev);

hdev->open = dtl1_hci_open;
hdev->close = dtl1_hci_close;
Expand Down
80 changes: 80 additions & 0 deletions drivers/bluetooth/hci_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,19 @@ static struct usb_device_id blacklist_ids[] = {
/* RTX Telecom based adapter with buggy SCO support */
{ USB_DEVICE(0x0400, 0x0807), .driver_info = HCI_BROKEN_ISOC },

/* Belkin F8T012 */
{ USB_DEVICE(0x050d, 0x0012), .driver_info = HCI_WRONG_SCO_MTU },

/* Digianswer devices */
{ USB_DEVICE(0x08fd, 0x0001), .driver_info = HCI_DIGIANSWER },
{ USB_DEVICE(0x08fd, 0x0002), .driver_info = HCI_IGNORE },

/* CSR BlueCore Bluetooth Sniffer */
{ USB_DEVICE(0x0a12, 0x0002), .driver_info = HCI_SNIFFER },

/* Frontline ComProbe Bluetooth Sniffer */
{ USB_DEVICE(0x16d3, 0x0002), .driver_info = HCI_SNIFFER },

{ } /* Terminating entry */
};

Expand Down Expand Up @@ -984,6 +990,9 @@ static int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id
if (reset || id->driver_info & HCI_RESET)
set_bit(HCI_QUIRK_RESET_ON_INIT, &hdev->quirks);

if (id->driver_info & HCI_WRONG_SCO_MTU)
set_bit(HCI_QUIRK_FIXUP_BUFFER_SIZE, &hdev->quirks);

if (id->driver_info & HCI_SNIFFER) {
if (le16_to_cpu(udev->descriptor.bcdDevice) > 0x997)
set_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks);
Expand Down Expand Up @@ -1042,10 +1051,81 @@ static void hci_usb_disconnect(struct usb_interface *intf)
hci_free_dev(hdev);
}

static int hci_usb_suspend(struct usb_interface *intf, pm_message_t message)
{
struct hci_usb *husb = usb_get_intfdata(intf);
struct list_head killed;
unsigned long flags;
int i;

if (!husb || intf == husb->isoc_iface)
return 0;

hci_suspend_dev(husb->hdev);

INIT_LIST_HEAD(&killed);

for (i = 0; i < 4; i++) {
struct _urb_queue *q = &husb->pending_q[i];
struct _urb *_urb, *_tmp;

while ((_urb = _urb_dequeue(q))) {
/* reset queue since _urb_dequeue sets it to NULL */
_urb->queue = q;
usb_kill_urb(&_urb->urb);
list_add(&_urb->list, &killed);
}

spin_lock_irqsave(&q->lock, flags);

list_for_each_entry_safe(_urb, _tmp, &killed, list) {
list_move_tail(&_urb->list, &q->head);
}

spin_unlock_irqrestore(&q->lock, flags);
}

return 0;
}

static int hci_usb_resume(struct usb_interface *intf)
{
struct hci_usb *husb = usb_get_intfdata(intf);
unsigned long flags;
int i, err = 0;

if (!husb || intf == husb->isoc_iface)
return 0;

for (i = 0; i < 4; i++) {
struct _urb_queue *q = &husb->pending_q[i];
struct _urb *_urb;

spin_lock_irqsave(&q->lock, flags);

list_for_each_entry(_urb, &q->head, list) {
err = usb_submit_urb(&_urb->urb, GFP_ATOMIC);
if (err)
break;
}

spin_unlock_irqrestore(&q->lock, flags);

if (err)
return -EIO;
}

hci_resume_dev(husb->hdev);

return 0;
}

static struct usb_driver hci_usb_driver = {
.name = "hci_usb",
.probe = hci_usb_probe,
.disconnect = hci_usb_disconnect,
.suspend = hci_usb_suspend,
.resume = hci_usb_resume,
.id_table = bluetooth_ids,
};

Expand Down
1 change: 1 addition & 0 deletions drivers/bluetooth/hci_usb.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#define HCI_SNIFFER 0x10
#define HCI_BCM92035 0x20
#define HCI_BROKEN_ISOC 0x40
#define HCI_WRONG_SCO_MTU 0x80

#define HCI_MAX_IFACE_NUM 3

Expand Down
1 change: 0 additions & 1 deletion drivers/bluetooth/hci_vhci.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,6 @@ static int vhci_open(struct inode *inode, struct file *file)

hdev->type = HCI_VHCI;
hdev->driver_data = vhci;
SET_HCIDEV_DEV(hdev, vhci_miscdev.dev);

hdev->open = vhci_open_dev;
hdev->close = vhci_close_dev;
Expand Down
20 changes: 12 additions & 8 deletions drivers/dma/dmaengine.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ static struct dma_chan *dma_client_chan_alloc(struct dma_client *client)
}

/**
* dma_client_chan_free - release a DMA channel
* @chan: &dma_chan
* dma_chan_cleanup - release a DMA channel's resources
* @kref: kernel reference structure that contains the DMA channel device
*/
void dma_chan_cleanup(struct kref *kref)
{
Expand Down Expand Up @@ -199,7 +199,7 @@ static void dma_client_chan_free(struct dma_chan *chan)
* dma_chans_rebalance - reallocate channels to clients
*
* When the number of DMA channel in the system changes,
* channels need to be rebalanced among clients
* channels need to be rebalanced among clients.
*/
static void dma_chans_rebalance(void)
{
Expand Down Expand Up @@ -264,7 +264,7 @@ struct dma_client *dma_async_client_register(dma_event_callback event_callback)

/**
* dma_async_client_unregister - unregister a client and free the &dma_client
* @client:
* @client: &dma_client to free
*
* Force frees any allocated DMA channels, frees the &dma_client memory
*/
Expand Down Expand Up @@ -306,7 +306,7 @@ void dma_async_client_chan_request(struct dma_client *client,
}

/**
* dma_async_device_register -
* dma_async_device_register - registers DMA devices found
* @device: &dma_device
*/
int dma_async_device_register(struct dma_device *device)
Expand Down Expand Up @@ -348,8 +348,8 @@ int dma_async_device_register(struct dma_device *device)
}

/**
* dma_async_device_unregister -
* @device: &dma_device
* dma_async_device_cleanup - function called when all references are released
* @kref: kernel reference object
*/
static void dma_async_device_cleanup(struct kref *kref)
{
Expand All @@ -359,7 +359,11 @@ static void dma_async_device_cleanup(struct kref *kref)
complete(&device->done);
}

void dma_async_device_unregister(struct dma_device* device)
/**
* dma_async_device_unregister - unregisters DMA devices
* @device: &dma_device
*/
void dma_async_device_unregister(struct dma_device *device)
{
struct dma_chan *chan;
unsigned long flags;
Expand Down
Loading

0 comments on commit 67ab33d

Please sign in to comment.