--- zzzz-none-000/linux-5.15.111/net/openvswitch/vport.c 2023-05-11 14:00:40.000000000 +0000 +++ puma7-atom-6670-761/linux-5.15.111/net/openvswitch/vport.c 2024-02-07 10:23:30.000000000 +0000 @@ -3,6 +3,16 @@ * Copyright (c) 2007-2014 Nicira, Inc. */ +/* + * Includes Inango Systems Ltd’s changes/modifications dated: 2021. + * Changed/modified portions - Copyright (c) 2021 , Inango Systems Ltd. + */ + +/* + Includes MaxLinear's changes dated: 2021, 2022, 2023. + Changed portions - Copyright 2021-2023 MaxLinear, Inc. +*/ + #include #include #include @@ -106,6 +116,20 @@ return NULL; } +#ifdef CONFIG_OPENVSWITCH_BRCOMPAT +static void release_vport(struct kobject *kobj) +{ + pr_info("Open vSwitch release_vport\n"); +} + +static struct kobj_type brport_ktype = { +#ifdef CONFIG_SYSFS + .sysfs_ops = &ovs_brport_sysfs_ops, +#endif + .release = release_vport +}; +#endif + /** * ovs_vport_alloc - allocate and initialize new vport * @@ -140,6 +164,13 @@ vport->ops = ops; INIT_HLIST_NODE(&vport->dp_hash_node); +#ifdef CONFIG_OPENVSWITCH_BRCOMPAT + /* Initialize kobject for bridge. This will be added as + * /sys/class/net//brport later, if sysfs is enabled. */ + vport->kobj.kset = NULL; + kobject_init(&vport->kobj, &brport_ktype); +#endif + if (ovs_vport_set_upcall_portids(vport, parms->upcall_portids)) { kfree(vport); return ERR_PTR(-EINVAL); @@ -165,6 +196,9 @@ * it is safe to use raw dereference. */ kfree(rcu_dereference_raw(vport->upcall_portids)); +#ifdef CONFIG_OPENVSWITCH_BRCOMPAT + kobject_put(&vport->kobj); +#endif kfree(vport); } EXPORT_SYMBOL_GPL(ovs_vport_free);