* suspicius csum initialization in vmxnet3_rx_csum
@ 2018-05-24 8:47 Paolo Abeni
[not found] ` <EDF373A9-CD98-428C-B9D5-6C9139D35A72@vmware.com>
0 siblings, 1 reply; 8+ messages in thread
From: Paolo Abeni @ 2018-05-24 8:47 UTC (permalink / raw)
To: Ronak Doshi, Shrikrishna Khare, pv-drivers; +Cc: netdev, Neil Horman
Hi all,
we are hitting the BUG() condition in skb_checksum_help() -
skb_checksum_start_offset(skb) >= skb_headlen(skb) for skb received
from vmnxnet3 and queued from OVS to user-space
I think that the root cause is in vmxnet3_rx_csum():
if (gdesc->rcd.csum) {
skb->csum = htons(gdesc->rcd.csum);
skb->ip_summed = CHECKSUM_PARTIAL;
CHECKSUM_PARTIAL looks suspicious here, as the csum field is
initialized, instead of csum_offset/csum_start. To be honest I find
also strange that the csum value is converted from host byte order.
I'm wild guessing something like the below patch should fix the issue,
but I'm not familiar with the vmxnet3 code. Can you please have a look?
Thank you,
Paolo
---
diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
index 9ebe2a689966..06ade074c32c 100644
--- a/drivers/net/vmxnet3/vmxnet3_drv.c
+++ b/drivers/net/vmxnet3/vmxnet3_drv.c
@@ -1172,7 +1172,7 @@ vmxnet3_rx_csum(struct vmxnet3_adapter *adapter,
} else {
if (gdesc->rcd.csum) {
skb->csum = htons(gdesc->rcd.csum);
- skb->ip_summed = CHECKSUM_PARTIAL;
+ skb->ip_summed = CHECKSUM_COMPLETE;
} else {
skb_checksum_none_assert(skb);
}
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: suspicius csum initialization in vmxnet3_rx_csum
[not found] ` <BLUPR05MB1907699C14C2F900BA57323DD96A0@BLUPR05MB1907.namprd05.prod.outlook.com>
@ 2018-05-30 20:29 ` Paolo Abeni
2018-05-31 18:02 ` Ronak Doshi
0 siblings, 1 reply; 8+ messages in thread
From: Paolo Abeni @ 2018-05-30 20:29 UTC (permalink / raw)
To: Guolin Yang, Ronak Doshi; +Cc: Neil Horman, Boon Ang, Louis Luo, netdev
Hi,
On Thu, 2018-05-24 at 21:48 +0000, Guolin Yang wrote:
> Yes, that code is not correct, we should fix that code
Did you have any chance to address the issue and/or to give a more in-
deepth look to the change proposed in my initial email?
Thanks,
Paolo
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: suspicius csum initialization in vmxnet3_rx_csum
2018-05-30 20:29 ` Paolo Abeni
@ 2018-05-31 18:02 ` Ronak Doshi
2018-05-31 23:32 ` Neil Horman
0 siblings, 1 reply; 8+ messages in thread
From: Ronak Doshi @ 2018-05-31 18:02 UTC (permalink / raw)
To: Paolo Abeni; +Cc: Guolin Yang, Neil Horman, Boon Ang, Louis Luo, netdev
On Wed, 30 May 2018, Paolo Abeni wrote:
> Hi,
>
> On Thu, 2018-05-24 at 21:48 +0000, Guolin Yang wrote:
> > Yes, that code is not correct, we should fix that code
>
> Did you have any chance to address the issue and/or to give a more in-
> deepth look to the change proposed in my initial email?
>
Hi Paolo,
Can you provide the esx build you are using? It can be found using
"vmware -vl" on ESX host.
Did you try your proposed fix and did it work? Are you sure the packet
hits the below if block and not the else block? I still don't think the
ICMP packet will go through the below if block.
if (gdesc->rcd.csum) {
skb->csum = htons(gdesc->rcd.csum);
skb->ip_summed = CHECKSUM_PARTIAL;
} else {
skb_checksum_none_assert(skb);
}
The vmxnet3 emulation does not calculate rcd.csum for ICMP packet and
hence should go through the else block i.e. checksum none.
Thanks,
Ronak
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: suspicius csum initialization in vmxnet3_rx_csum
2018-05-31 18:02 ` Ronak Doshi
@ 2018-05-31 23:32 ` Neil Horman
2018-06-01 18:10 ` Ronak Doshi
0 siblings, 1 reply; 8+ messages in thread
From: Neil Horman @ 2018-05-31 23:32 UTC (permalink / raw)
To: Ronak Doshi; +Cc: Paolo Abeni, Guolin Yang, Boon Ang, Louis Luo, netdev
On Thu, May 31, 2018 at 11:02:34AM -0700, Ronak Doshi wrote:
>
> On Wed, 30 May 2018, Paolo Abeni wrote:
>
> > Hi,
> >
> > On Thu, 2018-05-24 at 21:48 +0000, Guolin Yang wrote:
> > > Yes, that code is not correct, we should fix that code
> >
> > Did you have any chance to address the issue and/or to give a more in-
> > deepth look to the change proposed in my initial email?
> >
> Hi Paolo,
>
> Can you provide the esx build you are using? It can be found using
> "vmware -vl" on ESX host.
>
> Did you try your proposed fix and did it work? Are you sure the packet
> hits the below if block and not the else block? I still don't think the
> ICMP packet will go through the below if block.
>
> if (gdesc->rcd.csum) {
> skb->csum = htons(gdesc->rcd.csum);
> skb->ip_summed = CHECKSUM_PARTIAL;
> } else {
> skb_checksum_none_assert(skb);
> }
>
> The vmxnet3 emulation does not calculate rcd.csum for ICMP packet and
> hence should go through the else block i.e. checksum none.
>
What packet types will rcd.csum be set for?
Neil
> Thanks,
> Ronak
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: suspicius csum initialization in vmxnet3_rx_csum
2018-05-31 23:32 ` Neil Horman
@ 2018-06-01 18:10 ` Ronak Doshi
2018-06-01 22:12 ` Neil Horman
2018-06-05 16:08 ` Paolo Abeni
0 siblings, 2 replies; 8+ messages in thread
From: Ronak Doshi @ 2018-06-01 18:10 UTC (permalink / raw)
To: Neil Horman; +Cc: Paolo Abeni, Guolin Yang, Boon Ang, Louis Luo, netdev
On Thu, 31 May 2018, Neil Horman wrote:
> On Thu, May 31, 2018 at 11:02:34AM -0700, Ronak Doshi wrote:
> >
> > On Wed, 30 May 2018, Paolo Abeni wrote:
> >
> > > Hi,
> > >
> > > On Thu, 2018-05-24 at 21:48 +0000, Guolin Yang wrote:
> > > > Yes, that code is not correct, we should fix that code
> > >
> > > Did you have any chance to address the issue and/or to give a more in-
> > > deepth look to the change proposed in my initial email?
> > >
> > Hi Paolo,
> >
> > Can you provide the esx build you are using? It can be found using
> > "vmware -vl" on ESX host.
> >
> > Did you try your proposed fix and did it work? Are you sure the packet
> > hits the below if block and not the else block? I still don't think the
> > ICMP packet will go through the below if block.
> >
> > if (gdesc->rcd.csum) {
> > skb->csum = htons(gdesc->rcd.csum);
> > skb->ip_summed = CHECKSUM_PARTIAL;
> > } else {
> > skb_checksum_none_assert(skb);
> > }
> >
> > The vmxnet3 emulation does not calculate rcd.csum for ICMP packet and
> > hence should go through the else block i.e. checksum none.
> >
> What packet types will rcd.csum be set for?
> Neil
>
I looked thorugh the emulation code and found that rcd.csum is not set.
For valid v4/v6, TCP/UDP packets the code block above the mentioend "if"
block will be executed or else it will go through checksum none.
That's why I wanted to know (in previous emails) which ESX build is being
used while this was tested. The code block under "if (gdesc->rcd.csum)"
block might seem incorrect but it shouldn't be hit as rcd.csum is not set.
Hence, I asked did the fix provided by Paolo worked for the icmp test?
Thanks,
Ronak
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: suspicius csum initialization in vmxnet3_rx_csum
2018-06-01 18:10 ` Ronak Doshi
@ 2018-06-01 22:12 ` Neil Horman
2018-06-05 16:08 ` Paolo Abeni
1 sibling, 0 replies; 8+ messages in thread
From: Neil Horman @ 2018-06-01 22:12 UTC (permalink / raw)
To: Ronak Doshi; +Cc: Paolo Abeni, Guolin Yang, Boon Ang, Louis Luo, netdev
On Fri, Jun 01, 2018 at 11:10:01AM -0700, Ronak Doshi wrote:
>
>
> On Thu, 31 May 2018, Neil Horman wrote:
>
> > On Thu, May 31, 2018 at 11:02:34AM -0700, Ronak Doshi wrote:
> > >
> > > On Wed, 30 May 2018, Paolo Abeni wrote:
> > >
> > > > Hi,
> > > >
> > > > On Thu, 2018-05-24 at 21:48 +0000, Guolin Yang wrote:
> > > > > Yes, that code is not correct, we should fix that code
> > > >
> > > > Did you have any chance to address the issue and/or to give a more in-
> > > > deepth look to the change proposed in my initial email?
> > > >
> > > Hi Paolo,
> > >
> > > Can you provide the esx build you are using? It can be found using
> > > "vmware -vl" on ESX host.
> > >
> > > Did you try your proposed fix and did it work? Are you sure the packet
> > > hits the below if block and not the else block? I still don't think the
> > > ICMP packet will go through the below if block.
> > >
> > > if (gdesc->rcd.csum) {
> > > skb->csum = htons(gdesc->rcd.csum);
> > > skb->ip_summed = CHECKSUM_PARTIAL;
> > > } else {
> > > skb_checksum_none_assert(skb);
> > > }
> > >
> > > The vmxnet3 emulation does not calculate rcd.csum for ICMP packet and
> > > hence should go through the else block i.e. checksum none.
> > >
> > What packet types will rcd.csum be set for?
> > Neil
> >
> I looked thorugh the emulation code and found that rcd.csum is not set.
> For valid v4/v6, TCP/UDP packets the code block above the mentioend "if"
> block will be executed or else it will go through checksum none.
>
> That's why I wanted to know (in previous emails) which ESX build is being
> used while this was tested. The code block under "if (gdesc->rcd.csum)"
> block might seem incorrect but it shouldn't be hit as rcd.csum is not set.
> Hence, I asked did the fix provided by Paolo worked for the icmp test?
>
Paolo will have to tell you that specifically I'm afraid. I'm not sure if the patch was tested or not.
> Thanks,
> Ronak
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: suspicius csum initialization in vmxnet3_rx_csum
2018-06-01 18:10 ` Ronak Doshi
2018-06-01 22:12 ` Neil Horman
@ 2018-06-05 16:08 ` Paolo Abeni
2018-06-05 19:15 ` Ronak Doshi
1 sibling, 1 reply; 8+ messages in thread
From: Paolo Abeni @ 2018-06-05 16:08 UTC (permalink / raw)
To: Ronak Doshi, Neil Horman; +Cc: Guolin Yang, Boon Ang, Louis Luo, netdev
Hi,
I'm sorry for the long delay in my answer, I've been travelling.
On Fri, 2018-06-01 at 11:10 -0700, Ronak Doshi wrote:
> On Thu, 31 May 2018, Neil Horman wrote:
> > What packet types will rcd.csum be set for?
> > Neil
>
> I looked thorugh the emulation code and found that rcd.csum is not set.
> For valid v4/v6, TCP/UDP packets the code block above the mentioend "if"
> block will be executed or else it will go through checksum none.
>
> That's why I wanted to know (in previous emails) which ESX build is being
> used while this was tested. The code block under "if (gdesc->rcd.csum)"
> block might seem incorrect but it shouldn't be hit as rcd.csum is not set.
I'm unsure if I read the above correctly. Do you mean that the relevant
code-path is never hit? If so, can we simply drop it, as we agreed that
such code is uncorrect? Elsewhere, could you plese specify under which
circumstances gdesc->rcd.csum is filled by the hypervisor?
> Hence, I asked did the fix provided by Paolo worked for the icmp test?
Unfortunatelly so far I've not been able to reproduce the issue outside
a production environment and I can't run test kernel there.
Thanks,
Paolo
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: suspicius csum initialization in vmxnet3_rx_csum
2018-06-05 16:08 ` Paolo Abeni
@ 2018-06-05 19:15 ` Ronak Doshi
0 siblings, 0 replies; 8+ messages in thread
From: Ronak Doshi @ 2018-06-05 19:15 UTC (permalink / raw)
To: Paolo Abeni; +Cc: Neil Horman, Guolin Yang, Boon Ang, Louis Luo, netdev
On Tue, 5 Jun 2018, Paolo Abeni wrote:
> Hi,
>
> I'm sorry for the long delay in my answer, I've been travelling.
>
> On Fri, 2018-06-01 at 11:10 -0700, Ronak Doshi wrote:
> > On Thu, 31 May 2018, Neil Horman wrote:
> > > What packet types will rcd.csum be set for?
> > > Neil
> >
> > I looked thorugh the emulation code and found that rcd.csum is not set.
> > For valid v4/v6, TCP/UDP packets the code block above the mentioend "if"
> > block will be executed or else it will go through checksum none.
> >
> > That's why I wanted to know (in previous emails) which ESX build is being
> > used while this was tested. The code block under "if (gdesc->rcd.csum)"
> > block might seem incorrect but it shouldn't be hit as rcd.csum is not set.
>
> I'm unsure if I read the above correctly. Do you mean that the relevant
> code-path is never hit? If so, can we simply drop it, as we agreed that
> such code is uncorrect? Elsewhere, could you plese specify under which
> circumstances gdesc->rcd.csum is filled by the hypervisor?
>
I do not see hypervisor populating rcd.csum field or may be the code has
changed over the years. So, the codepath should not be hit as it is not
populated. I will check and fix it or remove the block if not required.
But as far as your issue is concerned, that code block is not hit.
Thanks,
Ronak
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2018-06-05 19:15 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-24 8:47 suspicius csum initialization in vmxnet3_rx_csum Paolo Abeni
[not found] ` <EDF373A9-CD98-428C-B9D5-6C9139D35A72@vmware.com>
[not found] ` <BLUPR05MB1907699C14C2F900BA57323DD96A0@BLUPR05MB1907.namprd05.prod.outlook.com>
2018-05-30 20:29 ` Paolo Abeni
2018-05-31 18:02 ` Ronak Doshi
2018-05-31 23:32 ` Neil Horman
2018-06-01 18:10 ` Ronak Doshi
2018-06-01 22:12 ` Neil Horman
2018-06-05 16:08 ` Paolo Abeni
2018-06-05 19:15 ` Ronak Doshi
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).