Skip to content

Commit 3a3052f

Browse files
committed
Merge tag 'soc-fsl-next-v5.7' of git://git.kernel.org/pub/scm/linux/kernel/git/leo/linux into arm/drivers
NXP/FSL SoC driver updates for v5.7 DPAA2 DPIO driver performance optimization - Add and use QMAN multiple enqueue interface - Use function pointer indirection to replace checks in hotpath QUICC Engine drivers - Fix sparse warnings and exposed endian issues * tag 'soc-fsl-next-v5.7' of git://git.kernel.org/pub/scm/linux/kernel/git/leo/linux: soc: fsl: qe: fix sparse warnings for ucc_slow.c soc: fsl: qe: ucc_slow: remove 0 assignment for kzalloc'ed structure soc: fsl: qe: fix sparse warnings for ucc_fast.c soc: fsl: qe: fix sparse warnings for qe_ic.c soc: fsl: qe: fix sparse warnings for ucc.c soc: fsl: qe: fix sparse warning for qe_common.c soc: fsl: qe: fix sparse warnings for qe.c soc: fsl: dpio: fix dereference of pointer p before null check soc: fsl: dpio: Replace QMAN array mode with ring mode enqueue soc: fsl: dpio: QMAN performance improvement with function pointer indirection soc: fsl: dpio: Adding QMAN multiple enqueue interface Link: https://lore.kernel.org/r/20200326001257.22696-1-leoyang.li@nxp.com Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2 parents 575c809 + 461c3ac commit 3a3052f

11 files changed

Lines changed: 935 additions & 127 deletions

File tree

‎drivers/soc/fsl/dpio/dpio-service.c‎

Lines changed: 66 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
22
/*
33
* Copyright 2014-2016 Freescale Semiconductor Inc.
4-
* Copyright 2016 NXP
4+
* Copyright 2016-2019 NXP
55
*
66
*/
77
#include <linux/types.h>
@@ -432,6 +432,69 @@ int dpaa2_io_service_enqueue_fq(struct dpaa2_io *d,
432432
}
433433
EXPORT_SYMBOL(dpaa2_io_service_enqueue_fq);
434434

435+
/**
436+
* dpaa2_io_service_enqueue_multiple_fq() - Enqueue multiple frames
437+
* to a frame queue using one fqid.
438+
* @d: the given DPIO service.
439+
* @fqid: the given frame queue id.
440+
* @fd: the frame descriptor which is enqueued.
441+
* @nb: number of frames to be enqueud
442+
*
443+
* Return 0 for successful enqueue, -EBUSY if the enqueue ring is not ready,
444+
* or -ENODEV if there is no dpio service.
445+
*/
446+
int dpaa2_io_service_enqueue_multiple_fq(struct dpaa2_io *d,
447+
u32 fqid,
448+
const struct dpaa2_fd *fd,
449+
int nb)
450+
{
451+
struct qbman_eq_desc ed;
452+
453+
d = service_select(d);
454+
if (!d)
455+
return -ENODEV;
456+
457+
qbman_eq_desc_clear(&ed);
458+
qbman_eq_desc_set_no_orp(&ed, 0);
459+
qbman_eq_desc_set_fq(&ed, fqid);
460+
461+
return qbman_swp_enqueue_multiple(d->swp, &ed, fd, 0, nb);
462+
}
463+
EXPORT_SYMBOL(dpaa2_io_service_enqueue_multiple_fq);
464+
465+
/**
466+
* dpaa2_io_service_enqueue_multiple_desc_fq() - Enqueue multiple frames
467+
* to different frame queue using a list of fqids.
468+
* @d: the given DPIO service.
469+
* @fqid: the given list of frame queue ids.
470+
* @fd: the frame descriptor which is enqueued.
471+
* @nb: number of frames to be enqueud
472+
*
473+
* Return 0 for successful enqueue, -EBUSY if the enqueue ring is not ready,
474+
* or -ENODEV if there is no dpio service.
475+
*/
476+
int dpaa2_io_service_enqueue_multiple_desc_fq(struct dpaa2_io *d,
477+
u32 *fqid,
478+
const struct dpaa2_fd *fd,
479+
int nb)
480+
{
481+
int i;
482+
struct qbman_eq_desc ed[32];
483+
484+
d = service_select(d);
485+
if (!d)
486+
return -ENODEV;
487+
488+
for (i = 0; i < nb; i++) {
489+
qbman_eq_desc_clear(&ed[i]);
490+
qbman_eq_desc_set_no_orp(&ed[i], 0);
491+
qbman_eq_desc_set_fq(&ed[i], fqid[i]);
492+
}
493+
494+
return qbman_swp_enqueue_multiple_desc(d->swp, &ed[0], fd, nb);
495+
}
496+
EXPORT_SYMBOL(dpaa2_io_service_enqueue_multiple_desc_fq);
497+
435498
/**
436499
* dpaa2_io_service_enqueue_qd() - Enqueue a frame to a QD.
437500
* @d: the given DPIO service.
@@ -526,7 +589,7 @@ EXPORT_SYMBOL_GPL(dpaa2_io_service_acquire);
526589

527590
/**
528591
* dpaa2_io_store_create() - Create the dma memory storage for dequeue result.
529-
* @max_frames: the maximum number of dequeued result for frames, must be <= 16.
592+
* @max_frames: the maximum number of dequeued result for frames, must be <= 32.
530593
* @dev: the device to allow mapping/unmapping the DMAable region.
531594
*
532595
* The size of the storage is "max_frames*sizeof(struct dpaa2_dq)".
@@ -541,7 +604,7 @@ struct dpaa2_io_store *dpaa2_io_store_create(unsigned int max_frames,
541604
struct dpaa2_io_store *ret;
542605
size_t size;
543606

544-
if (!max_frames || (max_frames > 16))
607+
if (!max_frames || (max_frames > 32))
545608
return NULL;
546609

547610
ret = kmalloc(sizeof(*ret), GFP_KERNEL);

0 commit comments

Comments
 (0)