On Thu, 17 Dec 2015, Hal Rosenstock wrote:
> > + * Get a MAD block of data.
>
> Nit: Get PerfMgt MAD block of data
Ok.
> > + * Returns error code or the number of bytes retrieved.
> > + */
> > +static int get_mad(struct ib_device *dev, int port_num, int attr,
>
> Nit: Maybe this is too verbose but better name might be get_perf_mad
Ok.
> > +static int port_check_extended_counters(struct ib_device *dev, int port)
> > +{
> > + int ret = 0;
> > + struct ib_class_port_info cpi;
> > +
> > + ret = get_mad(dev, port, IB_PMA_CLASS_PORT_INFO, &cpi, 40, sizeof(cpi));
>
> ClassPortInfo is per class not per class per port so need to indicate to
> get_mad whether a port is supplied or not or conditionalize based on
> attr ID.
I thought a port is always supplied since we get the info for a particular
port and the directory only exists if there is a port?
> > - ret = sysfs_create_group(&p->kobj, &pma_group);
> > + ret = sysfs_create_group(&p->kobj,
> > + port_check_extended_counters(device, port_num) ?
> > + &pma_group_ext :
> > + &pma_group);
>
> PortExtendedCounters does not have all the error counters in
> PortCounters so this isn't an either or. When extended port counters are
> supported should still include the original port counters with the
> exception of the [xmit rcv] [pkts data] which should come from the
> extended counters.
The original port counters are still included. The _ext table refers to
both extended and regular counters.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html