On Wed, 1 Nov 2017 12:29:48 -0700, Felix Manlunas wrote: > > > +lio_vf_rep_phys_port_name(struct net_device *dev, > > > + char *buf, size_t len) > > > +{ > > > + struct lio_vf_rep_desc *vf_rep = netdev_priv(dev); > > > + struct octeon_device *oct = vf_rep->oct; > > > + int ret; > > > + > > > + ret = snprintf(buf, len, "pf%dvf%d", oct->pf_num, > > > + vf_rep->ifidx - oct->pf_num * 64 - 1); > > > + if (ret >= len) > > > + return -EOPNOTSUPP; > > > > EOPNOTSUPP seems an odd return code for too short a buffer? > > We will replace that with ENOBUFS in a future patch.
Strangely enough mlx5 and bnxt also use EOPNOTSUPP if string doesn't fit. Others use EINVAL, IMHO that's more appropriate.