Skip to content

Commit

Permalink
Merge rsync://rsync.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Linus Torvalds committed Jun 24, 2005
2 parents 52c1da3 + f2d368f commit 59a49e3
Show file tree
Hide file tree
Showing 26 changed files with 1,538 additions and 183 deletions.
14 changes: 4 additions & 10 deletions drivers/net/slip.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,18 +198,12 @@ sl_alloc_bufs(struct slip *sl, int mtu)
static void
sl_free_bufs(struct slip *sl)
{
void * tmp;

/* Free all SLIP frame buffers. */
tmp = xchg(&sl->rbuff, NULL);
kfree(tmp);
tmp = xchg(&sl->xbuff, NULL);
kfree(tmp);
kfree(xchg(&sl->rbuff, NULL));
kfree(xchg(&sl->xbuff, NULL));
#ifdef SL_INCLUDE_CSLIP
tmp = xchg(&sl->cbuff, NULL);
kfree(tmp);
if ((tmp = xchg(&sl->slcomp, NULL)) != NULL)
slhc_free(tmp);
kfree(xchg(&sl->cbuff, NULL));
slhc_free(xchg(&sl->slcomp, NULL));
#endif
}

Expand Down
11 changes: 1 addition & 10 deletions include/linux/netdevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,6 @@ struct netif_rx_stats
unsigned total;
unsigned dropped;
unsigned time_squeeze;
unsigned throttled;
unsigned fastroute_hit;
unsigned fastroute_success;
unsigned fastroute_defer;
unsigned fastroute_deferred_out;
unsigned fastroute_latency_reduction;
unsigned cpu_collision;
};

Expand Down Expand Up @@ -562,12 +556,9 @@ static inline int unregister_gifconf(unsigned int family)

struct softnet_data
{
int throttle;
int cng_level;
int avg_blog;
struct net_device *output_queue;
struct sk_buff_head input_pkt_queue;
struct list_head poll_list;
struct net_device *output_queue;
struct sk_buff *completion_queue;

struct net_device backlog_dev; /* Sorry. 8) */
Expand Down
1 change: 1 addition & 0 deletions include/linux/pkt_cls.h
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,7 @@ enum
TCF_EM_NBYTE,
TCF_EM_U32,
TCF_EM_META,
TCF_EM_TEXT,
__TCF_EM_MAX
};

Expand Down
7 changes: 5 additions & 2 deletions include/linux/rtnetlink.h
Original file line number Diff line number Diff line change
Expand Up @@ -892,10 +892,13 @@ extern void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const voi
goto rtattr_failure; \
__rta_fill(skb, attrtype, attrlen, data); })

#define RTA_PUT_NOHDR(skb, attrlen, data) \
#define RTA_APPEND(skb, attrlen, data) \
({ if (unlikely(skb_tailroom(skb) < (int)(attrlen))) \
goto rtattr_failure; \
memcpy(skb_put(skb, RTA_ALIGN(attrlen)), data, attrlen); })
memcpy(skb_put(skb, attrlen), data, attrlen); })

#define RTA_PUT_NOHDR(skb, attrlen, data) \
RTA_APPEND(skb, RTA_ALIGN(attrlen), data)

