* [PATCH iwl-next v2] ice: Support untagged VLAN traffic in br offload
@ 2023-07-28 8:30 Wojciech Drewek
2023-07-29 11:11 ` Simon Horman
2023-08-01 7:27 ` [Intel-wired-lan] " Buvaneswaran, Sujai
0 siblings, 2 replies; 3+ messages in thread
From: Wojciech Drewek @ 2023-07-28 8:30 UTC (permalink / raw)
To: intel-wired-lan; +Cc: netdev, pmenzel
When driver receives SWITCHDEV_FDB_ADD_TO_DEVICE notification
with vid = 1, it means that we have to offload untagged traffic.
This is achieved by adding vlan metadata lookup.
Signed-off-by: Wojciech Drewek <wojciech.drewek@intel.com>
---
v2: remove unrelated changes, fix typos, add comment in
ice_eswitch_br_get_lkups_cnt
---
drivers/net/ethernet/intel/ice/ice_eswitch_br.c | 10 +++++++---
drivers/net/ethernet/intel/ice/ice_eswitch_br.h | 9 ---------
2 files changed, 7 insertions(+), 12 deletions(-)
diff --git a/drivers/net/ethernet/intel/ice/ice_eswitch_br.c b/drivers/net/ethernet/intel/ice/ice_eswitch_br.c
index 67bfd1f61cdd..5b425260b0eb 100644
--- a/drivers/net/ethernet/intel/ice/ice_eswitch_br.c
+++ b/drivers/net/ethernet/intel/ice/ice_eswitch_br.c
@@ -104,13 +104,18 @@ ice_eswitch_br_rule_delete(struct ice_hw *hw, struct ice_rule_query_data *rule)
static u16
ice_eswitch_br_get_lkups_cnt(u16 vid)
{
- return ice_eswitch_br_is_vid_valid(vid) ? 2 : 1;
+ /* if vid == 0 then we need only one lookup (ICE_MAC_OFOS),
+ * otherwise we need both mac and vlan
+ */
+ return vid == 0 ? 1 : 2;
}
static void
ice_eswitch_br_add_vlan_lkup(struct ice_adv_lkup_elem *list, u16 vid)
{
- if (ice_eswitch_br_is_vid_valid(vid)) {
+ if (vid == 1) {
+ ice_rule_add_vlan_metadata(&list[1]);
+ } else if (vid > 1) {
list[1].type = ICE_VLAN_OFOS;
list[1].h_u.vlan_hdr.vlan = cpu_to_be16(vid & VLAN_VID_MASK);
list[1].m_u.vlan_hdr.vlan = cpu_to_be16(0xFFFF);
@@ -400,7 +405,6 @@ ice_eswitch_br_fdb_entry_create(struct net_device *netdev,
unsigned long event;
int err;
- /* untagged filtering is not yet supported */
if (!(bridge->flags & ICE_ESWITCH_BR_VLAN_FILTERING) && vid)
return;
diff --git a/drivers/net/ethernet/intel/ice/ice_eswitch_br.h b/drivers/net/ethernet/intel/ice/ice_eswitch_br.h
index 85a8fadb2928..cf7b0e5acfcb 100644
--- a/drivers/net/ethernet/intel/ice/ice_eswitch_br.h
+++ b/drivers/net/ethernet/intel/ice/ice_eswitch_br.h
@@ -103,15 +103,6 @@ struct ice_esw_br_vlan {
struct ice_esw_br_fdb_work, \
work)
-static inline bool ice_eswitch_br_is_vid_valid(u16 vid)
-{
- /* In trunk VLAN mode, for untagged traffic the bridge sends requests
- * to offload VLAN 1 with pvid and untagged flags set. Since these
- * flags are not supported, add a MAC filter instead.
- */
- return vid > 1;
-}
-
void
ice_eswitch_br_offloads_deinit(struct ice_pf *pf);
int
--
2.40.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH iwl-next v2] ice: Support untagged VLAN traffic in br offload
2023-07-28 8:30 [PATCH iwl-next v2] ice: Support untagged VLAN traffic in br offload Wojciech Drewek
@ 2023-07-29 11:11 ` Simon Horman
2023-08-01 7:27 ` [Intel-wired-lan] " Buvaneswaran, Sujai
1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2023-07-29 11:11 UTC (permalink / raw)
To: Wojciech Drewek; +Cc: intel-wired-lan, netdev, pmenzel
On Fri, Jul 28, 2023 at 10:30:42AM +0200, Wojciech Drewek wrote:
> When driver receives SWITCHDEV_FDB_ADD_TO_DEVICE notification
> with vid = 1, it means that we have to offload untagged traffic.
> This is achieved by adding vlan metadata lookup.
>
> Signed-off-by: Wojciech Drewek <wojciech.drewek@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [Intel-wired-lan] [PATCH iwl-next v2] ice: Support untagged VLAN traffic in br offload
2023-07-28 8:30 [PATCH iwl-next v2] ice: Support untagged VLAN traffic in br offload Wojciech Drewek
2023-07-29 11:11 ` Simon Horman
@ 2023-08-01 7:27 ` Buvaneswaran, Sujai
1 sibling, 0 replies; 3+ messages in thread
From: Buvaneswaran, Sujai @ 2023-08-01 7:27 UTC (permalink / raw)
To: Drewek, Wojciech, intel-wired-lan@lists.osuosl.org
Cc: netdev@vger.kernel.org, pmenzel@molgen.mpg.de
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Wojciech Drewek
> Sent: Friday, July 28, 2023 2:01 PM
> To: intel-wired-lan@lists.osuosl.org
> Cc: netdev@vger.kernel.org; pmenzel@molgen.mpg.de
> Subject: [Intel-wired-lan] [PATCH iwl-next v2] ice: Support untagged VLAN
> traffic in br offload
>
> When driver receives SWITCHDEV_FDB_ADD_TO_DEVICE notification with
> vid = 1, it means that we have to offload untagged traffic.
> This is achieved by adding vlan metadata lookup.
>
> Signed-off-by: Wojciech Drewek <wojciech.drewek@intel.com>
> ---
> v2: remove unrelated changes, fix typos, add comment in
> ice_eswitch_br_get_lkups_cnt
> ---
> drivers/net/ethernet/intel/ice/ice_eswitch_br.c | 10 +++++++---
> drivers/net/ethernet/intel/ice/ice_eswitch_br.h | 9 ---------
> 2 files changed, 7 insertions(+), 12 deletions(-)
>
Tested-by: Sujai Buvaneswaran <sujai.buvaneswaran@intel.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-08-01 7:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-28 8:30 [PATCH iwl-next v2] ice: Support untagged VLAN traffic in br offload Wojciech Drewek
2023-07-29 11:11 ` Simon Horman
2023-08-01 7:27 ` [Intel-wired-lan] " Buvaneswaran, Sujai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).