Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1303345pxu; Sat, 5 Dec 2020 10:47:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJxhlIiavsx2tfm1Lg7AEuL9qc20c3IxGaHE86ReJQZDKcmwAWpqdGwn8c4vq7BkkmSVNNff X-Received: by 2002:a17:906:1c8e:: with SMTP id g14mr12501033ejh.5.1607194055764; Sat, 05 Dec 2020 10:47:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607194055; cv=none; d=google.com; s=arc-20160816; b=HiX1sc9ak0IoWASlol/eC0JlYI/0cuhRbHT1g2xIPMXjz8WDlKjRoGUc0vfbApXl4S uuMp5Eih50HHzommB1awbdPTlDgVXhXSivJEZ+BKT+xxcfp1NtcYx7bgDcBJrWvN1YHO +BcV9c2It0ZoVdbjRvCtUUIWnFubvimD20M99tQ7wMrMqN5OEzo4v98oAVKIA/lpWZpE 9RA/oLjJgaI1l3afDdbwf2wuEcYMw7LJI3QO/DNGJ+YZ+dLD9puFxezUbwXbK2nu7kCY CHp+QfsLAl/+Q7jNJkFGq6AnpAWtBIdwbBnMMHHQlqHEMPxirW+WS3ueYcU16tyHi7Xg IFkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=YrtBHn1LjYKXSExOc2Ie11/hAw2WMlJB5mkp17GAe1M=; b=nkJlwH21Fr3n2C+D7J88cOz8+vdoj8nBNNrawb6miqsDgyNoi/MafmmsXWLf+yx2B1 eERSU5virRdlBiWNBg3NeRxOQ8u+gg7Y9oeeBEejo/AmsjwkkWaeV6paNQynNza7fFtr HD2u8FXAq6n3q2EX5aE4dJmYpXYh7pVxl++yI8Md801aSByk9pE3j2OHdrjYbjRj+3eW dblOwPLlfNki/EJ4dU7Kidg+jlvEZPVekbi8DXbi4rQddJ5pjWLzaan3JSNbF/1uwhtH fEnXHYO1c/XI2mLKOQJv6/bjYc2T8GUEdZTlvYDoWoKFihSltiZOtoMjvNsQPZLMruvM EYYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fjlMEOxP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v19si476572eds.239.2020.12.05.10.47.13; Sat, 05 Dec 2020 10:47:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fjlMEOxP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726485AbgLESpe (ORCPT + 99 others); Sat, 5 Dec 2020 13:45:34 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:35120 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726798AbgLEQrp (ORCPT ); Sat, 5 Dec 2020 11:47:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1607186761; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=YrtBHn1LjYKXSExOc2Ie11/hAw2WMlJB5mkp17GAe1M=; b=fjlMEOxPJKtcAwhIcz/MYmpdqRK6AhjCP9Sm1KB3mIZy9Zi0a4IgQBxsmXnpzoTXqfT39f 5+3g+jqnGTqFhyd7e06WHIHhUhT6aGMLSaQddkqgMT16N11XHr3gg8Q570gyztC7v67H6P SyfaLWJSM8qHUknJoG6lB3TUFIVgb/w= Received: from mail-oi1-f197.google.com (mail-oi1-f197.google.com [209.85.167.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-20-fGG7ktpnNVGORd_fpceiMg-1; Sat, 05 Dec 2020 11:13:55 -0500 X-MC-Unique: fGG7ktpnNVGORd_fpceiMg-1 Received: by mail-oi1-f197.google.com with SMTP id x4so2368888oia.8 for ; Sat, 05 Dec 2020 08:13:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=YrtBHn1LjYKXSExOc2Ie11/hAw2WMlJB5mkp17GAe1M=; b=RX/KHCa/1u2J+Ua43jNuV0G3PhFSZg1s2DetT5ZayDpLH7kI3FiyhC+sgUVByQfAfw mqvYBmnqs+nB8ybNqO8RBM5IVYSM+hy9Lw1xhFDi+PR+DeabsrDZmUUWgPTc9+Ugwo8v 4XsFit8zqNdnoaFWmbzF7jO0r4EelBTp15dLysw3EkoIqDUCyRvtYuBk/+KN3ptkCKdY e8PM8lgybA2x0GdZiR6wY/NXc0tYom5Ub0C2Hx9frs7/ylOKdlyE9Uq7RBSG53NPURPN wgzpM3DiakXyyT02RTwNpsw8/XyAVdiRK4nt8EZuuIYguD69Pk5Dm90F9uKoqtumS9Yf XpAA== X-Gm-Message-State: AOAM532bPQYCBszh8uM8LUuJuqoEfsllLWIeqBijTI/VYgFAAm3antUB 1hMyaKx0lSWZMaqCk1foWFLWbvKZCjFSQmljqIG4KRp8B6jHLQ7Q0QUCV3DPlC1cuneJYnP8pNI BtVmYud3nAmO/aalbmjhXGv+BqQPnKqDVgkQQUAB0 X-Received: by 2002:a9d:4788:: with SMTP id b8mr7438690otf.172.1607184834912; Sat, 05 Dec 2020 08:13:54 -0800 (PST) X-Received: by 2002:a9d:4788:: with SMTP id b8mr7438669otf.172.1607184834697; Sat, 05 Dec 2020 08:13:54 -0800 (PST) MIME-Version: 1.0 References: <20201202173053.13800-1-jarod@redhat.com> <20201203004357.3125-1-jarod@redhat.com> <20201203084525.7f1a8e93@kicinski-fedora-pc1c0hjn.DHCP.thefacebook.com> In-Reply-To: <20201203084525.7f1a8e93@kicinski-fedora-pc1c0hjn.DHCP.thefacebook.com> From: Jarod Wilson Date: Sat, 5 Dec 2020 11:13:45 -0500 Message-ID: Subject: Re: [PATCH net v3] bonding: fix feature flag setting at init time To: Jakub Kicinski Cc: LKML , Ivan Vecera , Jay Vosburgh , Veaceslav Falico , Andy Gospodarek , "David S. Miller" , Thomas Davis , Netdev Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 3, 2020 at 11:45 AM Jakub Kicinski wrote: ... > nit: let's narrow down the ifdef-enery > > no need for the ifdef here, if the helper looks like this: > > +static void bond_set_xfrm_features(struct net_device *bond_dev, u64 mode) > +{ > +#ifdef CONFIG_XFRM_OFFLOAD > + if (mode == BOND_MODE_ACTIVEBACKUP) > + bond_dev->wanted_features |= BOND_XFRM_FEATURES; > + else > + bond_dev->wanted_features &= ~BOND_XFRM_FEATURES; > + > + netdev_update_features(bond_dev); > +#endif /* CONFIG_XFRM_OFFLOAD */ > +} > > Even better: > > +static void bond_set_xfrm_features(struct net_device *bond_dev, u64 mode) > +{ > + if (!IS_ENABLED(CONFIG_XFRM_OFFLOAD)) > + return; > + > + if (mode == BOND_MODE_ACTIVEBACKUP) > + bond_dev->wanted_features |= BOND_XFRM_FEATURES; > + else > + bond_dev->wanted_features &= ~BOND_XFRM_FEATURES; > + > + netdev_update_features(bond_dev); > +} > > (Assuming BOND_XFRM_FEATURES doesn't itself hide under an ifdef.) It is, but doesn't need to be. I can mix these changes in as well. -- Jarod Wilson jarod@redhat.com