Sentence #1: "The police officer, who gave me directions, was friendly."
main clause: "The police officer was friendly."
subordinate phrase describing the police officer: "who gave me directions"
(Which police officer was it? The one who gave me directions)
Sentence #2: "The police officer, who was friendly, gave me directions."
main clause: "The police officer gave me directions"
subordinate phrase identifying the police officer: "who was friendly".
(Which police officer was it? The one who was friendly)
In each case, the main clause is what matters most. The subordinate clauses give secondary information about the police officer. My conclusion is the opposite of the one reached in the previous comment.
Commas to isolate the secondary phrase are helpful but not necessary.