Message ID | 20241008181436.4120604-2-vadfed@meta.com (mailing list archive) |
---|---|
State | Accepted |
Commit | be65bfc957eb70aecdf3e351ec9fc3f067598f9e |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | eth: fbnic: add timestamping support | expand |
Hi, On 10/8/24 20:14, Vadim Fedorenko wrote: > diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_ethtool.c b/drivers/net/ethernet/meta/fbnic/fbnic_ethtool.c > index 5d980e178941..ffc773014e0f 100644 > --- a/drivers/net/ethernet/meta/fbnic/fbnic_ethtool.c > +++ b/drivers/net/ethernet/meta/fbnic/fbnic_ethtool.c > @@ -6,6 +6,16 @@ > #include "fbnic_netdev.h" > #include "fbnic_tlv.h" > > +static int > +fbnic_get_ts_info(struct net_device *netdev, > + struct kernel_ethtool_ts_info *tsinfo) > +{ > + tsinfo->so_timestamping = > + SOF_TIMESTAMPING_TX_SOFTWARE; Only if you need to repost for some other reasons: the above could use a single line. /P
On 10/10/24 12:18, Paolo Abeni wrote: > On 10/8/24 20:14, Vadim Fedorenko wrote: >> diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_ethtool.c b/drivers/net/ethernet/meta/fbnic/fbnic_ethtool.c >> index 5d980e178941..ffc773014e0f 100644 >> --- a/drivers/net/ethernet/meta/fbnic/fbnic_ethtool.c >> +++ b/drivers/net/ethernet/meta/fbnic/fbnic_ethtool.c >> @@ -6,6 +6,16 @@ >> #include "fbnic_netdev.h" >> #include "fbnic_tlv.h" >> >> +static int >> +fbnic_get_ts_info(struct net_device *netdev, >> + struct kernel_ethtool_ts_info *tsinfo) >> +{ >> + tsinfo->so_timestamping = >> + SOF_TIMESTAMPING_TX_SOFTWARE; > > Only if you need to repost for some other reasons: the above could use a > single line. Never mind, I see the changes in patch 3 now... /P
On 10/10/2024 11:38, Paolo Abeni wrote: > On 10/10/24 12:18, Paolo Abeni wrote: >> On 10/8/24 20:14, Vadim Fedorenko wrote: >>> diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_ethtool.c b/ >>> drivers/net/ethernet/meta/fbnic/fbnic_ethtool.c >>> index 5d980e178941..ffc773014e0f 100644 >>> --- a/drivers/net/ethernet/meta/fbnic/fbnic_ethtool.c >>> +++ b/drivers/net/ethernet/meta/fbnic/fbnic_ethtool.c >>> @@ -6,6 +6,16 @@ >>> #include "fbnic_netdev.h" >>> #include "fbnic_tlv.h" >>> +static int >>> +fbnic_get_ts_info(struct net_device *netdev, >>> + struct kernel_ethtool_ts_info *tsinfo) >>> +{ >>> + tsinfo->so_timestamping = >>> + SOF_TIMESTAMPING_TX_SOFTWARE; >> >> Only if you need to repost for some other reasons: the above could use a >> single line. > > Never mind, I see the changes in patch 3 now... Yep, the next patches will change this line..
diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_ethtool.c b/drivers/net/ethernet/meta/fbnic/fbnic_ethtool.c index 5d980e178941..ffc773014e0f 100644 --- a/drivers/net/ethernet/meta/fbnic/fbnic_ethtool.c +++ b/drivers/net/ethernet/meta/fbnic/fbnic_ethtool.c @@ -6,6 +6,16 @@ #include "fbnic_netdev.h" #include "fbnic_tlv.h" +static int +fbnic_get_ts_info(struct net_device *netdev, + struct kernel_ethtool_ts_info *tsinfo) +{ + tsinfo->so_timestamping = + SOF_TIMESTAMPING_TX_SOFTWARE; + + return 0; +} + static void fbnic_get_drvinfo(struct net_device *netdev, struct ethtool_drvinfo *drvinfo) { @@ -66,6 +76,7 @@ fbnic_get_eth_mac_stats(struct net_device *netdev, static const struct ethtool_ops fbnic_ethtool_ops = { .get_drvinfo = fbnic_get_drvinfo, + .get_ts_info = fbnic_get_ts_info, .get_eth_mac_stats = fbnic_get_eth_mac_stats, }; diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c b/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c index 6a6d7e22f1a7..8337d49bad0b 100644 --- a/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c +++ b/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c @@ -205,6 +205,9 @@ fbnic_tx_map(struct fbnic_ring *ring, struct sk_buff *skb, __le64 *meta) ring->tail = tail; + /* Record SW timestamp */ + skb_tx_timestamp(skb); + /* Verify there is room for another packet */ fbnic_maybe_stop_tx(skb->dev, ring, FBNIC_MAX_SKB_DESC);
Add software TX timestamping support. RX software timestamping is implemented in the core and there is no need to provide special flag in the driver anymore. Signed-off-by: Vadim Fedorenko <vadfed@meta.com> --- drivers/net/ethernet/meta/fbnic/fbnic_ethtool.c | 11 +++++++++++ drivers/net/ethernet/meta/fbnic/fbnic_txrx.c | 3 +++ 2 files changed, 14 insertions(+)