checksum disabling in dpaa driver in dpdk

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

checksum disabling in dpaa driver in dpdk

2,116 Views
rashmikj
Contributor III

How to disable the checksum checking in dpaa drivers in dpdk?

I tried the solution mentioned in this thread

https://community.nxp.com/t5/Layerscape/udp-checksum-on-rx-packet-of-dpdk/m-p/1262638#M7826

but its not working also dpaa_ethdev.c code is different.

I am using dpdk 20 present in LSDK and have attached the dpaa_ethdev.c file.

Kindly help

0 Kudos
10 Replies

2,116 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please add function fman_if_receive_rx_errors definition in drivers/bus/dpaa/base/fman/fman_hw.c.

void
fman_if_receive_rx_errors(struct fman_if *fm_if,
unsigned int err_eq)
{
struct __fman_if *__if = container_of(fm_if, struct __fman_if, __if);
unsigned int *fmbm_rcfg, *fmbm_rfsdm, *fmbm_rfsem;
unsigned int val;

fmbm_rcfg = &((struct rx_bmi_regs *)__if->bmi_map)->fmbm_rcfg;
fmbm_rfsdm = &((struct rx_bmi_regs *)__if->bmi_map)->fmbm_rfsdm;
fmbm_rfsem = &((struct rx_bmi_regs *)__if->bmi_map)->fmbm_rfsem;

val = in_be32(fmbm_rcfg);
out_be32(fmbm_rcfg, val | BMI_PORT_CFG_FDOVR);

out_be32(fmbm_rfsdm, 0);
out_be32(fmbm_rfsem, err_eq);
}

Please add function fman_if_receive_rx_errors declaratin in drivers/bus/dpaa/include/fsl_fman.h.

void fman_if_receive_rx_errors(struct fman_if *fm_if,
unsigned int err_eq);

 

In file drivers/net/dpaa/dpaa_ethdev.c, please modify fman_if_discard_rx_errors(fman_intf) to 

fman_if_receive_rx_errors(fman_intf, FM_FD_RX_STATUS_ERR_MASK).


if (!fman_intf->is_shared_mac) {
           /* Disable RX mode */
          fman_if_discard_rx_errors(fman_intf);=>fman_if_receive_rx_errors(fman_intf, FM_FD_RX_STATUS_ERR_MASK).
          fman_if_disable_rx(fman_intf);
          /* Disable promiscuous mode */

0 Kudos

2,096 Views
rashmikj
Contributor III

I tried the above code . it is giving me following error

 

/dpdk/drivers/bus/dpaa/base/fman/fman_hw.c: In function 'fman_if_recei ve_rx_errors':

/dpdk/drivers/bus/dpaa/base/fman/fman_hw.c:626:27: error: 'BMI_PORT_CF G_FDOVR' undeclared (first use in this function)
out_be32(fmbm_rcfg, val | BMI_PORT_CFG_FDOVR);

Kindly help

Tags (1)
0 Kudos

2,087 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please add the following definition in dpdk/drivers/bus/dpaa/include/fman.h.

#define BMI_PORT_CFG_FDOVR 0x02000000

0 Kudos

2,086 Views
rashmikj
Contributor III

After that this error

home/user/dpdk/drivers/net/dpaa/dpaa_ethdev.c: In function 'dpaa_dev_init':
/home/user/dpdk/drivers/net/dpaa/dpaa_ethdev.c:1816:40: error: 'FM_FD_RX_STATUS_ERR_MASK' undeclared (first use in this function); did you mean 'QM_MCR_NP_STATE_MASK'?
fman_if_receive_rx_errors(fman_intf, FM_FD_RX_STATUS_ERR_MASK);

0 Kudos

2,076 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please refer to the attached file in dpdk/drivers/net/dpaa/fmlib/fm_ext.h.

#define FM_FD_RX_STATUS_ERR_MASK (FM_FD_ERR_UNSUPPORTED_FORMAT | \
FM_FD_ERR_LENGTH | \
FM_FD_ERR_DMA | \
FM_FD_ERR_IPR | \
FM_FD_ERR_IPR_TO | \
FM_FD_ERR_IPR_NCSP | \
FM_FD_ERR_PHYSICAL | \
FM_FD_ERR_SIZE | \
FM_FD_ERR_CLS_DISCARD | \
FM_FD_ERR_COLOR_RED | \
FM_FD_ERR_COLOR_YELLOW | \
FM_FD_ERR_ILL_PLCR | \
FM_FD_ERR_PLCR_FRAME_LEN | \
FM_FD_ERR_EXTRACTION | \
FM_FD_ERR_NO_SCHEME | \
FM_FD_ERR_KEYSIZE_OVERFLOW | \
FM_FD_ERR_PRS_TIMEOUT | \
FM_FD_ERR_PRS_ILL_INSTRUCT | \
FM_FD_ERR_PRS_HDR_ERR | \
FM_FD_ERR_BLOCK_LIMIT_EXCEEDED) /**< RX Error FD bits */

