diff mbox series

[net-next,1/2] net: mana: Add handling of CQE_RX_TRUNCATED

Message ID 1644014745-22261-2-git-send-email-haiyangz@microsoft.com (mailing list archive)
State Accepted
Commit e4b7621982d29f26ff4d39af389e5e675a4ffed4
Delegated to: Netdev Maintainers
Headers show
Series net: mana: Add handling of CQE_RX_TRUNCATED and a cleanup | expand

Checks

Context Check Description
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cover_letter success Series has a cover letter
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers warning 2 maintainers not CCed: wei.liu@kernel.org kuba@kernel.org
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 19 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/tree_selection success Guessing tree name failed - patch did not apply

Commit Message

Haiyang Zhang Feb. 4, 2022, 10:45 p.m. UTC
The proper way to drop this kind of CQE is advancing rxq tail
without indicating the packet to the upper network layer.

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
---
 drivers/net/ethernet/microsoft/mana/mana_en.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Dexuan Cui Feb. 4, 2022, 11:52 p.m. UTC | #1
> From: LKML haiyangz <lkmlhyz@microsoft.com> On Behalf Of Haiyang Zhang
> Sent: Friday, February 4, 2022 2:46 PM
>  ..
> The proper way to drop this kind of CQE is advancing rxq tail
> without indicating the packet to the upper network layer.
> 
> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>

