[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20221109170210.1155273-1-alexandr.lobakin@intel.com>
Date: Wed, 9 Nov 2022 18:02:10 +0100
From: Alexander Lobakin <alexandr.lobakin@...el.com>
To: Tirthendu Sarkar <tirthendu.sarkar@...el.com>
Cc: Alexander Lobakin <alexandr.lobakin@...el.com>, tirtha@...il.com,
magnus.karlsson@...el.com, intel-wired-lan@...ts.osuosl.org,
anthony.l.nguyen@...el.com, maciej.fijalkowski@...el.com,
netdev@...r.kernel.org
Subject: Re: [Intel-wired-lan] [PATCH intel-next] i40e: allow toggling loopback mode via
From: Tirthendu Sarkar <tirthendu.sarkar@...el.com>
Date: Wed, 9 Nov 2022 20:50:16 +0530
> Add support for NETIF_F_LOOPBACK. This feature can be set via:
> $ ethtool -K eth0 loopback <on|off>
>
> This sets the MAC Tx->Rx loopback.
>
> This feature is used for the xsk selftests, and might have other uses
> too.
>
> Signed-off-by: Tirthendu Sarkar <tirthendu.sarkar@...el.com>
> ---
> drivers/net/ethernet/intel/i40e/i40e_common.c | 22 +++++++++++++++
> drivers/net/ethernet/intel/i40e/i40e_main.c | 28 +++++++++++++++++++
> .../net/ethernet/intel/i40e/i40e_prototype.h | 3 ++
> 3 files changed, 53 insertions(+)
[...]
> @@ -13721,6 +13747,8 @@ static int i40e_config_netdev(struct i40e_vsi *vsi)
> if (!(pf->flags & I40E_FLAG_MFP_ENABLED))
> hw_features |= NETIF_F_NTUPLE | NETIF_F_HW_TC;
>
> + hw_features |= NETIF_F_LOOPBACK;
> +
> netdev->hw_features |= hw_features;
>
> netdev->features |= hw_features | NETIF_F_HW_VLAN_CTAG_FILTER;
So here it will be enabled by default, which shouldn't happen as it
breaks traffic flow.
Just add it directly to netdev->hw_features one line above.
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_prototype.h b/drivers/net/ethernet/intel/i40e/i40e_prototype.h
> index ebdcde6f1aeb..9a71121420c3 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_prototype.h
> +++ b/drivers/net/ethernet/intel/i40e/i40e_prototype.h
> @@ -105,6 +105,9 @@ enum i40e_status_code i40e_aq_set_phy_config(struct i40e_hw *hw,
> struct i40e_asq_cmd_details *cmd_details);
> enum i40e_status_code i40e_set_fc(struct i40e_hw *hw, u8 *aq_failures,
> bool atomic_reset);
> +i40e_status i40e_aq_set_mac_loopback(struct i40e_hw *hw,
> + bool ena_lpbk,
> + struct i40e_asq_cmd_details *cmd_details);
> i40e_status i40e_aq_set_phy_int_mask(struct i40e_hw *hw, u16 mask,
> struct i40e_asq_cmd_details *cmd_details);
> i40e_status i40e_aq_clear_pxe_mode(struct i40e_hw *hw,
> --
> 2.34.1
Thanks,
Olek
Powered by blists - more mailing lists