From: Hemant Agrawal <hemant.agrawal@nxp.com>
To: dev@dpdk.org
Cc: stable@dpdk.org
Subject: [dpdk-stable] [PATCH v2 03/16] bus/dpaa: fix the buffer offset setting in FMAN
Date: Wed, 4 Jul 2018 15:13:38 +0530 [thread overview]
Message-ID: <1530697431-1244-3-git-send-email-hemant.agrawal@nxp.com> (raw)
In-Reply-To: <1530697431-1244-1-git-send-email-hemant.agrawal@nxp.com>
The buffer offset was incorrectly being set at 64,
thus not honoring the packet headroom.
Fixes: 6d6b4f49a155 (bus/dpaa: add FMAN hardware operations")
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
drivers/bus/dpaa/base/fman/fman_hw.c | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/drivers/bus/dpaa/base/fman/fman_hw.c b/drivers/bus/dpaa/base/fman/fman_hw.c
index 0148b98..7ada7fa 100644
--- a/drivers/bus/dpaa/base/fman/fman_hw.c
+++ b/drivers/bus/dpaa/base/fman/fman_hw.c
@@ -16,6 +16,8 @@
#include <fsl_fman_crc64.h>
#include <fsl_bman.h>
+#define FMAN_SP_EXT_BUF_MARG_START_SHIFT 16
+
/* Instantiate the global variable that the inline CRC64 implementation (in
* <fsl_fman.h>) depends on.
*/
@@ -422,20 +424,16 @@ fman_if_set_fc_quanta(struct fman_if *fm_if, u16 pause_quanta)
int
fman_if_get_fdoff(struct fman_if *fm_if)
{
- u32 fmbm_ricp;
+ u32 fmbm_rebm;
int fdoff;
- int iceof_mask = 0x001f0000;
- int icsz_mask = 0x0000001f;
struct __fman_if *__if = container_of(fm_if, struct __fman_if, __if);
assert(fman_ccsr_map_fd != -1);
- fmbm_ricp =
- in_be32(&((struct rx_bmi_regs *)__if->bmi_map)->fmbm_ricp);
- /*iceof + icsz*/
- fdoff = ((fmbm_ricp & iceof_mask) >> 16) * 16 +
- (fmbm_ricp & icsz_mask) * 16;
+ fmbm_rebm = in_be32(&((struct rx_bmi_regs *)__if->bmi_map)->fmbm_rebm);
+
+ fdoff = (fmbm_rebm >> FMAN_SP_EXT_BUF_MARG_START_SHIFT) & 0x1ff;
return fdoff;
}
@@ -502,12 +500,16 @@ fman_if_set_fdoff(struct fman_if *fm_if, uint32_t fd_offset)
{
struct __fman_if *__if = container_of(fm_if, struct __fman_if, __if);
unsigned int *fmbm_rebm;
+ int val = 0;
+ int fmbm_mask = 0x01ff0000;
+
+ val = fd_offset << FMAN_SP_EXT_BUF_MARG_START_SHIFT;
assert(fman_ccsr_map_fd != -1);
fmbm_rebm = &((struct rx_bmi_regs *)__if->bmi_map)->fmbm_rebm;
- out_be32(fmbm_rebm, in_be32(fmbm_rebm) | (fd_offset << 16));
+ out_be32(fmbm_rebm, (in_be32(fmbm_rebm) & ~fmbm_mask) | val);
}
void
--
2.7.4
next prev parent reply other threads:[~2018-07-04 9:45 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-21 9:43 [dpdk-stable] [PATCH 01/10] bus/dpaa: fix phandle support for kernel 4.16 Hemant Agrawal
2018-06-21 9:43 ` [dpdk-stable] [PATCH 02/10] bus/dpaa: fix svr id fetch location Hemant Agrawal
2018-06-21 9:44 ` [dpdk-stable] [PATCH 08/10] net/dpaa2: fix the prefetch Rx to honor nb pkts Hemant Agrawal
2018-07-04 9:43 ` [dpdk-stable] [PATCH v2 01/16] bus/dpaa: fix phandle support for kernel 4.16 Hemant Agrawal
2018-07-04 9:43 ` [dpdk-stable] [PATCH v2 02/16] bus/dpaa: fix svr id fetch location Hemant Agrawal
2018-07-06 4:44 ` [dpdk-stable] [dpdk-dev] " Shreyansh Jain
2018-07-04 9:43 ` Hemant Agrawal [this message]
2018-07-04 9:43 ` [dpdk-stable] [PATCH v2 04/16] net/dpaa: fix the queue err handling and logs Hemant Agrawal
2018-07-06 4:56 ` [dpdk-stable] [dpdk-dev] " Shreyansh Jain
2018-07-04 9:43 ` [dpdk-stable] [PATCH v2 05/16] net/dpaa2: fix the prefetch Rx to honor nb pkts Hemant Agrawal
2018-07-06 5:01 ` [dpdk-stable] [dpdk-dev] " Shreyansh Jain
2018-07-06 8:13 ` Hemant Agrawal
2018-07-04 10:59 ` [dpdk-stable] [PATCH v2 01/16] bus/dpaa: fix phandle support for kernel 4.16 Shreyansh Jain
2018-07-06 8:09 ` [dpdk-stable] [PATCH v3 " Hemant Agrawal
2018-07-06 8:09 ` [dpdk-stable] [PATCH v3 02/16] bus/dpaa: fix svr id fetch location Hemant Agrawal
2018-07-06 8:10 ` [dpdk-stable] [PATCH v3 03/16] bus/dpaa: fix the buffer offset setting in FMAN Hemant Agrawal
2018-07-06 12:28 ` [dpdk-stable] [dpdk-dev] " Shreyansh Jain
2018-07-06 8:10 ` [dpdk-stable] [PATCH v3 04/16] net/dpaa: fix the queue err handling and logs Hemant Agrawal
2018-07-06 8:10 ` [dpdk-stable] [PATCH v3 05/16] net/dpaa2: fix the prefetch Rx to honor nb pkts Hemant Agrawal
2018-07-12 12:49 ` [dpdk-stable] [dpdk-dev] [PATCH v3 01/16] bus/dpaa: fix phandle support for kernel 4.16 Thomas Monjalon
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=1530697431-1244-3-git-send-email-hemant.agrawal@nxp.com \
--to=hemant.agrawal@nxp.com \
--cc=dev@dpdk.org \
--cc=stable@dpdk.org \
/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).