netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jay Cliburn <jacliburn@bellsouth.net>
To: Christoph Hellwig <hch@infradead.org>,
	Jay Cliburn <jacliburn@bellsouth.net>,
	jeff@garzik.org, shemminger@osdl.org, csnook@redhat.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	atl1-devel@lists.sourceforge.net
Subject: Re: [PATCH 2/4] atl1: Header files for Attansic L1 driver
Date: Mon, 15 Jan 2007 13:21:17 -0600	[thread overview]
Message-ID: <45ABD42D.1060901@bellsouth.net> (raw)
In-Reply-To: <20070111092704.GB3141@infradead.org>

Christoph Hellwig wrote:
> On Wed, Jan 10, 2007 at 06:41:37PM -0600, Jay Cliburn wrote:

>> +struct csum_param {
>> +	unsigned buf_len:14;
>> +	unsigned dma_int:1;
>> +	unsigned pkt_int:1;
>> +	u16 valan_tag;
>> +	unsigned eop:1;
>> +	/* command */
>> +	unsigned coalese:1;
>> +	unsigned ins_vlag:1;
>> +	unsigned custom_chksum:1;
>> +	unsigned segment:1;
>> +	unsigned ip_chksum:1;
>> +	unsigned tcp_chksum:1;
>> +	unsigned udp_chksum:1;
>> +	/* packet state */
>> +	unsigned vlan_tagged:1;
>> +	unsigned eth_type:1;
>> +	unsigned iphl:4;
>> +	unsigned:2;
>> +	unsigned payload_offset:8;
>> +	unsigned xsum_offset:8;
>> +} _ATL1_ATTRIB_PACK_;
> 
> Bitfields should not be used for hardware datastructures ever.
> Please convert this to explicit masking and shifting.


>> +/* formerly ATL1_WRITE_REG */
>> +static inline void atl1_write32(const struct atl1_hw *hw, int reg, u32 val)
>> +{
>> +        writel(val, hw->hw_addr + reg);
>> +}
>> +
>> +/* formerly ATL1_READ_REG */
>> +static inline u32 atl1_read32(const struct atl1_hw *hw, int reg)
>> +{
>> +        return readl(hw->hw_addr + reg);
>> +}
> 
> Just kill all these wrappers.  Also you probably want to convert to
> pci_iomap + ioread*/iowrite*.

Christoph et al.,

I've incorporated all your comments except the two shown above.  I 
killed the indicated atl1_write*/atl1_read* wrappers, but I'm not yet 
familiar enough with pci_iomap/iowrite*/ioread* to make that particular 
conversion, and I'm having trouble getting the bitfield struct converted 
to shift/mask semantics (No matter how hard I try, I keep breaking the 
transmit side of the adapter).

I'd like to plead for relief on these two items and submit a new version 
of the driver containing all your other comments.  I need help from a 
more experienced netdev hacker, and in my mind, the best way to do that 
is to get the driver in the kernel so more people can use it and 
contribute changes and make improvements.

I welcome any comments on the rationality of this approach.

Jay

  parent reply	other threads:[~2007-01-15 19:21 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-11  0:41 [PATCH 2/4] atl1: Header files for Attansic L1 driver Jay Cliburn
2007-01-11  9:27 ` Christoph Hellwig
2007-01-11 16:53   ` Jay Cliburn
2007-01-11 17:44     ` Stephen Hemminger
2007-01-11 17:58     ` Christoph Hellwig
2007-01-15 19:21   ` Jay Cliburn [this message]
2007-01-15 20:33     ` Francois Romieu
2007-01-15 20:45       ` Jay Cliburn
  -- strict thread matches above, loose matches on Subject: below --
2007-01-21 21:06 Jay Cliburn
2007-01-22 11:31 ` Francois Romieu
2006-11-19 20:30 Jay Cliburn
2006-11-19 21:36 ` Jan Engelhardt
2006-11-20  6:01   ` Chris Snook
2006-11-20 11:02     ` Jan Engelhardt
2006-11-20  5:54 ` Chris Snook

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=45ABD42D.1060901@bellsouth.net \
    --to=jacliburn@bellsouth.net \
    --cc=atl1-devel@lists.sourceforge.net \
    --cc=csnook@redhat.com \
    --cc=hch@infradead.org \
    --cc=jeff@garzik.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@osdl.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).