From: Nicolas Ferre <nicolas.ferre@microchip.com>
To: Jennifer Dahm <jennifer.dahm@ni.com>, <netdev@vger.kernel.org>,
"David S . Miller" <davem@davemloft.net>
Cc: Nathan Sullivan <nathan.sullivan@ni.com>
Subject: Re: [RFC PATCH 1/2] net: macb: Add CAP to disable hardware TX checksum offloading
Date: Mon, 4 Jun 2018 17:13:28 +0200 [thread overview]
Message-ID: <ad25fd2b-a3a0-28d5-4dd1-a7ccc935fff2@microchip.com> (raw)
In-Reply-To: <1527284654-24835-2-git-send-email-jennifer.dahm@ni.com>
On 25/05/2018 at 23:44, Jennifer Dahm wrote:
> Certain PHYs have significant bugs in their TX checksum offloading
> that cannot be solved in software. In order to accommodate these PHYS,
> add a CAP to disable this hardware.
>
> Signed-off-by: Jennifer Dahm <jennifer.dahm@ni.com>
> ---
> drivers/net/ethernet/cadence/macb.h | 1 +
> drivers/net/ethernet/cadence/macb_main.c | 8 ++++++--
> 2 files changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h
> index 8665982..6b85e97 100644
> --- a/drivers/net/ethernet/cadence/macb.h
> +++ b/drivers/net/ethernet/cadence/macb.h
> @@ -635,6 +635,7 @@
> #define MACB_CAPS_USRIO_DISABLED 0x00000010
> #define MACB_CAPS_JUMBO 0x00000020
> #define MACB_CAPS_GEM_HAS_PTP 0x00000040
> +#define MACB_CAPS_DISABLE_TX_HW_CSUM 0x00000080
Nitpicking: "DISABLED" tends to be at the end of the name...
> #define MACB_CAPS_FIFO_MODE 0x10000000
> #define MACB_CAPS_GIGABIT_MODE_AVAILABLE 0x20000000
> #define MACB_CAPS_SG_DISABLED 0x40000000
> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
> index 3e93df5..a5d564b 100644
> --- a/drivers/net/ethernet/cadence/macb_main.c
> +++ b/drivers/net/ethernet/cadence/macb_main.c
> @@ -3360,8 +3360,12 @@ static int macb_init(struct platform_device *pdev)
> dev->hw_features |= MACB_NETIF_LSO;
>
> /* Checksum offload is only available on gem with packet buffer */
> - if (macb_is_gem(bp) && !(bp->caps & MACB_CAPS_FIFO_MODE))
> - dev->hw_features |= NETIF_F_HW_CSUM | NETIF_F_RXCSUM;
> + if (macb_is_gem(bp) && !(bp->caps & MACB_CAPS_FIFO_MODE)) {
> + if (!(bp->caps & MACB_CAPS_DISABLE_TX_HW_CSUM))
Why not the other way around? negating a "disabled" feature is always
challenge ;-)
> + dev->hw_features |= NETIF_F_HW_CSUM | NETIF_F_RXCSUM;
> + else
> + dev->hw_features |= NETIF_F_RXCSUM;
> + }
> if (bp->caps & MACB_CAPS_SG_DISABLED)
> dev->hw_features &= ~NETIF_F_SG;
> dev->features = dev->hw_features;
>
--
Nicolas Ferre
next prev parent reply other threads:[~2018-06-04 15:15 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-25 21:44 [RFC PATCH 0/2] net: macb: Disable TX checksum offloading on all Zynq Jennifer Dahm
2018-05-25 21:44 ` [RFC PATCH 1/2] net: macb: Add CAP to disable hardware TX checksum offloading Jennifer Dahm
2018-06-04 15:13 ` Nicolas Ferre [this message]
2018-06-07 16:43 ` Jennifer Dahm
2018-05-25 21:44 ` [RFC PATCH 2/2] net: macb: Disable TX checksum offloading on all Zynq Jennifer Dahm
2018-06-04 15:06 ` Nicolas Ferre
2018-06-06 6:50 ` Michal Simek
2018-06-04 15:05 ` [RFC PATCH 0/2] " Nicolas Ferre
2018-06-05 4:51 ` Harini Katakam
2018-08-01 12:53 ` Harini Katakam
2018-08-07 8:50 ` Claudiu Beznea
2018-08-07 9:09 ` Harini Katakam
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ad25fd2b-a3a0-28d5-4dd1-a7ccc935fff2@microchip.com \
--to=nicolas.ferre@microchip.com \
--cc=davem@davemloft.net \
--cc=jennifer.dahm@ni.com \
--cc=nathan.sullivan@ni.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).