ed on that value. Add a parameter for
otx2_alloc_rbuf/__otx2_alloc_rbuf() to store the dma address and make
the return value to indicate if the buffer allocation really fail or
not.
Reported-by: Pavel Machek
Signed-off-by: Kevin Hao
Tested-by: Subbaraya Sundeep
---
v2: Just sort the var
ed on that value. Add a parameter for
otx2_alloc_rbuf/__otx2_alloc_rbuf() to store the dma address and make
the return value to indicate if the buffer allocation really fail or
not.
Reported-by: Pavel Machek
Signed-off-by: Kevin Hao
---
.../marvell/octeontx2/nic/otx2_common.c
The napi_alloc_frag_align() will guarantee that a correctly align
buffer address is returned. So use this function to simplify the buffer
alloc and avoid the unnecessary memory waste.
Signed-off-by: Kevin Hao
Reviewed-by: Ioana Ciornei
---
v3: Add Reviewed-by from Ioana.
drivers/net/ethernet
t for the page_frag functions, so add the corresponding
{netdev,napi}_frag functions.
Signed-off-by: Kevin Hao
---
v3: Use align mask and refactor the {netdev,napi}_alloc_frag_align() as
suggested by Alexander.
include/linux/skbuff.h | 36 ++--
net/core/skb
The napi_alloc_frag_align() will guarantee that a correctly align
buffer address is returned. So use this function to simplify the buffer
alloc and avoid the unnecessary memory waste.
Signed-off-by: Kevin Hao
Tested-by: Subbaraya Sundeep
---
v3: Add Tested-by from Subbaraya.
drivers/net
that an aligned buffer address is
returned.
Signed-off-by: Kevin Hao
Acked-by: Vlastimil Babka
---
v3: Use align mask as suggested by Alexander.
include/linux/gfp.h | 12 ++--
mm/page_alloc.c | 8 +---
2 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/include/
align buffer is returned.
Then we can drop the ugly workarounds and avoid the unnecessary memory
waste.
Kevin Hao (4):
mm: page_frag: Introduce page_frag_alloc_align()
net: Introduce {netdev,napi}_alloc_frag_align()
net: octeontx2: Use napi_alloc_frag_align() to avoid the memory waste
On Tue, Feb 02, 2021 at 08:26:19AM -0800, Alexander Duyck wrote:
> On Sun, Jan 31, 2021 at 12:17 AM Kevin Hao wrote:
> >
> > In the current implementation of {netdev,napi}_alloc_frag(), it doesn't
> > have any align guarantee for the returned buffer address, But for
On Tue, Feb 02, 2021 at 08:19:54AM -0800, Alexander Duyck wrote:
> On Sat, Jan 30, 2021 at 11:54 PM Kevin Hao wrote:
> >
> > In the current implementation of page_frag_alloc(), it doesn't have
> > any align guarantee for the returned buffer address. But for some
> &g
The napi_alloc_frag_align() will guarantee that a correctly align
buffer address is returned. So use this function to simplify the buffer
alloc and avoid the unnecessary memory waste.
Signed-off-by: Kevin Hao
---
v2: No change.
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c | 3
t for the page_frag functions, so add the corresponding
{netdev,napi}_frag functions.
Signed-off-by: Kevin Hao
---
v2: Inline {netdev,napi}_alloc_frag().
include/linux/skbuff.h | 22 --
net/core/skbuff.c | 25 +
2 files changed, 29 insertions(+
The napi_alloc_frag_align() will guarantee that a correctly align
buffer address is returned. So use this function to simplify the buffer
alloc and avoid the unnecessary memory waste.
Signed-off-by: Kevin Hao
---
v2: No change.
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 3 +--
1 file
that an aligned buffer address is
returned.
Signed-off-by: Kevin Hao
Acked-by: Vlastimil Babka
---
v2:
- Inline page_frag_alloc()
- Adopt Vlastimil's suggestion and add his Acked-by
include/linux/gfp.h | 12 ++--
mm/page_alloc.c | 8 +---
2 files changed, 15 insert
ds to make sure that we can get a align buffer
address for some Ethernet drivers. This patch series tries to introduce
some helper functions to make sure that an align buffer is returned.
Then we can drop the ugly workarounds and avoid the unnecessary memory
waste.
Kevin Hao (4):
mm: page_frag:
On Sat, Jan 23, 2021 at 12:52:21PM -0800, Jakub Kicinski wrote:
> On Sat, 23 Jan 2021 19:59:00 +0800 Kevin Hao wrote:
> > +void *page_frag_alloc(struct page_frag_cache *nc,
> > + unsigned int fragsz, gfp_t gfp_mask)
> > +{
> > + return page_frag_alloc
that an aligned buffer address is
returned.
Signed-off-by: Kevin Hao
---
include/linux/gfp.h | 3 +++
mm/page_alloc.c | 12 ++--
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 6e479e9c48ce..e76e8618e9d7 100644
--- a/in
The napi_alloc_frag_align() will guarantee that a correctly align
buffer address is returned. So use this function to simplify the buffer
alloc and avoid the unnecessary memory waste.
Signed-off-by: Kevin Hao
---
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c | 3 +--
1 file changed
The napi_alloc_frag_align() will guarantee that a correctly align
buffer address is returned. So use this function to simplify the buffer
alloc and avoid the unnecessary memory waste.
Signed-off-by: Kevin Hao
---
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 3 +--
1 file changed, 1
t for the page_frag functions, so add the corresponding
{netdev,napi}_frag functions.
Signed-off-by: Kevin Hao
---
include/linux/skbuff.h | 2 ++
net/core/skbuff.c | 40 ++--
2 files changed, 28 insertions(+), 14 deletions(-)
diff --git a/include/
elper functions to make sure that an align buffer is returned.
Then we can drop the ugly workarounds and avoid the unnecessary memory
waste.
Kevin Hao (4):
mm: page_frag: Introduce page_frag_alloc_align()
net: Introduce {netdev,napi}_alloc_frag_align()
net: octeontx2: Use napi_alloc_frag_align
On Thu, Jan 21, 2021 at 09:53:08AM +, David Laight wrote:
> From: Kevin Hao
> > Sent: 21 January 2021 07:09
> >
> > The octeontx2 hardware needs the buffer to be 128 byte aligned.
> > But in the current implementation of napi_alloc_frag(), it can't
> > gu
() to make sure that the buffer is aligned correctly.
Fixes: 7a36e4918e30 ("octeontx2-pf: Use the napi_alloc_frag() to alloc the pool
buffers")
Reported-by: Subbaraya Sundeep
Signed-off-by: Kevin Hao
---
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c | 3 ++-
1 file change
On Wed, Jan 20, 2021 at 09:13:20PM -0800, Jakub Kicinski wrote:
> On Thu, 21 Jan 2021 13:09:10 +0800 Kevin Hao wrote:
> > On Wed, Jan 20, 2021 at 08:59:14PM -0800, Jakub Kicinski wrote:
> > > On Thu, 21 Jan 2021 12:20:35 +0800 Kevin Hao wrote:
> > > &g
On Wed, Jan 20, 2021 at 08:59:14PM -0800, Jakub Kicinski wrote:
> On Thu, 21 Jan 2021 12:20:35 +0800 Kevin Hao wrote:
> > Hmm, why not?
> > buf = napi_alloc_frag(pool->rbsize + 128);
> > buf = PTR_ALIGN(buf, 128);
>
> I'd keep the aligning in the driver u
On Wed, Jan 20, 2021 at 10:32:35AM +0530, sundeep.l...@gmail.com wrote:
> From: Subbaraya Sundeep
>
> Octeontx2 hardware needs buffer pointers which are 128 byte
> aligned. napi_alloc_frag() returns buffer pointers which are
> not 128 byte aligned sometimes because if napi_alloc_skb() is
> called
remain area of the allocated
page wasted. On a kernel with 64K page, 62K area is wasted.
IMHO it is really unnecessary to implement our own method for the
buffers allocate, we can reuse the napi_alloc_frag() to simplify
our code.
Signed-off-by: Kevin Hao
---
v3:
1. Use double underscore for
On Fri, May 08, 2020 at 05:38:33PM -0700, Jakub Kicinski wrote:
> On Fri, 8 May 2020 19:49:53 +0800 Kevin Hao wrote:
> > diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
> > b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
> > index f1d2d
remain area of the allocated
page wasted. On a kernel with 64K page, 62K area is wasted.
IMHO it is really unnecessary to implement our own method for the
buffers allocate, we can reuse the napi_alloc_frag() to simplify
our code.
Signed-off-by: Kevin Hao
---
v2: Use DMA_ATTR_SKIP_CPU_SYNC
On Fri, May 08, 2020 at 01:10:00PM +0530, Sunil Kovvuri wrote:
> On Fri, May 8, 2020 at 9:43 AM Kevin Hao wrote:
> >
> > In the current codes, the octeontx2 uses its own method to allocate
> > the pool buffers, but there are some issues in this implementation.
>
On Fri, May 08, 2020 at 10:18:27AM +0530, Sunil Kovvuri wrote:
> On Fri, May 8, 2020 at 9:43 AM Kevin Hao wrote:
> >
> > In the current codes, the octeontx2 uses its own method to allocate
> > the pool buffers, but there are some issues in this implementation.
>
remain area of the allocated
page wasted. On a kernel with 64K page, 62K area is wasted.
IMHO it is really unnecessary to implement our own method for the
buffers allocate, we can reuse the napi_alloc_frag() to simplify
our code.
Signed-off-by: Kevin Hao
---
.../marvell/octeontx2/nic
ault")
Signed-off-by: Kevin Hao
---
drivers/net/phy/realtek.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c
index ee3ca4a2f12b..9f48ecf9c627 100644
--- a/drivers/net/phy/realtek.c
+++ b/drivers/net/phy/realtek.c
@@ -172,6 +172,8 @@
The new general dummy stubs for MMD register access were introduced.
Use that for the codes reuse.
Signed-off-by: Kevin Hao
---
drivers/net/phy/micrel.c | 23 ++-
1 file changed, 2 insertions(+), 21 deletions(-)
diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy
ffect.
Fixes: b6b5e8a69118 ("gianfar: Disable EEE autoneg by default")
Signed-off-by: Kevin Hao
---
drivers/net/phy/phy_device.c | 17 +
include/linux/phy.h | 4
2 files changed, 21 insertions(+)
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/p
v2:
As suggested by Andrew:
- Add general dummy stubs
- Also use that for the micrel phy
This patch series fix the Ethernet broken on the mpc8315erdb board introduced
by commit b6b5e8a69118 ("gianfar: Disable EEE autoneg by default").
Kevin Hao (3):
net: phy: Add general dummy
On Mon, Mar 19, 2018 at 01:39:39PM +0100, Andrew Lunn wrote:
> On Mon, Mar 19, 2018 at 08:05:47PM +0800, Kevin Hao wrote:
> > The Ethernet on mpc8315erdb is broken since commit b6b5e8a69118
> > ("gianfar: Disable EEE autoneg by default"). The reason is that
> > e
indirect method. This makes it seem that the
EEE is supported by this phy device. And the subsequent writing to
the MMD registers does cause the phy malfunction. So add dummy stubs
for the MMD register access to fix this issue.
Fixes: b6b5e8a69118 ("gianfar: Disable EEE autoneg by default&qu
On Fri, Sep 18, 2015 at 09:36:42AM +, Shaohui Xie wrote:
> > -Original Message-
> > From: Kevin Hao [mailto:haoke...@gmail.com]
> > Sent: Friday, September 18, 2015 3:43 PM
> > To: netdev@vger.kernel.org
> > Cc: Florian Fainelli; Xie Shaohui-B21989
> &
Ethernet on p1010rdb-pa board.
So we definitely need a rework in order to support the 8641 phy
in this driver.
Signed-off-by: Kevin Hao
---
drivers/net/phy/vitesse.c | 14 --
1 file changed, 14 deletions(-)
diff --git a/drivers/net/phy/vitesse.c b/drivers/net/phy/vitesse.c
index
d the corresponding
memory barrier to guarantee that the update to the bdps, dirty_tx and
cur_tx performed in the proper order.
Signed-off-by: Kevin Hao
---
I have run into a kernel hang due to this race on a custom rt kernel. Even
I can't reproduce it on the vanilla kernel, it seems that the
40 matches
Mail list logo