All of lore.kernel.org
 help / color / mirror / Atom feed
From: Taehee Yoo <ap420073@gmail.com>
To: David Ahern <dsahern@gmail.com>,
	davem@davemloft.net, kuba@kernel.org, dsahern@kernel.org,
	netdev@vger.kernel.org
Cc: dkirjanov@suse.de
Subject: Re: [PATCH net-next 3/4 v4] amt: add multicast(IGMP) report message handler
Date: Thu, 28 Oct 2021 01:17:32 +0900	[thread overview]
Message-ID: <9762b3a4-6d72-e5ce-e2bd-aa5deedfc686@gmail.com> (raw)
In-Reply-To: <f9f4dbfa-81aa-f88f-3e06-bd29acc25b19@gmail.com>

Hi David,
Thank you for your review!

On 10/28/21 12:08 AM, David Ahern wrote:
 > On 10/26/21 9:10 AM, Taehee Yoo wrote:
 >> +static bool amt_status_filter(struct amt_source_node *snode,
 >> +			      enum amt_filter filter)
 >> +{
 >
 > How about:
 > 	bool rc = false;
 >
 > and then
 >
 >> +	switch (filter) {
 >> +	case AMT_FILTER_FWD:
 >> +		if (snode->status == AMT_SOURCE_STATUS_FWD &&
 >> +		    snode->flags == AMT_SOURCE_OLD)
 >> +			rc = true;
 >> +		break;
 > similar change for the rest of the cases.
 >

Thanks, I will use it.

 >> +	case AMT_FILTER_D_FWD:
 >> +		if (snode->status == AMT_SOURCE_STATUS_D_FWD &&
 >> +		    snode->flags == AMT_SOURCE_OLD)
 >> +			return true;
 >> +		else
 >> +			return false;
 >> +	case AMT_FILTER_FWD_NEW:
 >> +		if (snode->status == AMT_SOURCE_STATUS_FWD &&
 >> +		    snode->flags == AMT_SOURCE_NEW)
 >> +			return true;
 >> +		else
 >> +			return false;
 >> +	case AMT_FILTER_D_FWD_NEW:
 >> +		if (snode->status == AMT_SOURCE_STATUS_D_FWD &&
 >> +		    snode->flags == AMT_SOURCE_NEW)
 >> +			return true;
 >> +		else
 >> +			return false;
 >> +	case AMT_FILTER_ALL:
 >> +		return true;
 >> +	case AMT_FILTER_NONE_NEW:
 >> +		if (snode->status == AMT_SOURCE_STATUS_NONE &&
 >> +		    snode->flags == AMT_SOURCE_NEW)
 >> +			return true;
 >> +		else
 >> +			return false;
 >> +	case AMT_FILTER_BOTH:
 >> +		if ((snode->status == AMT_SOURCE_STATUS_D_FWD ||
 >> +		     snode->status == AMT_SOURCE_STATUS_FWD) &&
 >> +		    snode->flags == AMT_SOURCE_OLD)
 >> +			return true;
 >> +		else
 >> +			return false;
 >> +	case AMT_FILTER_BOTH_NEW:
 >> +		if ((snode->status == AMT_SOURCE_STATUS_D_FWD ||
 >> +		     snode->status == AMT_SOURCE_STATUS_FWD) &&
 >> +		    snode->flags == AMT_SOURCE_NEW)
 >> +			return true;
 >> +		else
 >> +			return false;
 >> +	default:
 >> +		return false;
 >> +	}
 >> +
 >> +	return false;
 >> +}
 >> +
 >
 >
 >> +
 >> +/* If a source timer expires with a router filter-mode for the group of
 >> + * INCLUDE, the router concludes that traffic from this particular
 >> + * source is no longer desired on the attached network, and deletes the
 >> + * associated source record.
 >> + */
 >> +static void amt_source_work(struct work_struct *work)
 >> +{
 >> +	struct amt_source_node *snode = container_of(to_delayed_work(work),
 >> +						     struct amt_source_node,
 >> +						     source_timer);
 >> +	struct amt_group_node *gnode = snode->gnode;
 >> +	struct amt_dev *amt = gnode->amt;
 >> +	struct amt_tunnel_list *tunnel;
 >> +
 >> +	tunnel = gnode->tunnel_list;
 >> +	spin_lock_bh(&tunnel->lock);
 >> +	rcu_read_lock();
 >> +	if (gnode->filter_mode == MCAST_INCLUDE) {
 >> +		amt_destroy_source(snode);
 >> +		if (!gnode->nr_sources)
 >> +			amt_del_group(amt, gnode);
 >> +	} else {
 >> +/* When a router filter-mode for a group is EXCLUDE, source records are
 >> + * only deleted when the group timer expires
 >> + */
 >
 > comment needs to be indented.
 >

Okay, I will fix it.

 >> +		snode->status = AMT_SOURCE_STATUS_D_FWD;
 >> +	}
 >> +	rcu_read_unlock();
 >> +	spin_unlock_bh(&tunnel->lock);
 >> +}
 >> +
 >
 >

Thanks a lot for your reviews.
I will fix these things and send v2 patch.

Thanks,
Taehee

  reply	other threads:[~2021-10-27 16:17 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-26 15:10 [PATCH net-next 0/4 v4] amt: add initial driver for Automatic Multicast Tunneling (AMT) Taehee Yoo
2021-10-26 15:10 ` [PATCH net-next 1/4 v4] amt: add control plane of amt interface Taehee Yoo
2021-10-27 14:37   ` David Ahern
2021-10-27 15:38     ` Taehee Yoo
2021-10-28 13:57   ` Denis Kirjanov
2021-10-28 15:03     ` Taehee Yoo
2021-10-26 15:10 ` [PATCH net-next 2/4 v4] amt: add data " Taehee Yoo
2021-10-27 15:00   ` David Ahern
2021-10-27 16:12     ` Taehee Yoo
2021-10-26 15:10 ` [PATCH net-next 3/4 v4] amt: add multicast(IGMP) report message handler Taehee Yoo
2021-10-27 15:08   ` David Ahern
2021-10-27 16:17     ` Taehee Yoo [this message]
2021-10-26 15:10 ` [PATCH net-next 4/4 v4] amt: add mld " Taehee Yoo

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=9762b3a4-6d72-e5ce-e2bd-aa5deedfc686@gmail.com \
    --to=ap420073@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dkirjanov@suse.de \
    --cc=dsahern@gmail.com \
    --cc=dsahern@kernel.org \
    --cc=kuba@kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.