014-mvneta-driver-disallow-XDP-program-on-hardware-buffe.patch 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. From 79572c98c554dcdb080bca547c871a51716dcdf8 Mon Sep 17 00:00:00 2001
  2. From: Sven Auhagen <[email protected]>
  3. Date: Sat, 25 Jan 2020 08:07:03 +0000
  4. Subject: [PATCH] mvneta driver disallow XDP program on hardware buffer
  5. management
  6. Recently XDP Support was added to the mvneta driver
  7. for software buffer management only.
  8. It is still possible to attach an XDP program if
  9. hardware buffer management is used.
  10. It is not doing anything at that point.
  11. The patch disallows attaching XDP programs to mvneta
  12. if hardware buffer management is used.
  13. I am sorry about that. It is my first submission and I am having
  14. some troubles with the format of my emails.
  15. v4 -> v5:
  16. - Remove extra tabs
  17. v3 -> v4:
  18. - Please ignore v3 I accidentally submitted
  19. my other patch with git-send-mail and v4 is correct
  20. v2 -> v3:
  21. - My mailserver corrupted the patch
  22. resubmission with git-send-email
  23. v1 -> v2:
  24. - Fixing the patches indentation
  25. Signed-off-by: Sven Auhagen <[email protected]>
  26. Signed-off-by: David S. Miller <[email protected]>
  27. ---
  28. drivers/net/ethernet/marvell/mvneta.c | 6 ++++++
  29. 1 file changed, 6 insertions(+)
  30. --- a/drivers/net/ethernet/marvell/mvneta.c
  31. +++ b/drivers/net/ethernet/marvell/mvneta.c
  32. @@ -4270,6 +4270,12 @@ static int mvneta_xdp_setup(struct net_d
  33. return -EOPNOTSUPP;
  34. }
  35. + if (pp->bm_priv) {
  36. + NL_SET_ERR_MSG_MOD(extack,
  37. + "Hardware Buffer Management not supported on XDP");
  38. + return -EOPNOTSUPP;
  39. + }
  40. +
  41. need_update = !!pp->xdp_prog != !!prog;
  42. if (running && need_update)
  43. mvneta_stop(dev);