Reviewed-by: Dexuan Cui <decui@microsoft.com>
Haiyang Zhang Feb. 5, 2022, 10:32 p.m. UTC | #2
> -----Original Message-----
> From: LKML haiyangz <lkmlhyz@microsoft.com> On Behalf Of Haiyang Zhang
> Sent: Friday, February 4, 2022 5:46 PM
> To: linux-hyperv@vger.kernel.org; netdev@vger.kernel.org
> Cc: Haiyang Zhang <haiyangz@microsoft.com>; Dexuan Cui <decui@microsoft.com>; KY
> Srinivasan <kys@microsoft.com>; Stephen Hemminger <sthemmin@microsoft.com>; Paul Rosswurm
> <paulros@microsoft.com>; Shachar Raindel <shacharr@microsoft.com>; olaf@aepfle.de;
> vkuznets <vkuznets@redhat.com>; davem@davemloft.net; linux-kernel@vger.kernel.org
> Subject: [PATCH net-next, 1/2] net: mana: Add handling of CQE_RX_TRUNCATED
> 
> The proper way to drop this kind of CQE is advancing rxq tail
> without indicating the packet to the upper network layer.
> 
> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
> ---
>  drivers/net/ethernet/microsoft/mana/mana_en.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/microsoft/mana/mana_en.c
> b/drivers/net/ethernet/microsoft/mana/mana_en.c
> index 69e791e6abc4..d2481a500654 100644
> --- a/drivers/net/ethernet/microsoft/mana/mana_en.c
> +++ b/drivers/net/ethernet/microsoft/mana/mana_en.c
> @@ -1085,8 +1085,10 @@ static void mana_process_rx_cqe(struct mana_rxq *rxq, struct
> mana_cq *cq,
>  		break;
> 
>  	case CQE_RX_TRUNCATED:
> -		netdev_err(ndev, "Dropped a truncated packet\n");
> -		return;
> +		++ndev->stats.rx_dropped;
> +		rxbuf_oob = &rxq->rx_oobs[rxq->buf_index];
> +		netdev_warn_once(ndev, "Dropped a truncated packet\n");
> +		goto drop;
> 
>  	case CQE_RX_COALESCED_4:
>  		netdev_err(ndev, "RX coalescing is unsupported\n");
> @@ -1154,6 +1156,7 @@ static void mana_process_rx_cqe(struct mana_rxq *rxq, struct mana_cq
> *cq,
> 
>  	mana_rx_skb(old_buf, oob, rxq);
> 
> +drop:
>  	mana_move_wq_tail(rxq->gdma_rq, rxbuf_oob->wqe_inf.wqe_size_in_bu);
> 
>  	mana_post_pkt_rxq(rxq);
> --

To netdev maintainers:

Since the proper handling of CQE_RX_TRUNCATED type is important, could any
of you backport this patch to the stable branches: 5.16 & 5.15?

Thanks,
- Haiyang
Jakub Kicinski Feb. 7, 2022, 5:12 p.m. UTC | #3
On Sat, 5 Feb 2022 22:32:41 +0000 Haiyang Zhang wrote:
> Since the proper handling of CQE_RX_TRUNCATED type is important, could any
> of you backport this patch to the stable branches: 5.16 & 5.15?

Only patches which are in Linus's tree can be backported to stable.
You sent this change for -next so no, it can't be backported now.
You need to wait until 5.17 final is released and then ask Greg KH 
to backport it.
Haiyang Zhang Feb. 8, 2022, 7:55 p.m. UTC | #4
> -----Original Message-----
> From: Jakub Kicinski <kuba@kernel.org>
> Sent: Monday, February 7, 2022 12:12 PM
> To: Haiyang Zhang <haiyangz@microsoft.com>
> Cc: linux-hyperv@vger.kernel.org; netdev@vger.kernel.org; Dexuan Cui <decui@microsoft.com>;
> KY Srinivasan <kys@microsoft.com>; Stephen Hemminger <sthemmin@microsoft.com>; Paul
> Rosswurm <paulros@microsoft.com>; Shachar Raindel <shacharr@microsoft.com>; olaf@aepfle.de;
> vkuznets <vkuznets@redhat.com>; davem@davemloft.net; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH net-next, 1/2] net: mana: Add handling of CQE_RX_TRUNCATED
> 
> On Sat, 5 Feb 2022 22:32:41 +0000 Haiyang Zhang wrote:
> > Since the proper handling of CQE_RX_TRUNCATED type is important, could any
> > of you backport this patch to the stable branches: 5.16 & 5.15?
> 
> Only patches which are in Linus's tree can be backported to stable.
> You sent this change for -next so no, it can't be backported now.
> You need to wait until 5.17 final is released and then ask Greg KH
> to backport it.

Will do.

Thanks!
Haiyang Zhang June 21, 2022, 7:55 p.m. UTC | #5
> -----Original Message-----
> From: Jakub Kicinski <kuba@kernel.org>
> Sent: Monday, February 7, 2022 12:12 PM
> To: Haiyang Zhang <haiyangz@microsoft.com>
> Cc: linux-hyperv@vger.kernel.org; netdev@vger.kernel.org; Dexuan Cui
> <decui@microsoft.com>; KY Srinivasan <kys@microsoft.com>; Stephen
> Hemminger <sthemmin@microsoft.com>; Paul Rosswurm
> <paulros@microsoft.com>; Shachar Raindel <shacharr@microsoft.com>;
> olaf@aepfle.de; vkuznets <vkuznets@redhat.com>; davem@davemloft.net;
> linux-kernel@vger.kernel.org
> Subject: Re: [PATCH net-next, 1/2] net: mana: Add handling of
> CQE_RX_TRUNCATED
> 
> On Sat, 5 Feb 2022 22:32:41 +0000 Haiyang Zhang wrote:
> > Since the proper handling of CQE_RX_TRUNCATED type is important, could
> any
> > of you backport this patch to the stable branches: 5.16 & 5.15?
> 
> Only patches which are in Linus's tree can be backported to stable.
> You sent this change for -next so no, it can't be backported now.
> You need to wait until 5.17 final is released and then ask Greg KH
> to backport it.

@Greg KH <gregkh@linuxfoundation.org>

Hi Greg,

This patch is on 5.18 now:
	net: mana: Add handling of CQE_RX_TRUNCATED
	https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.18.5&id=e4b7621982d29f26ff4d39af389e5e675a4ffed4

Could you backport it to 5.15?

Thanks,
- Haiyang
Greg KH June 21, 2022, 8:26 p.m. UTC | #6
On Tue, Jun 21, 2022 at 07:55:26PM +0000, Haiyang Zhang wrote:
> 
> 
> > -----Original Message-----
> > From: Jakub Kicinski <kuba@kernel.org>
> > Sent: Monday, February 7, 2022 12:12 PM
> > To: Haiyang Zhang <haiyangz@microsoft.com>
> > Cc: linux-hyperv@vger.kernel.org; netdev@vger.kernel.org; Dexuan Cui
> > <decui@microsoft.com>; KY Srinivasan <kys@microsoft.com>; Stephen
> > Hemminger <sthemmin@microsoft.com>; Paul Rosswurm
> > <paulros@microsoft.com>; Shachar Raindel <shacharr@microsoft.com>;
> > olaf@aepfle.de; vkuznets <vkuznets@redhat.com>; davem@davemloft.net;
> > linux-kernel@vger.kernel.org
> > Subject: Re: [PATCH net-next, 1/2] net: mana: Add handling of
> > CQE_RX_TRUNCATED
> > 
> > On Sat, 5 Feb 2022 22:32:41 +0000 Haiyang Zhang wrote:
> > > Since the proper handling of CQE_RX_TRUNCATED type is important, could
> > any
> > > of you backport this patch to the stable branches: 5.16 & 5.15?
> > 
> > Only patches which are in Linus's tree can be backported to stable.
> > You sent this change for -next so no, it can't be backported now.
> > You need to wait until 5.17 final is released and then ask Greg KH
> > to backport it.
> 
> @Greg KH <gregkh@linuxfoundation.org>
> 
> Hi Greg,
> 
> This patch is on 5.18 now:
> 	net: mana: Add handling of CQE_RX_TRUNCATED
> 	https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.18.5&id=e4b7621982d29f26ff4d39af389e5e675a4ffed4
> 
> Could you backport it to 5.15?


<formletter>

This is not the correct way to submit patches for inclusion in the
stable kernel tree.  Please read:
    https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
for how to do this properly.

</formletter>
Haiyang Zhang June 21, 2022, 8:34 p.m. UTC | #7
> -----Original Message-----
> From: Greg KH <gregkh@linuxfoundation.org>
> Sent: Tuesday, June 21, 2022 4:27 PM
> To: Haiyang Zhang <haiyangz@microsoft.com>
> Cc: Jakub Kicinski <kuba@kernel.org>; linux-hyperv@vger.kernel.org;
> netdev@vger.kernel.org; Dexuan Cui <decui@microsoft.com>; KY Srinivasan
> <kys@microsoft.com>; Stephen Hemminger <sthemmin@microsoft.com>; Paul
> Rosswurm <paulros@microsoft.com>; Shachar Raindel
> <shacharr@microsoft.com>; olaf@aepfle.de; vkuznets <vkuznets@redhat.com>;
> davem@davemloft.net; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH net-next, 1/2] net: mana: Add handling of
> CQE_RX_TRUNCATED
> 
> <formletter>
> 
> This is not the correct way to submit patches for inclusion in the
> stable kernel tree.  Please read:
> 
> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.ker
> nel.org%2Fdoc%2Fhtml%2Flatest%2Fprocess%2Fstable-kernel-
> rules.html&amp;data=05%7C01%7Chaiyangz%40microsoft.com%7C9ecaef20f4
> c04a77741e08da53c45e7d%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0
> %7C637914400166157108%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAw
> MDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7
> C&amp;sdata=Lgg0cEUxQf3uhKHqAF0pTFcQvHj4NKkUCEuQ9elePvw%3D&amp;
> reserved=0
> for how to do this properly.
> 
> </formletter>

