From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hangbin Liu Subject: Re: [PATCH net] ipvlan: call dev_change_flags when reset ipvlan mode Date: Wed, 20 Jun 2018 11:22:54 +0800 Message-ID: <20180620032254.GW8958@leo.usersys.redhat.com> References: <1529330677-15328-1-git-send-email-liuhangbin@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Linux Kernel Network Developers , Stefano Brivio , Paolo Abeni , David Miller , Mahesh Bandewar To: Cong Wang Return-path: Received: from mail-pg0-f65.google.com ([74.125.83.65]:45740 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753906AbeFTDXG (ORCPT ); Tue, 19 Jun 2018 23:23:06 -0400 Received: by mail-pg0-f65.google.com with SMTP id z1-v6so786911pgv.12 for ; Tue, 19 Jun 2018 20:23:06 -0700 (PDT) Content-Disposition: inline In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: On Tue, Jun 19, 2018 at 02:10:18PM -0700, Cong Wang wrote: > On Mon, Jun 18, 2018 at 7:04 AM, Hangbin Liu wrote: > > @@ -94,10 +95,13 @@ static int ipvlan_set_port_mode(struct ipvl_port *port, u16 nval) > > mdev->l3mdev_ops = NULL; > > } > > list_for_each_entry(ipvlan, &port->ipvlans, pnode) { > > + flags = ipvlan->dev->flags; > > if (nval == IPVLAN_MODE_L3 || nval == IPVLAN_MODE_L3S) > > - ipvlan->dev->flags |= IFF_NOARP; > > + dev_change_flags(ipvlan->dev, > > + flags | IFF_NOARP); > > else > > - ipvlan->dev->flags &= ~IFF_NOARP; > > + dev_change_flags(ipvlan->dev, > > + flags & ~IFF_NOARP); > > You need to check the return value of dev_change_flags(). Hi Wang Cong, The only case dev_change_flags() return an err is when we change IFF_UP flag. Since we only set/reset IFF_NOARP, do you think we still need to check the return value? Thanks Hangbin