Somewhat archaic greeting. Was popular in England in polite society before the 50s.
The phrase is somthing of a non-sequiter - if read as written there's only half a verb, because one usualy does somthing rather than just does. The question could be construed as 'doing' your girlfriend or wife, but the intent is not to open a discussion on sexual acts, but rather to greet.
The nickname for a maneuver in which you (1) insert your entire hand into a person's anus and (2) open your hand, as if you are about to wave it and say "how do you do?"