Bareilly is the name of a town in Western Uttar Pradesh, of course spelled so by the British (kids always start with spelling it Bareli or something like that and teachers get to show off their intelligence on this name). Barfi, as you probably know by now, is an Indian sweet, traditionally white (barf=ice/snow, hence the name), but now found in all colors.
So the name simply means that-white-sweet of Bareilly.
For a diversion from the meaning though, as far as I have known Bareilly, it's been more famous for laddoos, especially those from Kipps, from earlier times. Not sure if the shop is still as good. I'd hope it is. But then when it comes to the movie's name, maybe they named it so for the alliteration one gets in Bareilly ki Barfi.