All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jeff@garzik.org>
To: Rick Peralta <fbp@tiac.net>
Cc: Project Hail List <hail-devel@vger.kernel.org>
Subject: Re: [Patch] chunkd: use port xxx82 to build
Date: Fri, 07 Aug 2009 19:47:40 -0400	[thread overview]
Message-ID: <4A7CBD1C.9020100@garzik.org> (raw)
In-Reply-To: <22384029.1249688189096.JavaMail.root@elwamui-mouette.atl.sa.earthlink.net>

Rick Peralta wrote:
> Hi Jeff,
> 
> Here are the notes on the endian notes.  On first blush it looks like the basic problems are related to I/O and structure alignment.  Correcting the structure (in the compiler) might be enough (if is supports endian pragmas or some such.  The traditional way is to hard code endian conversions of the data before it goes out over the network and converting back on return.  There are macros in the networking code that do the core byte swaping function.  I was looking from net_write() & net_read() to see where they were called and what was passed to them.  struct chunksrv_req & struct chunksrv_resp_get seem to be the primary structures.  Where to optimally put the changes is less clear.

In struct chunksrv_req, only one member has the possibility of endian 
problems: data_len.  And it appears to me that this is already properly 
converted:
> [jgarzik@bd chunkd]$ grep -w data_len */*.[ch]
> include/chunk_msg.h:	uint64_t		data_len;		/* len of addn'l data */
> lib/chunkdc.c:	*plen = GUINT64_FROM_LE(resp.req.data_len);
> lib/chunkdc.c:	req.data_len = GUINT64_TO_LE(content_len);
> lib/chunkdc.c:	req.data_len = GUINT64_TO_LE(cont_len);
> lib/chunkdc.c:	content_len = GUINT64_FROM_LE(resp.req.data_len);
> server/object.c:	uint64_t content_len = GUINT64_FROM_LE(cli->creq.data_len);
> server/object.c:	resp->req.data_len = GUINT32_TO_LE(obj->size);
> server/server.c:	resp->data_len = GUINT64_TO_LE(content_len);
> server/server.c:		       (long long) GUINT64_FROM_LE(req->data_len));

In struct chunksrv_resp_get, the only possibility of endian problem with 
is the 'mtime' struct member, which is only referenced once in
server/object.c (the other uses are native-endian internal variables):
> [jgarzik@bd chunkd]$ grep -w mtime */*.[ch]
> include/chunk_msg.h:	uint64_t		mtime;
> lib/chunkdc.c:	if (!net_read(stc, &resp.mtime, sizeof(resp) - sizeof(resp.req)))
> server/be-fs.c:	obj->bo.mtime = st.st_mtime;
> server/be-fs.c:			ve->mtime = st.st_mtime;
> server/chunkd.h:	time_t			mtime;
> server/chunkd.h:	time_t			mtime;		/* obj last-mod time */
> server/object.c:	resp->mtime = GUINT64_TO_LE(obj->mtime);
> server/server.c:			 time2str(timestr, ve->mtime),


What are the "basic problems of I/O and structure alignment"?


> I cobbled on a VM to get the PPC vm working.  It seemed to boot, but needed more configuration than I had time to dope out.  I was cool to see a mini-laptop (using the atom processor) run windows (yetch), support a VM running Fedora, support a VM running PPC code!  I'm thinking a DVD could still run in the background, on  an external monitor...

Great!

	Jeff



  reply	other threads:[~2009-08-07 23:47 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-07 23:36 [Patch] chunkd: use port xxx82 to build Rick Peralta
2009-08-07 23:47 ` Jeff Garzik [this message]
2009-08-08  0:55 ` Pete Zaitcev
2009-08-10 17:37   ` Jeff Garzik
2009-08-10 18:07     ` Pete Zaitcev
2009-08-12  6:49   ` Jeff Garzik
  -- strict thread matches above, loose matches on Subject: below --
2009-08-13 16:59 Rick Peralta
2009-08-13 14:46 Rick Peralta
2009-08-13 15:27 ` Jeff Garzik
2009-08-12 23:42 Rick Peralta
2009-08-13  0:11 ` Jeff Garzik
2009-08-08  4:24 Rick Peralta
2009-08-08  4:47 ` Jeff Garzik
2009-08-08  3:27 Rick Peralta
2009-08-08  3:38 ` Jeff Garzik
2009-08-07 14:11 Rick Peralta
2009-08-07 14:16 ` Fabian Deutsch
2009-08-07 14:23 ` Jeff Garzik
     [not found] <16874317.1249435954950.JavaMail.root@mswamui-andean.atl.sa.earthlink.net>
     [not found] ` <4A78E306.7000707@garzik.org>
2009-08-05  1:43   ` Pete Zaitcev
2009-08-05  1:50     ` Jeff Garzik
2009-08-05  0:34 Pete Zaitcev
2009-08-05  0:57 ` Jeff Garzik
2009-08-05  1:00   ` Jeff Garzik
2009-08-05  1:11     ` Pete Zaitcev
2009-08-05  1:26       ` Jeff Garzik
2009-08-05  1:04   ` Pete Zaitcev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A7CBD1C.9020100@garzik.org \
    --to=jeff@garzik.org \
    --cc=fbp@tiac.net \
    --cc=hail-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.