netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Divy Le Ray <divy@chelsio.com>
To: Jeff Garzik <jeff@garzik.org>
Cc: Divy Le Ray <None@chelsio.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	swise@opengridcomputing.com, David Miller <davem@davemloft.net>
Subject: Re: [PATCH 8/10] cxgb3 - Unmap offload packets when they are freed.
Date: Wed, 31 Jan 2007 17:27:42 -0800	[thread overview]
Message-ID: <45C1420E.7080701@chelsio.com> (raw)
In-Reply-To: <45C07275.9010501@garzik.org>

Jeff Garzik wrote:
> Divy Le Ray wrote:
>> From: Divy Le Ray <divy@chelsio.com>
>>
>> Offload packets may be DMAed long after their SGE Tx descriptors are 
>> done
>> so they must remain mapped until they are freed rather than until their
>> descriptors are freed.  Unmap such packets through an skb destructor.
>>
>> Signed-off-by: Divy Le Ray <divy@chelsio.com>
>
> this is questionable and sounds like you are working around a bug.  I 
> can't think of another driver that uses skb destructors, and I could 
> have sworn that skb destructors were not for drivers to use anyway
It's not a bug work around.  The payload of RDMA packets is DMAd lazily, 
potentially well after the DMA descriptors themselves have been 
processed and released. On plaftorms w/ IOMMUs, the packets need to 
remain mapped in the IOMMU until their payload is fetched, at which time 
the Scatter/Gather Engine may or may not still have knowledge of those 
packets.  So the SGE maps them for the IOMMU, then sets up the 
destructor so they can be unmapped whenever they complete.  It's true 
that drivers don't typically set up destructors but the lazy DMA this 
device does is also uncommon.  Packets carrying these destructors are 
exchanged between the RDMA driver and the low-level driver and aren't 
visible to any parts of the stack that may have different expectations 
of destructors.  Using the destructor is the simplest, most convenient 
way to solve this problem.

Cheers,
Divy

      reply	other threads:[~2007-02-01  1:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-31  3:44 [PATCH 8/10] cxgb3 - Unmap offload packets when they are freed Divy Le Ray
2007-01-31 10:41 ` Jeff Garzik
2007-02-01  1:27   ` 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=45C1420E.7080701@chelsio.com \
    --to=divy@chelsio.com \
    --cc=None@chelsio.com \
    --cc=davem@davemloft.net \
    --cc=jeff@garzik.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=swise@opengridcomputing.com \
    /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).