Merge rsync://rsync.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
@@ -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) */
|
||||
|
||||
@@ -408,6 +408,7 @@ enum
|
||||
TCF_EM_NBYTE,
|
||||
TCF_EM_U32,
|
||||
TCF_EM_META,
|
||||
TCF_EM_TEXT,
|
||||
__TCF_EM_MAX
|
||||
};
|
||||
|
||||
|
||||
@@ -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); \
|
||||
|
||||
@@ -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 */
|
||||
@@ -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))
|
||||
|
||||
|
||||
@@ -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 */
|
||||
|
||||
19
include/linux/tc_ematch/tc_em_text.h
Normal file
19
include/linux/tc_ematch/tc_em_text.h
Normal file
@@ -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
|
||||
@@ -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
|
||||
|
||||
180
include/linux/textsearch.h
Normal file
180
include/linux/textsearch.h
Normal file
@@ -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
include/linux/textsearch_fsm.h
Normal file
48
include/linux/textsearch_fsm.h
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user