Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Dec 2012 14:06:05 -0800
From:      Garrett Cooper <yanegomi@gmail.com>
To:        Anthony Cornehl <accornehl@gmail.com>
Cc:        freebsd-infiniband@freebsd.org
Subject:   Re: using ConnectX card as Ethernet (mlxen)
Message-ID:  <CAGH67wTr8%2B91-D7y8bJLhZvxNEzmqt1cRzd7HXomDwGTOk=1Dg@mail.gmail.com>
In-Reply-To: <CAAoDvRxj8SvyY1ZMFxT5inS1BLdnZKj07u8Bq%2B%2BArWv7Y5_fwg@mail.gmail.com>
References:  <3A359B33-380C-4230-A62C-623765E9376A@jnielsen.net> <FB2BC2D5-46CC-4CF6-8EC8-5C2836253D14@jnielsen.net> <CAGH67wRDDjkLxJhQwYFnez2bpV6gTDPi2WMC58W6oURDH15WKQ@mail.gmail.com> <53A5EDFD-B2C5-4E24-9AB9-5504AA693602@jnielsen.net> <CAGH67wTVH2TmfDvqy-ZKs6Ge=T-sbARmwJ-Jw2RK8JtWjK=LGg@mail.gmail.com> <CAAoDvRxj8SvyY1ZMFxT5inS1BLdnZKj07u8Bq%2B%2BArWv7Y5_fwg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Dec 6, 2012 at 8:07 PM, Anthony Cornehl <accornehl@gmail.com> wrote:
> There is an issue with the sysfs/sysctl abstraction for storing values.
> Whups.
>
> http://www.freebsd.org/cgi/query-pr.cgi?pr=174213

I have a patch for the sysctl<->sysfs shim that corrects it to
function when storing/showing values and makes it function more like
Linux. Setting the value works on CURRENT when changing to eth mode a
single caveat: when changing the mode for the card, you need to do it
for the last port. This is because of the following code [in
sys/ofed/drivers/net/mlx4/main.c]:

    200 int mlx4_check_port_params(struct mlx4_dev *dev,
    201                            enum mlx4_port_type *port_type)
    202 {
    203         int i;

...

    212                         if (port_type[i] == MLX4_PORT_TYPE_ETH &&
    213                             port_type[i + 1] == MLX4_PORT_TYPE_IB)
    214                                 return -EINVAL; /* <-- HERE */
    215                 }
    216         }

Example (setting the first port to eth mode when the other is in ib mode):

# sysctl sys.device.mlx4_core0
sys.device.mlx4_core0.mlx4_port1: ib
sys.device.mlx4_core0.mlx4_port2: ib
# sysctl sys.device.mlx4_core0.mlx4_port1=eth
sys.device.mlx4_core0.mlx4_port1: ib
sysctl: sys.device.mlx4_core0.mlx4_port1: Invalid argument

Example (setting the last port to eth mode when the first one is in ib
mode flips the mode of the entire card to eth mode):

# sysctl sys.device.mlx4_core0.mlx4_port2=eth
sys.device.mlx4_core0.mlx4_port2: ib -> eth
# sysctl sys.device.mlx4_core0
sys.device.mlx4_core0.mlx4_port1: eth
sys.device.mlx4_core0.mlx4_port2: eth

Need to functionally test whether or not it's functioning properly
with eth mode, but at least you can set it with my upcoming patch. I'm
sending the code out to our IB team and submitting the patch to jeff@
for review.

Thanks,
-Garrett



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAGH67wTr8%2B91-D7y8bJLhZvxNEzmqt1cRzd7HXomDwGTOk=1Dg>