* [bug report] ionic: add ethtool support for PTP
@ 2021-04-09 6:47 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2021-04-09 6:47 UTC (permalink / raw)
To: snelson; +Cc: kernel-janitors
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-04-09 6:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-09 6:47 [bug report] ionic: add ethtool support for PTP Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox