From owner-freebsd-bugs@FreeBSD.ORG Thu Dec 6 01:20:01 2012 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 216B8573 for ; Thu, 6 Dec 2012 01:20:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id E90158FC13 for ; Thu, 6 Dec 2012 01:20:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id qB61K0JB077144 for ; Thu, 6 Dec 2012 01:20:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id qB61K0P1077140; Thu, 6 Dec 2012 01:20:00 GMT (envelope-from gnats) Resent-Date: Thu, 6 Dec 2012 01:20:00 GMT Resent-Message-Id: <201212060120.qB61K0P1077140@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Anthony Cornehl Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 15A1256D for ; Thu, 6 Dec 2012 01:19:38 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id EE0278FC08 for ; Thu, 6 Dec 2012 01:19:37 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.5/8.14.5) with ESMTP id qB61JbN6097985 for ; Thu, 6 Dec 2012 01:19:37 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.5/8.14.5/Submit) id qB61Jbdh097984; Thu, 6 Dec 2012 01:19:37 GMT (envelope-from nobody) Message-Id: <201212060119.qB61Jbdh097984@red.freebsd.org> Date: Thu, 6 Dec 2012 01:19:37 GMT From: Anthony Cornehl To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: misc/174213: OFED sysfs/sysctl compat does not handle show/set attribute functions X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Dec 2012 01:20:01 -0000 >Number: 174213 >Category: misc >Synopsis: OFED sysfs/sysctl compat does not handle show/set attribute functions >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Dec 06 01:20:00 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Anthony Cornehl >Release: 9.1-RC2 >Organization: EMC Isilon >Environment: FreeBSD Waltraute 9.1-RC2 FreeBSD 9.1-RC2 #2: Wed Dec 5 21:38:19 PST 2012 root@Waltraute:/usr/obj/usr/src/sys/KERN_IB amd64 >Description: Thread is here: http://lists.freebsd.org/pipermail/freebsd-infiniband/2012-November/000002.html Mellanox Connect-X VPI cards allow the QSFP ports to be used for InfiniBand or Ethernet communication, by setting the port mode in sysfs/sysctl. But it appears that a sysfs/sysctl abstraction didn't get carried over all the for FreeBSD... --- # sysctl sys.device.mlx4_core0.mlx4_port1 sys.device.mlx4_core0.mlx4_port1: ib # sysctl sys.device.mlx4_core0.mlx4_port1=ib sys.device.mlx4_core0.mlx4_port1: ib sysctl: sys.device.mlx4_core0.mlx4_port1: Invalid argument --- The problem is that sysfs allows our MLX4 code to use two functions in an attribute structure, .store and .show. The compat header for sysfs in `sys/ofed/include/linux/sysfs.h` is doing something wrong and never calls the .store function in `sys/ofed/drivers/net/mlx4/main.c` for this sysctl. It looks like sysctl_handle_attr() should be handling this, but I'm not sure how. Yet. >How-To-Repeat: # pciconf -lv | grep -C2 'ConnectX VPI' # kldload mlx4 # sysctl sys.device.mlx4_core0.mlx4_port1=eth The value from `sysctl sys.device.mlx4_core0.mlx4_port1` should be "eth". >Fix: >Release-Note: >Audit-Trail: >Unformatted: