]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
octeontx2-pf: Fix ethtool support for SDP representors
authorHariprasad Kelam <hkelam@marvell.com>
Mon, 12 May 2025 06:29:01 +0000 (11:59 +0530)
committerDavid S. Miller <davem@davemloft.net>
Wed, 14 May 2025 09:37:20 +0000 (10:37 +0100)
The hardware supports multiple MAC types, including RPM, SDP, and LBK.
However, features such as link settings and pause frames are only available
on RPM MAC, and not supported on SDP or LBK.

This patch updates the ethtool operations logic accordingly to reflect
this behavior.

Fixes: 2f7f33a09516 ("octeontx2-pf: Add representors for sdp MAC")
Signed-off-by: Hariprasad Kelam <hkelam@marvell.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c

index 010385b2998869545325eb90c93eb671e623a0b0..45b8c9230184d8bd72976126055c51ac2f5882b6 100644 (file)
@@ -315,7 +315,7 @@ static void otx2_get_pauseparam(struct net_device *netdev,
        struct otx2_nic *pfvf = netdev_priv(netdev);
        struct cgx_pause_frm_cfg *req, *rsp;
 
-       if (is_otx2_lbkvf(pfvf->pdev))
+       if (is_otx2_lbkvf(pfvf->pdev) || is_otx2_sdp_rep(pfvf->pdev))
                return;
 
        mutex_lock(&pfvf->mbox.lock);
@@ -347,7 +347,7 @@ static int otx2_set_pauseparam(struct net_device *netdev,
        if (pause->autoneg)
                return -EOPNOTSUPP;
 
-       if (is_otx2_lbkvf(pfvf->pdev))
+       if (is_otx2_lbkvf(pfvf->pdev) || is_otx2_sdp_rep(pfvf->pdev))
                return -EOPNOTSUPP;
 
        if (pause->rx_pause)
@@ -941,8 +941,8 @@ static u32 otx2_get_link(struct net_device *netdev)
 {
        struct otx2_nic *pfvf = netdev_priv(netdev);
 
-       /* LBK link is internal and always UP */
-       if (is_otx2_lbkvf(pfvf->pdev))
+       /* LBK and SDP links are internal and always UP */
+       if (is_otx2_lbkvf(pfvf->pdev) || is_otx2_sdp_rep(pfvf->pdev))
                return 1;
        return pfvf->linfo.link_up;
 }
@@ -1413,7 +1413,7 @@ static int otx2vf_get_link_ksettings(struct net_device *netdev,
 {
        struct otx2_nic *pfvf = netdev_priv(netdev);
 
-       if (is_otx2_lbkvf(pfvf->pdev)) {
+       if (is_otx2_lbkvf(pfvf->pdev) || is_otx2_sdp_rep(pfvf->pdev)) {
                cmd->base.duplex = DUPLEX_FULL;
                cmd->base.speed = SPEED_100000;
        } else {