Layer > Convert To Data Layer
This is very much only a starting point. You will need to split the ways up, connect them with correct topology, move nodes around, thin them out, tag them and so on. Never upload raw converted ways!
When converting a Marker Layer the following "tags" of the marker will be converted to osm tags:
|marker tag||osm tag|
You can adjust or enhance this list by modifying the key
gpx.to-osm-mapping in the advanced preferences. The key
gpxicon is intended for custom icon display within JOSM, so make sure to not upload any keys which should not be part of the OSM database. (See also ticket #13717, the implementation of this feature.)