From owner-freebsd-net@freebsd.org Fri Feb 7 21:46:30 2020 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8FB7422EEA3 for ; Fri, 7 Feb 2020 21:46:30 +0000 (UTC) (envelope-from kib@freebsd.org) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48Dplp0wGmz43Y3 for ; Fri, 7 Feb 2020 21:46:29 +0000 (UTC) (envelope-from kib@freebsd.org) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id 017LkGpF015980 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 7 Feb 2020 23:46:19 +0200 (EET) (envelope-from kib@freebsd.org) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 017LkGpF015980 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id 017LkGH8015979; Fri, 7 Feb 2020 23:46:16 +0200 (EET) (envelope-from kib@freebsd.org) X-Authentication-Warning: tom.home: kostik set sender to kib@freebsd.org using -f Date: Fri, 7 Feb 2020 23:46:16 +0200 From: Konstantin Belousov To: Adam Peace Cc: freebsd-net@freebsd.org, freebsd-drivers@mellanox.com Subject: Re: mlx5en - PTYS reg - eth_proto_oper bit 19 not defined Message-ID: <20200207214616.GT4808@kib.kiev.ua> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 48Dplp0wGmz43Y3 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-1.78 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.84)[-0.843,0]; NEURAL_HAM_LONG(-0.94)[-0.938,0]; TAGGED_RCPT(0.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2020 21:46:30 -0000 On Fri, Feb 07, 2020 at 02:15:53PM -0500, Adam Peace wrote: > Hello, > > I'm using the mlx5en driver that's in the FreeBSD 11.3 tree for a Mellanox > ConnectX-4 ethernet card on an Azure VM. > > The problem that I'm seeing is that the value being retrieved from the PTYS > register for eth_proto_oper is 0x80000, which is bit 19 of the field, but a > value for bit 19 is not defined in the mlx5e_link_speed enum. This causes It is 50GBase-KR4 whatever this means. > the driver to not find an entry in the mlx5e_mode_table and the > media.subtype and media.baudrate are not set. This does not stop the > mlx5en.ko module from loading, but network connectivity is affected. > > It seems that this enum is phased out in the upstream Linux driver, but > it's not clear to me how the replacement method works. Is this a known > issue? It seems that FreeBSD 12.1 and master still use the method that's > used in 11.3. Does anyone have any insight on this? The problem seems to be that net/if_media.h does not pre-define this mode. It is somewhat larger patch than just adding the entry in the table in the driver.