* [dpdk-dev] [PATCH] net/af_packet: set default blocksize to pagesize
@ 2019-06-24 14:32 kkanas
2019-06-27 18:25 ` Ferruh Yigit
2019-07-03 17:23 ` [dpdk-dev] " Ferruh Yigit
0 siblings, 2 replies; 4+ messages in thread
From: kkanas @ 2019-06-24 14:32 UTC (permalink / raw)
To: dev, John W. Linville; +Cc: Krzysztof Kanas
From: Krzysztof Kanas <kkanas@marvell.com>
Kernel validates block size to be aligned to page size. Code works on
platforms with page size 4k, but on others e.g. Arm64 fails with default
parameters.
Signed-off-by: Krzysztof Kanas <kkanas@marvell.com>
---
drivers/net/af_packet/rte_eth_af_packet.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c
index 4a660d5f013f..ec3d2cbb5202 100644
--- a/drivers/net/af_packet/rte_eth_af_packet.c
+++ b/drivers/net/af_packet/rte_eth_af_packet.c
@@ -32,7 +32,6 @@
#define ETH_AF_PACKET_FRAMECOUNT_ARG "framecnt"
#define ETH_AF_PACKET_QDISC_BYPASS_ARG "qdisc_bypass"
-#define DFLT_BLOCK_SIZE (1 << 12)
#define DFLT_FRAME_SIZE (1 << 11)
#define DFLT_FRAME_COUNT (1 << 9)
@@ -811,7 +810,7 @@ rte_eth_from_packet(struct rte_vdev_device *dev,
struct rte_kvargs_pair *pair = NULL;
unsigned k_idx;
unsigned int blockcount;
- unsigned int blocksize = DFLT_BLOCK_SIZE;
+ unsigned int blocksize;
unsigned int framesize = DFLT_FRAME_SIZE;
unsigned int framecount = DFLT_FRAME_COUNT;
unsigned int qpairs = 1;
@@ -821,6 +820,7 @@ rte_eth_from_packet(struct rte_vdev_device *dev,
if (*sockfd < 0)
return -1;
+ blocksize = getpagesize();
/*
* Walk arguments for configurable settings
*/
--
2.21.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH] net/af_packet: set default blocksize to pagesize
2019-06-24 14:32 [dpdk-dev] [PATCH] net/af_packet: set default blocksize to pagesize kkanas
@ 2019-06-27 18:25 ` Ferruh Yigit
2019-07-03 9:42 ` [dpdk-dev] [EXT] " Krzysztof Kanas
2019-07-03 17:23 ` [dpdk-dev] " Ferruh Yigit
1 sibling, 1 reply; 4+ messages in thread
From: Ferruh Yigit @ 2019-06-27 18:25 UTC (permalink / raw)
To: kkanas, dev, John W. Linville
On 6/24/2019 3:32 PM, kkanas@marvell.com wrote:
> From: Krzysztof Kanas <kkanas@marvell.com>
>
> Kernel validates block size to be aligned to page size. Code works on
> platforms with page size 4k, but on others e.g. Arm64 fails with default
> parameters.
What is the pagesize in arm64?
>
> Signed-off-by: Krzysztof Kanas <kkanas@marvell.com>
> ---
> drivers/net/af_packet/rte_eth_af_packet.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c
> index 4a660d5f013f..ec3d2cbb5202 100644
> --- a/drivers/net/af_packet/rte_eth_af_packet.c
> +++ b/drivers/net/af_packet/rte_eth_af_packet.c
> @@ -32,7 +32,6 @@
> #define ETH_AF_PACKET_FRAMECOUNT_ARG "framecnt"
> #define ETH_AF_PACKET_QDISC_BYPASS_ARG "qdisc_bypass"
>
> -#define DFLT_BLOCK_SIZE (1 << 12)
> #define DFLT_FRAME_SIZE (1 << 11)
> #define DFLT_FRAME_COUNT (1 << 9)
>
> @@ -811,7 +810,7 @@ rte_eth_from_packet(struct rte_vdev_device *dev,
> struct rte_kvargs_pair *pair = NULL;
> unsigned k_idx;
> unsigned int blockcount;
> - unsigned int blocksize = DFLT_BLOCK_SIZE;
> + unsigned int blocksize;
> unsigned int framesize = DFLT_FRAME_SIZE;
> unsigned int framecount = DFLT_FRAME_COUNT;
> unsigned int qpairs = 1;
> @@ -821,6 +820,7 @@ rte_eth_from_packet(struct rte_vdev_device *dev,
> if (*sockfd < 0)
> return -1;
>
> + blocksize = getpagesize();
> /*
> * Walk arguments for configurable settings
> */
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [EXT] Re: [PATCH] net/af_packet: set default blocksize to pagesize
2019-06-27 18:25 ` Ferruh Yigit
@ 2019-07-03 9:42 ` Krzysztof Kanas
0 siblings, 0 replies; 4+ messages in thread
From: Krzysztof Kanas @ 2019-07-03 9:42 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: Krzysztof Kanas, dev, John W. Linville
On 19-06-27 19:25, Ferruh Yigit wrote:
> External Email
>
> ----------------------------------------------------------------------
> On 6/24/2019 3:32 PM, kkanas@marvell.com wrote:
> > From: Krzysztof Kanas <kkanas@marvell.com>
> >
> > Kernel validates block size to be aligned to page size. Code works on
> > platforms with page size 4k, but on others e.g. Arm64 fails with default
> > parameters.
>
> What is the pagesize in arm64?
On aarch64 it is configurable. Linux kernel, supports sizes 4k, 16k, 64k
see ARM64_64K_PAGES in arch/arm64/Kconfig.
>
> >
> > Signed-off-by: Krzysztof Kanas <kkanas@marvell.com>
> > ---
> > drivers/net/af_packet/rte_eth_af_packet.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c
> > index 4a660d5f013f..ec3d2cbb5202 100644
> > --- a/drivers/net/af_packet/rte_eth_af_packet.c
> > +++ b/drivers/net/af_packet/rte_eth_af_packet.c
> > @@ -32,7 +32,6 @@
> > #define ETH_AF_PACKET_FRAMECOUNT_ARG "framecnt"
> > #define ETH_AF_PACKET_QDISC_BYPASS_ARG "qdisc_bypass"
> >
> > -#define DFLT_BLOCK_SIZE (1 << 12)
> > #define DFLT_FRAME_SIZE (1 << 11)
> > #define DFLT_FRAME_COUNT (1 << 9)
> >
> > @@ -811,7 +810,7 @@ rte_eth_from_packet(struct rte_vdev_device *dev,
> > struct rte_kvargs_pair *pair = NULL;
> > unsigned k_idx;
> > unsigned int blockcount;
> > - unsigned int blocksize = DFLT_BLOCK_SIZE;
> > + unsigned int blocksize;
> > unsigned int framesize = DFLT_FRAME_SIZE;
> > unsigned int framecount = DFLT_FRAME_COUNT;
> > unsigned int qpairs = 1;
> > @@ -821,6 +820,7 @@ rte_eth_from_packet(struct rte_vdev_device *dev,
> > if (*sockfd < 0)
> > return -1;
> >
> > + blocksize = getpagesize();
> > /*
> > * Walk arguments for configurable settings
> > */
> >
>
--
-
Regards,
Krzysztof(Chris) Kanas
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH] net/af_packet: set default blocksize to pagesize
2019-06-24 14:32 [dpdk-dev] [PATCH] net/af_packet: set default blocksize to pagesize kkanas
2019-06-27 18:25 ` Ferruh Yigit
@ 2019-07-03 17:23 ` Ferruh Yigit
1 sibling, 0 replies; 4+ messages in thread
From: Ferruh Yigit @ 2019-07-03 17:23 UTC (permalink / raw)
To: kkanas, dev, John W. Linville
On 6/24/2019 3:32 PM, kkanas@marvell.com wrote:
> From: Krzysztof Kanas <kkanas@marvell.com>
>
> Kernel validates block size to be aligned to page size. Code works on
> platforms with page size 4k, but on others e.g. Arm64 fails with default
> parameters.
>
> Signed-off-by: Krzysztof Kanas <kkanas@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Applied to dpdk-next-net/master, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-07-03 17:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-24 14:32 [dpdk-dev] [PATCH] net/af_packet: set default blocksize to pagesize kkanas
2019-06-27 18:25 ` Ferruh Yigit
2019-07-03 9:42 ` [dpdk-dev] [EXT] " Krzysztof Kanas
2019-07-03 17:23 ` [dpdk-dev] " Ferruh Yigit
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).