diff options
Diffstat (limited to 'include/net/sctp')
| -rw-r--r-- | include/net/sctp/sctp.h | 4 | ||||
| -rw-r--r-- | include/net/sctp/structs.h | 51 | ||||
| -rw-r--r-- | include/net/sctp/ulpevent.h | 12 | 
3 files changed, 59 insertions, 8 deletions
| diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index b392ac8382f2..632e205ca54b 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h @@ -186,6 +186,10 @@ void sctp_assocs_proc_exit(struct net *net);  int sctp_remaddr_proc_init(struct net *net);  void sctp_remaddr_proc_exit(struct net *net); +/* + * sctp/offload.c + */ +int sctp_offload_init(void);  /*   * Module global variables diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index 16b013a6191c..ce93c4b10d26 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h @@ -59,6 +59,7 @@  #include <linux/workqueue.h>	/* We need tq_struct.	 */  #include <linux/sctp.h>		/* We need sctp* header structs.  */  #include <net/sctp/auth.h>	/* We need auth specific structs */ +#include <net/ip.h>		/* For inet_skb_parm */  /* A convenience structure for handling sockaddr structures.   * We should wean ourselves off this. @@ -566,6 +567,9 @@ struct sctp_chunk {  	/* This points to the sk_buff containing the actual data.  */  	struct sk_buff *skb; +	/* In case of GSO packets, this will store the head one */ +	struct sk_buff *head_skb; +  	/* These are the SCTP headers by reverse order in a packet.  	 * Note that some of these may happen more than once.  In that  	 * case, we point at the "current" one, whatever that means @@ -599,6 +603,16 @@ struct sctp_chunk {  	/* This needs to be recoverable for SCTP_SEND_FAILED events. */  	struct sctp_sndrcvinfo sinfo; +	/* We use this field to record param for prsctp policies, +	 * for TTL policy, it is the time_to_drop of this chunk, +	 * for RTX policy, it is the max_sent_count of this chunk, +	 * for PRIO policy, it is the priority of this chunk. +	 */ +	unsigned long prsctp_param; + +	/* How many times this chunk have been sent, for prsctp RTX policy */ +	int sent_count; +  	/* Which association does this belong to?  */  	struct sctp_association *asoc; @@ -696,6 +710,8 @@ struct sctp_packet {  	size_t overhead;  	/* This is the total size of all chunks INCLUDING padding.  */  	size_t size; +	/* This is the maximum size this packet may have */ +	size_t max_size;  	/* The packet is destined for this transport address.  	 * The function we finally use to pass down to the next lower @@ -1069,12 +1085,36 @@ void sctp_retransmit(struct sctp_outq *, struct sctp_transport *,  		     sctp_retransmit_reason_t);  void sctp_retransmit_mark(struct sctp_outq *, struct sctp_transport *, __u8);  int sctp_outq_uncork(struct sctp_outq *, gfp_t gfp); +void sctp_prsctp_prune(struct sctp_association *asoc, +		       struct sctp_sndrcvinfo *sinfo, int msg_len);  /* Uncork and flush an outqueue.  */  static inline void sctp_outq_cork(struct sctp_outq *q)  {  	q->cork = 1;  } +/* SCTP skb control block. + * sctp_input_cb is currently used on rx and sock rx queue + */ +struct sctp_input_cb { +	union { +		struct inet_skb_parm	h4; +#if IS_ENABLED(CONFIG_IPV6) +		struct inet6_skb_parm	h6; +#endif +	} header; +	struct sctp_chunk *chunk; +	struct sctp_af *af; +}; +#define SCTP_INPUT_CB(__skb)	((struct sctp_input_cb *)&((__skb)->cb[0])) + +static inline const struct sk_buff *sctp_gso_headskb(const struct sk_buff *skb) +{ +	const struct sctp_chunk *chunk = SCTP_INPUT_CB(skb)->chunk; + +	return chunk->head_skb ? : skb; +} +  /* These bind address data fields common between endpoints and associations */  struct sctp_bind_addr { @@ -1251,7 +1291,8 @@ struct sctp_endpoint {  	/* SCTP-AUTH: endpoint shared keys */  	struct list_head endpoint_shared_keys;  	__u16 active_key_id; -	__u8  auth_enable; +	__u8  auth_enable:1, +	      prsctp_enable:1;  };  /* Recover the outter endpoint structure. */ @@ -1843,9 +1884,15 @@ struct sctp_association {  	__u16 active_key_id;  	__u8 need_ecne:1,	/* Need to send an ECNE Chunk? */ -	     temp:1;		/* Is it a temporary association? */ +	     temp:1,		/* Is it a temporary association? */ +	     prsctp_enable:1;  	struct sctp_priv_assoc_stats stats; + +	int sent_cnt_removable; + +	__u64 abandoned_unsent[SCTP_PR_INDEX(MAX) + 1]; +	__u64 abandoned_sent[SCTP_PR_INDEX(MAX) + 1];  }; diff --git a/include/net/sctp/ulpevent.h b/include/net/sctp/ulpevent.h index cccdcfd14973..2c098cd7e7e2 100644 --- a/include/net/sctp/ulpevent.h +++ b/include/net/sctp/ulpevent.h @@ -48,15 +48,15 @@   */  struct sctp_ulpevent {  	struct sctp_association *asoc; -	__u16 stream; -	__u16 ssn; -	__u16 flags; +	struct sctp_chunk *chunk; +	unsigned int rmem_len;  	__u32 ppid;  	__u32 tsn;  	__u32 cumtsn; -	int msg_flags; -	int iif; -	unsigned int rmem_len; +	__u16 stream; +	__u16 ssn; +	__u16 flags; +	__u16 msg_flags;  };  /* Retrieve the skb this event sits inside of. */ |