Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3171525pxu; Sat, 10 Oct 2020 23:25:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz5Il/ALGAFBzBAIFnAqMZfRhM4GCioKGJqMf3gR1keu7fn85PprTaAIeZcOzzr81dE/WaX X-Received: by 2002:a17:906:95c5:: with SMTP id n5mr22912269ejy.111.1602397556840; Sat, 10 Oct 2020 23:25:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602397556; cv=none; d=google.com; s=arc-20160816; b=UiLK/Ac7PpQIK3aL5u3ORSOr+MT73DBk97TLLhynaIgNlgN6WCi+6yI619tIt+GgoU 3uR4Pe7bgeEJNsEzsgLUUg06CqrPa6+6M4/Rfi8AApPw34ZSowZsTDGJrKqm9D1jvn3B 6XAEm0bMGwgbfUlQ1ZE7YB2KhazVcpcdgUagYUuBw6bwI5gFilV+UaJZ5eia8tNne+uG TuX/LogafILB7u50aZLAdvgnGatO56ucWPWliSFVwk0otf4EtCcgSqN67pe+ZWlh5Ce0 ay6rtGI883lAMuS/HhU2OgsSdZp8giN0d5F0anszuxuo1Sv6/yopq3+Kl2+vVpTZ3XXF 8UhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=AylKL4rYayGjO7fLdfPIx0Po548Pk98P6Wb1+vOUlVw=; b=enNn8yFqu/iaUwP8XFkUtYog7GSG4/TwscPavE6AnnwrJIGbUEmfXbHlWrVy9SCEJz 5/w6VjxB8NiGDgmcItc30geSqX0Q7ztMsMlkhzc6/MWFjn0PWoNoySbP0rPTxGz6rPGV k5T3qT4cwd1eWSV0gyTdo0SeKM9BsLjXsjWWcJasKrlLpKPE06edWKD01Tj5wRi8V9jB HEvzfVDw3NXamdsTcCK+xSxIUa5xyKcAIPZ5iuiKJjzWfBF/f4Sjt6urqYLy0a7OJUpZ 0huYhM1hjr4EUyr/QtdX3FHNaxpj24HCedjqvMSwuwpyQURfSRavX5IJf/2aNL3BRfeX xUyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="i3/UCdo4"; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id zj19si9668140ejb.605.2020.10.10.23.25.34; Sat, 10 Oct 2020 23:25:56 -0700 (PDT) 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=@kernel.org header.s=default header.b="i3/UCdo4"; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729880AbgJJCBc (ORCPT + 99 others); Fri, 9 Oct 2020 22:01:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:33528 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729817AbgJJBqC (ORCPT ); Fri, 9 Oct 2020 21:46:02 -0400 Received: from kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com (unknown [163.114.132.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DCC8122245; Sat, 10 Oct 2020 01:45:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602294358; bh=iTtWEPs7R3iiq6VK1b1OfrjyVJP0Uism8CyeDJiP+1A=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=i3/UCdo4sP3wFVvX/GsyGPxSv+NwjzRumeuYLzX3/3SJCoMs2bq/S9SartvMqeZoV 1SX+uZiRywSiMnwT0mk9trEnqyUeXfqOr5S87gAFtHsBvy+29SeRG8OiO0D0lwo1cX sHjtwGtujakQCWBgra+Xjitb8AkkTyt2bGyKVatA= Date: Fri, 9 Oct 2020 18:45:56 -0700 From: Jakub Kicinski To: Henrik Bjoernlund Cc: , , , , , , , , , Horatiu Vultur Subject: Re: [PATCH net-next v4 07/10] bridge: cfm: Netlink SET configuration Interface. Message-ID: <20201009184556.6cfe6fbc@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: <20201009143530.2438738-8-henrik.bjoernlund@microchip.com> References: <20201009143530.2438738-1-henrik.bjoernlund@microchip.com> <20201009143530.2438738-8-henrik.bjoernlund@microchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 9 Oct 2020 14:35:27 +0000 Henrik Bjoernlund wrote: > +static inline struct mac_addr nla_get_mac(const struct nlattr *nla) static inlines are generally not needed in C sources and just hide unused code. Please drop the inline annotation. > +{ > + struct mac_addr mac; > + > + nla_memcpy(&mac.addr, nla, sizeof(mac.addr)); > + > + return mac; > +} > + > +static inline struct br_cfm_maid nla_get_maid(const struct nlattr *nla) ditto > +{ > + struct br_cfm_maid maid; > + > + nla_memcpy(&maid.data, nla, sizeof(maid.data)); returning a 48B struct from a helper is a little strange, but I guess it's not too bad when compiler inlines the thing? > + return maid; > +} > + > +static const struct nla_policy > +br_cfm_policy[IFLA_BRIDGE_CFM_MAX + 1] = { > + [IFLA_BRIDGE_CFM_UNSPEC] = { .type = NLA_REJECT }, Not needed, REJECT is treated the same as 0 / uninit, right? > + [IFLA_BRIDGE_CFM_MEP_CREATE] = { .type = NLA_NESTED }, Consider using NLA_POLICY_NESTED() to link up the next layers. > + [IFLA_BRIDGE_CFM_MEP_DELETE] = { .type = NLA_NESTED }, > + [IFLA_BRIDGE_CFM_MEP_CONFIG] = { .type = NLA_NESTED }, > + [IFLA_BRIDGE_CFM_CC_CONFIG] = { .type = NLA_NESTED }, > + [IFLA_BRIDGE_CFM_CC_PEER_MEP_ADD] = { .type = NLA_NESTED }, > + [IFLA_BRIDGE_CFM_CC_PEER_MEP_REMOVE] = { .type = NLA_NESTED }, > + [IFLA_BRIDGE_CFM_CC_RDI] = { .type = NLA_NESTED }, > + [IFLA_BRIDGE_CFM_CC_CCM_TX] = { .type = NLA_NESTED }, > +};