[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJK669YQ+x5zXSZA1FQHkRrcCt+SgZP-M_ea-Ey8ziGLhq9cqQ@mail.gmail.com>
Date: Wed, 13 Feb 2013 13:50:41 +0100
From: Sjur Brændeland <sjurbren@...il.com>
To: Rusty Russell <rusty@...tcorp.com.au>
Cc: "David S. Miller" <davem@...emloft.net>,
Ohad Ben-Cohen <ohad@...ery.com>,
Vikram ARV <vikram.arv@...ricsson.com>,
Dmitry TARNYAGIN <dmitry.tarnyagin@...ricsson.com>,
Linus Walleij <linus.walleij@...aro.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Erwan YVIN <erwan.yvin@...ricsson.com>,
"virtualization@...ts.linux-foundation.org"
<virtualization@...ts.linux-foundation.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
Ido Yariv <ido@...ery.com>
Subject: Re: [PATCH vringh 2/2] caif_virtio: Introduce caif over virtio
Hi Rusty,
On Wed, Feb 13, 2013 at 11:16 AM, Rusty Russell <rusty@...tcorp.com.au> wrote:
> Sjur BRENDELAND <sjur.brandeland@...ricsson.com> writes:
>>> > +static inline void ctx_prep_iov(struct cfv_napi_context *ctx)
>>> > +{
>>> > + if (ctx->riov.allocated) {
>>> > + kfree(ctx->riov.iov);
>>> > + ctx->riov.iov = NULL;
>>> > + ctx->riov.allocated = false;
>>> > + }
>>> > + ctx->riov.iov = NULL;
>>> > + ctx->riov.i = 0;
>>> > + ctx->riov.max = 0;
>>> > +}
>>>
>>> Hmm, we should probably make sure you don't have to do this: that if
>>> allocated once, you can simply reuse it by setting i = 0.
>>
>> Yes, I had problems getting the alloc/free of iov right. This is
>> perhaps the least intuitively part of the API. I maybe it's just me, but
>> I think some more helper functions and support from vringh in this
>> area would be great.
>
> Yes, I've neatened my git tree, an in particular added a commit which
> covers this explicitly, and one for the -EPROTO when we get unexpected
> r/w bufs. I've appended them below.
Great, thanks. This helps a lot. I picked up your patch-sett yesterday
so my V2 patch-set is using this already.
...
> +static inline void vringh_iov_init(struct vringh_iov *iov,
> + struct iovec *iovec, unsigned num)
> +{
> + iov->used = iov->i = 0;
> + iov->off = 0;
> + iov->max_num = num;
> + iov->iov = iovec;
> +}
How about supporting struct vringh_kiov and struct kvec as well?
I currently get the following complaints with my V2 patch-set:
drivers/net/caif/caif_virtio.c:486:2: warning: passing argument 1 of
‘vringh_iov_init’ from incompatible pointer type [enabled by default]
...
Thanks,
Sjur
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists