net/ice/base: propagate errors from functions
authorQi Zhang <qi.z.zhang@intel.com>
Mon, 23 Sep 2019 07:44:24 +0000 (15:44 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 7 Oct 2019 13:00:56 +0000 (15:00 +0200)
There could be an error returned from ice_fill_adv_dummy_packet()
so we need to propagate that to the caller. Additionally, the
call to ice_flow_xtract_pkt_flags() could also return an error so
we need to propagate it as well.

Also add in the correct offsets for GENEVE and VXLAN_GPE to the
dummy packets.

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
drivers/net/ice/base/ice_flow.c
drivers/net/ice/base/ice_switch.c

index 682f26c..7dae532 100644 (file)
@@ -869,9 +869,12 @@ ice_flow_create_xtrct_seq(struct ice_hw *hw,
        /* For ACL, we also need to extract the direction bit (Rx,Tx) data from
         * packet flags
         */
-       if (params->blk == ICE_BLK_ACL)
-               ice_flow_xtract_pkt_flags(hw, params,
-                                         ICE_RX_MDID_PKT_FLAGS_15_0);
+       if (params->blk == ICE_BLK_ACL) {
+               status = ice_flow_xtract_pkt_flags(hw, params,
+                                                  ICE_RX_MDID_PKT_FLAGS_15_0);
+               if (status)
+                       return status;
+       }
 
        for (i = 0; i < params->prof->segs_cnt; i++) {
                u64 match = params->prof->segs[i].match;
index 00358e4..fa02316 100644 (file)
@@ -156,6 +156,7 @@ struct ice_dummy_pkt_offsets dummy_udp_tun_tcp_packet_offsets[] = {
        { ICE_UDP_OF,           34 },
        { ICE_VXLAN,            42 },
        { ICE_GENEVE,           42 },
+       { ICE_VXLAN_GPE,        42 },
        { ICE_MAC_IL,           50 },
        { ICE_IPV4_IL,          64 },
        { ICE_TCP_IL,           84 },
@@ -208,6 +209,7 @@ struct ice_dummy_pkt_offsets dummy_udp_tun_udp_packet_offsets[] = {
        { ICE_UDP_OF,           34 },
        { ICE_VXLAN,            42 },
        { ICE_GENEVE,           42 },
+       { ICE_VXLAN_GPE,        42 },
        { ICE_MAC_IL,           50 },
        { ICE_IPV4_IL,          64 },
        { ICE_UDP_ILOS,         84 },
@@ -6189,8 +6191,10 @@ ice_add_adv_rule(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,
        s_rule->pdata.lkup_tx_rx.recipe_id = CPU_TO_LE16(rid);
        s_rule->pdata.lkup_tx_rx.act = CPU_TO_LE32(act);
 
-       ice_fill_adv_dummy_packet(lkups, lkups_cnt, s_rule, pkt, pkt_len,
-                                 pkt_offsets);
+       status = ice_fill_adv_dummy_packet(lkups, lkups_cnt, s_rule, pkt,
+                                          pkt_len, pkt_offsets);
+       if (status)
+               goto err_ice_add_adv_rule;
 
        if (rinfo->tun_type != ICE_NON_TUN) {
                status = ice_fill_adv_packet_tun(hw, rinfo->tun_type,