From: Jakub Kicinski Date: Mon, 15 Jul 2024 20:05:05 +0000 (-0700) Subject: Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net X-Git-Tag: microblaze-v6.13~667^2~4 X-Git-Url: http://git.monstr.eu/?a=commitdiff_plain;h=51b35d4f9d8860b7c181e545a90bc0ad370efbdb;p=linux-2.6-microblaze.git Merge git://git./linux/kernel/git/netdev/net Merge in late fixes to prepare for the 6.11 net-next PR. Conflicts: 93c3a96c301f ("net: pse-pd: Do not return EOPNOSUPP if config is null") 4cddb0f15ea9 ("net: ethtool: pse-pd: Fix possible null-deref") 30d7b6727724 ("net: ethtool: Add new power limit get and set features") https://lore.kernel.org/20240715123204.623520bb@canb.auug.org.au/ Signed-off-by: Jakub Kicinski --- 51b35d4f9d8860b7c181e545a90bc0ad370efbdb diff --cc net/ethtool/pse-pd.c index ba46c9c8b12d,776ac96cdadc..ff81aa749784 --- a/net/ethtool/pse-pd.c +++ b/net/ethtool/pse-pd.c @@@ -256,39 -172,21 +256,43 @@@ static in ethnl_set_pse(struct ethnl_req_info *req_info, struct genl_info *info) { struct net_device *dev = req_info->dev; - struct pse_control_config config = {}; struct nlattr **tb = info->attrs; struct phy_device *phydev; + int ret = 0; phydev = dev->phydev; + + if (tb[ETHTOOL_A_C33_PSE_AVAIL_PW_LIMIT]) { + unsigned int pw_limit; + + pw_limit = nla_get_u32(tb[ETHTOOL_A_C33_PSE_AVAIL_PW_LIMIT]); + ret = pse_ethtool_set_pw_limit(phydev->psec, info->extack, + pw_limit); + if (ret) + return ret; + } + /* These values are already validated by the ethnl_pse_set_policy */ - if (tb[ETHTOOL_A_PODL_PSE_ADMIN_CONTROL]) - config.podl_admin_control = nla_get_u32(tb[ETHTOOL_A_PODL_PSE_ADMIN_CONTROL]); - if (tb[ETHTOOL_A_C33_PSE_ADMIN_CONTROL]) - config.c33_admin_control = nla_get_u32(tb[ETHTOOL_A_C33_PSE_ADMIN_CONTROL]); - - /* Return errno directly - PSE has no notification - * pse_ethtool_set_config() will do nothing if the config is null - */ - return pse_ethtool_set_config(phydev->psec, info->extack, &config); + if (tb[ETHTOOL_A_PODL_PSE_ADMIN_CONTROL] || + tb[ETHTOOL_A_C33_PSE_ADMIN_CONTROL]) { + struct pse_control_config config = {}; + - if (pse_has_podl(phydev->psec)) ++ if (tb[ETHTOOL_A_PODL_PSE_ADMIN_CONTROL]) + config.podl_admin_control = nla_get_u32(tb[ETHTOOL_A_PODL_PSE_ADMIN_CONTROL]); - if (pse_has_c33(phydev->psec)) ++ if (tb[ETHTOOL_A_C33_PSE_ADMIN_CONTROL]) + config.c33_admin_control = nla_get_u32(tb[ETHTOOL_A_C33_PSE_ADMIN_CONTROL]); + ++ /* pse_ethtool_set_config() will do nothing if the config ++ * is zero ++ */ + ret = pse_ethtool_set_config(phydev->psec, info->extack, + &config); + if (ret) + return ret; + } + ++ /* Return errno or zero - PSE has no notification */ + return ret; } const struct ethnl_request_ops ethnl_pse_request_ops = { diff --cc net/xfrm/xfrm_input.c index 7cee9c0a2cdc,e95462b982b0..749e7eea99e4 --- a/net/xfrm/xfrm_input.c +++ b/net/xfrm/xfrm_input.c @@@ -471,15 -471,9 +471,10 @@@ int xfrm_input(struct sk_buff *skb, in struct xfrm_offload *xo = xfrm_offload(skb); struct sec_path *sp; - if (encap_type < 0 || (xo && xo->flags & XFRM_GRO)) { + if (encap_type < 0 || (xo && (xo->flags & XFRM_GRO || encap_type == 0 || + encap_type == UDP_ENCAP_ESPINUDP))) { x = xfrm_input_state(skb); - if (unlikely(x->dir && x->dir != XFRM_SA_DIR_IN)) { - XFRM_INC_STATS(net, LINUX_MIB_XFRMINSTATEDIRERROR); - goto drop; - } - if (unlikely(x->km.state != XFRM_STATE_VALID)) { if (x->km.state == XFRM_STATE_ACQ) XFRM_INC_STATS(net, LINUX_MIB_XFRMACQUIREERROR);