On 17/08/15 07:24, Maxim Uvarov wrote:
On 08/14/15 21:42, Zoltan Kiss wrote:
This platform doesn't compute it, packet_init set it to 0, which happens
to be ODP_PACKET_RSS_INVALID.

Signed-off-by: Zoltan Kiss <zoltan.k...@linaro.org>
---
  platform/linux-generic/include/odp/plat/packet_types.h |  2 ++
  platform/linux-generic/include/odp_packet_internal.h   |  1 +
  platform/linux-generic/odp_packet.c                    | 14
++++++++++++++
  3 files changed, 17 insertions(+)

diff --git a/platform/linux-generic/include/odp/plat/packet_types.h
b/platform/linux-generic/include/odp/plat/packet_types.h
index 45cb801..afc72f4 100644
--- a/platform/linux-generic/include/odp/plat/packet_types.h
+++ b/platform/linux-generic/include/odp/plat/packet_types.h
@@ -36,6 +36,8 @@ typedef ODP_HANDLE_T(odp_packet_seg_t);
  #define ODP_PACKET_SEG_INVALID _odp_cast_scalar(odp_packet_seg_t,
0xffffffff)
+#define ODP_PACKET_RSS_INVALID _odp_cast_scalar(odp_packet_t, 0)

This define is incorrect, I think.

+
  /** Get printable format of odp_packet_t */
  static inline uint64_t odp_packet_to_u64(odp_packet_t hdl)
  {
diff --git a/platform/linux-generic/include/odp_packet_internal.h
b/platform/linux-generic/include/odp_packet_internal.h
index 8c41491..6e52713 100644
--- a/platform/linux-generic/include/odp_packet_internal.h
+++ b/platform/linux-generic/include/odp_packet_internal.h
@@ -136,6 +136,7 @@ typedef struct {
      uint32_t tailroom;
      odp_pktio_t input;
+    uint32_t rss_hash;      /**< RSS hash value*/

is rss_hash always and everywhere 32 bit?

I don't think it's guaranteed anywhere. Maybe we should rather use an opaque type? But then we would need to provide operator functions for all the possible uses, that would be an overkill.

Maxim.


      odp_crypto_generic_op_result_t op_result;  /**< Result for
crypto */
  } odp_packet_hdr_t;
diff --git a/platform/linux-generic/odp_packet.c
b/platform/linux-generic/odp_packet.c
index 5581cc4..649071f 100644
--- a/platform/linux-generic/odp_packet.c
+++ b/platform/linux-generic/odp_packet.c
@@ -326,6 +326,20 @@ int odp_packet_l4_offset_set(odp_packet_t pkt,
uint32_t offset)
      return 0;
  }
+uint32_t odp_packet_rss_hash(odp_packet_t pkt)
+{
+    odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt);
+
+    return pkt_hdr->rss_hash;
+}
+
+void odp_packet_rss_hash_set(odp_packet_t pkt, uint32_t rss_hash)
+{
+    odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt);
+
+    pkt_hdr->rss_hash = rss_hash;
+}
+
  int odp_packet_is_segmented(odp_packet_t pkt)
  {
      return odp_packet_hdr(pkt)->buf_hdr.segcount > 1;

_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp
_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to