Prev: MIPS: Add base support for Ingenic JZ4740 System-on-a-Chip
Next: drivers/net/enic: Use (pr|netdev)_<level> macro helpers
From: Vlad Yasevich on 3 Jun 2010 10:50 Yaogong Wang wrote: > Declare sctp_sched_ops structure and related functions > > Signed-off-by: Yaogong Wang <ywang15(a)ncsu.edu> > --- > diff -uprN -X linux-2.6.32.8/Documentation/dontdiff > linux-2.6.32.8/include/net/sctp/structs.h > p1/include/net/sctp/structs.h > --- linux-2.6.32.8/include/net/sctp/structs.h 2010-02-09 > 04:57:19.000000000 -0800 > +++ p1/include/net/sctp/structs.h 2010-05-28 10:33:12.000000000 -0700 > @@ -320,6 +320,9 @@ struct sctp_sock { > /* Flags controlling Heartbeat, SACK delay, and Path MTU Discovery. */ > __u32 param_flags; > > + /* Multistream scheduling */ > + const struct sctp_sched_ops *sched_ops; > + > struct sctp_initmsg initmsg; > struct sctp_rtoinfo rtoinfo; > struct sctp_paddrparams paddrparam; > @@ -534,6 +537,36 @@ static inline void sctp_ssn_skip(struct > } > > /* > + * Interface for adding new SCTP scheduling handlers > + * This is similar to the pluggable TCP congestion control > + */ > +struct sctp_sched_ops { > + struct list_head list; > + > + /* initialize out_chunk_list (required) */ > + int (*init)(struct sctp_outq *q, gfp_t gfp); > + /* cleanup out_chunk_list (required) */ > + void (*release)(struct sctp_outq *q); > + /* enqueue head function (required) */ > + void (*enqueue_head_data)(struct sctp_outq *q, struct sctp_chunk *ch); > + /* enqueue tail function (required) */ > + void (*enqueue_tail_data)(struct sctp_outq *q, struct sctp_chunk *ch); > + /* dequeue function (required) */ > + struct sctp_chunk* (*dequeue_data)(struct sctp_outq *q); > + /* is out_chunk_list empty? (required) */ > + int (*is_empty)(struct sctp_outq *q); > + > + char name[SCTP_SCHED_NAME_MAX]; > + struct module *owner; > +}; > + > +extern int sctp_register_sched(struct sctp_sched_ops *type); > +extern void sctp_unregister_sched(struct sctp_sched_ops *type); > + > +extern void sctp_cleanup_sched(struct sock *sk); > +extern int sctp_set_sched(struct sock *sk, const char *name); > + > +/* > * Pointers to address related SCTP functions. > * (i.e. things that depend on the address family.) > */ > @@ -1650,6 +1683,9 @@ struct sctp_association { > /* The largest timeout or RTO value to use in attempting an INIT */ > unsigned long max_init_timeo; > > + /* Multistream scheduling */ > + const struct sctp_sched_ops *sched_ops; > + > /* Heartbeat interval: The endpoint sends out a Heartbeat chunk to > * the destination address every heartbeat interval. This value > * will be inherited by all new transports. > diff -uprN -X linux-2.6.32.8/Documentation/dontdiff > linux-2.6.32.8/include/net/sctp/user.h p1/include/net/sctp/user.h > --- linux-2.6.32.8/include/net/sctp/user.h 2010-02-09 04:57:19.000000000 -0800 > +++ p1/include/net/sctp/user.h 2010-05-28 10:52:57.000000000 -0700 > @@ -171,6 +171,8 @@ struct sctp_initmsg { > __u16 sinit_max_init_timeo; > }; > > +#define SCTP_SCHED_NAME_MAX 16 > + > /* > * 5.2.2 SCTP Header Information Structure (SCTP_SNDRCV) > * > You might as well through the global definition here as well. You can set it later, but let's define that in one place. -vlad -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: Vlad Yasevich on 3 Jun 2010 11:10 Yaogong Wang wrote: > Declare sctp_sched_ops structure and related functions > > Signed-off-by: Yaogong Wang <ywang15(a)ncsu.edu> > --- > diff -uprN -X linux-2.6.32.8/Documentation/dontdiff > linux-2.6.32.8/include/net/sctp/structs.h > p1/include/net/sctp/structs.h > --- linux-2.6.32.8/include/net/sctp/structs.h 2010-02-09 > 04:57:19.000000000 -0800 > +++ p1/include/net/sctp/structs.h 2010-05-28 10:33:12.000000000 -0700 > @@ -320,6 +320,9 @@ struct sctp_sock { > /* Flags controlling Heartbeat, SACK delay, and Path MTU Discovery. */ > __u32 param_flags; > > + /* Multistream scheduling */ > + const struct sctp_sched_ops *sched_ops; > + > struct sctp_initmsg initmsg; > struct sctp_rtoinfo rtoinfo; > struct sctp_paddrparams paddrparam; > @@ -534,6 +537,36 @@ static inline void sctp_ssn_skip(struct > } > BTW, is there a reason you decided to through the sched_ops into the association and not the queue? I seems to make more sense to me to put one into the other. -vlad > /* > + * Interface for adding new SCTP scheduling handlers > + * This is similar to the pluggable TCP congestion control > + */ > +struct sctp_sched_ops { > + struct list_head list; > + > + /* initialize out_chunk_list (required) */ > + int (*init)(struct sctp_outq *q, gfp_t gfp); > + /* cleanup out_chunk_list (required) */ > + void (*release)(struct sctp_outq *q); > + /* enqueue head function (required) */ > + void (*enqueue_head_data)(struct sctp_outq *q, struct sctp_chunk *ch); > + /* enqueue tail function (required) */ > + void (*enqueue_tail_data)(struct sctp_outq *q, struct sctp_chunk *ch); > + /* dequeue function (required) */ > + struct sctp_chunk* (*dequeue_data)(struct sctp_outq *q); > + /* is out_chunk_list empty? (required) */ > + int (*is_empty)(struct sctp_outq *q); > + > + char name[SCTP_SCHED_NAME_MAX]; > + struct module *owner; > +}; > + > +extern int sctp_register_sched(struct sctp_sched_ops *type); > +extern void sctp_unregister_sched(struct sctp_sched_ops *type); > + > +extern void sctp_cleanup_sched(struct sock *sk); > +extern int sctp_set_sched(struct sock *sk, const char *name); > + > +/* > * Pointers to address related SCTP functions. > * (i.e. things that depend on the address family.) > */ > @@ -1650,6 +1683,9 @@ struct sctp_association { > /* The largest timeout or RTO value to use in attempting an INIT */ > unsigned long max_init_timeo; > > + /* Multistream scheduling */ > + const struct sctp_sched_ops *sched_ops; > + > /* Heartbeat interval: The endpoint sends out a Heartbeat chunk to > * the destination address every heartbeat interval. This value > * will be inherited by all new transports. > diff -uprN -X linux-2.6.32.8/Documentation/dontdiff > linux-2.6.32.8/include/net/sctp/user.h p1/include/net/sctp/user.h > --- linux-2.6.32.8/include/net/sctp/user.h 2010-02-09 04:57:19.000000000 -0800 > +++ p1/include/net/sctp/user.h 2010-05-28 10:52:57.000000000 -0700 > @@ -171,6 +171,8 @@ struct sctp_initmsg { > __u16 sinit_max_init_timeo; > }; > > +#define SCTP_SCHED_NAME_MAX 16 > + > /* > * 5.2.2 SCTP Header Information Structure (SCTP_SNDRCV) > * > -- > To unsubscribe from this list: send the line "unsubscribe linux-sctp" in > the body of a message to majordomo(a)vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: Yaogong Wang on 5 Jun 2010 15:20
I agree that it's clearer to put sched_ops in sctp_outq. That way, the data structure and the operations on it are put together. I'll make the required changes. Yaogong On Thu, Jun 3, 2010 at 8:01 AM, Vlad Yasevich <vladislav.yasevich(a)hp.com> wrote: > > > Yaogong Wang wrote: >> Declare sctp_sched_ops structure and related functions >> >> Signed-off-by: Yaogong Wang <ywang15(a)ncsu.edu> >> --- >> diff -uprN -X linux-2.6.32.8/Documentation/dontdiff >> linux-2.6.32.8/include/net/sctp/structs.h >> p1/include/net/sctp/structs.h >> --- linux-2.6.32.8/include/net/sctp/structs.h 2010-02-09 >> 04:57:19.000000000 -0800 >> +++ p1/include/net/sctp/structs.h � � 2010-05-28 10:33:12.000000000 -0700 >> @@ -320,6 +320,9 @@ struct sctp_sock { >> � � � /* Flags controlling Heartbeat, SACK delay, and Path MTU Discovery. */ >> � � � __u32 param_flags; >> >> + � � /* Multistream scheduling �*/ >> + � � const struct sctp_sched_ops *sched_ops; >> + >> � � � struct sctp_initmsg initmsg; >> � � � struct sctp_rtoinfo rtoinfo; >> � � � struct sctp_paddrparams paddrparam; >> @@ -534,6 +537,36 @@ static inline void sctp_ssn_skip(struct >> �} >> > > BTW, is there a reason you decided to through the sched_ops into the association > and not the queue? �I seems to make more sense to me to put one into the other. > > -vlad > >> �/* >> + * Interface for adding new SCTP scheduling handlers >> + * This is similar to the pluggable TCP congestion control >> + */ >> +struct sctp_sched_ops { >> + � � struct list_head � � � �list; >> + >> + � � /* initialize out_chunk_list (required) */ >> + � � int (*init)(struct sctp_outq *q, gfp_t gfp); >> + � � /* cleanup out_chunk_list (required) */ >> + � � void (*release)(struct sctp_outq *q); >> + � � /* enqueue head function (required) */ >> + � � void (*enqueue_head_data)(struct sctp_outq *q, struct sctp_chunk *ch); >> + � � /* enqueue tail function (required) */ >> + � � void (*enqueue_tail_data)(struct sctp_outq *q, struct sctp_chunk *ch); >> + � � /* dequeue function (required) */ >> + � � struct sctp_chunk* (*dequeue_data)(struct sctp_outq *q); >> + � � /* is out_chunk_list empty? (required) */ >> + � � int (*is_empty)(struct sctp_outq *q); >> + >> + � � char � � � � � �name[SCTP_SCHED_NAME_MAX]; >> + � � struct module � *owner; >> +}; >> + >> +extern int sctp_register_sched(struct sctp_sched_ops *type); >> +extern void sctp_unregister_sched(struct sctp_sched_ops *type); >> + >> +extern void sctp_cleanup_sched(struct sock *sk); >> +extern int sctp_set_sched(struct sock *sk, const char *name); >> + >> +/* >> � * Pointers to address related SCTP functions. >> � * (i.e. things that depend on the address family.) >> � */ >> @@ -1650,6 +1683,9 @@ struct sctp_association { >> � � � /* The largest timeout or RTO value to use in attempting an INIT */ >> � � � unsigned long max_init_timeo; >> >> + � � /* Multistream scheduling �*/ >> + � � const struct sctp_sched_ops *sched_ops; >> + >> � � � /* Heartbeat interval: The endpoint sends out a Heartbeat chunk to >> � � � �* the destination address every heartbeat interval. This value >> � � � �* will be inherited by all new transports. >> diff -uprN -X linux-2.6.32.8/Documentation/dontdiff >> linux-2.6.32.8/include/net/sctp/user.h p1/include/net/sctp/user.h >> --- linux-2.6.32.8/include/net/sctp/user.h � �2010-02-09 04:57:19.000000000 -0800 >> +++ p1/include/net/sctp/user.h � � � �2010-05-28 10:52:57.000000000 -0700 >> @@ -171,6 +171,8 @@ struct sctp_initmsg { >> � � � __u16 sinit_max_init_timeo; >> �}; >> >> +#define SCTP_SCHED_NAME_MAX �16 >> + >> �/* >> � * 5.2.2 SCTP Header Information Structure (SCTP_SNDRCV) >> � * >> -- >> To unsubscribe from this list: send the line "unsubscribe linux-sctp" in >> the body of a message to majordomo(a)vger.kernel.org >> More majordomo info at �http://vger.kernel.org/majordomo-info.html >> > -- ======================== Yaogong Wang, PhD candidate Department of Computer Science North Carolina State University http://www4.ncsu.edu/~ywang15/ ======================== -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ |