* [PATCH] net/iavf: fix Tx offloading flags check @ 2023-10-23 16:38 Radu Nicolau 2023-10-24 5:42 ` Zhang, Qi Z 2023-10-25 9:12 ` [PATCH v2] " Radu Nicolau 0 siblings, 2 replies; 9+ messages in thread From: Radu Nicolau @ 2023-10-23 16:38 UTC (permalink / raw) To: Jingjing Wu, Beilei Xing; +Cc: dev, Radu Nicolau, stable, david.marchand Use IAVF_TX_OFFLOAD_MASK flags instead of IAVF_TX_CKSUM_OFFLOAD_MASK. Fixes: 3c715591ece0 ("net/iavf: fix checksum offloading") Cc: stable@dpdk.org Cc: david.marchand@redhat.com Signed-off-by: Radu Nicolau <radu.nicolau@intel.com> --- drivers/net/iavf/iavf_rxtx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c index c6ef6af1d8..85f8c141ce 100644 --- a/drivers/net/iavf/iavf_rxtx.c +++ b/drivers/net/iavf/iavf_rxtx.c @@ -2664,7 +2664,7 @@ iavf_build_data_desc_cmd_offset_fields(volatile uint64_t *qw1, l2tag1 |= m->vlan_tci; } - if ((m->ol_flags & IAVF_TX_CKSUM_OFFLOAD_MASK) == 0) + if ((m->ol_flags & IAVF_TX_OFFLOAD_MASK) == 0) goto skip_cksum; /* Set MACLEN */ -- 2.25.1 ^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: [PATCH] net/iavf: fix Tx offloading flags check 2023-10-23 16:38 [PATCH] net/iavf: fix Tx offloading flags check Radu Nicolau @ 2023-10-24 5:42 ` Zhang, Qi Z 2023-10-24 8:39 ` Radu Nicolau 2023-10-25 9:12 ` [PATCH v2] " Radu Nicolau 1 sibling, 1 reply; 9+ messages in thread From: Zhang, Qi Z @ 2023-10-24 5:42 UTC (permalink / raw) To: Nicolau, Radu, Wu, Jingjing, Xing, Beilei Cc: dev, Nicolau, Radu, stable, Marchand, David > -----Original Message----- > From: Radu Nicolau <radu.nicolau@intel.com> > Sent: Tuesday, October 24, 2023 12:38 AM > To: Wu, Jingjing <jingjing.wu@intel.com>; Xing, Beilei <beilei.xing@intel.com> > Cc: dev@dpdk.org; Nicolau, Radu <radu.nicolau@intel.com>; > stable@dpdk.org; Marchand, David <david.marchand@redhat.com> > Subject: [PATCH] net/iavf: fix Tx offloading flags check > > Use IAVF_TX_OFFLOAD_MASK flags instead of > IAVF_TX_CKSUM_OFFLOAD_MASK. > > Fixes: 3c715591ece0 ("net/iavf: fix checksum offloading") > Cc: stable@dpdk.org > Cc: david.marchand@redhat.com > > Signed-off-by: Radu Nicolau <radu.nicolau@intel.com> > --- > drivers/net/iavf/iavf_rxtx.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c index > c6ef6af1d8..85f8c141ce 100644 > --- a/drivers/net/iavf/iavf_rxtx.c > +++ b/drivers/net/iavf/iavf_rxtx.c > @@ -2664,7 +2664,7 @@ iavf_build_data_desc_cmd_offset_fields(volatile > uint64_t *qw1, > l2tag1 |= m->vlan_tci; > } > > - if ((m->ol_flags & IAVF_TX_CKSUM_OFFLOAD_MASK) == 0) > + if ((m->ol_flags & IAVF_TX_OFFLOAD_MASK) == 0) Not sure if this will break previous fix. Could you please provide some clarification regarding the specific offload flags that not in IAVF_TX_CKSUM_OFFLOAD_MASK, but you still don't want to skip? > goto skip_cksum; > > /* Set MACLEN */ > -- > 2.25.1 ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] net/iavf: fix Tx offloading flags check 2023-10-24 5:42 ` Zhang, Qi Z @ 2023-10-24 8:39 ` Radu Nicolau 2023-10-24 8:44 ` David Marchand 0 siblings, 1 reply; 9+ messages in thread From: Radu Nicolau @ 2023-10-24 8:39 UTC (permalink / raw) To: Zhang, Qi Z, Wu, Jingjing, Xing, Beilei; +Cc: dev, stable, Marchand, David On 24-Oct-23 6:42 AM, Zhang, Qi Z wrote: > >> -----Original Message----- >> From: Radu Nicolau <radu.nicolau@intel.com> >> Sent: Tuesday, October 24, 2023 12:38 AM >> To: Wu, Jingjing <jingjing.wu@intel.com>; Xing, Beilei <beilei.xing@intel.com> >> Cc: dev@dpdk.org; Nicolau, Radu <radu.nicolau@intel.com>; >> stable@dpdk.org; Marchand, David <david.marchand@redhat.com> >> Subject: [PATCH] net/iavf: fix Tx offloading flags check >> >> Use IAVF_TX_OFFLOAD_MASK flags instead of >> IAVF_TX_CKSUM_OFFLOAD_MASK. >> >> Fixes: 3c715591ece0 ("net/iavf: fix checksum offloading") >> Cc: stable@dpdk.org >> Cc: david.marchand@redhat.com >> >> Signed-off-by: Radu Nicolau <radu.nicolau@intel.com> >> --- >> drivers/net/iavf/iavf_rxtx.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c index >> c6ef6af1d8..85f8c141ce 100644 >> --- a/drivers/net/iavf/iavf_rxtx.c >> +++ b/drivers/net/iavf/iavf_rxtx.c >> @@ -2664,7 +2664,7 @@ iavf_build_data_desc_cmd_offset_fields(volatile >> uint64_t *qw1, >> l2tag1 |= m->vlan_tci; >> } >> >> - if ((m->ol_flags & IAVF_TX_CKSUM_OFFLOAD_MASK) == 0) >> + if ((m->ol_flags & IAVF_TX_OFFLOAD_MASK) == 0) > Not sure if this will break previous fix. > Could you please provide some clarification regarding the specific offload flags that not in IAVF_TX_CKSUM_OFFLOAD_MASK, but you still don't want to skip? A specific flag is RTE_ETH_TX_OFFLOAD_SECURITY, and because this is not contained in IAVF_TX_OFFLOAD_MASK the previous fix broke the inline crypto feature. The previous fix was supposed to prevent reading l2_len and l3_len if no Tx offloads has been requested - but there are offloads that can be requested that are not in the IAVF_TX_CKSUM_OFFLOAD_MASK set. > > > >> goto skip_cksum; >> >> /* Set MACLEN */ >> -- >> 2.25.1 ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] net/iavf: fix Tx offloading flags check 2023-10-24 8:39 ` Radu Nicolau @ 2023-10-24 8:44 ` David Marchand 2023-10-24 9:03 ` Radu Nicolau 0 siblings, 1 reply; 9+ messages in thread From: David Marchand @ 2023-10-24 8:44 UTC (permalink / raw) To: Radu Nicolau Cc: Zhang, Qi Z, Wu, Jingjing, Xing, Beilei, dev, stable, Ferruh Yigit, Thomas Monjalon, Akhil Goyal On Tue, Oct 24, 2023 at 10:40 AM Radu Nicolau <radu.nicolau@intel.com> wrote: > > > On 24-Oct-23 6:42 AM, Zhang, Qi Z wrote: > > > >> -----Original Message----- > >> From: Radu Nicolau <radu.nicolau@intel.com> > >> Sent: Tuesday, October 24, 2023 12:38 AM > >> To: Wu, Jingjing <jingjing.wu@intel.com>; Xing, Beilei <beilei.xing@intel.com> > >> Cc: dev@dpdk.org; Nicolau, Radu <radu.nicolau@intel.com>; > >> stable@dpdk.org; Marchand, David <david.marchand@redhat.com> > >> Subject: [PATCH] net/iavf: fix Tx offloading flags check > >> > >> Use IAVF_TX_OFFLOAD_MASK flags instead of > >> IAVF_TX_CKSUM_OFFLOAD_MASK. > >> > >> Fixes: 3c715591ece0 ("net/iavf: fix checksum offloading") > >> Cc: stable@dpdk.org > >> Cc: david.marchand@redhat.com > >> > >> Signed-off-by: Radu Nicolau <radu.nicolau@intel.com> > >> --- > >> drivers/net/iavf/iavf_rxtx.c | 2 +- > >> 1 file changed, 1 insertion(+), 1 deletion(-) > >> > >> diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c index > >> c6ef6af1d8..85f8c141ce 100644 > >> --- a/drivers/net/iavf/iavf_rxtx.c > >> +++ b/drivers/net/iavf/iavf_rxtx.c > >> @@ -2664,7 +2664,7 @@ iavf_build_data_desc_cmd_offset_fields(volatile > >> uint64_t *qw1, > >> l2tag1 |= m->vlan_tci; > >> } > >> > >> - if ((m->ol_flags & IAVF_TX_CKSUM_OFFLOAD_MASK) == 0) > >> + if ((m->ol_flags & IAVF_TX_OFFLOAD_MASK) == 0) > > Not sure if this will break previous fix. > > Could you please provide some clarification regarding the specific offload flags that not in IAVF_TX_CKSUM_OFFLOAD_MASK, but you still don't want to skip? > > A specific flag is RTE_ETH_TX_OFFLOAD_SECURITY, and because this is not > contained in IAVF_TX_OFFLOAD_MASK the previous fix broke the inline > crypto feature. RTE_ETH_TX_OFFLOAD_SECURITY is a ethdev level flag. This is not supposed to be in a mbuf ol_flags, is it? -- David Marchand ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] net/iavf: fix Tx offloading flags check 2023-10-24 8:44 ` David Marchand @ 2023-10-24 9:03 ` Radu Nicolau 2023-10-24 9:24 ` David Marchand 0 siblings, 1 reply; 9+ messages in thread From: Radu Nicolau @ 2023-10-24 9:03 UTC (permalink / raw) To: David Marchand Cc: Zhang, Qi Z, Wu, Jingjing, Xing, Beilei, dev, stable, Ferruh Yigit, Thomas Monjalon, Akhil Goyal On 24-Oct-23 9:44 AM, David Marchand wrote: > On Tue, Oct 24, 2023 at 10:40 AM Radu Nicolau <radu.nicolau@intel.com> wrote: >> >> On 24-Oct-23 6:42 AM, Zhang, Qi Z wrote: >>>> -----Original Message----- >>>> From: Radu Nicolau <radu.nicolau@intel.com> >>>> Sent: Tuesday, October 24, 2023 12:38 AM >>>> To: Wu, Jingjing <jingjing.wu@intel.com>; Xing, Beilei <beilei.xing@intel.com> >>>> Cc: dev@dpdk.org; Nicolau, Radu <radu.nicolau@intel.com>; >>>> stable@dpdk.org; Marchand, David <david.marchand@redhat.com> >>>> Subject: [PATCH] net/iavf: fix Tx offloading flags check >>>> >>>> Use IAVF_TX_OFFLOAD_MASK flags instead of >>>> IAVF_TX_CKSUM_OFFLOAD_MASK. >>>> >>>> Fixes: 3c715591ece0 ("net/iavf: fix checksum offloading") >>>> Cc: stable@dpdk.org >>>> Cc: david.marchand@redhat.com >>>> >>>> Signed-off-by: Radu Nicolau <radu.nicolau@intel.com> >>>> --- >>>> drivers/net/iavf/iavf_rxtx.c | 2 +- >>>> 1 file changed, 1 insertion(+), 1 deletion(-) >>>> >>>> diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c index >>>> c6ef6af1d8..85f8c141ce 100644 >>>> --- a/drivers/net/iavf/iavf_rxtx.c >>>> +++ b/drivers/net/iavf/iavf_rxtx.c >>>> @@ -2664,7 +2664,7 @@ iavf_build_data_desc_cmd_offset_fields(volatile >>>> uint64_t *qw1, >>>> l2tag1 |= m->vlan_tci; >>>> } >>>> >>>> - if ((m->ol_flags & IAVF_TX_CKSUM_OFFLOAD_MASK) == 0) >>>> + if ((m->ol_flags & IAVF_TX_OFFLOAD_MASK) == 0) >>> Not sure if this will break previous fix. >>> Could you please provide some clarification regarding the specific offload flags that not in IAVF_TX_CKSUM_OFFLOAD_MASK, but you still don't want to skip? >> A specific flag is RTE_ETH_TX_OFFLOAD_SECURITY, and because this is not >> contained in IAVF_TX_OFFLOAD_MASK the previous fix broke the inline >> crypto feature. > RTE_ETH_TX_OFFLOAD_SECURITY is a ethdev level flag. > This is not supposed to be in a mbuf ol_flags, is it? No, it's not, you are right. Actually it's RTE_MBUF_F_TX_SEC_OFFLOAD, and that also means the IAVF_TX_OFFLOAD_MASK definition is not correct. I will send another patch to fix the definition of IAVF_TX_OFFLOAD_MASK. As for this fix, if you prefer a safer approach I can add another check only for RTE_MBUF_F_TX_SEC_OFFLOAD, but one way or the other we need to have this fix. > > > ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] net/iavf: fix Tx offloading flags check 2023-10-24 9:03 ` Radu Nicolau @ 2023-10-24 9:24 ` David Marchand 0 siblings, 0 replies; 9+ messages in thread From: David Marchand @ 2023-10-24 9:24 UTC (permalink / raw) To: Radu Nicolau Cc: Zhang, Qi Z, Wu, Jingjing, Xing, Beilei, dev, stable, Ferruh Yigit, Thomas Monjalon, Akhil Goyal On Tue, Oct 24, 2023 at 11:04 AM Radu Nicolau <radu.nicolau@intel.com> wrote: > On 24-Oct-23 9:44 AM, David Marchand wrote: > > On Tue, Oct 24, 2023 at 10:40 AM Radu Nicolau <radu.nicolau@intel.com> wrote: > >> > >> On 24-Oct-23 6:42 AM, Zhang, Qi Z wrote: > >>>> -----Original Message----- > >>>> From: Radu Nicolau <radu.nicolau@intel.com> > >>>> Sent: Tuesday, October 24, 2023 12:38 AM > >>>> To: Wu, Jingjing <jingjing.wu@intel.com>; Xing, Beilei <beilei.xing@intel.com> > >>>> Cc: dev@dpdk.org; Nicolau, Radu <radu.nicolau@intel.com>; > >>>> stable@dpdk.org; Marchand, David <david.marchand@redhat.com> > >>>> Subject: [PATCH] net/iavf: fix Tx offloading flags check > >>>> > >>>> Use IAVF_TX_OFFLOAD_MASK flags instead of > >>>> IAVF_TX_CKSUM_OFFLOAD_MASK. > >>>> > >>>> Fixes: 3c715591ece0 ("net/iavf: fix checksum offloading") > >>>> Cc: stable@dpdk.org > >>>> Cc: david.marchand@redhat.com > >>>> > >>>> Signed-off-by: Radu Nicolau <radu.nicolau@intel.com> > >>>> --- > >>>> drivers/net/iavf/iavf_rxtx.c | 2 +- > >>>> 1 file changed, 1 insertion(+), 1 deletion(-) > >>>> > >>>> diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c index > >>>> c6ef6af1d8..85f8c141ce 100644 > >>>> --- a/drivers/net/iavf/iavf_rxtx.c > >>>> +++ b/drivers/net/iavf/iavf_rxtx.c > >>>> @@ -2664,7 +2664,7 @@ iavf_build_data_desc_cmd_offset_fields(volatile > >>>> uint64_t *qw1, > >>>> l2tag1 |= m->vlan_tci; > >>>> } > >>>> > >>>> - if ((m->ol_flags & IAVF_TX_CKSUM_OFFLOAD_MASK) == 0) > >>>> + if ((m->ol_flags & IAVF_TX_OFFLOAD_MASK) == 0) > >>> Not sure if this will break previous fix. > >>> Could you please provide some clarification regarding the specific offload flags that not in IAVF_TX_CKSUM_OFFLOAD_MASK, but you still don't want to skip? > >> A specific flag is RTE_ETH_TX_OFFLOAD_SECURITY, and because this is not > >> contained in IAVF_TX_OFFLOAD_MASK the previous fix broke the inline > >> crypto feature. > > RTE_ETH_TX_OFFLOAD_SECURITY is a ethdev level flag. > > This is not supposed to be in a mbuf ol_flags, is it? > > No, it's not, you are right. Actually it's RTE_MBUF_F_TX_SEC_OFFLOAD, > and that also means the IAVF_TX_OFFLOAD_MASK definition is not correct. > I will send another patch to fix the definition of IAVF_TX_OFFLOAD_MASK. Thanks. > > As for this fix, if you prefer a safer approach I can add another check > only for RTE_MBUF_F_TX_SEC_OFFLOAD, but one way or the other we need to > have this fix. There are multiple helpers touching offloads in this code and I don't have a clear view of what the best fix for this driver is. My concern is that IAVF_TX_OFFLOAD_MASK mixes both packet types (RTE_MBUF_F_TX_IPV[46], RTE_MBUF_F_TX_OUTER_IPV6[46]...) and actual offloading requests (RTE_MBUF_F_TX_VLAN, RTE_MBUF_F_TX_IP_CKSUM etc...). In the mbuf API, the presence of "packet types" tx flags is not described as something that requires filling l2_len / l3_len etc... For a similar reason, the presence of RTE_MBUF_F_TX_VLAN tells nothing about l2_len / l3_len. So switching to IAVF_TX_OFFLOAD_MASK seems dangerous. As for your suggestion, it seems safer only checking RTE_MBUF_F_TX_SEC_OFFLOAD, I agree. This code is still really hard to follow, so I'll let Intel maintainers advise on the best fix. -- David Marchand ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v2] net/iavf: fix Tx offloading flags check 2023-10-23 16:38 [PATCH] net/iavf: fix Tx offloading flags check Radu Nicolau 2023-10-24 5:42 ` Zhang, Qi Z @ 2023-10-25 9:12 ` Radu Nicolau 2023-10-26 8:07 ` David Marchand 1 sibling, 1 reply; 9+ messages in thread From: Radu Nicolau @ 2023-10-25 9:12 UTC (permalink / raw) To: Jingjing Wu, Beilei Xing; +Cc: dev, Radu Nicolau, stable, david.marchand Relax the check in the previous fix to allow packets with security offload flag set. Fixes: 3c715591ece0 ("net/iavf: fix checksum offloading") Cc: stable@dpdk.org Cc: david.marchand@redhat.com Signed-off-by: Radu Nicolau <radu.nicolau@intel.com> --- v2: extend the check for only TX_SEC_OFFLOAD drivers/net/iavf/iavf_rxtx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c index c6ef6af1d8..99007676a8 100644 --- a/drivers/net/iavf/iavf_rxtx.c +++ b/drivers/net/iavf/iavf_rxtx.c @@ -2664,7 +2664,8 @@ iavf_build_data_desc_cmd_offset_fields(volatile uint64_t *qw1, l2tag1 |= m->vlan_tci; } - if ((m->ol_flags & IAVF_TX_CKSUM_OFFLOAD_MASK) == 0) + if ((m->ol_flags & + (IAVF_TX_CKSUM_OFFLOAD_MASK | RTE_MBUF_F_TX_SEC_OFFLOAD)) == 0) goto skip_cksum; /* Set MACLEN */ -- 2.25.1 ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2] net/iavf: fix Tx offloading flags check 2023-10-25 9:12 ` [PATCH v2] " Radu Nicolau @ 2023-10-26 8:07 ` David Marchand 2023-10-30 0:19 ` Zhang, Qi Z 0 siblings, 1 reply; 9+ messages in thread From: David Marchand @ 2023-10-26 8:07 UTC (permalink / raw) To: Radu Nicolau; +Cc: Jingjing Wu, Beilei Xing, dev, stable On Wed, Oct 25, 2023 at 11:13 AM Radu Nicolau <radu.nicolau@intel.com> wrote: > > Relax the check in the previous fix to allow packets > with security offload flag set. > > Fixes: 3c715591ece0 ("net/iavf: fix checksum offloading") > Cc: stable@dpdk.org > > Signed-off-by: Radu Nicolau <radu.nicolau@intel.com> Acked-by: David Marchand <david.marchand@redhat.com> -- David Marchand ^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: [PATCH v2] net/iavf: fix Tx offloading flags check 2023-10-26 8:07 ` David Marchand @ 2023-10-30 0:19 ` Zhang, Qi Z 0 siblings, 0 replies; 9+ messages in thread From: Zhang, Qi Z @ 2023-10-30 0:19 UTC (permalink / raw) To: Marchand, David, Nicolau, Radu; +Cc: Wu, Jingjing, Xing, Beilei, dev, stable > -----Original Message----- > From: David Marchand <david.marchand@redhat.com> > Sent: Thursday, October 26, 2023 4:08 PM > To: Nicolau, Radu <radu.nicolau@intel.com> > Cc: Wu, Jingjing <jingjing.wu@intel.com>; Xing, Beilei <beilei.xing@intel.com>; > dev@dpdk.org; stable@dpdk.org > Subject: Re: [PATCH v2] net/iavf: fix Tx offloading flags check > > On Wed, Oct 25, 2023 at 11:13 AM Radu Nicolau <radu.nicolau@intel.com> > wrote: > > > > Relax the check in the previous fix to allow packets with security > > offload flag set. > > > > Fixes: 3c715591ece0 ("net/iavf: fix checksum offloading") > > Cc: stable@dpdk.org > > > > Signed-off-by: Radu Nicolau <radu.nicolau@intel.com> > > Acked-by: David Marchand <david.marchand@redhat.com> Applied to dpdk-next-net-intel. Thanks Qi > > > -- > David Marchand ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2023-10-30 0:19 UTC | newest] Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2023-10-23 16:38 [PATCH] net/iavf: fix Tx offloading flags check Radu Nicolau 2023-10-24 5:42 ` Zhang, Qi Z 2023-10-24 8:39 ` Radu Nicolau 2023-10-24 8:44 ` David Marchand 2023-10-24 9:03 ` Radu Nicolau 2023-10-24 9:24 ` David Marchand 2023-10-25 9:12 ` [PATCH v2] " Radu Nicolau 2023-10-26 8:07 ` David Marchand 2023-10-30 0:19 ` Zhang, Qi Z
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).