Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Dec 2012 01:19:37 GMT
From:      Anthony Cornehl <accornehl@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   misc/174213: OFED sysfs/sysctl compat does not handle show/set attribute functions
Message-ID:  <201212060119.qB61Jbdh097984@red.freebsd.org>
Resent-Message-ID: <201212060120.qB61K0P1077140@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201212060119.qB61Jbdh097984>