All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] crypto/qat: fix memzone creation to use a fixed size string
@ 2016-09-01 10:21 John Griffin
  2016-09-05  3:23 ` Yuanhan Liu
  0 siblings, 1 reply; 5+ messages in thread
From: John Griffin @ 2016-09-01 10:21 UTC (permalink / raw)
  To: dev; +Cc: eoin.breen, pablo.de.lara.guarch, John Griffin

Remove the dependency on dev->driver->pci_drv.name when
creating the memzone for the qat hardware queues.
The pci_drv.name may grow too large for RTE_MEMZONE_NAMESIZE.

Fixes: 1703e94ac5ce ("qat: add driver for QuickAssist devices")

Signed-off-by: John Griffin <john.griffin@intel.com>
---
 drivers/crypto/qat/qat_qp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/crypto/qat/qat_qp.c b/drivers/crypto/qat/qat_qp.c
index 5de47e3..a29ed66 100644
--- a/drivers/crypto/qat/qat_qp.c
+++ b/drivers/crypto/qat/qat_qp.c
@@ -300,7 +300,7 @@ qat_queue_create(struct rte_cryptodev *dev, struct qat_queue *queue,
 	 * Allocate a memzone for the queue - create a unique name.
 	 */
 	snprintf(queue->memz_name, sizeof(queue->memz_name), "%s_%s_%d_%d_%d",
-		dev->driver->pci_drv.name, "qp_mem", dev->data->dev_id,
+		"qat_pmd", "qp_mem", dev->data->dev_id,
 		queue->hw_bundle_number, queue->hw_queue_number);
 	qp_mz = queue_dma_zone_reserve(queue->memz_name, queue_size_bytes,
 			socket_id);
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] crypto/qat: fix memzone creation to use a fixed size string
  2016-09-01 10:21 [PATCH] crypto/qat: fix memzone creation to use a fixed size string John Griffin
@ 2016-09-05  3:23 ` Yuanhan Liu
  2016-09-14 15:32   ` John Griffin
  0 siblings, 1 reply; 5+ messages in thread
From: Yuanhan Liu @ 2016-09-05  3:23 UTC (permalink / raw)
  To: John Griffin; +Cc: dev, eoin.breen, pablo.de.lara.guarch

On Thu, Sep 01, 2016 at 11:21:38AM +0100, John Griffin wrote:
> Remove the dependency on dev->driver->pci_drv.name when
> creating the memzone for the qat hardware queues.
> The pci_drv.name may grow too large for RTE_MEMZONE_NAMESIZE.

Will the "may grow too large" cause any issues? If so, state it here. If
not, marking this patch as a "fix" patch doesn't make sense to me then.

> 
> Fixes: 1703e94ac5ce ("qat: add driver for QuickAssist devices")
> 
> Signed-off-by: John Griffin <john.griffin@intel.com>
> ---
>  drivers/crypto/qat/qat_qp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/crypto/qat/qat_qp.c b/drivers/crypto/qat/qat_qp.c
> index 5de47e3..a29ed66 100644
> --- a/drivers/crypto/qat/qat_qp.c
> +++ b/drivers/crypto/qat/qat_qp.c
> @@ -300,7 +300,7 @@ qat_queue_create(struct rte_cryptodev *dev, struct qat_queue *queue,
>  	 * Allocate a memzone for the queue - create a unique name.
>  	 */
>  	snprintf(queue->memz_name, sizeof(queue->memz_name), "%s_%s_%d_%d_%d",
> -		dev->driver->pci_drv.name, "qp_mem", dev->data->dev_id,
> +		"qat_pmd", "qp_mem", dev->data->dev_id,

Besides that, why not putting "qat_pmd" and "qp_mem" inside the format
string?

	--yliu

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] crypto/qat: fix memzone creation to use a fixed size string
  2016-09-05  3:23 ` Yuanhan Liu
@ 2016-09-14 15:32   ` John Griffin
  2016-09-18  8:16     ` Yuanhan Liu
  0 siblings, 1 reply; 5+ messages in thread
From: John Griffin @ 2016-09-14 15:32 UTC (permalink / raw)
  To: Yuanhan Liu; +Cc: dev, eoin.breen, pablo.de.lara.guarch

Hi Liu,
Comments embedded.

Rgds,
John.

On 05/09/16 04:23, Yuanhan Liu wrote:
> On Thu, Sep 01, 2016 at 11:21:38AM +0100, John Griffin wrote:
>> Remove the dependency on dev->driver->pci_drv.name when
>> creating the memzone for the qat hardware queues.
>> The pci_drv.name may grow too large for RTE_MEMZONE_NAMESIZE.
>
> Will the "may grow too large" cause any issues? If so, state it here. If
> not, marking this patch as a "fix" patch doesn't make sense to me then.
We discovered this when applying a future patch (2141c21966) and it 
exposed this issue.
Problem is we create a memzone per hardware queue pair and if the 
memzone name is too large, then this code will not produce a unique
name and two qps will end using the same memzone.
In retrospect, I'll wait for Pablo to apply that future patch and then 
re-base a v2.

