Re: [patch 1/9] [PATCH] qeth: convert to hw_features part 2

Michał Mirosław
2011-05-13T08:07:47Z

2011/5/13 <frank.blaschka@de.ibm.com>:
> From: Frank Blaschka <frank.blaschka@de.ibm.com>
>
> Set rx csum default to hw checksumming again.
> Remove sysfs interface for rx csum (checksumming) and TSO (large_send).
> With the new hw_features it does not work to keep the old sysfs
> interface in parallel. Convert options.checksum_type to new hw_features.
[...]
> @@ -1482,32 +1478,34 @@ static int qeth_l3_start_ipa_checksum(st
>
>        QETH_CARD_TEXT(card, 3, "strtcsum");
>
> -       if (card->options.checksum_type == NO_CHECKSUMMING) {
> -               dev_info(&card->gdev->dev,
> -                       "Using no checksumming on %s.\n",
> -                       QETH_CARD_IFNAME(card));
> -               return 0;
> -       }
> -       if (card->options.checksum_type == SW_CHECKSUMMING) {
> -               dev_info(&card->gdev->dev,
> -                       "Using SW checksumming on %s.\n",
> -                       QETH_CARD_IFNAME(card));
> -               return 0;
> -       }
> -       if (!qeth_is_supported(card, IPA_INBOUND_CHECKSUM)) {
> -               dev_info(&card->gdev->dev,
> +       if (card->dev->features & NETIF_F_RXCSUM) {
> +               /* hw may have changed during offline or recovery */
> +               if (!qeth_is_supported(card, IPA_INBOUND_CHECKSUM)) {
> +                       dev_info(&card->gdev->dev,
>                        "Inbound HW Checksumming not "
>                        "supported on %s,\ncontinuing "
>                        "using Inbound SW Checksumming\n",
>                        QETH_CARD_IFNAME(card));
> -               card->options.checksum_type = SW_CHECKSUMMING;
> -               return 0;
> -       }
> -       rc = qeth_l3_send_checksum_command(card);
> -       if (!rc)
> -               dev_info(&card->gdev->dev,
> +                       goto update_feature;
> +               }
> +
> +               rc = qeth_l3_send_checksum_command(card);
> +               if (!rc)
> +                       dev_info(&card->gdev->dev,
>                        "HW Checksumming (inbound) enabled\n");
> +               else
> +                       goto update_feature;
> +       } else
> +               dev_info(&card->gdev->dev,
> +                       "Using SW checksumming on %s.\n",
> +                       QETH_CARD_IFNAME(card));
> +       return 0;
>
> +update_feature:
> +       rtnl_lock();
> +       card->dev->features &= ~NETIF_F_RXCSUM;
> +       netdev_update_features(card->dev);
> +       rtnl_unlock();
>        return rc;
>  }

This will retry starting the RX checksumming via set_features(). Is
that the intention? If not, then just use something like my example in
qeth_l3_start_ipa_checksum().

Best Regards,
Michał Mirosław