Esempio n. 1
0
static void
ixp_perform_cb(
	UINT32 ctx_id,
	IX_MBUF *sbufp,
	IX_MBUF *dbufp,
	IxCryptoAccStatus status)
{
	request_t *r = NULL;

	total++;
	if (total > request_num) {
		outstanding--;
		return;
	}

	if (!sbufp || !(r = IX_MBUF_PRIV(sbufp))) {
		printk("crappo %p %p\n", sbufp, r);
		outstanding--;
		return;
	}

#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
	INIT_WORK(&r->work, ixp_request_wq);
#else
	INIT_WORK(&r->work, ixp_request, r);
#endif
	schedule_work(&r->work);
}
Esempio n. 2
0
static void
ixp_perform_cb(
	UINT32 ctx_id,
	IX_MBUF *sbufp,
	IX_MBUF *dbufp,
	IxCryptoAccStatus status)
{
	request_t *r = NULL;
	unsigned long flags;

	/* do all requests  but take at least 1 second */
	spin_lock_irqsave(&ocfbench_counter_lock, flags);
	total++;
	if (total > request_num && jstart + HZ < jiffies) {
		outstanding--;
		spin_unlock_irqrestore(&ocfbench_counter_lock, flags);
		return;
	}

	if (!sbufp || !(r = IX_MBUF_PRIV(sbufp))) {
		printk("crappo %p %p\n", sbufp, r);
		outstanding--;
		spin_unlock_irqrestore(&ocfbench_counter_lock, flags);
		return;
	}
	spin_unlock_irqrestore(&ocfbench_counter_lock, flags);

	schedule_work(&r->work);
}
Esempio n. 3
0
static void
ixp_request(void *arg)
{
	request_t *r = arg;
	IxCryptoAccStatus status;

	memset(&r->mbuf, 0, sizeof(r->mbuf));
	IX_MBUF_MLEN(&r->mbuf) = IX_MBUF_PKT_LEN(&r->mbuf) = request_size + 64;
	IX_MBUF_MDATA(&r->mbuf) = r->buffer;
	IX_MBUF_PRIV(&r->mbuf) = r;
	status = ixCryptoAccAuthCryptPerform(ixp_ctx_id, &r->mbuf, NULL,
			0, request_size, 0, request_size, request_size, r->buffer);
	if (IX_CRYPTO_ACC_STATUS_SUCCESS != status) {
		printk("status1 = %d\n", status);
		outstanding--;
		return;
	}
	return;
}
Esempio n. 4
0
static void
ixp_request(void *arg)
{
	request_t *r = arg;
	IxCryptoAccStatus status;
	unsigned long flags;

	memset(&r->mbuf, 0, sizeof(r->mbuf));
	IX_MBUF_MLEN(&r->mbuf) = IX_MBUF_PKT_LEN(&r->mbuf) = request_size + 64;
	IX_MBUF_MDATA(&r->mbuf) = r->buffer;
	IX_MBUF_PRIV(&r->mbuf) = r;
	status = ixCryptoAccAuthCryptPerform(ixp_ctx_id, &r->mbuf, NULL,
			0, request_size, 0, request_size, request_size, r->buffer);
	if (IX_CRYPTO_ACC_STATUS_SUCCESS != status) {
		printk("status1 = %d\n", status);
		spin_lock_irqsave(&ocfbench_counter_lock, flags);
		outstanding--;
		spin_unlock_irqrestore(&ocfbench_counter_lock, flags);
		return;
	}
	return;
}
Esempio n. 5
0
static void 
ixp_perform_cb( 
        UINT32 ctx_id, 
        IX_MBUF *sbufp, 
        IX_MBUF *dbufp, 
        IxCryptoAccStatus status) 
{ 
        request_t *r = NULL; 
 
        total++; 
        if (total > request_num) { 
                outstanding--; 
                return; 
        } 
 
        if (!sbufp || !(r = IX_MBUF_PRIV(sbufp))) { 
                printk("crappo %p %p\n", sbufp, r); 
                outstanding--; 
                return; 
        } 
 
        INIT_WORK(&r->work, ixp_request, r); 
        schedule_work(&r->work); 
}