Thanks. I will do.

- Haiyang
diff mbox series

Patch

diff --git a/drivers/net/ethernet/microsoft/mana/mana_en.c b/drivers/net/ethernet/microsoft/mana/mana_en.c
index 69e791e6abc4..d2481a500654 100644
--- a/drivers/net/ethernet/microsoft/mana/mana_en.c
+++ b/drivers/net/ethernet/microsoft/mana/mana_en.c
@@ -1085,8 +1085,10 @@  static void mana_process_rx_cqe(struct mana_rxq *rxq, struct mana_cq *cq,
 		break;
 
 	case CQE_RX_TRUNCATED:
-		netdev_err(ndev, "Dropped a truncated packet\n");
-		return;
+		++ndev->stats.rx_dropped;
+		rxbuf_oob = &rxq->rx_oobs[rxq->buf_index];
+		netdev_warn_once(ndev, "Dropped a truncated packet\n");
+		goto drop;
 
 	case CQE_RX_COALESCED_4:
 		netdev_err(ndev, "RX coalescing is unsupported\n");
@@ -1154,6 +1156,7 @@  static void mana_process_rx_cqe(struct mana_rxq *rxq, struct mana_cq *cq,
 
 	mana_rx_skb(old_buf, oob, rxq);
 
+drop:
 	mana_move_wq_tail(rxq->gdma_rq, rxbuf_oob->wqe_inf.wqe_size_in_bu);
 
 	mana_post_pkt_rxq(rxq);