[2/3] common/sfc_efx/base: add missing handler for 1-byte fields

Message ID 20220217222509.667611-2-ivan.malov@oktetlabs.ru (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series [1/3] common/sfc_efx/base: fix recirculation ID set in outer rules |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Ivan Malov Feb. 17, 2022, 10:25 p.m. UTC
  One may set RECIRC_ID in a MAE action rule specification.
This field is not a network one, and its handling goes
to the code snippet which does not recognise field
sizes other than 4 bytes. Add the missing handler.

Fixes: 3a73dcfdb255 ("common/sfc_efx/base: match on recirc ID in action rules")
Cc: stable@dpdk.org

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
---
 drivers/common/sfc_efx/base/efx_mae.c | 8 ++++++++
 1 file changed, 8 insertions(+)
  

Patch

diff --git a/drivers/common/sfc_efx/base/efx_mae.c b/drivers/common/sfc_efx/base/efx_mae.c
index 7d48b5787e..31f51b5548 100644
--- a/drivers/common/sfc_efx/base/efx_mae.c
+++ b/drivers/common/sfc_efx/base/efx_mae.c
@@ -1027,6 +1027,10 @@  efx_mae_match_spec_field_set(
 			memcpy(mvp + descp->emmd_value_offset,
 			    &dword, sizeof (dword));
 			break;
+		case 1:
+			memcpy(mvp + descp->emmd_value_offset,
+			    value, 1);
+			break;
 		default:
 			EFSYS_ASSERT(B_FALSE);
 		}
@@ -1039,6 +1043,10 @@  efx_mae_match_spec_field_set(
 			memcpy(mvp + descp->emmd_mask_offset,
 			    &dword, sizeof (dword));
 			break;
+		case 1:
+			memcpy(mvp + descp->emmd_mask_offset,
+			    mask, 1);
+			break;
 		default:
 			EFSYS_ASSERT(B_FALSE);
 		}