Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

crypto: qat - add num_rps sysfs attribute

Add the attribute `num_rps` to the `qat` attribute group. This returns
the number of ring pairs that a single device has. This allows to know
the maximum value that can be set to the attribute `rp2svc`.

Signed-off-by: Ciunas Bennett <ciunas.bennett@intel.com>
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Reviewed-by: Damian Muszynski <damian.muszynski@intel.com>
Reviewed-by: Tero Kristo <tero.kristo@linux.intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Ciunas Bennett and committed by
Herbert Xu
71fed09b dbc8876d

+28
+14
Documentation/ABI/testing/sysfs-driver-qat
··· 127 127 sym 128 128 129 129 This attribute is only available for qat_4xxx devices. 130 + 131 + What: /sys/bus/pci/devices/<BDF>/qat/num_rps 132 + Date: January 2024 133 + KernelVersion: 6.7 134 + Contact: qat-linux@intel.com 135 + Description: 136 + (RO) Returns the number of ring pairs that a single device has. 137 + 138 + Example usage:: 139 + 140 + # cat /sys/bus/pci/devices/<BDF>/qat/num_rps 141 + 64 142 + 143 + This attribute is only available for qat_4xxx devices.
+14
drivers/crypto/intel/qat/qat_common/adf_sysfs.c
··· 268 268 } 269 269 static DEVICE_ATTR_RW(rp2srv); 270 270 271 + static ssize_t num_rps_show(struct device *dev, struct device_attribute *attr, 272 + char *buf) 273 + { 274 + struct adf_accel_dev *accel_dev; 275 + 276 + accel_dev = adf_devmgr_pci_to_accel_dev(to_pci_dev(dev)); 277 + if (!accel_dev) 278 + return -EINVAL; 279 + 280 + return sysfs_emit(buf, "%u\n", GET_MAX_BANKS(accel_dev)); 281 + } 282 + static DEVICE_ATTR_RO(num_rps); 283 + 271 284 static struct attribute *qat_attrs[] = { 272 285 &dev_attr_state.attr, 273 286 &dev_attr_cfg_services.attr, 274 287 &dev_attr_pm_idle_enabled.attr, 275 288 &dev_attr_rp2srv.attr, 289 + &dev_attr_num_rps.attr, 276 290 NULL, 277 291 }; 278 292