Skip to contentSkip to conversation

Use xdp_set_features_flag instead of direct assignment

PATCH In review Haiyang Zhang 2 participants 2 messages Oct 27, 2023

Subsystems (6)
lore
Share & tools
lore

Haiyang Zhang

author maintainer
#0 lore raw

PATCH 1/1 Use xdp_set_features_flag instead of direct assignment

From: Konstantin Taranov <[email protected]>

This patch uses a helper function for assignment of xdp_features. This change simplifies backports.

---
 drivers/net/ethernet/microsoft/mana/mana_en.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/microsoft/mana/mana_en.c +2 -2
index 48ea4aeeea5d..035f24764ad9 100644
@@ -2687,8 +2687,8 @@ static int mana_probe_port(struct mana_context *ac, int port_idx,
 	ndev->features = ndev->hw_features | NETIF_F_HW_VLAN_CTAG_TX |
 			 NETIF_F_HW_VLAN_CTAG_RX;
 	ndev->vlan_features = ndev->features;
-	ndev->xdp_features = NETDEV_XDP_ACT_BASIC | NETDEV_XDP_ACT_REDIRECT |
-			     NETDEV_XDP_ACT_NDO_XMIT;
+	xdp_set_features_flag(ndev, NETDEV_XDP_ACT_BASIC | NETDEV_XDP_ACT_REDIRECT |
+			     NETDEV_XDP_ACT_NDO_XMIT);
 
 	err = register_netdev(ndev);
 	if (err) {
Signature · 1 line
2.25.1
maintainer
#1 lore raw
Quoted 4 lines · On Fri, 27 Oct 2023 11:06:51 -0700 Haiyang Zhang wrote:

From: Konstantin Taranov <[email protected]>

This patch uses a helper function for assignment of xdp_features. This change simplifies backports.

Generally making backports is not a strong enough reason to change upstream code, but using the helper seems like a good idea.

I touched up the white space and title when applying, thanks!

Signature · 1 line
pw-bot: applied