They were potato farmers, vegetable wholesalers, textile workers, priests, housewives, grandmothers and students and they bumped against one another trying to drink Irish coffee and whiskey in the jammed room.

"There is an unbelievable family resemblance here," said Rep. Thomas P. (Tip) O'Neill (D-Mass.) as he hugged and kissed several generations of cousins he never knew until yesterday.

Sylvio Conte, another representative from Massachusetts and one of O'Neill's best friends despite the fact that he is Italian and a Republican, took home movies. Small children moved around at their feet.

O'Neill, 66-year-old Massachusetts-born speaker of the House of Representatives, son of Mary Tolan and grandson of Winnie Fullerton, Mary's mother, uncovered some of his roots today in this seaside town of 3,000 that faces Lough Swilly and is framed by the 2,000 foot mountain, Sliee Snacht, in north Donegal.

"When I walked into Dublin Castle last night and saw Jim Fullerton, I thought I saw Eddie Glennon from up home . . . A thrill came over me like I never felt before," O'Neill told a throng relatives gathered at the White Strand Hotel.

O'Neill, whose bricklayer father emigrated from County Cork, met about eight of 20 second cousins at Dublin Castle the night before at a reception hosted by Irish Prime Minister Jack Lynch.

The reunion was researched by John Hume, a friend of O'Neill who lives in Londonberry, 10 miles away in Ulster, and is deputy leader of the Social Democratic and Labor Party which represents the Catholic minority in Northern Ireland.

"We got a tip that his grandmother was born in Buncrana and it didn't take long to look up names in the local registry," Humes said.

Winnie Fullerton gave up her potato farm during the famine in the last century. But a shell of the gray stone ancestral home still stands, barely 20 by 40 feet. Today, O'Neill paid homage to the site.

Driving through narrow roads on the outskirts of town where peat bogs, heather and rushes can be seen for miles without interruption, O'Neill was met by the clan, who cheered his arrival.

Among the high families of Ireland who were forced to leave the country in the 17th century after the British conquest were the O'Neills.

Denice McLauglin, chairman of the Buncrana Urban District Council, cited that in his welcome.

"From our Lough Swilly the great Earls and O'Neills have sailed into exile and into the services of a distant land," he said. "What a change today to welcome back another great O'Neill to the land of the origin of his forefathers."

Meanwhile, a remark made by O'Neill in Thursday night speech in Dublin that Northern Ireland was being treated as a "political football" by British politicians touched off a storm of controvesy.

Leaders of both the ruling Labor Party and opposition Conservatives condemned O'Neill's comments and much of the commentary in the British press today was devoted to them.

Ciaran McKeown, former leader of a Nobel Prize-winning peace group in Ulster, said O'Neill's opinions on Ireland were "a combination of sentimental Irish-Americanism and a calculated interest in the Irsh-American vote." CAPTION: Picture, House Speaker O'Neill leaves U.S. consul's home in Belfast after surprise visit. AP