* [net] cxgb4: advertise NETIF_F_HW_CSUM
@ 2021-01-05 16:57 Rohit Maheshwari
2021-01-05 17:30 ` Alexander Duyck
2021-01-05 20:29 ` Jakub Kicinski
0 siblings, 2 replies; 4+ messages in thread
From: Rohit Maheshwari @ 2021-01-05 16:57 UTC (permalink / raw)
To: kuba, netdev, davem; +Cc: secdev, Rohit Maheshwari
advertise NETIF_F_HW_CSUM instead of protocol specific values of
NETIF_F_IP_CSUM and NETIF_F_IPV6_CSUM. This change is added long
back in other drivers. This issue is seen recently when TLS offload
made it mandatory to enable NETIF_F_HW_CSUM.
Fixes: 2ed28baa7076 ("net: cxgb4{,vf}: convert to hw_features")
Signed-off-by: Rohit Maheshwari <rohitm@chelsio.com>
---
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
index 7fd264a6d085..f99f43570d41 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
@@ -6831,14 +6831,13 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
netdev->irq = pdev->irq;
netdev->hw_features = NETIF_F_SG | TSO_FLAGS |
- NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
+ NETIF_F_HW_CSUM |
NETIF_F_RXCSUM | NETIF_F_RXHASH | NETIF_F_GRO |
NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX |
NETIF_F_HW_TC | NETIF_F_NTUPLE;
if (chip_ver > CHELSIO_T5) {
- netdev->hw_enc_features |= NETIF_F_IP_CSUM |
- NETIF_F_IPV6_CSUM |
+ netdev->hw_enc_features |= NETIF_F_HW_CSUM |
NETIF_F_RXCSUM |
NETIF_F_GSO_UDP_TUNNEL |
NETIF_F_GSO_UDP_TUNNEL_CSUM |
--
2.18.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [net] cxgb4: advertise NETIF_F_HW_CSUM
2021-01-05 16:57 [net] cxgb4: advertise NETIF_F_HW_CSUM Rohit Maheshwari
@ 2021-01-05 17:30 ` Alexander Duyck
2021-01-05 20:29 ` Jakub Kicinski
1 sibling, 0 replies; 4+ messages in thread
From: Alexander Duyck @ 2021-01-05 17:30 UTC (permalink / raw)
To: Rohit Maheshwari; +Cc: Jakub Kicinski, Netdev, David Miller, secdev
On Tue, Jan 5, 2021 at 9:01 AM Rohit Maheshwari <rohitm@chelsio.com> wrote:
>
> advertise NETIF_F_HW_CSUM instead of protocol specific values of
> NETIF_F_IP_CSUM and NETIF_F_IPV6_CSUM. This change is added long
> back in other drivers. This issue is seen recently when TLS offload
> made it mandatory to enable NETIF_F_HW_CSUM.
>
> Fixes: 2ed28baa7076 ("net: cxgb4{,vf}: convert to hw_features")
> Signed-off-by: Rohit Maheshwari <rohitm@chelsio.com>
> ---
> drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
> index 7fd264a6d085..f99f43570d41 100644
> --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
> +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
> @@ -6831,14 +6831,13 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
> netdev->irq = pdev->irq;
>
> netdev->hw_features = NETIF_F_SG | TSO_FLAGS |
> - NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
> + NETIF_F_HW_CSUM |
> NETIF_F_RXCSUM | NETIF_F_RXHASH | NETIF_F_GRO |
> NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX |
> NETIF_F_HW_TC | NETIF_F_NTUPLE;
>
> if (chip_ver > CHELSIO_T5) {
> - netdev->hw_enc_features |= NETIF_F_IP_CSUM |
> - NETIF_F_IPV6_CSUM |
> + netdev->hw_enc_features |= NETIF_F_HW_CSUM |
> NETIF_F_RXCSUM |
> NETIF_F_GSO_UDP_TUNNEL |
> NETIF_F_GSO_UDP_TUNNEL_CSUM |
If you are going to enable the feature you should fully enable the
feature. My concern is the "nocsum:" label in hwcsum(). If you are
going to say you support the feature you should at least look at
dealing with the exception case and process a software checksum via
skb_checksum_help() rather than just not bothering and "hope a bad
packet is detected".
- Alex
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [net] cxgb4: advertise NETIF_F_HW_CSUM
2021-01-05 16:57 [net] cxgb4: advertise NETIF_F_HW_CSUM Rohit Maheshwari
2021-01-05 17:30 ` Alexander Duyck
@ 2021-01-05 20:29 ` Jakub Kicinski
2021-01-06 7:39 ` Tariq Toukan
1 sibling, 1 reply; 4+ messages in thread
From: Jakub Kicinski @ 2021-01-05 20:29 UTC (permalink / raw)
To: Rohit Maheshwari; +Cc: netdev, davem, secdev, Tariq Toukan, Boris Pismenny
On Tue, 5 Jan 2021 22:27:49 +0530 Rohit Maheshwari wrote:
> advertise NETIF_F_HW_CSUM instead of protocol specific values of
> NETIF_F_IP_CSUM and NETIF_F_IPV6_CSUM. This change is added long
> back in other drivers. This issue is seen recently when TLS offload
> made it mandatory to enable NETIF_F_HW_CSUM.
>
> Fixes: 2ed28baa7076 ("net: cxgb4{,vf}: convert to hw_features")
> Signed-off-by: Rohit Maheshwari <rohitm@chelsio.com>
Ugh, commit ae0b04b238e2 ("net: Disable NETIF_F_HW_TLS_TX when HW_CSUM
is disabled") is buggy, it should probably use NETIF_F_CSUM_MASK.
Can you fix that instead?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [net] cxgb4: advertise NETIF_F_HW_CSUM
2021-01-05 20:29 ` Jakub Kicinski
@ 2021-01-06 7:39 ` Tariq Toukan
0 siblings, 0 replies; 4+ messages in thread
From: Tariq Toukan @ 2021-01-06 7:39 UTC (permalink / raw)
To: Jakub Kicinski, Rohit Maheshwari
Cc: netdev, davem, secdev, Tariq Toukan, Boris Pismenny
On 1/5/2021 10:29 PM, Jakub Kicinski wrote:
> On Tue, 5 Jan 2021 22:27:49 +0530 Rohit Maheshwari wrote:
>> advertise NETIF_F_HW_CSUM instead of protocol specific values of
>> NETIF_F_IP_CSUM and NETIF_F_IPV6_CSUM. This change is added long
>> back in other drivers. This issue is seen recently when TLS offload
>> made it mandatory to enable NETIF_F_HW_CSUM.
>>
>> Fixes: 2ed28baa7076 ("net: cxgb4{,vf}: convert to hw_features")
>> Signed-off-by: Rohit Maheshwari <rohitm@chelsio.com>
>
> Ugh, commit ae0b04b238e2 ("net: Disable NETIF_F_HW_TLS_TX when HW_CSUM
> is disabled") is buggy, it should probably use NETIF_F_CSUM_MASK.
> Can you fix that instead?
>
The HW_TLS_TX feature is for both IPv4/6. We do not want to allow
NETIF_F_HW_TLS_TX if only one of (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM)
is set (of course NETIF_F_HW_CSUM is not set in this case).
Hence, using NETIF_F_CSUM_MASK would not be a strong enough condition.
I think we have two options here:
Either (1) request device drivers to move to NETIF_F_HW_CSUM if they
want to have HW_TLS_TX (as it is today), or (2) use the following condition:
((features & NETIF_F_IP_CSUM) && (features & NETIF_F_IPV6_CSUM)) ||
(features & NETIF_F_HW_CSUM).
Thanks,
Tariq
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-01-06 7:40 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-05 16:57 [net] cxgb4: advertise NETIF_F_HW_CSUM Rohit Maheshwari
2021-01-05 17:30 ` Alexander Duyck
2021-01-05 20:29 ` Jakub Kicinski
2021-01-06 7:39 ` Tariq Toukan
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.