netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Pirko <jpirko@redhat.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, eric.dumazet@gmail.com
Subject: Re: [patch net-next 1/5] team: add support for per-port options
Date: Wed, 11 Apr 2012 07:43:51 +0200	[thread overview]
Message-ID: <20120411054023.GA1955@minipsycho> (raw)
In-Reply-To: <20120410.143356.28893999541977853.davem@davemloft.net>

Tue, Apr 10, 2012 at 08:33:56PM CEST, davem@davemloft.net wrote:
>From: Jiri Pirko <jpirko@redhat.com>
>Date: Tue, 10 Apr 2012 17:15:42 +0200
>
>> @@ -81,7 +81,16 @@ EXPORT_SYMBOL(team_port_set_team_mac);
>>   * Options handling
>>   *******************/
>>  
>> -struct team_option *__team_find_option(struct team *team, const char *opt_name)
>> +struct team_option_inst { /* One for each option instance */
>> +	struct list_head list;
>> +	struct team_option *option;
>> +	struct team_port *port; /* != NULL if per-port */
>> +	bool changed;
>> +	bool removed;
>> +};
>> +
>
>All this indirection... just simply embed struct team_option into
>struct team_option_inst instead of using a pointer, and allocate a
>full team_option_inst where you currently memdup in the options.

Well the list of options is needed alone. When port is added/removed, this list
gets iterated over and instances are created/deleted. Therefore I put
pointer to option to option instance struct to save memory (and also to
be nicer)

  reply	other threads:[~2012-04-11  6:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-10 15:15 [patch net-next 0/5] team: add some features and fixes Jiri Pirko
2012-04-10 15:15 ` [patch net-next 1/5] team: add support for per-port options Jiri Pirko
2012-04-10 18:33   ` David Miller
2012-04-11  5:43     ` Jiri Pirko [this message]
2012-04-11 13:58       ` David Miller
2012-04-10 15:15 ` [patch net-next 2/5] team: add bool option type Jiri Pirko
2012-04-10 15:15 ` [patch net-next 3/5] team: add user_linkup and user_linkup_enabled per-port option Jiri Pirko
2012-04-10 15:15 ` [patch net-next 4/5] team: ab: walk through port list non-rcu Jiri Pirko
2012-04-10 15:15 ` [patch net-next 5/5] team: add missed "statics" Jiri Pirko

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=20120411054023.GA1955@minipsycho \
    --to=jpirko@redhat.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --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).