0 Kudos

2,049 Views
rashmikj
Contributor III

I am still not receiving packet at application layer.

I am encrypting data below L3 layer , Hence both udp length and checkum are encrypted.

Is the driver dropping because of checksum or length??

0 Kudos

2,042 Views
yipingwang
NXP TechSupport
NXP TechSupport

When running l3fwd with vPMD, there is one thing to note.
In the configuration, ensure that DEV_RX_OFFLOAD_CHECKSUM in port_conf.rxmode.offloads is NOT set.
Otherwise, by default, RX vPMD is disabled.

0 Kudos

2,033 Views
rashmikj
Contributor III

I am using l2fwd-crypto application with encryption of IP payload.  when i enable dpaa log , it prints the following msg,

"Some of Rx offloads enabled by default - requested 0  fixed are 0x8004E"
Is this becoz of this function,
 
static int
dpaa_eth_dev_configure(struct rte_eth_dev *dev)
{
    struct dpaa_if *dpaa_intf = dev->data->dev_private;
    struct rte_eth_conf *eth_conf = &dev->data->dev_conf;
    uint64_t rx_offloads = eth_conf->rxmode.offloads;
    uint64_t tx_offloads = eth_conf->txmode.offloads;

    PMD_INIT_FUNC_TRACE();

    /* Rx offloads which are enabled by default */
    if (dev_rx_offloads_nodis & ~rx_offloads) {
        DPAA_PMD_INFO(
        "Some of Rx offloads enabled by default - requested 0x%" PRIx64
        " fixed are 0x%" PRIx64,
        rx_offloadsdev_rx_offloads_nodis);
    }

    /* Tx offloads which are enabled by default */
    if (dev_tx_offloads_nodis & ~tx_offloads) {
        DPAA_PMD_INFO(
        "Some of Tx offloads enabled by default - requested 0x%" PRIx64
        " fixed are 0x%" PRIx64,
        tx_offloadsdev_tx_offloads_nodis);
    }

    if (rx_offloads & DEV_RX_OFFLOAD_JUMBO_FRAME) {
        uint32_t max_len;

        DPAA_PMD_DEBUG("enabling jumbo");

        if (dev->data->dev_conf.rxmode.max_rx_pkt_len <=
            DPAA_MAX_RX_PKT_LEN)
            max_len = dev->data->dev_conf.rxmode.max_rx_pkt_len;
        else {
            DPAA_PMD_INFO("enabling jumbo override conf max len=%d "
                "supported is %d",
                dev->data->dev_conf.rxmode.max_rx_pkt_len,
                DPAA_MAX_RX_PKT_LEN);
            max_len = DPAA_MAX_RX_PKT_LEN;
        }

        fman_if_set_maxfrm(dpaa_intf->fifmax_len);
        dev->data->mtu = max_len
                - ETHER_HDR_LEN - ETHER_CRC_LEN - VLAN_TAG_SIZE;
    }

    if (rx_offloads & DEV_RX_OFFLOAD_SCATTER) {
        DPAA_PMD_DEBUG("enabling scatter mode");
        fman_if_set_sg(dpaa_intf->fif1);
        dev->data->scattered_rx = 1;
    }

    if (!(default_q || fmc_q)) {
        if (dpaa_fm_config(dev,
            eth_conf->rx_adv_conf.rss_conf.rss_hf)) {
            dpaa_write_fm_config_to_file();
            DPAA_PMD_ERR("FM port configuration: Failed\n");
            return -1;
        }
        dpaa_write_fm_config_to_file();
    }

    return 0;
}

 

 

how to disable it??

Tags (1)
0 Kudos

2,109 Views
rashmikj
Contributor III

Is there any documentation on dpaa drivers used in dpdk.

Kindly help.

 

Tags (1)
0 Kudos

2,099 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please refer to the following in dpdk source code.

doc/guides/nics/dpaa.rst

doc/guides/platform/dpaa.rst

0 Kudos