netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Divy Le Ray <divy@chelsio.com>
To: Al Viro <viro@ftp.linux.org.uk>
Cc: Jeff Garzik <jeff@garzik.org>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Steve Wise <swise@opengridcomputing.com>
Subject: Re: [PATCH 0/3] cxgb3 driver update
Date: Thu, 23 Aug 2007 15:03:07 -0700	[thread overview]
Message-ID: <46CE041B.8030403@chelsio.com> (raw)
In-Reply-To: <20070823070216.GI21089@ftp.linux.org.uk>

Hi Al,

> Speaking of cxgb3, could you explain what the hell is
> static int do_term(struct t3cdev *dev, struct sk_buff *skb)
> {
>         unsigned int hwtid = ntohl(skb->priority) >> 8 & 0xfffff;
> doing?  AFAIK, skb->priority is not net-endian...
>

the RDMA connection id is saved in the skb's priority field for TERM 
messages
because it is not in the CPL message that comes up from the hardware.
Yet the RDMA driver needs it, so sge.c::process_responses() overloads
the skb's priority and csum with these values.


>
> Another odd place is
> int t3_seeprom_write(struct adapter *adapter, u32 addr, u32 data)
> {  
>         u16 val;
>         int attempts = EEPROM_MAX_POLL;
>         unsigned int base = adapter->params.pci.vpd_cap_addr;
>
>         if ((addr >= EEPROMSIZE && addr != EEPROM_STAT_ADDR) || (addr 
> & 3))  
>                 return -EINVAL;
>
>         pci_write_config_dword(adapter->pdev, base + PCI_VPD_DATA,
>                                cpu_to_le32(data));
> with callers like
> int t3_seeprom_wp(struct adapter *adapter, int enable)
> {
>         return t3_seeprom_write(adapter, EEPROM_STAT_ADDR, enable ? 
> 0xc : 0);
>
> IOW, you really get little-endian values passed to 
> pci_write_config_dword()
> and it expects a host-endian as the last argument...
>

It looks like a bug. Thanks for spotting this.

Cheers,
Divy

      reply	other threads:[~2007-08-23 22:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-23  6:35 [PATCH 0/3] cxgb3 driver update Divy Le Ray
2007-08-23  7:02 ` Al Viro
2007-08-23 22:03   ` Divy Le Ray [this message]

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=46CE041B.8030403@chelsio.com \
    --to=divy@chelsio.com \
    --cc=jeff@garzik.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=swise@opengridcomputing.com \
    --cc=viro@ftp.linux.org.uk \
    /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).