xfrm: extract dst lookup parameters into a struct
Subsystems (14)
Sasha Levin
maintainerPATCH 1/15 xfrm: extract dst lookup parameters into a struct
From: Eyal Birger <[email protected]>
[ Upstream commit e509996b16728e37d5a909a5c63c1bd64f23b306 ]
Preparation for adding more fields to dst lookup functions without changing their signatures.
--- include/net/xfrm.h | 26 +++++++++++++------------- net/ipv4/xfrm4_policy.c | 38 ++++++++++++++++---------------------- net/ipv6/xfrm6_policy.c | 28 +++++++++++++--------------- net/xfrm/xfrm_device.c | 11 ++++++++--- net/xfrm/xfrm_policy.c | 35 +++++++++++++++++++++++------------ 5 files changed, 73 insertions(+), 65 deletions(-)
include/net/xfrm.h +13 -13
@@ -342,20 +342,23 @@ struct xfrm_if_cb {void xfrm_if_register_cb (const struct xfrm_if_cb *ifcb);void xfrm_if_unregister_cb (void ); +struct xfrm_dst_lookup_params { +struct net *net; +int tos; +int oif; +xfrm_address_t *saddr; +xfrm_address_t *daddr; +u32 mark; +}; +struct net_device ;struct xfrm_type ;struct xfrm_dst ;struct xfrm_policy_afinfo {struct dst_ops *dst_ops; -struct dst_entry *(*dst_lookup)(struct net *net, -int tos,int oif, -const xfrm_address_t *saddr, -const xfrm_address_t *daddr, -u32 mark); -int (*get_saddr)(struct net *net,int oif, -xfrm_address_t *saddr, -xfrm_address_t *daddr, -u32 mark); +struct dst_entry *(*dst_lookup)(const struct xfrm_dst_lookup_params *params); +int (*get_saddr)(xfrm_address_t *saddr, +const struct xfrm_dst_lookup_params *params);int (*fill_dst)(struct xfrm_dst *xdst,struct net_device *dev,const struct flowi *fl);
@@ -1728,10 +1731,7 @@ static inline int xfrm_user_policy(struct sock *sk, int optname, }#endif -struct dst_entry *__xfrm_dst_lookup (struct net *net,int tos,int oif, -const xfrm_address_t *saddr, -const xfrm_address_t *daddr, -int family,u32 mark); +struct dst_entry *__xfrm_dst_lookup (int family,const struct xfrm_dst_lookup_params *params);struct xfrm_policy *xfrm_policy_alloc (struct net *net,gfp_t gfp);
net/ipv4/xfrm4_policy.c +16 -22
@@ -17,47 +17,41 @@#include <net/ip.h> #include <net/l3mdev.h> -static struct dst_entry *__xfrm4_dst_lookup (struct net *net,struct flowi4 *fl4, -int tos,int oif, -const xfrm_address_t *saddr, -const xfrm_address_t *daddr, -u32 mark) +static struct dst_entry *__xfrm4_dst_lookup (struct flowi4 *fl4, +const struct xfrm_dst_lookup_params *params) {struct rtable *rt;memset (fl4,0 ,sizeof (*fl4)); - fl4->daddr = daddr->a4; - fl4->flowi4_tos = tos; - fl4->flowi4_l3mdev =l3mdev_master_ifindex_by_index (net, oif); - fl4->flowi4_mark = mark; -if (saddr) - fl4->saddr = saddr->a4; - - rt =__ip_route_output_key (net, fl4); + fl4->daddr = params->daddr->a4; + fl4->flowi4_tos = params->tos; + fl4->flowi4_l3mdev =l3mdev_master_ifindex_by_index (params->net, + params->oif); + fl4->flowi4_mark = params->mark; +if (params->saddr) + fl4->saddr = params->saddr->a4; + + rt =__ip_route_output_key (params->net, fl4);if (!IS_ERR (rt))return &rt->dst;return ERR_CAST (rt); } -static struct dst_entry *xfrm4_dst_lookup (struct net *net,int tos,int oif, -const xfrm_address_t *saddr, -const xfrm_address_t *daddr, -u32 mark) +static struct dst_entry *xfrm4_dst_lookup (const struct xfrm_dst_lookup_params *params) {struct flowi4 fl4; -return __xfrm4_dst_lookup (net, &fl4, tos, oif, saddr, daddr, mark); +return __xfrm4_dst_lookup (&fl4, params); } -static int xfrm4_get_saddr (struct net *net,int oif, -xfrm_address_t *saddr,xfrm_address_t *daddr, -u32 mark) +static int xfrm4_get_saddr (xfrm_address_t *saddr, +const struct xfrm_dst_lookup_params *params) {struct dst_entry *dst;struct flowi4 fl4; - dst =__xfrm4_dst_lookup (net, &fl4,0 , oif,NULL , daddr, mark); + dst =__xfrm4_dst_lookup (&fl4, params);if (IS_ERR (dst))return -EHOSTUNREACH ;
net/ipv6/xfrm6_policy.c +13 -15
@@ -23,23 +23,21 @@#include <net/ip6_route.h> #include <net/l3mdev.h> -static struct dst_entry *xfrm6_dst_lookup (struct net *net,int tos,int oif, -const xfrm_address_t *saddr, -const xfrm_address_t *daddr, -u32 mark) +static struct dst_entry *xfrm6_dst_lookup (const struct xfrm_dst_lookup_params *params) {struct flowi6 fl6;struct dst_entry *dst;int err;memset (&fl6,0 ,sizeof (fl6)); - fl6.flowi6_l3mdev =l3mdev_master_ifindex_by_index (net, oif); - fl6.flowi6_mark = mark; -memcpy (&fl6.daddr, daddr,sizeof (fl6.daddr)); -if (saddr) -memcpy (&fl6.saddr, saddr,sizeof (fl6.saddr)); + fl6.flowi6_l3mdev =l3mdev_master_ifindex_by_index (params->net, + params->oif); + fl6.flowi6_mark = params->mark; +memcpy (&fl6.daddr, params->daddr,sizeof (fl6.daddr)); +if (params->saddr) +memcpy (&fl6.saddr, params->saddr,sizeof (fl6.saddr)); - dst =ip6_route_output (net,NULL , &fl6); + dst =ip6_route_output (params->net,NULL , &fl6); err = dst->error;if (dst->error) {
@@ -50,15 +48,14 @@ static struct dst_entry *xfrm6_dst_lookup(struct net *net, int tos, int oif,return dst; } -static int xfrm6_get_saddr (struct net *net,int oif, -xfrm_address_t *saddr,xfrm_address_t *daddr, -u32 mark) +static int xfrm6_get_saddr (xfrm_address_t *saddr, +const struct xfrm_dst_lookup_params *params) {struct dst_entry *dst;struct net_device *dev;struct inet6_dev *idev; - dst =xfrm6_dst_lookup (net,0 , oif,NULL , daddr, mark); + dst =xfrm6_dst_lookup (params);if (IS_ERR (dst))return -EHOSTUNREACH ;
@@ -68,7 +65,8 @@ static int xfrm6_get_saddr(struct net *net, int oif,return -EHOSTUNREACH ; } dev = idev->dev; -ipv6_dev_get_saddr (dev_net (dev), dev, &daddr->in6,0 , &saddr->in6); +ipv6_dev_get_saddr (dev_net (dev), dev, ¶ms->daddr->in6,0 , + &saddr->in6);dst_release (dst);return 0 ; }
net/xfrm/xfrm_device.c +8 -3
@@ -263,6 +263,8 @@ int xfrm_dev_state_add(struct net *net, struct xfrm_state *x, dev =dev_get_by_index (net, xuo->ifindex);if (!dev) { +struct xfrm_dst_lookup_params params; +if (!(xuo->flags &XFRM_OFFLOAD_INBOUND )) { saddr = &x->props.saddr; daddr = &x->id.daddr;
@@ -271,9 +273,12 @@ int xfrm_dev_state_add(struct net *net, struct xfrm_state *x, daddr = &x->props.saddr; } - dst =__xfrm_dst_lookup (net,0 ,0 , saddr, daddr, - x->props.family, -xfrm_smark_get (0 , x)); +memset (¶ms,0 ,sizeof (params)); + params.net = net; + params.saddr = saddr; + params.daddr = daddr; + params.mark =xfrm_smark_get (0 , x); + dst =__xfrm_dst_lookup (x->props.family, ¶ms);if (IS_ERR (dst))return (is_packet_offload) ? -EINVAL :0 ;
net/xfrm/xfrm_policy.c +23 -12
@@ -251,10 +251,8 @@ static const struct xfrm_if_cb *xfrm_if_get_cb(void)return rcu_dereference (xfrm_if_cb); } -struct dst_entry *__xfrm_dst_lookup (struct net *net,int tos,int oif, -const xfrm_address_t *saddr, -const xfrm_address_t *daddr, -int family,u32 mark) +struct dst_entry *__xfrm_dst_lookup (int family, +const struct xfrm_dst_lookup_params *params) {const struct xfrm_policy_afinfo *afinfo;struct dst_entry *dst;
@@ -263,7 +261,7 @@ struct dst_entry *__xfrm_dst_lookup(struct net *net, int tos, int oif,if (unlikely (afinfo ==NULL ))return ERR_PTR (-EAFNOSUPPORT ); - dst = afinfo->dst_lookup (net, tos, oif, saddr, daddr, mark); + dst = afinfo->dst_lookup (params);rcu_read_unlock ();
@@ -277,6 +275,7 @@ static inline struct dst_entry *xfrm_dst_lookup(struct xfrm_state *x,xfrm_address_t *prev_daddr, int family, u32 mark) { + struct xfrm_dst_lookup_params params;struct net *net =xs_net (x);xfrm_address_t *saddr = &x->props.saddr;xfrm_address_t *daddr = &x->id.daddr;
@@ -291,7 +290,14 @@ static inline struct dst_entry *xfrm_dst_lookup(struct xfrm_state *x, daddr = x->coaddr; } - dst =__xfrm_dst_lookup (net, tos, oif, saddr, daddr, family, mark); + params.net = net; + params.saddr = saddr; + params.daddr = daddr; + params.tos = tos; + params.oif = oif; + params.mark = mark; + + dst =__xfrm_dst_lookup (family, ¶ms);if (!IS_ERR (dst)) {if (prev_saddr != saddr)
@@ -2424,15 +2430,15 @@ int __xfrm_sk_clone_policy(struct sock *sk, const struct sock *osk) }static int -xfrm_get_saddr (struct net *net,int oif,xfrm_address_t *local, -xfrm_address_t *remote,unsigned short family,u32 mark) +xfrm_get_saddr (unsigned short family,xfrm_address_t *saddr, +const struct xfrm_dst_lookup_params *params) {int err;const struct xfrm_policy_afinfo *afinfo =xfrm_policy_get_afinfo (family);if (unlikely (afinfo ==NULL ))return -EINVAL ; - err = afinfo->get_saddr (net, oif, local, remote, mark); + err = afinfo->get_saddr (saddr, params);rcu_read_unlock ();return err; }
@@ -2461,9 +2467,14 @@ xfrm_tmpl_resolve_one(struct xfrm_policy *policy, const struct flowi *fl, remote = &tmpl->id.daddr; local = &tmpl->saddr;if (xfrm_addr_any (local, tmpl->encap_family)) { - error =xfrm_get_saddr (net, fl->flowi_oif, - &tmp, remote, - tmpl->encap_family,0 ); +struct xfrm_dst_lookup_params params; + +memset (¶ms,0 ,sizeof (params)); + params.net = net; + params.oif = fl->flowi_oif; + params.daddr = remote; + error =xfrm_get_saddr (tmpl->encap_family, &tmp, + ¶ms);if (error) goto fail; local = &tmp;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 2/15 ASoC: amd: yc: Add quirk for ASUS Vivobook S15 M3502RA
From: Christian Heusel <[email protected]>
[ Upstream commit 182fff3a2aafe4e7f3717a0be9df2fe2ed1a77de ]
As reported the builtin microphone doesn't work on the ASUS Vivobook model S15 OLED M3502RA. Therefore add a quirk for it to make it work.
--- sound/soc/amd/yc/acp6x-mach.c | 7 +++++++ 1 file changed, 7 insertions(+)
sound/soc/amd/yc/acp6x-mach.c +7 -0
@@ -339,6 +339,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "M7600RE"), } }, + { + .driver_data = &acp6x_card, + .matches = { +DMI_MATCH (DMI_BOARD_VENDOR ,"ASUSTeK COMPUTER INC." ), + DMI_MATCH(DMI_PRODUCT_NAME, "M3502RA"), + } + }, { .driver_data = &acp6x_card, .matches = {
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 3/15 ASoC: fsl_esai: change dev_warn to dev_dbg in irq handler
In reply to Sasha LevinFrom: Shengjiu Wang <[email protected]>
[ Upstream commit 54c805c1eb264c839fa3027d0073bb7f323b0722 ]
Irq handler need to be executed as fast as possible, so the log in irq handler is better to use dev_dbg which needs to be enabled when debugging.
--- sound/soc/fsl/fsl_esai.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/fsl/fsl_esai.c +2 -2
@@ -119,10 +119,10 @@ static irqreturn_t esai_isr(int irq, void *devid)dev_dbg (&pdev->dev,"isr: Transmission Initialized\n" );if (esr &ESAI_ESR_RFF_MASK ) -dev_warn (&pdev->dev,"isr: Receiving overrun\n" ); +dev_dbg (&pdev->dev,"isr: Receiving overrun\n" );if (esr &ESAI_ESR_TFE_MASK ) -dev_warn (&pdev->dev,"isr: Transmission underrun\n" ); +dev_dbg (&pdev->dev,"isr: Transmission underrun\n" );if (esr &ESAI_ESR_TLS_MASK )dev_dbg (&pdev->dev,"isr: Just transmitted the last slot\n" );
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 4/15 ASoC: amd: yc: Fix non-functional mic on ASUS E1404FA
In reply to Sasha LevinFrom: Ilya Dudikov <[email protected]>
[ Upstream commit b0867999e3282378a0b26a7ad200233044d31eca ]
ASUS Vivobook E1404FA needs a quirks-table entry for the internal microphone to function properly.
--- sound/soc/amd/yc/acp6x-mach.c | 7 +++++++ 1 file changed, 7 insertions(+)
sound/soc/amd/yc/acp6x-mach.c +7 -0
@@ -325,6 +325,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "M6500RC"), } }, + { + .driver_data = &acp6x_card, + .matches = { +DMI_MATCH (DMI_BOARD_VENDOR ,"ASUSTeK COMPUTER INC." ), + DMI_MATCH(DMI_PRODUCT_NAME, "E1404FA"), + } + }, { .driver_data = &acp6x_card, .matches = {
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 5/15 fs: Fix uninitialized value issue in from_kuid and from_kgid
In reply to Sasha LevinFrom: Alessandro Zanni <[email protected]>
[ Upstream commit 15f34347481648a567db67fb473c23befb796af5 ]
ocfs2_setattr() uses attr->ia_mode, attr->ia_uid and attr->ia_gid in a trace point even though ATTR_MODE, ATTR_UID and ATTR_GID aren't set.
Initialize all fields of newattrs to avoid uninitialized variables, by checking if ATTR_MODE, ATTR_UID, ATTR_GID are initialized, otherwise 0.
--- fs/ocfs2/file.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
fs/ocfs2/file.c +6 -3
@@ -1128,9 +1128,12 @@ int ocfs2_setattr(struct mnt_idmap *idmap, struct dentry *dentry,trace_ocfs2_setattr (inode, dentry, (unsigned long long )OCFS2_I (inode)->ip_blkno, dentry->d_name.len, dentry->d_name.name, - attr->ia_valid, attr->ia_mode, -from_kuid (&init_user_ns, attr->ia_uid), -from_kgid (&init_user_ns, attr->ia_gid)); + attr->ia_valid, + attr->ia_valid &ATTR_MODE ? attr->ia_mode :0 , + attr->ia_valid &ATTR_UID ? +from_kuid (&init_user_ns, attr->ia_uid) :0 , + attr->ia_valid &ATTR_GID ? +from_kgid (&init_user_ns, attr->ia_gid) :0 );/* ensuring we don't even attempt to truncate a symlink */ if (S_ISLNK (inode->i_mode))
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 6/15 HID: multitouch: Add quirk for Logitech Bolt receiver w/ Casa touchpad
In reply to Sasha LevinFrom: Kenneth Albanowski <[email protected]>
[ Upstream commit 526748b925185e95f1415900ee13c2469d4b64cc ]
The Logitech Casa Touchpad does not reliably send touch release signals when communicating through the Logitech Bolt wireless-to-USB receiver.
Adjusting the device class to add MT_QUIRK_NOT_SEEN_MEANS_UP to make sure that no touches become stuck, MT_QUIRK_FORCE_MULTI_INPUT is not needed, but harmless.
Linux does not have information on which devices are connected to the Bolt receiver, so we have to enable this for the entire device.
--- drivers/hid/hid-ids.h | 1 + drivers/hid/hid-multitouch.c | 4 ++++ 2 files changed, 5 insertions(+)
drivers/hid/hid-ids.h +1 -0
@@ -868,6 +868,7 @@#define USB_DEVICE_ID_LOGITECH_NANO_RECEIVER_LIGHTSPEED_1 0xc539#define USB_DEVICE_ID_LOGITECH_NANO_RECEIVER_LIGHTSPEED_1_1 0xc53f#define USB_DEVICE_ID_LOGITECH_NANO_RECEIVER_POWERPLAY 0xc53a +#define USB_DEVICE_ID_LOGITECH_BOLT_RECEIVER 0xc548#define USB_DEVICE_ID_SPACETRAVELLER 0xc623#define USB_DEVICE_ID_SPACENAVIGATOR 0xc626#define USB_DEVICE_ID_DINOVO_DESKTOP 0xc704
drivers/hid/hid-multitouch.c +4 -0
@@ -2131,6 +2131,10 @@ static const struct hid_device_id mt_devices[] = {HID_DEVICE (BUS_BLUETOOTH ,HID_GROUP_MULTITOUCH_WIN_8 ,USB_VENDOR_ID_LOGITECH , USB_DEVICE_ID_LOGITECH_CASA_TOUCHPAD) }, + { .driver_data = MT_CLS_WIN_8_FORCE_MULTI_INPUT_NSMU, +HID_DEVICE (BUS_USB ,HID_GROUP_MULTITOUCH_WIN_8 , +USB_VENDOR_ID_LOGITECH , + USB_DEVICE_ID_LOGITECH_BOLT_RECEIVER) }, /* MosArt panels */ { .driver_data = MT_CLS_CONFIDENCE_MINUS_ONE,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 7/15 HID: lenovo: Add support for Thinkpad X1 Tablet Gen 3 keyboard
In reply to Sasha LevinFrom: Hans de Goede <[email protected]>
[ Upstream commit 51268879eb2bfc563a91cdce69362d9dbf707e7e ]
The Thinkpad X1 Tablet Gen 3 keyboard has the same Lenovo specific quirks as the original Thinkpad X1 Tablet keyboard.
Add the PID for the "Thinkpad X1 Tablet Gen 3 keyboard" to the hid-lenovo driver to fix the FnLock, Mute and media buttons not working.
Closes https://bugzilla.redhat.com/show_bug.cgi?id=2315395
--- drivers/hid/hid-lenovo.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/hid/hid-lenovo.c +8 -0
@@ -473,6 +473,7 @@ static int lenovo_input_mapping(struct hid_device *hdev,return lenovo_input_mapping_tp10_ultrabook_kbd (hdev, hi, field, usage, bit, max);case USB_DEVICE_ID_LENOVO_X1_TAB : +case USB_DEVICE_ID_LENOVO_X1_TAB3 :return lenovo_input_mapping_x1_tab_kbd (hdev, hi, field, usage, bit, max);default :return 0 ;
@@ -583,6 +584,7 @@ static ssize_t attr_fn_lock_store(struct device *dev,break ;case USB_DEVICE_ID_LENOVO_TP10UBKBD :case USB_DEVICE_ID_LENOVO_X1_TAB : +case USB_DEVICE_ID_LENOVO_X1_TAB3 : ret =lenovo_led_set_tp10ubkbd (hdev,TP10UBKBD_FN_LOCK_LED , value);if (ret)return ret;
@@ -777,6 +779,7 @@ static int lenovo_event(struct hid_device *hdev, struct hid_field *field,return lenovo_event_cptkbd (hdev, field, usage, value);case USB_DEVICE_ID_LENOVO_TP10UBKBD :case USB_DEVICE_ID_LENOVO_X1_TAB : +case USB_DEVICE_ID_LENOVO_X1_TAB3 :return lenovo_event_tp10ubkbd (hdev, field, usage, value);default :return 0 ;
@@ -1059,6 +1062,7 @@ static int lenovo_led_brightness_set(struct led_classdev *led_cdev,break ;case USB_DEVICE_ID_LENOVO_TP10UBKBD :case USB_DEVICE_ID_LENOVO_X1_TAB : +case USB_DEVICE_ID_LENOVO_X1_TAB3 : ret =lenovo_led_set_tp10ubkbd (hdev, tp10ubkbd_led[led_nr], value);break ; }
@@ -1289,6 +1293,7 @@ static int lenovo_probe(struct hid_device *hdev,break ;case USB_DEVICE_ID_LENOVO_TP10UBKBD :case USB_DEVICE_ID_LENOVO_X1_TAB : +case USB_DEVICE_ID_LENOVO_X1_TAB3 : ret =lenovo_probe_tp10ubkbd (hdev);break ;default :
@@ -1375,6 +1380,7 @@ static void lenovo_remove(struct hid_device *hdev)break ;case USB_DEVICE_ID_LENOVO_TP10UBKBD :case USB_DEVICE_ID_LENOVO_X1_TAB : +case USB_DEVICE_ID_LENOVO_X1_TAB3 :lenovo_remove_tp10ubkbd (hdev);break ; }
@@ -1424,6 +1430,8 @@ static const struct hid_device_id lenovo_devices[] = {*/ {HID_DEVICE (BUS_USB ,HID_GROUP_GENERIC , USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_X1_TAB) }, + { HID_DEVICE(BUS_USB, HID_GROUP_GENERIC, + USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_X1_TAB3) }, { } };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 8/15 RISCV: KVM: use raw_spinlock for critical section in imsic
In reply to Sasha LevinFrom: Cyan Yang <[email protected]>
[ Upstream commit 3ec4350d4efb5ccb6bd0e11d9cf7f2be4f47297d ]
For the external interrupt updating procedure in imsic, there was a spinlock to protect it already. But since it should not be preempted in any cases, we should turn to use raw_spinlock to prevent any preemption in case PREEMPT_RT was enabled.
Message-ID: <[email protected]>
--- arch/riscv/kvm/aia_imsic.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/riscv/kvm/aia_imsic.c +4 -4
@@ -55,7 +55,7 @@ struct imsic {/* IMSIC SW-file */ struct imsic_mrif *swfile;phys_addr_t swfile_pa; -spinlock_t swfile_extirq_lock; +raw_spinlock_t swfile_extirq_lock; };#define imsic_vs_csr_read (__c) \
@@ -622,7 +622,7 @@ static void imsic_swfile_extirq_update(struct kvm_vcpu *vcpu)* interruptions between reading topei and updating pending status. */ -spin_lock_irqsave (&imsic->swfile_extirq_lock, flags); +raw_spin_lock_irqsave (&imsic->swfile_extirq_lock, flags);if (imsic_mrif_atomic_read (mrif, &mrif->eidelivery) &&imsic_mrif_topei (mrif, imsic->nr_eix, imsic->nr_msis))
@@ -630,7 +630,7 @@ static void imsic_swfile_extirq_update(struct kvm_vcpu *vcpu)else kvm_riscv_vcpu_unset_interrupt (vcpu,IRQ_VS_EXT ); -spin_unlock_irqrestore (&imsic->swfile_extirq_lock, flags); +raw_spin_unlock_irqrestore (&imsic->swfile_extirq_lock, flags); } static void imsic_swfile_read(struct kvm_vcpu *vcpu, bool clear,
@@ -1051,7 +1051,7 @@ int kvm_riscv_vcpu_aia_imsic_init(struct kvm_vcpu *vcpu) } imsic->swfile =page_to_virt (swfile_page); imsic->swfile_pa =page_to_phys (swfile_page); -spin_lock_init (&imsic->swfile_extirq_lock); +raw_spin_lock_init (&imsic->swfile_extirq_lock);/* Setup IO device */ kvm_iodevice_init (&imsic->iodev, &imsic_iodoev_ops);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 9/15 fsl/fman: Save device references taken in mac_probe()
In reply to Sasha LevinFrom: Aleksandr Mishin <[email protected]>
[ Upstream commit efeddd552ec6767e4c8884caa516ac80b65f8823 ]
In mac_probe() there are calls to of_find_device_by_node() which takes references to of_dev->dev. These references are not saved and not released later on error path in mac_probe() and in mac_remove().
Add new fields into mac_device structure to save references taken for future use in mac_probe() and mac_remove().
This is a preparation for further reference leaks fix.
--- drivers/net/ethernet/freescale/fman/mac.c | 6 ++++-- drivers/net/ethernet/freescale/fman/mac.h | 6 +++++- 2 files changed, 9 insertions(+), 3 deletions(-)
drivers/net/ethernet/freescale/fman/mac.c +4 -2
@@ -197,6 +197,7 @@ static int mac_probe(struct platform_device *_of_dev) err = -EINVAL ; goto _return_of_node_put; } + mac_dev->fman_dev = &of_dev->dev;/* Get the FMan cell-index */ err =of_property_read_u32 (dev_node,"cell-index" , &val);
@@ -208,7 +209,7 @@ static int mac_probe(struct platform_device *_of_dev)/* cell-index 0 => FMan id 1 */ fman_id = (u8)(val +1 ); - priv->fman =fman_bind (&of_dev->dev); + priv->fman =fman_bind (mac_dev->fman_dev);if (!priv->fman) {dev_err (dev,"fman_bind(%pOF) failed\n" , dev_node); err = -ENODEV ;
@@ -284,8 +285,9 @@ static int mac_probe(struct platform_device *_of_dev) err = -EINVAL ; goto _return_of_node_put; } + mac_dev->fman_port_devs[i] = &of_dev->dev; - mac_dev->port[i] =fman_port_bind (&of_dev->dev); + mac_dev->port[i] =fman_port_bind (mac_dev->fman_port_devs[i]);if (!mac_dev->port[i]) {dev_err (dev,"dev_get_drvdata(%pOF) failed\n" , dev_node);
drivers/net/ethernet/freescale/fman/mac.h +5 -1
@@ -19,12 +19,13 @@struct fman_mac ;struct mac_priv_s ; +#define PORT_NUM 2struct mac_device {void __iomem *vaddr;struct device *dev;struct resource *res;u8 addr[ETH_ALEN ]; -struct fman_port *port[2 ]; +struct fman_port *port[PORT_NUM ];struct phylink *phylink;struct phylink_config phylink_config;phy_interface_t phy_if;
@@ -52,6 +53,9 @@ struct mac_device {struct fman_mac *fman_mac;struct mac_priv_s *priv; + +struct device *fman_dev; +struct device *fman_port_devs[PORT_NUM ]; }; static inline struct mac_device
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 10/15 ASoC: rt722-sdca: increase clk_stop_timeout to fix clock stop issue
In reply to Sasha LevinFrom: Jack Yu <[email protected]>
[ Upstream commit 038fa6ddf5d22694f61ff7a7a53c8887c6b08c45 ]
clk_stop_timeout should be increased to 900ms to fix clock stop issue.
--- sound/soc/codecs/rt722-sdca-sdw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/rt722-sdca-sdw.c +1 -1
@@ -253,7 +253,7 @@ static int rt722_sdca_read_prop(struct sdw_slave *slave) }/* set the timeout values */ - prop->clk_stop_timeout =200 ; + prop->clk_stop_timeout =900 ;/* wake-up event */ prop->wake_capable =1 ;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 11/15 LoongArch: Use "Exception return address" to comment ERA
In reply to Sasha LevinFrom: Yanteng Si <[email protected]>
[ Upstream commit b69269c870ece1bc7d2e3e39ca76f4602f2cb0dd ]
The information contained in the comment for LOONGARCH_CSR_ERA is even less informative than the macro itself, which can cause confusion for junior developers. Let's use the full English term.
--- arch/loongarch/include/asm/loongarch.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/loongarch/include/asm/loongarch.h +1 -1
@@ -242,7 +242,7 @@#define CSR_ESTAT_IS_WIDTH 14#define CSR_ESTAT_IS (_ULCAST_(0x3fff) << CSR_ESTAT_IS_SHIFT) -#define LOONGARCH_CSR_ERA 0x6/* ERA */ +#define LOONGARCH_CSR_ERA 0x6/* Exception return address */ #define LOONGARCH_CSR_BADV 0x7/* Bad virtual address */
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 12/15 platform/x86: dell-wmi: Ignore suspend notifications
In reply to Sasha LevinFrom: Armin Wolf <[email protected]>
[ Upstream commit a7990957fa53326fe9b47f0349373ed99bb69aaa ]
Some machines like the Dell G15 5155 emit WMI events when suspending/resuming. Ignore those WMI events.
--- drivers/platform/x86/dell/dell-wmi-base.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/platform/x86/dell/dell-wmi-base.c +9 -0
@@ -264,6 +264,15 @@ static const struct key_entry dell_wmi_keymap_type_0010[] = {/*Speaker Mute*/ { KE_KEY, 0x109, { KEY_MUTE} }, +/* S2Idle screen off */ + { KE_IGNORE, 0x120, { KEY_RESERVED }}, + +/* Leaving S4 or S2Idle suspend */ + { KE_IGNORE, 0x130, { KEY_RESERVED }}, + +/* Entering S2Idle suspend */ + { KE_IGNORE, 0x140, { KEY_RESERVED }}, +/* Mic mute */ { KE_KEY, 0x150, { KEY_MICMUTE } },
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 13/15 ASoC: fsl_micfil: Add sample rate constraint
In reply to Sasha LevinFrom: Shengjiu Wang <[email protected]>
[ Upstream commit b9a8ecf81066e01e8a3de35517481bc5aa0439e5 ]
On some platforms, for example i.MX93, there is only one audio PLL source, so some sample rate can't be supported. If the PLL source is used for 8kHz series rates, then 11kHz series rates can't be supported.
So add constraints according to the frequency of available clock sources, then alsa-lib will help to convert the unsupported rate for the driver.
--- sound/soc/fsl/fsl_micfil.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+)
sound/soc/fsl/fsl_micfil.c +38 -0
@@ -28,6 +28,13 @@#define MICFIL_OSR_DEFAULT 16 +#define MICFIL_NUM_RATES 7 +#define MICFIL_CLK_SRC_NUM 3 +/* clock source ids */ +#define MICFIL_AUDIO_PLL1 0 +#define MICFIL_AUDIO_PLL2 1 +#define MICFIL_CLK_EXT3 2 +enum quality {QUALITY_HIGH ,QUALITY_MEDIUM ,
@@ -45,9 +52,12 @@ struct fsl_micfil {struct clk *mclk;struct clk *pll8k_clk;struct clk *pll11k_clk; +struct clk *clk_src[MICFIL_CLK_SRC_NUM ];struct snd_dmaengine_dai_dma_data dma_params_rx;struct sdma_peripheral_config sdmacfg;struct snd_soc_card *card; +struct snd_pcm_hw_constraint_list constraint_rates; +unsigned int constraint_rates_list[MICFIL_NUM_RATES ];unsigned int dataline;char name[32 ];int irq[MICFIL_IRQ_LINES ];
@@ -449,12 +459,34 @@ static int fsl_micfil_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) {struct fsl_micfil *micfil =snd_soc_dai_get_drvdata (dai); +unsigned int rates[MICFIL_NUM_RATES ] = {8000 ,11025 ,16000 ,22050 ,32000 ,44100 ,48000 }; +int i, j, k =0 ; +u64 clk_rate;if (!micfil) {dev_err (dai->dev,"micfil dai priv_data not set\n" );return -EINVAL ; } + micfil->constraint_rates.list = micfil->constraint_rates_list; + micfil->constraint_rates.count =0 ; + +for (j =0 ; j <MICFIL_NUM_RATES ; j++) { +for (i =0 ; i <MICFIL_CLK_SRC_NUM ; i++) { + clk_rate =clk_get_rate (micfil->clk_src[i]); +if (clk_rate !=0 &&do_div (clk_rate, rates[j]) ==0 ) { + micfil->constraint_rates_list[k++] = rates[j]; + micfil->constraint_rates.count++; +break ; + } + } + } + +if (micfil->constraint_rates.count >0 ) +snd_pcm_hw_constraint_list (substream->runtime,0 , +SNDRV_PCM_HW_PARAM_RATE , + &micfil->constraint_rates); +return 0 ; }
@@ -1124,6 +1156,12 @@ static int fsl_micfil_probe(struct platform_device *pdev)fsl_asoc_get_pll_clocks (&pdev->dev, &micfil->pll8k_clk, &micfil->pll11k_clk); + micfil->clk_src[MICFIL_AUDIO_PLL1 ] = micfil->pll8k_clk; + micfil->clk_src[MICFIL_AUDIO_PLL2 ] = micfil->pll11k_clk; + micfil->clk_src[MICFIL_CLK_EXT3 ] =devm_clk_get (&pdev->dev,"clkext3" ); +if (IS_ERR (micfil->clk_src[MICFIL_CLK_EXT3 ])) + micfil->clk_src[MICFIL_CLK_EXT3 ] =NULL ; +/* init regmap */ regs =devm_platform_get_and_ioremap_resource (pdev,0 , &res);if (IS_ERR (regs))
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 14/15 net: usb: qmi_wwan: add Fibocom FG132 0x0112 composition
In reply to Sasha LevinFrom: Reinhard Speyerer <[email protected]>
[ Upstream commit 64761c980cbf71fb7a532a8c7299907ea972a88c ]
Add Fibocom FG132 0x0112 composition:
T: Bus=03 Lev=02 Prnt=06 Port=01 Cnt=02 Dev#= 10 Spd=12 MxCh= 0 D: Ver= 2.01 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=2cb7 ProdID=0112 Rev= 5.15 S: Manufacturer=Fibocom Wireless Inc. S: Product=Fibocom Module S: SerialNumber=xxxxxxxx C:* #Ifs= 4 Cfg#= 1 Atr=a0 MxPwr=500mA I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=50 Driver=qmi_wwan E: Ad=82(I) Atr=03(Int.) MxPS= 8 Ivl=32ms E: Ad=81(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms E: Ad=01(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms E: Ad=83(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option E: Ad=85(I) Atr=03(Int.) MxPS= 10 Ivl=32ms E: Ad=84(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms E: Ad=03(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms I:* If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=86(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms E: Ad=04(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
--- drivers/net/usb/qmi_wwan.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/usb/qmi_wwan.c +1 -0
@@ -1432,6 +1432,7 @@ static const struct usb_device_id products[] = { {QMI_FIXED_INTF(0x2c7c, 0x0296, 4)}, /* Quectel BG96 */ {QMI_QUIRK_SET_DTR(0x2c7c, 0x030e, 4)}, /* Quectel EM05GV2 */ {QMI_QUIRK_SET_DTR(0x2cb7, 0x0104, 4)}, /* Fibocom NL678 series */ + {QMI_QUIRK_SET_DTR(0x2cb7, 0x0112, 0)}, /* Fibocom FG132 */ {QMI_FIXED_INTF(0x0489, 0xe0b4, 0)}, /* Foxconn T77W968 LTE */ {QMI_FIXED_INTF(0x0489, 0xe0b5, 0)}, /* Foxconn T77W968 LTE with eSIM support*/ {QMI_FIXED_INTF(0x2692, 0x9025, 4)}, /* Cellient MPL200 (rebranded Qualcomm 05c6:9025) */
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 15/15 bpf: Check validity of link->type in bpf_link_show_fdinfo()
In reply to Sasha LevinFrom: Hou Tao <[email protected]>
[ Upstream commit 8421d4c8762bd022cb491f2f0f7019ef51b4f0a7 ]
If a newly-added link type doesn't invoke BPF_LINK_TYPE(), accessing bpf_link_type_strs[link->type] may result in an out-of-bounds access.
To spot such missed invocations early in the future, checking the validity of link->type in bpf_link_show_fdinfo() and emitting a warning when such invocations are missed.
--- kernel/bpf/syscall.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
kernel/bpf/syscall.c +9 -5
@@ -2963,13 +2963,17 @@ static void bpf_link_show_fdinfo(struct seq_file *m, struct file *filp) {const struct bpf_link *link = filp->private_data;const struct bpf_prog *prog = link->prog; +enum bpf_link_type type = link->type;char prog_tag[sizeof (prog->tag) *2 +1 ] = { }; -seq_printf (m, -"link_type:\t%s\n" -"link_id:\t%u\n" , - bpf_link_type_strs[link->type], - link->id); +if (type <ARRAY_SIZE (bpf_link_type_strs) && bpf_link_type_strs[type]) { +seq_printf (m,"link_type:\t%s\n" , bpf_link_type_strs[type]); + }else { +WARN_ONCE (1 ,"missing BPF_LINK_TYPE(...) for link type %u\n" , type); +seq_printf (m,"link_type:\t<%u>\n" , type); + } +seq_printf (m,"link_id:\t%u\n" , link->id); +if (prog) {bin2hex (prog_tag, prog->tag,sizeof (prog->tag)); seq_printf(m,
Signature · 1 line
2.43.0
Hi!
Quoted 8 lines
[ Upstream commit
e509996b16728e37d5a909a5c63c1bd64f23b306]Preparation for adding more fields to dst lookup functions without changing their signatures.
Signed-off-by Eyal Birger <[email protected]>Signed-off-by Steffen Klassert <[email protected]>Signed-off-by Sasha Levin <[email protected]>
This does not sound like a bugfix.
BR,
Pavel
Quoted 305 lines
include/net/xfrm.h | 26 +++++++++++++------------- net/ipv4/xfrm4_policy.c | 38 ++++++++++++++++---------------------- net/ipv6/xfrm6_policy.c | 28 +++++++++++++--------------- net/xfrm/xfrm_device.c | 11 ++++++++--- net/xfrm/xfrm_policy.c | 35 +++++++++++++++++++++++------------ 5 files changed, 73 insertions(+), 65 deletions(-)include/net/xfrm.h +13
-13@@ -342,20 +342,23 @@ struct xfrm_if_cb {void xfrm_if_register_cb (const struct xfrm_if_cb *ifcb);void xfrm_if_unregister_cb (void ); +struct xfrm_dst_lookup_params { +struct net *net; +int tos; +int oif; +xfrm_address_t *saddr; +xfrm_address_t *daddr; +u32 mark; +}; +struct net_device ;struct xfrm_type ;struct xfrm_dst ;struct xfrm_policy_afinfo {struct dst_ops *dst_ops; -struct dst_entry *(*dst_lookup)(struct net *net, -int tos,int oif, -const xfrm_address_t *saddr, -const xfrm_address_t *daddr, -u32 mark); -int (*get_saddr)(struct net *net,int oif, -xfrm_address_t *saddr, -xfrm_address_t *daddr, -u32 mark); +struct dst_entry *(*dst_lookup)(const struct xfrm_dst_lookup_params *params); +int (*get_saddr)(xfrm_address_t *saddr, +const struct xfrm_dst_lookup_params *params);int (*fill_dst)(struct xfrm_dst *xdst,struct net_device *dev,const struct flowi *fl);@@ -1728,10 +1731,7 @@ static inline int xfrm_user_policy(struct sock *sk, int optname, }#endif -struct dst_entry *__xfrm_dst_lookup (struct net *net,int tos,int oif, -const xfrm_address_t *saddr, -const xfrm_address_t *daddr, -int family,u32 mark); +struct dst_entry *__xfrm_dst_lookup (int family,const struct xfrm_dst_lookup_params *params);struct xfrm_policy *xfrm_policy_alloc (struct net *net,gfp_t gfp);net/ipv4/xfrm4_policy.c +16
-22@@ -17,47 +17,41 @@#include <net/ip.h> #include <net/l3mdev.h> -static struct dst_entry *__xfrm4_dst_lookup (struct net *net,struct flowi4 *fl4, -int tos,int oif, -const xfrm_address_t *saddr, -const xfrm_address_t *daddr, -u32 mark) +static struct dst_entry *__xfrm4_dst_lookup (struct flowi4 *fl4, +const struct xfrm_dst_lookup_params *params) {struct rtable *rt;memset (fl4,0 ,sizeof (*fl4)); - fl4->daddr = daddr->a4; - fl4->flowi4_tos = tos; - fl4->flowi4_l3mdev =l3mdev_master_ifindex_by_index (net, oif); - fl4->flowi4_mark = mark; -if (saddr) - fl4->saddr = saddr->a4; - - rt =__ip_route_output_key (net, fl4); + fl4->daddr = params->daddr->a4; + fl4->flowi4_tos = params->tos; + fl4->flowi4_l3mdev =l3mdev_master_ifindex_by_index (params->net, + params->oif); + fl4->flowi4_mark = params->mark; +if (params->saddr) + fl4->saddr = params->saddr->a4; + + rt =__ip_route_output_key (params->net, fl4);if (!IS_ERR (rt))return &rt->dst;return ERR_CAST (rt); } -static struct dst_entry *xfrm4_dst_lookup (struct net *net,int tos,int oif, -const xfrm_address_t *saddr, -const xfrm_address_t *daddr, -u32 mark) +static struct dst_entry *xfrm4_dst_lookup (const struct xfrm_dst_lookup_params *params) {struct flowi4 fl4; -return __xfrm4_dst_lookup (net, &fl4, tos, oif, saddr, daddr, mark); +return __xfrm4_dst_lookup (&fl4, params); } -static int xfrm4_get_saddr (struct net *net,int oif, -xfrm_address_t *saddr,xfrm_address_t *daddr, -u32 mark) +static int xfrm4_get_saddr (xfrm_address_t *saddr, +const struct xfrm_dst_lookup_params *params) {struct dst_entry *dst;struct flowi4 fl4; - dst =__xfrm4_dst_lookup (net, &fl4,0 , oif,NULL , daddr, mark); + dst =__xfrm4_dst_lookup (&fl4, params);if (IS_ERR (dst))return -EHOSTUNREACH ;net/ipv6/xfrm6_policy.c +13
-15@@ -23,23 +23,21 @@#include <net/ip6_route.h> #include <net/l3mdev.h> -static struct dst_entry *xfrm6_dst_lookup (struct net *net,int tos,int oif, -const xfrm_address_t *saddr, -const xfrm_address_t *daddr, -u32 mark) +static struct dst_entry *xfrm6_dst_lookup (const struct xfrm_dst_lookup_params *params) {struct flowi6 fl6;struct dst_entry *dst;int err;memset (&fl6,0 ,sizeof (fl6)); - fl6.flowi6_l3mdev =l3mdev_master_ifindex_by_index (net, oif); - fl6.flowi6_mark = mark; -memcpy (&fl6.daddr, daddr,sizeof (fl6.daddr)); -if (saddr) -memcpy (&fl6.saddr, saddr,sizeof (fl6.saddr)); + fl6.flowi6_l3mdev =l3mdev_master_ifindex_by_index (params->net, + params->oif); + fl6.flowi6_mark = params->mark; +memcpy (&fl6.daddr, params->daddr,sizeof (fl6.daddr)); +if (params->saddr) +memcpy (&fl6.saddr, params->saddr,sizeof (fl6.saddr)); - dst =ip6_route_output (net,NULL , &fl6); + dst =ip6_route_output (params->net,NULL , &fl6); err = dst->error;if (dst->error) {@@ -50,15 +48,14 @@ static struct dst_entry *xfrm6_dst_lookup(struct net *net, int tos, int oif,return dst; } -static int xfrm6_get_saddr (struct net *net,int oif, -xfrm_address_t *saddr,xfrm_address_t *daddr, -u32 mark) +static int xfrm6_get_saddr (xfrm_address_t *saddr, +const struct xfrm_dst_lookup_params *params) {struct dst_entry *dst;struct net_device *dev;struct inet6_dev *idev; - dst =xfrm6_dst_lookup (net,0 , oif,NULL , daddr, mark); + dst =xfrm6_dst_lookup (params);if (IS_ERR (dst))return -EHOSTUNREACH ;@@ -68,7 +65,8 @@ static int xfrm6_get_saddr(struct net *net, int oif,return -EHOSTUNREACH ; } dev = idev->dev; -ipv6_dev_get_saddr (dev_net (dev), dev, &daddr->in6,0 , &saddr->in6); +ipv6_dev_get_saddr (dev_net (dev), dev, ¶ms->daddr->in6,0 , + &saddr->in6);dst_release (dst);return 0 ; }net/xfrm/xfrm_device.c +8
-3@@ -263,6 +263,8 @@ int xfrm_dev_state_add(struct net *net, struct xfrm_state *x, dev =dev_get_by_index (net, xuo->ifindex);if (!dev) { +struct xfrm_dst_lookup_params params; +if (!(xuo->flags &XFRM_OFFLOAD_INBOUND )) { saddr = &x->props.saddr; daddr = &x->id.daddr;@@ -271,9 +273,12 @@ int xfrm_dev_state_add(struct net *net, struct xfrm_state *x, daddr = &x->props.saddr; } - dst =__xfrm_dst_lookup (net,0 ,0 , saddr, daddr, - x->props.family, -xfrm_smark_get (0 , x)); +memset (¶ms,0 ,sizeof (params)); + params.net = net; + params.saddr = saddr; + params.daddr = daddr; + params.mark =xfrm_smark_get (0 , x); + dst =__xfrm_dst_lookup (x->props.family, ¶ms);if (IS_ERR (dst))return (is_packet_offload) ? -EINVAL :0 ;net/xfrm/xfrm_policy.c +23
-12@@ -251,10 +251,8 @@ static const struct xfrm_if_cb *xfrm_if_get_cb(void)return rcu_dereference (xfrm_if_cb); } -struct dst_entry *__xfrm_dst_lookup (struct net *net,int tos,int oif, -const xfrm_address_t *saddr, -const xfrm_address_t *daddr, -int family,u32 mark) +struct dst_entry *__xfrm_dst_lookup (int family, +const struct xfrm_dst_lookup_params *params) {const struct xfrm_policy_afinfo *afinfo;struct dst_entry *dst;@@ -263,7 +261,7 @@ struct dst_entry *__xfrm_dst_lookup(struct net *net, int tos, int oif,if (unlikely (afinfo ==NULL ))return ERR_PTR (-EAFNOSUPPORT ); - dst = afinfo->dst_lookup (net, tos, oif, saddr, daddr, mark); + dst = afinfo->dst_lookup (params);rcu_read_unlock ();@@ -277,6 +275,7 @@ static inline struct dst_entry *xfrm_dst_lookup(struct xfrm_state *x,xfrm_address_t *prev_daddr, int family, u32 mark) { + struct xfrm_dst_lookup_params params;struct net *net =xs_net (x);xfrm_address_t *saddr = &x->props.saddr;xfrm_address_t *daddr = &x->id.daddr;@@ -291,7 +290,14 @@ static inline struct dst_entry *xfrm_dst_lookup(struct xfrm_state *x, daddr = x->coaddr; } - dst =__xfrm_dst_lookup (net, tos, oif, saddr, daddr, family, mark); + params.net = net; + params.saddr = saddr; + params.daddr = daddr; + params.tos = tos; + params.oif = oif; + params.mark = mark; + + dst =__xfrm_dst_lookup (family, ¶ms);if (!IS_ERR (dst)) {if (prev_saddr != saddr)@@ -2424,15 +2430,15 @@ int __xfrm_sk_clone_policy(struct sock *sk, const struct sock *osk) }static int -xfrm_get_saddr (struct net *net,int oif,xfrm_address_t *local, -xfrm_address_t *remote,unsigned short family,u32 mark) +xfrm_get_saddr (unsigned short family,xfrm_address_t *saddr, +const struct xfrm_dst_lookup_params *params) {int err;const struct xfrm_policy_afinfo *afinfo =xfrm_policy_get_afinfo (family);if (unlikely (afinfo ==NULL ))return -EINVAL ; - err = afinfo->get_saddr (net, oif, local, remote, mark); + err = afinfo->get_saddr (saddr, params);rcu_read_unlock ();return err; }@@ -2461,9 +2467,14 @@ xfrm_tmpl_resolve_one(struct xfrm_policy *policy, const struct flowi *fl, remote = &tmpl->id.daddr; local = &tmpl->saddr;if (xfrm_addr_any (local, tmpl->encap_family)) { - error =xfrm_get_saddr (net, fl->flowi_oif, - &tmp, remote, - tmpl->encap_family,0 ); +struct xfrm_dst_lookup_params params; + +memset (¶ms,0 ,sizeof (params)); + params.net = net; + params.oif = fl->flowi_oif; + params.daddr = remote; + error =xfrm_get_saddr (tmpl->encap_family, &tmp, + ¶ms);if (error) goto fail; local = &tmp;
Signature · 1 line
People of Russia, stop Putin before his war on Ukraine escalates.