DPDK/PSA: add drop operation
#include <rte_ip.h>
#include "actions.h"
-//extern struct all_metadatas_t all_metadatas;
+extern struct all_metadatas_t all_metadatas;
void InternetChecksum_t_init() {
debug(" :::: calling extern " T4LIT(InternetChecksum_t_init,extern) "\n");
@@ -38,11 +38,11 @@ void InternetChecksum_t_get() {
int extract_egress_port(packet_descriptor_t* pd) {
- return pd->all_metadatas.meta_psa_egress_deparser_input_metadata_t.egress_port;
+ return all_metadatas.meta_psa_egress_deparser_input_metadata_t.egress_port;
}
int extract_ingress_port(packet_descriptor_t* pd) {
- return pd->all_metadatas.meta_psa_ingress_input_metadata_t.ingress_port;
+ return all_metadatas.meta_psa_ingress_input_metadata_t.ingress_port;
}
void set_handle_packet_metadata(packet_descriptor_t* pd, uint32_t portid)
@@ -71,6 +71,9 @@ void update_checksum_offload(bitfield_handle_t cksum_field_handle, enum enum_PSA
void mark_to_drop(SHORT_STDPARAMS) {
debug(" :::: Calling extern " T4LIT(mark_to_drop,extern) "\n");
+
+ uint32_t res32;
+ MODIFY_INT32_INT32_BITS_PACKET(pd, header_instance_standard_metadata, field_standard_metadata_t_drop, 1)
}
void verify(bool check, enum error_error toSignal, SHORT_STDPARAMS) {
