Preheat the oven to 350°F (180°C).
Prepare the cake pans (two 9-inch or three 8-inch with removable bottoms) by spraying or buttering them and lining the bottom with a circle of parchment paper. Flouring them and shaking off excess also works.
In a large bowl (I use an electric mixer, but you can use the stand mixer), beat 1 cup sunflower oil, ½ cup granulated sugar and 1 cup brown sugar for 2 minutes.
Add 3 eggs, one at a time, beating well after each.
Add 2 cups mashed ripe bananas, 1 cup very finely chopped pineapple, and ½ teaspoon vanilla extract. Mix well, but don’t beat much.
Sift the dry ingredients (3 cups all-purpose or cake flour, ½ teaspoon ground cinnamon, 1 teaspoon baking soda and ½ teaspoon salt) and add them in 2 parts. I have them measured and sift directly over the batter, but you can do so in a separate bowl if it's easier. Incorporate very well but do so at low speed, being careful not to overbeat at this point so the cake is tender. Beating the flour too much results in tougher cakes.
Add ½ cup walnuts or pecans, chopped, and mix it all with a spatula.
Divide the cake batter evenly among the prepared pans and bake in the preheated oven for about 25-30 minutes for three layers, and about 5-10 more minutes for 2 layers. The cake surface will be dry but shiny, and a cake tester or toothpick inserted in the middle should come out clean.
Let cool completely on a wire rack.
Fill and frost the cooled cake with the frosting below. Refrigerate leftovers, covered in plastic wrap or in an airtight container.