public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: snelson@pensando.io
Cc: kernel-janitors@vger.kernel.org
Subject: [bug report] ionic: add ethtool support for PTP
Date: Fri, 9 Apr 2021 09:47:32 +0300	[thread overview]
Message-ID: <YG/4hBGWp35acsPo@mwanda> (raw)

Hello Shannon Nelson,

The patch f8ba81da73fc: "ionic: add ethtool support for PTP" from Apr
1, 2021, leads to the following static checker warning:

drivers/net/ethernet/pensando/ionic/ionic_ethtool.c:895 ionic_get_ts_info() warn: 'HWTSTAMP_FILTER_PTP_V1_L4_SYNC' is a shifter (not for '|=').
drivers/net/ethernet/pensando/ionic/ionic_ethtool.c:899 ionic_get_ts_info() warn: 'HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ' is a shifter (not for '|=').
drivers/net/ethernet/pensando/ionic/ionic_ethtool.c:903 ionic_get_ts_info() warn: 'HWTSTAMP_FILTER_PTP_V1_L4_EVENT' is a shifter (not for '|=').
drivers/net/ethernet/pensando/ionic/ionic_ethtool.c:907 ionic_get_ts_info() warn: 'HWTSTAMP_FILTER_PTP_V2_L4_SYNC' is a shifter (not for '|=').
drivers/net/ethernet/pensando/ionic/ionic_ethtool.c:911 ionic_get_ts_info() warn: 'HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ' is a shifter (not for '|=').
drivers/net/ethernet/pensando/ionic/ionic_ethtool.c:915 ionic_get_ts_info() warn: 'HWTSTAMP_FILTER_PTP_V2_L4_EVENT' is a shifter (not for '|=').
drivers/net/ethernet/pensando/ionic/ionic_ethtool.c:927 ionic_get_ts_info() warn: 'HWTSTAMP_FILTER_PTP_V2_L2_EVENT' is a shifter (not for '|=').
drivers/net/ethernet/pensando/ionic/ionic_ethtool.c:931 ionic_get_ts_info() warn: 'HWTSTAMP_FILTER_PTP_V2_SYNC' is a shifter (not for '|=').
drivers/net/ethernet/pensando/ionic/ionic_ethtool.c:935 ionic_get_ts_info() warn: 'HWTSTAMP_FILTER_PTP_V2_DELAY_REQ' is a shifter (not for '|=').
drivers/net/ethernet/pensando/ionic/ionic_ethtool.c:939 ionic_get_ts_info() warn: 'HWTSTAMP_FILTER_PTP_V2_EVENT' is a shifter (not for '|=').

drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
   884          /* rx filters */
   885  
   886          info->rx_filters = BIT(HWTSTAMP_FILTER_NONE) |
   887                             BIT(HWTSTAMP_FILTER_ALL);
   888  
   889          mask = cpu_to_le64(IONIC_PKT_CLS_NTP_ALL);
   890          if ((ionic->ident.lif.eth.hwstamp_rx_filters & mask) == mask)
   891                  info->rx_filters |= HWTSTAMP_FILTER_NTP_ALL;
   892  
   893          mask = cpu_to_le64(IONIC_PKT_CLS_PTP1_SYNC);
   894          if ((ionic->ident.lif.eth.hwstamp_rx_filters & mask) == mask)
   895                  info->rx_filters |= HWTSTAMP_FILTER_PTP_V1_L4_SYNC;

This should probably be: BIT(HWTSTAMP_FILTER_PTP_V1_L4_SYNC).  This value
is 4.

   896  
   897          mask = cpu_to_le64(IONIC_PKT_CLS_PTP1_DREQ);
   898          if ((ionic->ident.lif.eth.hwstamp_rx_filters & mask) == mask)
   899                  info->rx_filters |= HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ;

This value is 5 so BIT(4) | BIT(1).

   900  
   901          mask = cpu_to_le64(IONIC_PKT_CLS_PTP1_ALL);
   902          if ((ionic->ident.lif.eth.hwstamp_rx_filters & mask) == mask)
   903                  info->rx_filters |= HWTSTAMP_FILTER_PTP_V1_L4_EVENT;
   904  
   905          mask = cpu_to_le64(IONIC_PKT_CLS_PTP2_L4_SYNC);
   906          if ((ionic->ident.lif.eth.hwstamp_rx_filters & mask) == mask)
   907                  info->rx_filters |= HWTSTAMP_FILTER_PTP_V2_L4_SYNC;
   908  
   909          mask = cpu_to_le64(IONIC_PKT_CLS_PTP2_L4_DREQ);
   910          if ((ionic->ident.lif.eth.hwstamp_rx_filters & mask) == mask)
   911                  info->rx_filters |= HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ;
   912  
   913          mask = cpu_to_le64(IONIC_PKT_CLS_PTP2_L4_ALL);
   914          if ((ionic->ident.lif.eth.hwstamp_rx_filters & mask) == mask)
   915                  info->rx_filters |= HWTSTAMP_FILTER_PTP_V2_L4_EVENT;
   916  
   917          mask = cpu_to_le64(IONIC_PKT_CLS_PTP2_L2_SYNC);
   918          if ((ionic->ident.lif.eth.hwstamp_rx_filters & mask) == mask)
   919                  info->rx_filters |= HWTSTAMP_FILTER_PTP_V2_L2_SYNC;
   920  
   921          mask = cpu_to_le64(IONIC_PKT_CLS_PTP2_L2_DREQ);
   922          if ((ionic->ident.lif.eth.hwstamp_rx_filters & mask) == mask)
   923                  info->rx_filters |= HWTSTAMP_FILTER_PTP_V2_L2_DELAY_REQ;
   924  
   925          mask = cpu_to_le64(IONIC_PKT_CLS_PTP2_L2_ALL);
   926          if ((ionic->ident.lif.eth.hwstamp_rx_filters & mask) == mask)

regards,
dan carpenter

                 reply	other threads:[~2021-04-09  6:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=YG/4hBGWp35acsPo@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=snelson@pensando.io \
    /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