[stgt] [PATCH RFC 2/2] - new iser code
FUJITA Tomonori
fujita.tomonori at lab.ntt.co.jp
Thu Jul 15 08:02:23 CEST 2010
On Wed, 7 Jul 2010 15:00:12 +0300 (IDT)
Alexander Nezhinsky <alexandern at voltaire.com> wrote:
I've not looked at the details yet. Just one comment,
>
> Files in patch 1/2:
> iser.h iser_ib.c
>
> Files in patch 2/2:
> issci/iser_text.c iscsi/iscsid.c iscsi/iscsid.h
> iscsi/iscsi_tcp.c iscsi/conn.c iscsi/session.c
> iscsi/target.c iscsi/transport.h iscsi/chap.c
> list.h Makefile
>
> Signed-off-by: Alexander Nezhinsky <alexandern at voltaire.com>
> ---
> usr/Makefile | 2 +-
> usr/iscsi/chap.c | 8 +-
> usr/iscsi/conn.c | 70 +++--
> usr/iscsi/iscsi_tcp.c | 68 +----
> usr/iscsi/iscsid.c | 468 +++++++++++++++--------------
> usr/iscsi/iscsid.h | 98 ++++---
> usr/iscsi/iser_text.c | 805 +++++++++++++++++++++++++++++++++++++++++++++++++
> usr/iscsi/session.c | 7 +-
> usr/iscsi/target.c | 199 +------------
> usr/iscsi/transport.h | 3 -
> usr/list.h | 3 +
> 11 files changed, 1165 insertions(+), 566 deletions(-)
> create mode 100644 usr/iscsi/iser_text.c
(snip)
> diff --git a/usr/iscsi/chap.c b/usr/iscsi/chap.c
> index 524bab5..f047359> index 7e501a4..d6dd064 100644
> --- a/usr/iscsi/iscsid.h
> +++ b/usr/iscsi/iscsid.h
> @@ -21,7 +21,6 @@
>
> #include <stdint.h>
> #include <inttypes.h>
> -#include <netdb.h>
>
> #include "transport.h"
> #include "list.h"
> @@ -132,16 +131,33 @@ struct iscsi_task {
> unsigned long extdata[0];
> };
>
> -struct iscsi_connection {
> - int state;
> +struct iscsi_conn_hdr;
>
> +struct iscsi_conn_ops {
> +
> + int (*conn_show)(struct iscsi_conn_hdr *conn, char *buf, int rest);
> + int (*conn_getsockname)(struct iscsi_conn_hdr *conn,
> + struct sockaddr *sa, socklen_t *len);
> + int (*conn_getpeername)(struct iscsi_conn_hdr *conn,
> + struct sockaddr *sa, socklen_t *len);
> +};
> +
> +struct iscsi_conn_hdr {
> + int state;
> /* should be a new state */
> int closed;
>
> - int rx_iostate;
> - int tx_iostate;
> int refcount;
>
> + struct iscsi_conn_ops op;
> +
> + uint32_t stat_sn;
> + uint32_t exp_stat_sn;
> +
> + uint32_t cmd_sn;
> + uint32_t exp_cmd_sn;
> + uint32_t max_cmd_sn;
> +
> struct list_head clist;
> struct iscsi_session *session;
>
> @@ -155,12 +171,22 @@ struct iscsi_connection {
> int session_type;
> int auth_method;
>
> - uint32_t stat_sn;
> - uint32_t exp_stat_sn;
> + int auth_state;
> + union {
> + struct {
> + int digest_alg;
> + int id;
> + int challenge_size;
> + unsigned char *challenge;
> + } chap;
> + } auth;
> +};
>
> - uint32_t cmd_sn;
> - uint32_t exp_cmd_sn;
> - uint32_t max_cmd_sn;
> +struct iscsi_connection {
> + struct iscsi_conn_hdr h;
Why you need to invent struct iscsi_conn_hdr? I meant that why we
can't pass a pointer to struct iscsi_connection to functions instead
of one to struct iscsi_conn_hdr? If it's because iser needs only
iscsi_conn_hdr and doesn't need iscsi_connection (just for small
memory footprint), then please don't do this for now.
> +
> + int rx_iostate;
> + int tx_iostate;
>
> struct iscsi_pdu req;
> void *req_buffer;
> @@ -186,16 +212,6 @@ struct iscsi_connection {
> unsigned char rx_digest[4];
> unsigned char tx_digest[4];
>
> - int auth_state;
> - union {
> - struct {
> - int digest_alg;
> - int id;
> - int challenge_size;
> - unsigned char *challenge;
> - } chap;
> - } auth;
> -
> struct iscsi_transport *tp;
> };
--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
More information about the stgt
mailing list