From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5FD78C43331 for ; Fri, 6 Sep 2019 06:05:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 38AFD206BB for ; Fri, 6 Sep 2019 06:05:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=resnulli-us.20150623.gappssmtp.com header.i=@resnulli-us.20150623.gappssmtp.com header.b="YoHI0sEB" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389092AbfIFGFs (ORCPT ); Fri, 6 Sep 2019 02:05:48 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:37294 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729318AbfIFGFr (ORCPT ); Fri, 6 Sep 2019 02:05:47 -0400 Received: by mail-wm1-f66.google.com with SMTP id r195so5595861wme.2 for ; Thu, 05 Sep 2019 23:05:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=u3xop73voN5t+H1zOjf4whXixLu0Xg3mQaakczC8GoE=; b=YoHI0sEBKh/IqHcUUQzXa8LStgtc1MpJSwovg5TO6ccdClihlMUSGpZTMzlUx3tw2W ik7AnbmKhPakyF2eVh/cViJhehY08aSDH5JUzgnqrC99TuVGver57ExGcefbr5PnP40V jhZqHCGTo1k9+0yZ6Mgn7y68D6p4vUuaop3TIninNrgNDdSIkupnygC7wOu9RrGVltVp BmtYW6yRhgRO8iWUCWtZCmtA/vpKlWOQmkFoPt+U/VFbndw9ZgBoMGvNHcWJvxg8YhH8 nXV7nTExacJ8hMex3gZ88LRtLLPmK88aZ01jT1m9rZOLh+Zb3PGpJflkUcjJRuqcJn6P faTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=u3xop73voN5t+H1zOjf4whXixLu0Xg3mQaakczC8GoE=; b=b1K7rTQy/GdMclOwbCG0YkAJ8loB0oNhOUJRkMOIkOUjxqXyNcVtsGqo9igHANm3oL hZYBA5Cxe1NUc5zrpwPFh60TseArZKLH4SwDMKhsqXUOEZ6xZjRXb5PRGmRABMXckLgF mvubAFrKr+S26+s9PznXzofdvcMXrE/UbsxCV0YLZtNf4uwNgXR+nEqMuLOXKk7kcKT9 eh5YQ4pvNKzueiOt99wsnD8R+ycf3lzNWQ7l7Lw8F3zT/wBI0S9EwjmLUdlp2noi49cr 274bfrmfdPxUSphnzM1tqbw7yRpxWXXiEKzpeftl6lb+6+trPwMuF+0T4Nnv68EhXD/2 xoYg== X-Gm-Message-State: APjAAAUZzvtasl0f8ggbOiDPUFVBu3FZjmpRZK+dgQ/Vel2t6omvZk9n bzSFqXosVtE8wWYHH35YuFwIJA== X-Google-Smtp-Source: APXvYqyeD592Tdecw+ops8SFwuo4jwPtVf6gbbWCxhmfMHWYcEzsBQTSsXFK0bo2msaHyZMyXbg8Ew== X-Received: by 2002:a1c:f50c:: with SMTP id t12mr5873528wmh.49.1567749945897; Thu, 05 Sep 2019 23:05:45 -0700 (PDT) Received: from localhost (jirka.pirko.cz. [84.16.102.26]) by smtp.gmail.com with ESMTPSA id b194sm9181776wmg.46.2019.09.05.23.05.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2019 23:05:45 -0700 (PDT) Date: Fri, 6 Sep 2019 08:05:44 +0200 From: Jiri Pirko To: Eric Dumazet Cc: netdev@vger.kernel.org, davem@davemloft.net, idosch@mellanox.com, dsahern@gmail.com, mlxsw@mellanox.com Subject: Re: [patch net-next] net: fib_notifier: move fib_notifier_ops from struct net into per-net struct Message-ID: <20190906060544.GA2264@nanopsycho.orion> References: <20190905180656.4756-1-jiri@resnulli.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Fri, Sep 06, 2019 at 07:54:39AM CEST, eric.dumazet@gmail.com wrote: > > >On 9/5/19 8:06 PM, Jiri Pirko wrote: >> From: Jiri Pirko >> >> No need for fib_notifier_ops to be in struct net. It is used only by >> fib_notifier as a private data. Use net_generic to introduce per-net >> fib_notifier struct and move fib_notifier_ops there. >> >> > >... > >> static struct pernet_operations fib_notifier_net_ops = { >> .init = fib_notifier_net_init, >> .exit = fib_notifier_net_exit, >> + .id = &fib_notifier_net_id, >> + .size = sizeof(struct fib_notifier_net), >> }; >> >> static int __init fib_notifier_init(void) >> > >Note that this will allocate a block of memory (in ops_init()) to hold this, >plus a second one to hold the pointer to this block. > >Due to kmalloc() constraints, this block will use more memory. I'm aware. But we have net_generic for exactly this purpose not to pullute struct net. > >Not sure your patch is a win, since it makes things a bit more complex. > >Is it a preparation patch so that you can add later other fields in struct fib_notifier_net ? Yes. >