From patchwork Fri Mar 26 20:22:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 410524 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=-19.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 BFA63C433E0 for ; Fri, 26 Mar 2021 20:23:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9B11F619DC for ; Fri, 26 Mar 2021 20:23:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230114AbhCZUXC (ORCPT ); Fri, 26 Mar 2021 16:23:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:41212 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230134AbhCZUW2 (ORCPT ); Fri, 26 Mar 2021 16:22:28 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 32C0161A02; Fri, 26 Mar 2021 20:22:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616790148; bh=ddnL4s7v9wNRvgNJHmRcz23Wtlt0n1J4XmQZLmnpSQk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hvYDKBNU001fcZ6NlR2FFTlvQzQ/Tp9qlULbX5BhidZYvLG9JoxryZlYKN8EoTLcA Xx4EAjN8ihiEzTv5Gz6e+dAVK4icgGdU5Mv9UiJ/Fbz+N1D9Sx2J5Ib7DUx2t0Id+H ZC6w0+1LK4FhET5/1VXMcqdUlSWipWtiFoh86CzJpl/H43y4KHK1cfl5ouWyo00FrQ RiTIxDrLydB4bXPWEp/raTg0CAvUywU5NfBQMlKuLPOdVl6ViAAGmuqxZFHfbf0HA5 P+x5ifTR8V/XVyrL0zBADCUFsbPmr9lt7eDXNLB5QyqY6GgDLU7wWkPEvLoeo15ctK xmTlM66fOljmg== From: Jakub Kicinski To: davem@davemloft.net Cc: netdev@vger.kernel.org, andrew@lunn.ch, mkubecek@suse.cz, Jakub Kicinski Subject: [PATCH net-next 1/3] ethtool: fec: add note about reuse of reserved Date: Fri, 26 Mar 2021 13:22:21 -0700 Message-Id: <20210326202223.302085-2-kuba@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210326202223.302085-1-kuba@kernel.org> References: <20210326202223.302085-1-kuba@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org struct ethtool_fecparam::reserved can't be used in SET, because ethtool user space doesn't zero-initialize the structure. Make this clear. Suggested-by: Andrew Lunn Signed-off-by: Jakub Kicinski --- include/uapi/linux/ethtool.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h index f6ef7d42c7a1..9a47c3efd8ca 100644 --- a/include/uapi/linux/ethtool.h +++ b/include/uapi/linux/ethtool.h @@ -1382,6 +1382,10 @@ struct ethtool_per_queue_op { * @fec: Bitmask of configured FEC modes. * @reserved: Reserved for future extensions, ignore on GET, write 0 for SET. * + * Note that @reserved was never validated on input and ethtool user space + * left it uninitialized when calling SET. Hence going forward it can only be + * used to return a value to userspace with GET. + * * FEC modes supported by the device can be read via %ETHTOOL_GLINKSETTINGS. * FEC settings are configured by link autonegotiation whenever it's enabled. * With autoneg on %ETHTOOL_GFECPARAM can be used to read the current mode.