Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

xgbe: Use netlink extack to report errors to ethtool

Upgrade XGBE driver to report errors via netlink extack instead
of netdev_error so ethtool userspace can be aware of failures.

Signed-off-by: Vishal Badole <Vishal.Badole@amd.com>
Reviewed-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Signed-off-by: Raju Rangoju <Raju.Rangoju@amd.com>
Link: https://patch.msgid.link/20260114080357.1778132-1-Raju.Rangoju@amd.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Vishal Badole and committed by
Jakub Kicinski
74ecff77 dc634118

+27 -22
+27 -22
drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c
··· 362 362 363 363 /* Check the bounds of values for Rx */ 364 364 if (rx_riwt > XGMAC_MAX_DMA_RIWT) { 365 - netdev_err(netdev, "rx-usec is limited to %d usecs\n", 366 - hw_if->riwt_to_usec(pdata, XGMAC_MAX_DMA_RIWT)); 365 + NL_SET_ERR_MSG_FMT_MOD(extack, 366 + "rx-usec is limited to %d usecs", 367 + hw_if->riwt_to_usec(pdata, 368 + XGMAC_MAX_DMA_RIWT)); 367 369 return -EINVAL; 368 370 } 369 371 if (rx_frames > pdata->rx_desc_count) { 370 - netdev_err(netdev, "rx-frames is limited to %d frames\n", 371 - pdata->rx_desc_count); 372 + NL_SET_ERR_MSG_FMT_MOD(extack, 373 + "rx-frames is limited to %d frames", 374 + pdata->rx_desc_count); 372 375 return -EINVAL; 373 376 } 374 377 ··· 380 377 381 378 /* Check the bounds of values for Tx */ 382 379 if (!tx_usecs) { 383 - NL_SET_ERR_MSG_FMT_MOD(extack, 384 - "tx-usecs must not be 0"); 380 + NL_SET_ERR_MSG_MOD(extack, "tx-usecs must not be 0"); 385 381 return -EINVAL; 386 382 } 387 383 if (tx_usecs > XGMAC_MAX_COAL_TX_TICK) { ··· 389 387 return -EINVAL; 390 388 } 391 389 if (tx_frames > pdata->tx_desc_count) { 392 - netdev_err(netdev, "tx-frames is limited to %d frames\n", 393 - pdata->tx_desc_count); 390 + NL_SET_ERR_MSG_FMT_MOD(extack, 391 + "tx-frames is limited to %d frames", 392 + pdata->tx_desc_count); 394 393 return -EINVAL; 395 394 } 396 395 ··· 477 474 478 475 if (rxfh->hfunc != ETH_RSS_HASH_NO_CHANGE && 479 476 rxfh->hfunc != ETH_RSS_HASH_TOP) { 480 - netdev_err(netdev, "unsupported hash function\n"); 477 + NL_SET_ERR_MSG_MOD(extack, "unsupported hash function"); 481 478 return -EOPNOTSUPP; 482 479 } 483 480 ··· 564 561 unsigned int rx, tx; 565 562 566 563 if (ringparam->rx_mini_pending || ringparam->rx_jumbo_pending) { 567 - netdev_err(netdev, "unsupported ring parameter\n"); 564 + NL_SET_ERR_MSG_MOD(extack, "unsupported ring parameter"); 568 565 return -EINVAL; 569 566 } 570 567 571 568 if ((ringparam->rx_pending < XGBE_RX_DESC_CNT_MIN) || 572 569 (ringparam->rx_pending > XGBE_RX_DESC_CNT_MAX)) { 573 - netdev_err(netdev, 574 - "rx ring parameter must be between %u and %u\n", 575 - XGBE_RX_DESC_CNT_MIN, XGBE_RX_DESC_CNT_MAX); 570 + NL_SET_ERR_MSG_FMT_MOD(extack, 571 + "rx ring parameter must be between %u and %u", 572 + XGBE_RX_DESC_CNT_MIN, 573 + XGBE_RX_DESC_CNT_MAX); 576 574 return -EINVAL; 577 575 } 578 576 579 577 if ((ringparam->tx_pending < XGBE_TX_DESC_CNT_MIN) || 580 578 (ringparam->tx_pending > XGBE_TX_DESC_CNT_MAX)) { 581 - netdev_err(netdev, 582 - "tx ring parameter must be between %u and %u\n", 583 - XGBE_TX_DESC_CNT_MIN, XGBE_TX_DESC_CNT_MAX); 579 + NL_SET_ERR_MSG_FMT_MOD(extack, 580 + "tx ring parameter must be between %u and %u", 581 + XGBE_TX_DESC_CNT_MIN, 582 + XGBE_TX_DESC_CNT_MAX); 584 583 return -EINVAL; 585 584 } 586 585 587 586 rx = __rounddown_pow_of_two(ringparam->rx_pending); 588 587 if (rx != ringparam->rx_pending) 589 - netdev_notice(netdev, 590 - "rx ring parameter rounded to power of two: %u\n", 591 - rx); 588 + NL_SET_ERR_MSG_FMT_MOD(extack, 589 + "rx ring parameter rounded to power of two: %u", 590 + rx); 592 591 593 592 tx = __rounddown_pow_of_two(ringparam->tx_pending); 594 593 if (tx != ringparam->tx_pending) 595 - netdev_notice(netdev, 596 - "tx ring parameter rounded to power of two: %u\n", 597 - tx); 594 + NL_SET_ERR_MSG_FMT_MOD(extack, 595 + "tx ring parameter rounded to power of two: %u", 596 + tx); 598 597 599 598 if ((rx == pdata->rx_desc_count) && 600 599 (tx == pdata->tx_desc_count))