[Stgt-devel] [PATCH] iscsi tcp: optimize rx
FUJITA Tomonori
tomof
Sun Dec 30 08:52:48 CET 2007
From: Pete Wyckoff <pw at osc.edu>
Subject: [Stgt-devel] [PATCH] iscsi tcp: optimize rx
Date: Sat, 29 Dec 2007 14:01:58 -0500
> Avoid another trip through the event loop in the case of an
> RX with no AHS, by jumping up to the top of the state machine
> directly. This saves about 500 ns per command on my hardware.
>
> Signed-off-by: Pete Wyckoff <pw at osc.edu>
> ---
> usr/iscsi/iscsid.c | 4 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/usr/iscsi/iscsid.c b/usr/iscsi/iscsid.c
> index 8872818..bbab32d 100644
> --- a/usr/iscsi/iscsid.c
> +++ b/usr/iscsi/iscsid.c
> @@ -1845,9 +1845,11 @@ again:
> if (conn->rx_size) {
> conn->rx_buffer = conn->req.ahs;
> conn->rx_iostate = IOSTATE_RX_AHS;
> - } else
> + } else {
> conn->rx_iostate = hdigest ?
> IOSTATE_RX_INIT_HDIGEST : IOSTATE_RX_INIT_DATA;
> + goto again;
> + }
>
> /*
> * if the datasize is zero, we must go to
Hmm, here we have:
if (conn->rx_iostate == IOSTATE_RX_INIT_DATA)
goto again;
else if (conn->rx_iostate != IOSTATE_RX_AHS)
break;
conn->rx_iostate == IOSTATE_RX_INIT_DATA case already goes to again?
What case do you try to improve?
More information about the stgt
mailing list