jhypolite / DeepMatch

DeepMatch: Practical Deep Packet Inspection in the Data Plane using Network Processors
Apache License 2.0
13 stars 4 forks source link

Failed to build DeepMatch with Programmer Studio 6.1.0.1-preview #1

Closed GavynDracula closed 3 years ago

GavynDracula commented 3 years ago

Hi,

Recently, we want to run DeepMatch on our Netronome Agilio SmartNIC, but we failed.

When we build the project of deepmatch according to READEME, the Programmer Studio reports us several errors like "struct 'pktio_meta' has no field 'xxx'", e.g., "plugin.c(302): error : struct 'pktio_meta' has no field 'pkt_buf'".

We are really new to the development of Netronome SmartNICs and not able to figure out the root cause of this compilation error. Do you know the reason of that?

jhypolite commented 3 years ago

Hi, The README states "we used version 6.0.3.1 build 3241" of the SDK. Please grep your Netronome SDK source to find that structure and see how it is defined -- does it include the pkt_buf field (it may be in a file called pktio.h)?

GavynDracula commented 3 years ago

Hi, Joel. Thanks for your reply. Acutally, I have checked the declaration of 'struct pktio_meta' in the pktio.h, and there are reallly no such fields. In my SDK (version 6.1.0.1), 'struct pktio_meta" is defined as follow.

struct pktio_meta {
    union {
        struct {
            struct nbi_meta_pkt_info p_nbi;     /**< Std NBI-formatted metadata
                                                  *  accessor #defines below */

            unsigned int p_ctm_size:2;          /**< CTM buffer encoded size */
            unsigned int p_orig_len:14;         /**< Original RX pkt length */
            unsigned int p_offset:16;           /**< Offset of data in buffer*/

            unsigned int p_src:16;              /**< Source port */
            unsigned int p_dst:16;              /**< Destination port */

            unsigned int p_seq:16;              /**< Sequence number */
            unsigned int p_ro_ctx:5;            /**< Reorder context mapped
                                                  *  from NBI or NFD seqr */
            unsigned int p_is_gro_seq:1;        /**< Is pkt to be reordered
                                                  *  with GRO? */
            unsigned int p_rx_ipv4_csum_ok:1;   /**< Set if IP csum was ok */
            unsigned int p_rx_ipv4_csum_present:1;/**< Set if IP csum present*/
            unsigned int p_rx_l4_csum_ok:1;     /**< Set if L4 csum was ok */
            unsigned int p_rx_l4_csum_present:1;/**< Set if L4 csum present */
            unsigned int p_rx_l4_tcp:1;         /**< Set if L4 is TCP */
            unsigned int p_rx_mac_matched:1;    /**< Dst MAC match port MAC? */
#ifdef MAC_EGRESS_PREPEND_ENABLE
            /* The CSUM Tx flags serves two purposes :
             * 1. For packets received from the host those flags cache the
             *    Tx CSUM flags extracted from the NFD descriptor and are
             *    later used in the Tx CSUM offload performed by the ME.
             *    When this stage is done those bits are cleared.
             * 2. For packets being sent out on the wire those flags are used
             *    to setup the MAC CSUM offload processing.
             */
            unsigned int p_tunnel:1;            /**< A tunnel packet */
            unsigned int resv4:1;               /**< Reserved */
            unsigned int p_tx_l3_csum:1;        /**< Req L3 csum TX offload */
            unsigned int p_tx_l4_csum:1;        /**< Req L4 csum TX offload */
#else
            unsigned int p_tunnel:1;            /**< A tunnel packet */
            unsigned int resv4:3;               /**< Reserved */
#endif

            union {
#ifdef PKTIO_LSO_ENABLED                        /**< LSO if host packet */
                struct {
                    unsigned int p_tx_lso:1;    /**< Pkt was PCIe LSO pkt */
                    unsigned int p_tx_lso_end:1;/**< Pkt is last in series*/
                    unsigned int resv2:6;       /**< Reserved */
                    unsigned int p_tx_lso_seq:8;/**< Pkt num in LSO sequence */
                    unsigned int p_tx_mss:14;   /**< MSS of TCP */
                    unsigned int resv1:2;       /**< Reserved */
                };
#endif
#if NBI_PKT_PREPEND_BYTES >= 8                  /**< timestamp if NBI packet */
                unsigned int p_timestamp:32;    /**< MAC timestamp */
#endif
            };

#ifdef PKTIO_VLAN_ENABLED
            unsigned int p_vlan:16;             /**< VLAN id for RX and TX VLAN
                                                  *  offloading */
            unsigned int resv3:16;              /**< Reserved */
#endif
        };

        uint32_t __raw[PKTIO_NBI_META_LW];
    };
};

It seems that Netronome has changed their some APIs in the latest SDK?

jhypolite commented 3 years ago

Yes, the API changed. Someone else tried installing with 6.1.0.1-preview and ran into the same compiler error. They reverted to 6.0.3.1 and the install worked. Are you able to contact Netronome to obtain the compatible SDK version? https://help.netronome.com/support/home

GavynDracula commented 3 years ago

Yes, I have submitted a ticket to apply for an older stable version. However, Netronome has not replied to me... Screenshot_20201230_091947

GavynDracula commented 3 years ago

Hi, Joel. We can only install the 6.0.4.1 version of SDK. However, when we compile DeepMatch with 6.0.4.1, a new error "error : No LM for spilling. (-Qspill=3). compilation stopped" appeared ... Do you learn about this compilation error?

jhypolite commented 3 years ago

Has Netronome responded about the SDK? The new error could be due to your build settings? You need reduced threads mode and to turn off/reduce features that are not needed, like debugging and multicast groups.

jhypolite commented 3 years ago

Note that Netronome has made SDK 6.0.3 available upon request. You must send them an explicit request for it.