netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@redhat.com>
To: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Cc: dccp@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH 2/8] [TFRC]: Put RX/TX initialisation into tfrc.c
Date: Sat, 8 Dec 2007 15:13:17 -0200	[thread overview]
Message-ID: <20071208171317.GC3180@ghostprotocols.net> (raw)
In-Reply-To: <11971083881667-git-send-email-gerrit@erg.abdn.ac.uk>

Em Sat, Dec 08, 2007 at 10:06:22AM +0000, Gerrit Renker escreveu:
> This separates RX/TX initialisation and puts all packet history / loss intervals
> initialisation into tfrc.c.
> The organisation is uniform: slab declaration -> {rx,tx}_init() -> {rx,tx}_exit()

NAK, you can't call a __exit marked routine from a __init marked
routine.

- Arnaldo
 
> Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
> ---
>  net/dccp/ccids/lib/packet_history.c |   68 ++++++++++++++++------------------
>  net/dccp/ccids/lib/tfrc.c           |   31 ++++++++++++----
>  2 files changed, 55 insertions(+), 44 deletions(-)
> 
> diff --git a/net/dccp/ccids/lib/packet_history.c b/net/dccp/ccids/lib/packet_history.c
> index 54cd23e..af0db71 100644
> --- a/net/dccp/ccids/lib/packet_history.c
> +++ b/net/dccp/ccids/lib/packet_history.c
> @@ -57,6 +57,22 @@ struct tfrc_tx_hist_entry {
>   */

<SNIP>

> +
> +void __exit tfrc_tx_packet_history_exit(void)
> +{
> +	if (tfrc_tx_hist_slab != NULL) {
> +		kmem_cache_destroy(tfrc_tx_hist_slab);
> +		tfrc_tx_hist_slab = NULL;
> +	}
> +}
> +

<SNIP>

> diff --git a/net/dccp/ccids/lib/tfrc.c b/net/dccp/ccids/lib/tfrc.c
> index 3a7a183..20763fa 100644
> --- a/net/dccp/ccids/lib/tfrc.c
> +++ b/net/dccp/ccids/lib/tfrc.c
> @@ -14,27 +14,42 @@ module_param(tfrc_debug, bool, 0444);
>  MODULE_PARM_DESC(tfrc_debug, "Enable debug messages");
>  #endif
>  
> +extern int  tfrc_tx_packet_history_init(void);
> +extern void tfrc_tx_packet_history_exit(void);
> +extern int  tfrc_rx_packet_history_init(void);
> +extern void tfrc_rx_packet_history_exit(void);
> +
>  extern int  dccp_li_init(void);
>  extern void dccp_li_exit(void);
> -extern int packet_history_init(void);
> -extern void packet_history_exit(void);
>  
>  static int __init tfrc_module_init(void)
>  {
>  	int rc = dccp_li_init();
>  
> -	if (rc == 0) {
> -		rc = packet_history_init();
> -		if (rc != 0)
> -			dccp_li_exit();
> -	}
> +	if (rc)
> +		goto out;
> +
> +	rc = tfrc_tx_packet_history_init();
> +	if (rc)
> +		goto out_free_loss_intervals;
>  
> +	rc = tfrc_rx_packet_history_init();
> +	if (rc)
> +		goto out_free_tx_history;
> +	return 0;
> +
> +out_free_tx_history:
> +	tfrc_tx_packet_history_exit();
> +out_free_loss_intervals:
> +	dccp_li_exit();
> +out:
>  	return rc;
>  }

<SNIP>

  parent reply	other threads:[~2007-12-08 17:13 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-08 10:06 [PATCH 0/8] [DCCP]: Updates and fixes to ensure code works with recent changes Gerrit Renker
2007-12-08 10:06 ` [PATCH 1/8] [TFRC]: Whitespace cleanups Gerrit Renker
2007-12-08 10:06   ` [PATCH 2/8] [TFRC]: Put RX/TX initialisation into tfrc.c Gerrit Renker
2007-12-08 10:06     ` [PATCH 3/8] [TFRC/CCID3]: Remove now unused functions / function calls Gerrit Renker
2007-12-08 10:06       ` [PATCH 4/8] [TFRC]: Need separate entry_from_skb routine Gerrit Renker
2007-12-08 10:06         ` [PATCH 5/8] [TFRC]: Loss interval code needs the macros/inlines that were moved Gerrit Renker
2007-12-08 10:06           ` [PATCH 6/8] [PATCH v2] [TFRC]: Ringbuffer to track loss interval history Gerrit Renker
2007-12-08 10:06             ` [PATCH 7/8] [TFRC]: CCID3 (and CCID4) needs to access these inlines Gerrit Renker
2007-12-08 10:06               ` [PATCH 8/8] [PATCH v2] [CCID3]: Interface CCID3 code with newer Loss Intervals Database Gerrit Renker
2007-12-10 21:04                 ` Arnaldo Carvalho de Melo
2007-12-11  9:42                   ` Gerrit Renker
2007-12-11 17:22                     ` Arnaldo Carvalho de Melo
2007-12-12 16:56                       ` Gerrit Renker
2007-12-12 17:05                         ` Arnaldo Carvalho de Melo
2007-12-12 17:21                           ` Gerrit Renker
2007-12-08 18:47           ` [PATCH 5/8] [TFRC]: Loss interval code needs the macros/inlines that were moved Arnaldo Carvalho de Melo
2007-12-10 11:31             ` Gerrit Renker
2007-12-10 11:48               ` Arnaldo Carvalho de Melo
2007-12-08 17:16       ` [PATCH 3/8] [TFRC/CCID3]: Remove now unused functions / function calls Arnaldo Carvalho de Melo
2007-12-08 17:13     ` Arnaldo Carvalho de Melo [this message]
2007-12-10 10:56       ` [PATCH 2/8] [TFRC]: Put RX/TX initialisation into tfrc.c Gerrit Renker
2007-12-08 17:08   ` [PATCH 1/8] [TFRC]: Whitespace cleanups Arnaldo Carvalho de Melo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071208171317.GC3180@ghostprotocols.net \
    --to=acme@redhat.com \
    --cc=dccp@vger.kernel.org \
    --cc=gerrit@erg.abdn.ac.uk \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).