The only information we have is related to the House of Dúrin, and they were not farmers, his chief supply of food and grains of farming were the Northmen which were herdsmen, tillers and shepherds. Dwarves were engineers, metallurgists, masons and jewelers.


There in the North grew the system known as the economy of Middle Earth (a type of bartering):

For the Longbeards, though the proudest of the seven kindreds, were also the wisest and the most farseeing. Men held them in awe and were eager to learn from them; and the Longbeards were very willing to use Men for their own purposes. Thus there grew up in those regions the economy, later characteristic of the dealings of Dwarves and Men (including Hobbits): Men became the chief providers of food, as herdsmen, shepherds, and land-tillerswhich the Dwarves exchanged for work as builders, roadmakers, miners, and the makers of things of craft, from useful tools to weapons and arms and many other things of great cost and skill. To the great profit of the Dwarves. Not only to be reckoned in hours of labour, though in early times the Dwarves must have obtained goods that were the product of greater and longer toil than the things or services that they gave in exchange - before Men became wiser and developed skills of their own. The chief advantage to them was their freedom to proceed unhindered with their own work and to refine their arts, especially in metallurgy, to the marvellous skill which these reached before the decline and dwindling of the Khazad. This system developed slowly, and it was long before the Longbeards felt any need to learn the language of their neighbours, still less to adopt names by which they could be known individually to 'outsiders'.

Sure, Dwarves had some source of food before they met Men, but it doesn't necessarily mean farming, also Dwarves have always lived in mines and halls, never on open land, except the wanderings.

Another thing, although it may have seemed cool in the movies, it is evident that some screenwriters of The Hobbit did not read the source material or decided to ignore it, no Dwarf has ever ridden pigs, horses (except ponies) nor did they raise animals, not even dogs.

No Dwarf would ever mount a horse willingly, nor did any ever harbour animals, not even dogs.