• Benjamin Block's avatar
    scsi: zfcp: diagnostics buffer caching and use for exchange port data · 7e418833
    Benjamin Block authored
    The FCP channel exposes two central interfaces to receive information about
    the local FCP-Adapter/-Port: Exchange Port and Exchange Config Data. Using
    these commands can negatively impact the adapter if we allow them to be
    sent at a very high rate.
    
    The later parts of this patchset will introduce new user-interfaces to
    receive more diagnostics from the adapter. To prevent any negative impact
    from using those, this patch adds a simple caching-mechanism that will
    prevent a malicious/faulty userspace-application from generating an
    abnormal high amount of Exchange Port/Config Data traffic.
    
    Relevant diagnostic data that is received via Exchange Config/Port Data is
    cached in buffers associated with the corresponding adapter-struct.  Each
    buffer is associated with a timestamp that signals how old the data is,
    and, added via a following patch in this series, lets userspace-interfaces
    determine when the data is too old and needs to be updated.
    
    Buffer-updates are made during the normal response path of the
    corresponding command. With this patch only the output of the Exchange Port
    Data command is captured.
    
    Link: https://lore.kernel.org/r/054ca020ce0a53dc0d9176428bea373898944e6a.1572018130.git.bblock@linux.ibm.comReviewed-by: default avatarSteffen Maier <maier@linux.ibm.com>
    Signed-off-by: default avatarBenjamin Block <bblock@linux.ibm.com>
    Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
    7e418833
zfcp_diag.h 1.59 KB