Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp2689218rwj; Mon, 19 Dec 2022 07:42:54 -0800 (PST) X-Google-Smtp-Source: AMrXdXsTVNT+tSpuu+q+SR+ZlBYv4sInwjKeKNU82AQ3kg5gfJy75aHk+qDcBBi6ZlR/IePmca2D X-Received: by 2002:a17:902:ea02:b0:187:2f28:bfd6 with SMTP id s2-20020a170902ea0200b001872f28bfd6mr11537380plg.21.1671464574166; Mon, 19 Dec 2022 07:42:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671464574; cv=none; d=google.com; s=arc-20160816; b=RA9CDBg6K7lpGfJ30v4EW8SF7QNrk4optriOoo/8gGkJDYHR7vNJMALYRzuxknLu1X SX8HWbL5LNz7FuXoaZiM7BCf2hICcxzfat7fwkedUUXF9+lG0RSFODIXyZB7CY7dNUvO C0A4BF5h+avwklGWpS4GbAiR8CRFSD+S3Nx+RNBFKCfhTQXEULspmx9NrCPu03G3a7fQ HQApHeL+k8+KhT3h9HjVjvMhrS/Tgpq7Uffh42b7R4CEo9PA6rjd1KB+FGmnV7tXEVxB dV/M6ValrYUq2vg+w1VD8NeMH3uoFdOBDXDs15tliHrFFCmEk+I/rjh3XIXta3x84AfZ G5Hw== 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=AW2GlRcYIzwFd0FF5U4Py3ypyOgrWMB/b3sWQqDwzG8=; b=IeTKChO9WTcUvcXDYHl8pCmp+EMNcnxApDEJ00Zhl5MsQFmufHbSmgeGpDlQj9JeQh eNaug6xW2/NkpnmOzg3d0ZucSJA5lmj03a1zwmM589RmEGU4xmKr+3qrRpz5piW1LE51 xUVc1iHAnrTeuBpJ4fVMQWAY+ZckJdigO28NwgVHZwGzDmeQs/9TDqsds3uP47LzMNPH AnmvJvtfg0T3zFoRyjgrm6LC3sVzp/wZqASMOW9LR49LHamXeAOwZtd5SbYu8LWrbCHb bmrxlBQ48Hx5PT5Sc6Cwkx34ABvxm0xlcUxUoweylsrKTRbZVHnFbFBBzT7G6IRbc6R7 7nYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=C7pQxfo9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q1-20020a63e201000000b0046af0960898si10755610pgh.625.2022.12.19.07.42.44; Mon, 19 Dec 2022 07:42:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=C7pQxfo9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232319AbiLSPbD (ORCPT + 71 others); Mon, 19 Dec 2022 10:31:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232289AbiLSPa7 (ORCPT ); Mon, 19 Dec 2022 10:30:59 -0500 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DEF5921BA; Mon, 19 Dec 2022 07:30:57 -0800 (PST) Received: by mail-pf1-x429.google.com with SMTP id d82so6473994pfd.11; Mon, 19 Dec 2022 07:30:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=AW2GlRcYIzwFd0FF5U4Py3ypyOgrWMB/b3sWQqDwzG8=; b=C7pQxfo9/JZ/CYjpCF6+ETurYI6L+Jn7sIh9/EKWflNzhjvszs/BUz1hmm1PLN7aNK LPFj4ICbKQ5ZhVNMo5d6Rqft8nBe43lx4EwCQmLci9Llcu55OaZF037OaYo3BW/nPVjm dw346t7+eGUATbbRuwfi+Qef0i8M6yASSQahSJZN5zn/h2f0/UaJVvPvaGk5Hp86RoGm o9QEScnwDjiRmRL4d4l7fzJUrHE/xW5VlZfuKAX+Jy1egDJIsOLvRhi3cFPDYzV8Ph65 r0AbWeevNMud9q7wqBxCZRFOswK50yHwOoVRleSawOKAkaRvTZCg0YMqKbkmRzaUZq3n 72Mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=AW2GlRcYIzwFd0FF5U4Py3ypyOgrWMB/b3sWQqDwzG8=; b=CgmPUmZoxG87F8gjJyNB9ZpUjdIGk9zHOVNh8elkU/uHU0gcyaLulM1h4n1P5tVOt8 UauxYoRDWyrznvfySFJxqoSQlc5TD5G5RhzUQPeNkEA2GR09r5euXiK56Y64hg/g7PcR PffvIjYhN9h+Xpw4Ed8h0j3RhbSA07ve1q6FUh78+95LTO5dc7Ejh5W7VvGGfi3/gRu7 z6kai6muJibMrC5mUef2IKUF8UWkVMYgSa/LEQ+e47fgbCoSYzFTQMO0yYJ8kV8LtAtn h3+f+pANr28MBUlKGkzM3mvN5fPNn2+bwmHU72WuCt/ZzQdWTtODZrM6p9h+x91Fp1KP BTIw== X-Gm-Message-State: ANoB5plt91RFemucJPaBRkvw+ZfJA6sHtfx5GLOKapBRagocxDL1Fh2E gG0i9KP0oGqYLV0+bf5im9m+s9MqmTuiVbDmqP0= X-Received: by 2002:a05:6a00:d01:b0:577:ab75:cec9 with SMTP id k1-20020a056a000d0100b00577ab75cec9mr5476941pfv.44.1671463857255; Mon, 19 Dec 2022 07:30:57 -0800 (PST) MIME-Version: 1.0 References: <20221213074726.51756-1-lianglixuehao@126.com> <20221214085106.42a88df1@kernel.org> <20221214125016.5a23c32a@kernel.org> In-Reply-To: From: Alexander Duyck Date: Mon, 19 Dec 2022 07:30:45 -0800 Message-ID: Subject: Re: [PATCH v7] igb: Assign random MAC address instead of fail in case of invalid one To: Leon Romanovsky Cc: Jakub Kicinski , Lixue Liang , anthony.l.nguyen@intel.com, linux-kernel@vger.kernel.org, jesse.brandeburg@intel.com, davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, netdev@vger.kernel.org, lianglixue@greatwall.com.cn Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Dec 18, 2022 at 12:41 AM Leon Romanovsky wrote: > > On Wed, Dec 14, 2022 at 12:50:16PM -0800, Jakub Kicinski wrote: > > On Wed, 14 Dec 2022 20:53:30 +0200 Leon Romanovsky wrote: > > > On Wed, Dec 14, 2022 at 08:51:06AM -0800, Jakub Kicinski wrote: > > > > On Wed, 14 Dec 2022 09:22:13 +0200 Leon Romanovsky wrote: > > > > > NAK to any module driver parameter. If it is applicable to all drivers, > > > > > please find a way to configure it to more user-friendly. If it is not, > > > > > try to do the same as other drivers do. > > > > > > > > I think this one may be fine. Configuration which has to be set before > > > > device probing can't really be per-device. > > > > > > This configuration can be different between multiple devices > > > which use same igb module. Module parameters doesn't allow such > > > separation. > > > > Configuration of the device, sure, but this module param is more of > > a system policy. > > And system policy should be controlled by userspace and applicable to as > much as possible NICs, without custom module parameters. > > I would imagine global (at the beginning, till someone comes forward and > requests this parameter be per-device) to whole stack parameter with policies: > * Be strict - fail if mac is not valid > * Fallback to random > * Random only ??? > > Thanks So are you suggesting you would rather see something like this as a sysctl then? Maybe something like net.core.netdev_mac_behavior where we have some enum with a predetermined set of behaviors available? I would be fine with us making this a global policy if that is the route we want to go. It would just be a matter of adding the sysctl and an accessor so that drivers can determine if it is set or not.