#define RTA_PUT_U8(skb, attrtype, value) \
({ u8 _tmp = (value); \
Expand Down
23 changes: 23 additions & 0 deletions include/linux/skbuff.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <linux/highmem.h>
#include <linux/poll.h>
#include <linux/net.h>
#include <linux/textsearch.h>
#include <net/checksum.h>

#define HAVE_ALLOC_SKB /* For the drivers to know */
Expand Down Expand Up @@ -321,6 +322,28 @@ extern void skb_over_panic(struct sk_buff *skb, int len,
extern void skb_under_panic(struct sk_buff *skb, int len,
void *here);

struct skb_seq_state
{
__u32 lower_offset;
__u32 upper_offset;
__u32 frag_idx;
__u32 stepped_offset;
struct sk_buff *root_skb;
struct sk_buff *cur_skb;
__u8 *frag_data;
};

extern void skb_prepare_seq_read(struct sk_buff *skb,
unsigned int from, unsigned int to,
struct skb_seq_state *st);
extern unsigned int skb_seq_read(unsigned int consumed, const u8 **data,
struct skb_seq_state *st);
extern void skb_abort_seq_read(struct skb_seq_state *st);

extern unsigned int skb_find_text(struct sk_buff *skb, unsigned int from,
unsigned int to, struct ts_config *config,
struct ts_state *state);

/* Internal */
#define skb_shinfo(SKB) ((struct skb_shared_info *)((SKB)->end))

Expand Down
1 change: 1 addition & 0 deletions include/linux/sysctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ enum
NET_CORE_MOD_CONG=16,
NET_CORE_DEV_WEIGHT=17,
NET_CORE_SOMAXCONN=18,
NET_CORE_BUDGET=19,
};

/* /proc/sys/net/ethernet */
Expand Down
19 changes: 19 additions & 0 deletions include/linux/tc_ematch/tc_em_text.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#ifndef __LINUX_TC_EM_TEXT_H
#define __LINUX_TC_EM_TEXT_H

#include <linux/pkt_cls.h>

#define TC_EM_TEXT_ALGOSIZ 16

struct tcf_em_text
{
char algo[TC_EM_TEXT_ALGOSIZ];
__u16 from_offset;
__u16 to_offset;
__u16 pattern_len;
__u8 from_layer:4;
__u8 to_layer:4;
__u8 pad;
};

#endif
1 change: 1 addition & 0 deletions include/linux/tcp.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ enum {
#define TCP_WINDOW_CLAMP 10 /* Bound advertised window */
#define TCP_INFO 11 /* Information about this connection. */
#define TCP_QUICKACK 12 /* Block/reenable quick acks */
#define TCP_CONGESTION 13 /* Congestion control algorithm */

#define TCPI_OPT_TIMESTAMPS 1
#define TCPI_OPT_SACK 2
Expand Down
180 changes: 180 additions & 0 deletions include/linux/textsearch.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
#ifndef __LINUX_TEXTSEARCH_H
#define __LINUX_TEXTSEARCH_H

#ifdef __KERNEL__

#include <linux/types.h>
#include <linux/list.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/err.h>

struct ts_config;

/**
* TS_AUTOLOAD - Automatically load textsearch modules when needed
*/
#define TS_AUTOLOAD 1

/**
* struct ts_state - search state
* @offset: offset for next match
* @cb: control buffer, for persistant variables of get_next_block()
*/
struct ts_state
{
unsigned int offset;
char cb[40];
};

/**
* struct ts_ops - search module operations
* @name: name of search algorithm
* @init: initialization function to prepare a search
* @find: find the next occurrence of the pattern
* @destroy: destroy algorithm specific parts of a search configuration
* @get_pattern: return head of pattern
* @get_pattern_len: return length of pattern
* @owner: module reference to algorithm
*/
struct ts_ops
{
const char *name;
struct ts_config * (*init)(const void *, unsigned int, int);
unsigned int (*find)(struct ts_config *,
struct ts_state *);
void (*destroy)(struct ts_config *);
void * (*get_pattern)(struct ts_config *);
unsigned int (*get_pattern_len)(struct ts_config *);
struct module *owner;
struct list_head list;
};

/**
* struct ts_config - search configuration
* @ops: operations of chosen algorithm
* @get_next_block: callback to fetch the next block to search in
* @finish: callback to finalize a search
*/
struct ts_config
{
struct ts_ops *ops;

/**
* get_next_block - fetch next block of data
* @consumed: number of bytes consumed by the caller
* @dst: destination buffer
* @conf: search configuration
* @state: search state
*
* Called repeatedly until 0 is returned. Must assign the
* head of the next block of data to &*dst and return the length
* of the block or 0 if at the end. consumed == 0 indicates
* a new search. May store/read persistant values in state->cb.
*/
unsigned int (*get_next_block)(unsigned int consumed,
const u8 **dst,
struct ts_config *conf,
struct ts_state *state);

/**
* finish - finalize/clean a series of get_next_block() calls
* @conf: search configuration
* @state: search state
*
* Called after the last use of get_next_block(), may be used
* to cleanup any leftovers.
*/
void (*finish)(struct ts_config *conf,
struct ts_state *state);
};

/**
* textsearch_next - continue searching for a pattern
* @conf: search configuration
* @state: search state
*
* Continues a search looking for more occurrences of the pattern.
* textsearch_find() must be called to find the first occurrence
* in order to reset the state.
*
* Returns the position of the next occurrence of the pattern or
* UINT_MAX if not match was found.
*/
static inline unsigned int textsearch_next(struct ts_config *conf,
struct ts_state *state)
{
unsigned int ret = conf->ops->find(conf, state);

if (conf->finish)
conf->finish(conf, state);

return ret;
}

/**
* textsearch_find - start searching for a pattern
* @conf: search configuration
* @state: search state
*
* Returns the position of first occurrence of the pattern or
* UINT_MAX if no match was found.
*/
static inline unsigned int textsearch_find(struct ts_config *conf,
struct ts_state *state)
{
state->offset = 0;
return textsearch_next(conf, state);
}

/**
* textsearch_get_pattern - return head of the pattern
* @conf: search configuration
*/
static inline void *textsearch_get_pattern(struct ts_config *conf)
{
return conf->ops->get_pattern(conf);
}

/**
* textsearch_get_pattern_len - return length of the pattern
* @conf: search configuration
*/
static inline unsigned int textsearch_get_pattern_len(struct ts_config *conf)
{
return conf->ops->get_pattern_len(conf);
}

extern int textsearch_register(struct ts_ops *);
extern int textsearch_unregister(struct ts_ops *);
extern struct ts_config *textsearch_prepare(const char *, const void *,
unsigned int, int, int);
extern void textsearch_destroy(struct ts_config *conf);
extern unsigned int textsearch_find_continuous(struct ts_config *,
struct ts_state *,
const void *, unsigned int);


#define TS_PRIV_ALIGNTO 8
#define TS_PRIV_ALIGN(len) (((len) + TS_PRIV_ALIGNTO-1) & ~(TS_PRIV_ALIGNTO-1))

static inline struct ts_config *alloc_ts_config(size_t payload, int gfp_mask)
{
struct ts_config *conf;

conf = kmalloc(TS_PRIV_ALIGN(sizeof(*conf)) + payload, gfp_mask);
if (conf == NULL)
return ERR_PTR(-ENOMEM);

memset(conf, 0, TS_PRIV_ALIGN(sizeof(*conf)) + payload);
return conf;
}

static inline void *ts_config_priv(struct ts_config *conf)
{
return ((u8 *) conf + TS_PRIV_ALIGN(sizeof(struct ts_config)));
}

#endif /* __KERNEL__ */

#endif
48 changes: 48 additions & 0 deletions include/linux/textsearch_fsm.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#ifndef __LINUX_TEXTSEARCH_FSM_H
#define __LINUX_TEXTSEARCH_FSM_H

#include <linux/types.h>

enum {
TS_FSM_SPECIFIC, /* specific character */
TS_FSM_WILDCARD, /* any character */
TS_FSM_DIGIT, /* isdigit() */
TS_FSM_XDIGIT, /* isxdigit() */
TS_FSM_PRINT, /* isprint() */
TS_FSM_ALPHA, /* isalpha() */
TS_FSM_ALNUM, /* isalnum() */
TS_FSM_ASCII, /* isascii() */
TS_FSM_CNTRL, /* iscntrl() */
TS_FSM_GRAPH, /* isgraph() */
TS_FSM_LOWER, /* islower() */
TS_FSM_UPPER, /* isupper() */
TS_FSM_PUNCT, /* ispunct() */
TS_FSM_SPACE, /* isspace() */
__TS_FSM_TYPE_MAX,
};
#define TS_FSM_TYPE_MAX (__TS_FSM_TYPE_MAX - 1)

enum {
TS_FSM_SINGLE, /* 1 occurrence */
TS_FSM_PERHAPS, /* 1 or 0 occurrence */
TS_FSM_ANY, /* 0..n occurrences */
TS_FSM_MULTI, /* 1..n occurrences */
TS_FSM_HEAD_IGNORE, /* 0..n ignored occurrences at head */
__TS_FSM_RECUR_MAX,
};
#define TS_FSM_RECUR_MAX (__TS_FSM_RECUR_MAX - 1)

/**
* struct ts_fsm_token - state machine token (state)
* @type: type of token
* @recur: number of recurrences
* @value: character value for TS_FSM_SPECIFIC
*/
struct ts_fsm_token
{
__u16 type;
__u8 recur;
__u8 value;
};

#endif
4 changes: 3 additions & 1 deletion include/net/tcp.h
Original file line number Diff line number Diff line change
Expand Up @@ -1162,12 +1162,14 @@ extern void tcp_init_congestion_control(struct tcp_sock *tp);
extern void tcp_cleanup_congestion_control(struct tcp_sock *tp);
extern int tcp_set_default_congestion_control(const char *name);
extern void tcp_get_default_congestion_control(char *name);
extern int tcp_set_congestion_control(struct tcp_sock *tp, const char *name);

extern struct tcp_congestion_ops tcp_reno;
extern struct tcp_congestion_ops tcp_init_congestion_ops;
extern u32 tcp_reno_ssthresh(struct tcp_sock *tp);
extern void tcp_reno_cong_avoid(struct tcp_sock *tp, u32 ack,
u32 rtt, u32 in_flight, int flag);
extern u32 tcp_reno_min_cwnd(struct tcp_sock *tp);
extern struct tcp_congestion_ops tcp_reno;

static inline void tcp_set_ca_state(struct tcp_sock *tp, u8 ca_state)
{
Expand Down
Loading

0 comments on commit 59a49e3

Please sign in to comment.