@@ -157,6 +157,8 @@ static void veth_get_strings(struct net_device *dev, u32 stringset, u8 *buf)
157157 for (j = 0 ; j < VETH_TQ_STATS_LEN ; j ++ )
158158 ethtool_sprintf (& p , "tx_queue_%u_%.18s" ,
159159 i , veth_tq_stats_desc [j ].desc );
160+
161+ page_pool_ethtool_stats_get_strings (p );
160162 break ;
161163 }
162164}
@@ -167,7 +169,8 @@ static int veth_get_sset_count(struct net_device *dev, int sset)
167169 case ETH_SS_STATS :
168170 return ARRAY_SIZE (ethtool_stats_keys ) +
169171 VETH_RQ_STATS_LEN * dev -> real_num_rx_queues +
170- VETH_TQ_STATS_LEN * dev -> real_num_tx_queues ;
172+ VETH_TQ_STATS_LEN * dev -> real_num_tx_queues +
173+ page_pool_ethtool_stats_get_count ();
171174 default :
172175 return - EOPNOTSUPP ;
173176 }
@@ -178,7 +181,8 @@ static void veth_get_ethtool_stats(struct net_device *dev,
178181{
179182 struct veth_priv * rcv_priv , * priv = netdev_priv (dev );
180183 struct net_device * peer = rtnl_dereference (priv -> peer );
181- int i , j , idx ;
184+ struct page_pool_stats pp_stats = {};
185+ int i , j , idx , pp_idx ;
182186
183187 data [0 ] = peer ? peer -> ifindex : 0 ;
184188 idx = 1 ;
@@ -197,9 +201,10 @@ static void veth_get_ethtool_stats(struct net_device *dev,
197201 } while (u64_stats_fetch_retry (& rq_stats -> syncp , start ));
198202 idx += VETH_RQ_STATS_LEN ;
199203 }
204+ pp_idx = idx ;
200205
201206 if (!peer )
202- return ;
207+ goto page_pool_stats ;
203208
204209 rcv_priv = netdev_priv (peer );
205210 for (i = 0 ; i < peer -> real_num_rx_queues ; i ++ ) {
@@ -216,7 +221,16 @@ static void veth_get_ethtool_stats(struct net_device *dev,
216221 data [tx_idx + j ] += * (u64 * )(base + offset );
217222 }
218223 } while (u64_stats_fetch_retry (& rq_stats -> syncp , start ));
224+ pp_idx = tx_idx + VETH_TQ_STATS_LEN ;
225+ }
226+
227+ page_pool_stats :
228+ for (i = 0 ; i < dev -> real_num_rx_queues ; i ++ ) {
229+ if (!priv -> rq [i ].page_pool )
230+ continue ;
231+ page_pool_get_stats (priv -> rq [i ].page_pool , & pp_stats );
219232 }
233+ page_pool_ethtool_stats_get (& data [pp_idx ], & pp_stats );
220234}
221235
222236static void veth_get_channels (struct net_device * dev ,
0 commit comments