On Fri, Sep 23, 2016 at 11:05:18PM +0800, Herbert Xu wrote: > When I said acomp layer I'm referring specifically to the algorithm > or driver. As to your last question it would be the caller's > responsibility to free that memory. > > The use-case is our oldest user, IPcomp. Most packets are 1500 bytes > max but we have to allocate 64K of memory to cover the worst case. > For an algorithm that can deal with SG lists it can easily allocate > pages of memory as it goes and place them in an SG list. It is clear now. Thanks. > Sure if you already have memory allocated then we don't want to > force you to allocate it again in the algorithm/driver. But our > interface should allow the memory to be allocated in the driver. I think the definition of the acomp interface already allows for this. If the destination scatterlist inside the request is NULL, the algorithm/driver can allocate pages of memory for the output buffers as well as the scatterlist. In this case, the destination length, if not zero, could be used to specify the maximum size to allocate. What do you think? -- Giovanni -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html