>
>>
>> Fixes: 1703e94ac5ce ("qat: add driver for QuickAssist devices")
>>
>> Signed-off-by: John Griffin <john.griffin@intel.com>
>> ---
>>   drivers/crypto/qat/qat_qp.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/crypto/qat/qat_qp.c b/drivers/crypto/qat/qat_qp.c
>> index 5de47e3..a29ed66 100644
>> --- a/drivers/crypto/qat/qat_qp.c
>> +++ b/drivers/crypto/qat/qat_qp.c
>> @@ -300,7 +300,7 @@ qat_queue_create(struct rte_cryptodev *dev, struct qat_queue *queue,
>>   	 * Allocate a memzone for the queue - create a unique name.
>>   	 */
>>   	snprintf(queue->memz_name, sizeof(queue->memz_name), "%s_%s_%d_%d_%d",
>> -		dev->driver->pci_drv.name, "qp_mem", dev->data->dev_id,
>> +		"qat_pmd", "qp_mem", dev->data->dev_id,
>
> Besides that, why not putting "qat_pmd" and "qp_mem" inside the format
> string?
Fair point will send in the v2.

>
> 	--yliu
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] crypto/qat: fix memzone creation to use a fixed size string
  2016-09-14 15:32   ` John Griffin
@ 2016-09-18  8:16     ` Yuanhan Liu
  2016-09-19 10:12       ` John Griffin
  0 siblings, 1 reply; 5+ messages in thread
From: Yuanhan Liu @ 2016-09-18  8:16 UTC (permalink / raw)
  To: John Griffin; +Cc: dev, eoin.breen, pablo.de.lara.guarch

On Wed, Sep 14, 2016 at 04:32:46PM +0100, John Griffin wrote:
> Hi Liu,
> Comments embedded.
> 
> Rgds,
> John.
> 
> On 05/09/16 04:23, Yuanhan Liu wrote:
> >On Thu, Sep 01, 2016 at 11:21:38AM +0100, John Griffin wrote:
> >>Remove the dependency on dev->driver->pci_drv.name when
> >>creating the memzone for the qat hardware queues.
> >>The pci_drv.name may grow too large for RTE_MEMZONE_NAMESIZE.
> >
> >Will the "may grow too large" cause any issues? If so, state it here. If
> >not, marking this patch as a "fix" patch doesn't make sense to me then.
> We discovered this when applying a future patch (2141c21966) and it exposed
> this issue.
> Problem is we create a memzone per hardware queue pair and if the memzone
> name is too large, then this code will not produce a unique
> name and two qps will end using the same memzone.

Thanks for the info, and I think you should put it in the commit log: it
helps people to really know what might go wrong without this fix.

	--yliu

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] crypto/qat: fix memzone creation to use a fixed size string
  2016-09-18  8:16     ` Yuanhan Liu
@ 2016-09-19 10:12       ` John Griffin
  0 siblings, 0 replies; 5+ messages in thread
From: John Griffin @ 2016-09-19 10:12 UTC (permalink / raw)
  To: Yuanhan Liu; +Cc: dev, eoin.breen, pablo.de.lara.guarch

On 18/09/16 09:16, Yuanhan Liu wrote:
> On Wed, Sep 14, 2016 at 04:32:46PM +0100, John Griffin wrote:
>> Hi Liu,
>> Comments embedded.
>>
>> Rgds,
>> John.
>>
>> On 05/09/16 04:23, Yuanhan Liu wrote:
>>> On Thu, Sep 01, 2016 at 11:21:38AM +0100, John Griffin wrote:
>>>> Remove the dependency on dev->driver->pci_drv.name when
>>>> creating the memzone for the qat hardware queues.
>>>> The pci_drv.name may grow too large for RTE_MEMZONE_NAMESIZE.
>>>
>>> Will the "may grow too large" cause any issues? If so, state it here. If
>>> not, marking this patch as a "fix" patch doesn't make sense to me then.
>> We discovered this when applying a future patch (2141c21966) and it exposed
>> this issue.
>> Problem is we create a memzone per hardware queue pair and if the memzone
>> name is too large, then this code will not produce a unique
>> name and two qps will end using the same memzone.
>
> Thanks for the info, and I think you should put it in the commit log: it
> helps people to really know what might go wrong without this fix.
>
> 	--yliu
>
No problem. Yes will add to the v2.

Rgds,
John.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-09-19 10:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-01 10:21 [PATCH] crypto/qat: fix memzone creation to use a fixed size string John Griffin
2016-09-05  3:23 ` Yuanhan Liu
2016-09-14 15:32   ` John Griffin
2016-09-18  8:16     ` Yuanhan Liu
2016-09-19 10:12       ` John Griffin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.