Date: Thu, 6 Dec 2012 20:07:32 -0800 From: Anthony Cornehl <accornehl@gmail.com> To: yanegomi@gmail.com Cc: freebsd-infiniband@freebsd.org Subject: Re: using ConnectX card as Ethernet (mlxen) Message-ID: <CAAoDvRxj8SvyY1ZMFxT5inS1BLdnZKj07u8Bq%2B%2BArWv7Y5_fwg@mail.gmail.com> In-Reply-To: <CAGH67wTVH2TmfDvqy-ZKs6Ge=T-sbARmwJ-Jw2RK8JtWjK=LGg@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>
next in thread | previous in thread | raw e-mail | index | archive | help
There is an issue with the sysfs/sysctl abstraction for storing values. Whups. http://www.freebsd.org/cgi/query-pr.cgi?pr=174213 On Nov 14, 2012 3:53 PM, "Garrett Cooper" <yanegomi@gmail.com> wrote: > On Wed, Nov 14, 2012 at 3:32 PM, John Nielsen <lists@jnielsen.net> wrote: > > > On Nov 9, 2012, at 9:51 PM, Garrett Cooper <yanegomi@gmail.com> wrote: > > > > > On Fri, Nov 9, 2012 at 7:44 PM, John Nielsen <lists@jnielsen.net> > wrote: > > > On the off chance there's someone on this list already that didn't see > > my earlier (unanswered) question, I'm reposting it below. I don't have > > FreeBSD on this hardware any more but I would like to know for future > > reference if using these cards with an Ethernet switch is an option. > > > > > > I know this might seem dumb, but what if you did > > sys.device.mlx4_core0.mlx4_port1="`printf 'en\n'`" (the newline's > > important). > > > > I'll try it next time I have an opportunity. Can you explain why the > > newline might make a difference? Also, I don't think I ever tried 'en', > > just 'eth'. Can someone say what the right value is or should be? > > > > It was a WAG based on this section of code (from > sys/ofed/drivers/net/mlx4/main.c)... > > 469 static ssize_t set_port_type(struct device *dev, > 470 struct device_attribute *attr, > 471 const char *buf, size_t count) > 472 { > 473 struct mlx4_port_info *info = container_of(attr, struct > mlx4_port_i nfo, > 474 port_attr); > 475 struct mlx4_dev *mdev = info->dev; > 476 struct mlx4_priv *priv = mlx4_priv(mdev); > 477 enum mlx4_port_type types[MLX4_MAX_PORTS]; > 478 enum mlx4_port_type new_types[MLX4_MAX_PORTS]; > 479 int i; > 480 int err = 0; > 481 > 482 if (!strcmp(buf, "ib\n")) > 483 info->tmp_type = MLX4_PORT_TYPE_IB; > 484 else if (!strcmp(buf, "eth\n")) > 485 info->tmp_type = MLX4_PORT_TYPE_ETH; > 486 else if (!strcmp(buf, "auto\n")) > 487 info->tmp_type = MLX4_PORT_TYPE_AUTO; > 488 else { > 489 mlx4_err(mdev, "%s is not supported port type\n", > buf); > 490 return -EINVAL; > 491 } > > I don't have one of these cards so I can't verify whether or not that's the > issue today, but it seemed like a likely cause. > > This being there is probably the remnant of a pseudo-valid hacky assumption > on Linux (you're echo'ing to a sysfs node and it's tacking on a newline), > but an invalid assumption on FreeBSD (the sysctl<->sysfs compat layer > doesn't make any translation assumptions w.r.t. newlines, etc). > > Thanks! > -Garrett > _______________________________________________ > freebsd-infiniband@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-infiniband > To unsubscribe, send any mail to " > freebsd-infiniband-unsubscribe@freebsd.org" >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAAoDvRxj8SvyY1ZMFxT5inS1BLdnZKj07u8Bq%2B%2BArWv7Y5_fwg>