• Harald Freudenberger's avatar
    s390/zcrypt: introduce msg tracking in zcrypt functions · 91ffc519
    Harald Freudenberger authored
    Introduce a new internal struct zcrypt_track with an retry counter
    field and a last return code field. Fill and update these fields at
    certain points during processing of an request/reply. This tracking
    info is then used to
    - avoid trying to resend the message forever. Now each message is
      tried to be send TRACK_AGAIN_MAX (currently 10) times and then the
      ioctl returns to userspace with errno EAGAIN.
    - avoid trying to resend the message on the very same card/domain. If
      possible (more than one APQN with same quality) don't use the very
      same qid as the previous attempt when again scheduling the request.
      This is done by adding penalty weight values when the dispatching
      takes place. There is a penalty TRACK_AGAIN_CARD_WEIGHT_PENALTY for
      using the same card as previously and another penalty define
      TRACK_AGAIN_QUEUE_WEIGHT_PENALTY to be considered when the same qid
      as the previous sent attempt is calculated. Both values make it
      harder to choose the very same card/domain but not impossible. For
      example when only one APQN is available a resend can only address the
      very same APQN.
    
    There are some more ideas for the future to extend the use of this
    tracking information. For example the last response code at NQAP and
    DQAP could be stored there, giving the possibility to extended tracing
    and debugging about requests failing to get processed properly.
    Signed-off-by: default avatarHarald Freudenberger <freude@linux.ibm.com>
    Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
    91ffc519
zcrypt_cex4.c 19.9 KB