From: Qi Zhang Date: Tue, 8 Oct 2019 01:50:16 +0000 (+0800) Subject: net/ice/base: fix switch rule programming for all profiles X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=d1a6a2da5dce6f476872a442ab0208fdd83523b6;p=dpdk.git net/ice/base: fix switch rule programming for all profiles In switch rule programming, if the caller requested tunnel type of ICE_SW_TUN_AND_NON_TUN, then the code would incorrectly attempt to add a tunneled UDP port in the training packet, this would cause the rule addition to fail. This patch does not attempt to add the UDP port so that the rule programming will succeed. Fixes: c3d6ac02c0c3 ("net/ice/base: update switch training packets with open ports") Signed-off-by: Dan Nowlin Signed-off-by: Paul M Stillwell Jr Signed-off-by: Qi Zhang Acked-by: Qiming Yang --- diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c index 2c02021b19..36da27f781 100644 --- a/drivers/net/ice/base/ice_switch.c +++ b/drivers/net/ice/base/ice_switch.c @@ -6214,7 +6214,8 @@ ice_add_adv_rule(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups, if (status) goto err_ice_add_adv_rule; - if (rinfo->tun_type != ICE_NON_TUN) { + if (rinfo->tun_type != ICE_NON_TUN && + rinfo->tun_type != ICE_SW_TUN_AND_NON_TUN) { status = ice_fill_adv_packet_tun(hw, rinfo->tun_type, s_rule->pdata.lkup_tx_rx.hdr, pkt_offsets);