The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/dev/qat/qat_api/common/crypto/sym/lac_sym_partial.c

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /* SPDX-License-Identifier: BSD-3-Clause */
    2 /* Copyright(c) 2007-2022 Intel Corporation */
    3 /* $FreeBSD$ */
    4 
    5 /**
    6  ***************************************************************************
    7  * @file lac_sym_partial.c   common partial packet functions
    8  *
    9  * @ingroup LacSym
   10  *
   11  ***************************************************************************/
   12 
   13 /*
   14 *******************************************************************************
   15 * Include public/global header files
   16 *******************************************************************************
   17 */
   18 #include "cpa.h"
   19 
   20 #include "icp_accel_devices.h"
   21 #include "icp_adf_debug.h"
   22 
   23 #include "lac_log.h"
   24 #include "lac_sym.h"
   25 #include "cpa_cy_sym.h"
   26 #include "lac_common.h"
   27 
   28 #include "lac_sym_partial.h"
   29 
   30 CpaStatus
   31 LacSym_PartialPacketStateCheck(CpaCySymPacketType packetType,
   32                                CpaCySymPacketType partialState)
   33 {
   34         CpaStatus status = CPA_STATUS_SUCCESS;
   35 
   36         /* ASSUMPTION - partial requests on a given session must be issued
   37          * sequentially to guarantee ordering
   38          * (i.e. issuing partials on concurrent threads for a particular session
   39          * just wouldn't work)
   40          */
   41 
   42         /* state is no partial - only a partial is allowed */
   43         if (((CPA_CY_SYM_PACKET_TYPE_FULL == partialState) &&
   44              (CPA_CY_SYM_PACKET_TYPE_PARTIAL == packetType)) ||
   45 
   46             /* state is partial - only a partial or final partial is allowed */
   47             ((CPA_CY_SYM_PACKET_TYPE_PARTIAL == partialState) &&
   48              ((CPA_CY_SYM_PACKET_TYPE_PARTIAL == packetType) ||
   49               (CPA_CY_SYM_PACKET_TYPE_LAST_PARTIAL == packetType)))) {
   50                 status = CPA_STATUS_SUCCESS;
   51         } else /* invalid sequence */
   52         {
   53                 LAC_INVALID_PARAM_LOG("invalid partial packet sequence");
   54                 status = CPA_STATUS_INVALID_PARAM;
   55         }
   56 
   57         return status;
   58 }
   59 
   60 void
   61 LacSym_PartialPacketStateUpdate(CpaCySymPacketType packetType,
   62                                 CpaCySymPacketType *pPartialState)
   63 {
   64         /* if previous packet was either a full or ended a partial stream,
   65          * update
   66          * state to partial to indicate a new partial stream was created */
   67         if (CPA_CY_SYM_PACKET_TYPE_FULL == *pPartialState) {
   68                 *pPartialState = CPA_CY_SYM_PACKET_TYPE_PARTIAL;
   69         } else {
   70                 /* if packet type is final - reset the partial state */
   71                 if (CPA_CY_SYM_PACKET_TYPE_LAST_PARTIAL == packetType) {
   72                         *pPartialState = CPA_CY_SYM_PACKET_TYPE_FULL;
   73                 }
   74         }
   75 }

Cache object: 492054233ed26d5b13b393883d7bdf9e


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.